Also passthrough for projection clauses · rust-lang/rust@16892cf (original) (raw)
File tree
8 files changed
lines changed
- compiler/rustc_trait_selection/src/solve
- higher-ranked/trait-bounds
8 files changed
lines changed
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -460,7 +460,9 @@ impl<'tcx> ProofTreeVisitor<'tcx> for BestObligation<'tcx> { | ||
460 | 460 | polarity: ty::PredicatePolarity::Positive, |
461 | 461 | })) |
462 | 462 | } |
463 | - ty::PredicateKind::Clause(ty::ClauseKind::WellFormed(_)) | |
463 | + ty::PredicateKind::Clause( | |
464 | + ty::ClauseKind::WellFormed(_) | ty::ClauseKind::Projection(..), | |
465 | +) | |
464 | 466 | | ty::PredicateKind::AliasRelate(..) => ChildMode::PassThrough, |
465 | 467 | _ => { |
466 | 468 | return ControlFlow::Break(self.obligation.clone()); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
1 | -error[E0284]: type annotations needed: cannot satisfy `for<'a> <_ as Trait<'a>>::Assoc <: <T as Trait<'_>>::Assoc` | |
1 | +error[E0284]: type annotations needed: cannot satisfy `for<'a> <_ as Trait<'a>>::Assoc normalizes-to <T as Trait<'_>>::Assoc` | |
2 | 2 | --> $DIR/rigid-equate-projections-in-higher-ranked-fn-signature.rs:27:50 |
3 | 3 | | |
4 | 4 | LL | let _: for<'a> fn(<_ as Trait<'a>>::Assoc) = foo::(); |
5 | - | ^^^^^^^^^^ cannot satisfy `for<'a> <_ as Trait<'a>>::Assoc <: <T as Trait<'_>>::Assoc` | |
5 | + | ^^^^^^^^^^ cannot satisfy `for<'a> <_ as Trait<'a>>::Assoc normalizes-to <T as Trait<'_>>::Assoc` | |
6 | 6 | |
7 | 7 | error: aborting due to 1 previous error |
8 | 8 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -2,13 +2,8 @@ error[E0271]: type mismatch resolving `::Assoc == i32` | ||
2 | 2 | --> $DIR/param-candidate-shadows-project.rs:27:19 |
3 | 3 | | |
4 | 4 | LL | require_bar::(); |
5 | - | ^ type mismatch resolving `::Assoc == i32` | |
5 | + | ^ types differ | |
6 | 6 | | |
7 | -note: types differ | |
8 | - --> $DIR/param-candidate-shadows-project.rs:10:18 | |
9 | - | | |
10 | -LL | type Assoc = i32; | |
11 | - | ^^^ | |
12 | 7 | note: required for `T` to implement `Bar` |
13 | 8 | --> $DIR/param-candidate-shadows-project.rs:13:9 |
14 | 9 | | |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -24,7 +24,7 @@ fn needs_bar<T: Bar>() {} | ||
24 | 24 | |
25 | 25 | fn foo<T: Foo<Assoc = i32> + Foo<Assoc = u32>>() { |
26 | 26 | needs_bar::<T>(); |
27 | -//~^ ERROR type annotations needed: cannot satisfy `::Assoc == i32` | |
27 | +//~^ ERROR type annotations needed: cannot normalize | |
28 | 28 | } |
29 | 29 | |
30 | 30 | fn main() {} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
1 | -error[E0284]: type annotations needed: cannot satisfy `::Assoc == i32` | |
1 | +error[E0284]: type annotations needed: cannot normalize `::Assoc` | |
2 | 2 | --> $DIR/two-projection-param-candidates-are-ambiguous.rs:26:17 |
3 | 3 | | |
4 | 4 | LL | needs_bar::(); |
5 | - | ^ cannot satisfy `::Assoc == i32` | |
5 | + | ^ cannot normalize `::Assoc` | |
6 | 6 | | |
7 | 7 | note: required for `T` to implement `Bar` |
8 | 8 | --> $DIR/two-projection-param-candidates-are-ambiguous.rs:21:9 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -22,11 +22,11 @@ error[E0284]: type annotations needed: cannot satisfy `::Id normal | ||
22 | 22 | LL | self |
23 | 23 | | ^^^^ cannot satisfy `::Id normalizes-to T` |
24 | 24 | |
25 | -error[E0284]: type annotations needed: cannot satisfy `::Id == Option<NonZero>` | |
25 | +error[E0284]: type annotations needed: cannot satisfy `::Id normalizes-to Option<NonZero>` | |
26 | 26 | --> $DIR/specialization-transmute.rs:28:13 |
27 | 27 | | |
28 | 28 | LL | let s = transmute::<u8, Option<NonZero>>(0); |
29 | - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot satisfy `::Id == Option<NonZero>` | |
29 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot satisfy `::Id normalizes-to Option<NonZero>` | |
30 | 30 | | |
31 | 31 | note: required by a bound in `transmute` |
32 | 32 | --> $DIR/specialization-transmute.rs:21:25 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -18,5 +18,5 @@ fn test<T: Default<Id = U>, U>() {} | ||
18 | 18 | |
19 | 19 | fn main() { |
20 | 20 | test::<u32, ()>(); |
21 | -//~^ ERROR cannot satisfy `::Id == ()` | |
21 | +//~^ ERROR cannot satisfy `::Id normalizes-to ()` | |
22 | 22 | } |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -8,11 +8,11 @@ LL | #![feature(specialization)] | ||
8 | 8 | = help: consider using `min_specialization` instead, which is more stable and complete |
9 | 9 | = note: `#[warn(incomplete_features)]` on by default |
10 | 10 | |
11 | -error[E0284]: type annotations needed: cannot satisfy `::Id == ()` | |
11 | +error[E0284]: type annotations needed: cannot satisfy `::Id normalizes-to ()` | |
12 | 12 | --> $DIR/specialization-unconstrained.rs:20:5 |
13 | 13 | | |
14 | 14 | LL | test::<u32, ()>(); |
15 | - | ^^^^^^^^^^^^^^^^^ cannot satisfy `::Id == ()` | |
15 | + | ^^^^^^^^^^^^^^^^^ cannot satisfy `::Id normalizes-to ()` | |
16 | 16 | | |
17 | 17 | note: required by a bound in `test` |
18 | 18 | --> $DIR/specialization-unconstrained.rs:17:20 |