Skip to content

Commit e2453dc

Browse files
committed
Revert "Rollup merge of #86011 - tlyu:correct-sized-bound-spans, r=estebank"
This reverts commit 36a1076, reversing changes made to e1e9319.
1 parent 5dab47d commit e2453dc

20 files changed

+61
-72
lines changed

compiler/rustc_typeck/src/bounds.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,16 +64,16 @@ impl<'tcx> Bounds<'tcx> {
6464
})
6565
});
6666

67-
self.region_bounds
68-
.iter()
69-
.map(|&(region_bound, span)| {
67+
sized_predicate
68+
.into_iter()
69+
.chain(self.region_bounds.iter().map(|&(region_bound, span)| {
7070
(
7171
region_bound
7272
.map_bound(|region_bound| ty::OutlivesPredicate(param_ty, region_bound))
7373
.to_predicate(tcx),
7474
span,
7575
)
76-
})
76+
}))
7777
.chain(self.trait_bounds.iter().map(|&(bound_trait_ref, span, constness)| {
7878
let predicate = bound_trait_ref.with_constness(constness).to_predicate(tcx);
7979
(predicate, span)
@@ -83,7 +83,6 @@ impl<'tcx> Bounds<'tcx> {
8383
.iter()
8484
.map(|&(projection, span)| (projection.to_predicate(tcx), span)),
8585
)
86-
.chain(sized_predicate.into_iter())
8786
.collect()
8887
}
8988
}

src/test/ui/derives/derives-span-Hash-enum-struct-variant.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ note: required by a bound in `std::hash::Hash::hash`
1111
--> $SRC_DIR/core/src/hash/mod.rs:LL:COL
1212
|
1313
LL | fn hash<H: Hasher>(&self, state: &mut H);
14-
| ^^^^^^ required by this bound in `std::hash::Hash::hash`
14+
| ^ required by this bound in `std::hash::Hash::hash`
1515
= note: this error originates in the derive macro `Hash` (in Nightly builds, run with -Z macro-backtrace for more info)
1616

1717
error: aborting due to previous error

src/test/ui/derives/derives-span-Hash-enum.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ note: required by a bound in `std::hash::Hash::hash`
1111
--> $SRC_DIR/core/src/hash/mod.rs:LL:COL
1212
|
1313
LL | fn hash<H: Hasher>(&self, state: &mut H);
14-
| ^^^^^^ required by this bound in `std::hash::Hash::hash`
14+
| ^ required by this bound in `std::hash::Hash::hash`
1515
= note: this error originates in the derive macro `Hash` (in Nightly builds, run with -Z macro-backtrace for more info)
1616

1717
error: aborting due to previous error

src/test/ui/derives/derives-span-Hash-struct.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ note: required by a bound in `std::hash::Hash::hash`
1111
--> $SRC_DIR/core/src/hash/mod.rs:LL:COL
1212
|
1313
LL | fn hash<H: Hasher>(&self, state: &mut H);
14-
| ^^^^^^ required by this bound in `std::hash::Hash::hash`
14+
| ^ required by this bound in `std::hash::Hash::hash`
1515
= note: this error originates in the derive macro `Hash` (in Nightly builds, run with -Z macro-backtrace for more info)
1616

1717
error: aborting due to previous error

src/test/ui/derives/derives-span-Hash-tuple-struct.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ note: required by a bound in `std::hash::Hash::hash`
1111
--> $SRC_DIR/core/src/hash/mod.rs:LL:COL
1212
|
1313
LL | fn hash<H: Hasher>(&self, state: &mut H);
14-
| ^^^^^^ required by this bound in `std::hash::Hash::hash`
14+
| ^ required by this bound in `std::hash::Hash::hash`
1515
= note: this error originates in the derive macro `Hash` (in Nightly builds, run with -Z macro-backtrace for more info)
1616

1717
error: aborting due to previous error

src/test/ui/generic-associated-types/issue-74816.stderr

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,34 @@
1-
error[E0277]: the size for values of type `Self` cannot be known at compilation time
1+
error[E0277]: the trait bound `Self: Trait1` is not satisfied
22
--> $DIR/issue-74816.rs:9:5
33
|
44
LL | type Associated: Trait1 = Self;
5-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Trait1` is not implemented for `Self`
66
|
77
note: required by a bound in `Trait2::Associated`
8-
--> $DIR/issue-74816.rs:9:5
8+
--> $DIR/issue-74816.rs:9:22
99
|
1010
LL | type Associated: Trait1 = Self;
11-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Trait2::Associated`
11+
| ^^^^^^ required by this bound in `Trait2::Associated`
1212
help: consider further restricting `Self`
1313
|
14-
LL | trait Trait2: Sized {
15-
| +++++++
14+
LL | trait Trait2: Trait1 {
15+
| ++++++++
1616

17-
error[E0277]: the trait bound `Self: Trait1` is not satisfied
17+
error[E0277]: the size for values of type `Self` cannot be known at compilation time
1818
--> $DIR/issue-74816.rs:9:5
1919
|
2020
LL | type Associated: Trait1 = Self;
21-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Trait1` is not implemented for `Self`
21+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
2222
|
2323
note: required by a bound in `Trait2::Associated`
24-
--> $DIR/issue-74816.rs:9:22
24+
--> $DIR/issue-74816.rs:9:5
2525
|
2626
LL | type Associated: Trait1 = Self;
27-
| ^^^^^^ required by this bound in `Trait2::Associated`
27+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Trait2::Associated`
2828
help: consider further restricting `Self`
2929
|
30-
LL | trait Trait2: Trait1 {
31-
| ++++++++
30+
LL | trait Trait2: Sized {
31+
| +++++++
3232

3333
error: aborting due to 2 previous errors
3434

src/test/ui/generic-associated-types/issue-86483.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ LL | for<'a> T: 'a,
2020
| ^^
2121

2222
error[E0311]: the parameter type `T` may not live long enough
23-
--> $DIR/issue-86483.rs:9:19
23+
--> $DIR/issue-86483.rs:9:5
2424
|
2525
LL | pub trait IceIce<T>
2626
| - help: consider adding an explicit lifetime bound...: `T: 'a`
2727
...
2828
LL | type Ice<'v>: IntoIterator<Item = &'v T>;
29-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds...
29+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds...
3030
|
3131
note: ...that is required by this bound
3232
--> $DIR/issue-86483.rs:7:16

src/test/ui/generics/issue-61631-default-type-param-can-reference-self-in-trait.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ LL | impl Tsized for () {}
66
|
77
= help: the trait `Sized` is not implemented for `[()]`
88
note: required by a bound in `Tsized`
9-
--> $DIR/issue-61631-default-type-param-can-reference-self-in-trait.rs:17:17
9+
--> $DIR/issue-61631-default-type-param-can-reference-self-in-trait.rs:17:14
1010
|
1111
LL | trait Tsized<P: Sized = [Self]> {}
12-
| ^^^^^ required by this bound in `Tsized`
12+
| ^ required by this bound in `Tsized`
1313

1414
error: aborting due to previous error
1515

src/test/ui/issues/issue-16966.stderr

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,11 @@
1-
error[E0283]: type annotations needed
1+
error[E0282]: type annotations needed
22
--> $DIR/issue-16966.rs:2:5
33
|
44
LL | panic!(std::default::Default::default());
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot infer type for type parameter `M` declared on the function `begin_panic`
66
|
7-
= note: cannot satisfy `_: Any`
8-
note: required by a bound in `begin_panic`
9-
--> $SRC_DIR/std/src/panicking.rs:LL:COL
10-
|
11-
LL | pub fn begin_panic<M: Any + Send>(msg: M) -> ! {
12-
| ^^^ required by this bound in `begin_panic`
137
= note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info)
14-
help: consider specifying the type argument in the function call
15-
|
16-
LL | $crate::rt::begin_panic::<M>($msg)
17-
| +++++
188

199
error: aborting due to previous error
2010

21-
For more information about this error, try `rustc --explain E0283`.
11+
For more information about this error, try `rustc --explain E0282`.

src/test/ui/issues/issue-21160.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ note: required by a bound in `std::hash::Hash::hash`
1010
--> $SRC_DIR/core/src/hash/mod.rs:LL:COL
1111
|
1212
LL | fn hash<H: Hasher>(&self, state: &mut H);
13-
| ^^^^^^ required by this bound in `std::hash::Hash::hash`
13+
| ^ required by this bound in `std::hash::Hash::hash`
1414
= note: this error originates in the derive macro `Hash` (in Nightly builds, run with -Z macro-backtrace for more info)
1515

1616
error: aborting due to previous error

0 commit comments

Comments
 (0)