File tree 4 files changed +9
-25
lines changed
rustc_next_trait_solver/src/solve/normalizes_to
4 files changed +9
-25
lines changed Original file line number Diff line number Diff line change @@ -134,7 +134,7 @@ where
134
134
// Add GAT where clauses from the trait's definition
135
135
// FIXME: We don't need these, since these are the type's own WF obligations.
136
136
ecx. add_goals (
137
- GoalSource :: Misc ,
137
+ GoalSource :: AliasWellFormed ,
138
138
cx. own_predicates_of ( goal. predicate . def_id ( ) )
139
139
. iter_instantiated ( cx, goal. predicate . alias . args )
140
140
. map ( |pred| goal. with ( cx, pred) ) ,
@@ -199,7 +199,7 @@ where
199
199
// Add GAT where clauses from the trait's definition.
200
200
// FIXME: We don't need these, since these are the type's own WF obligations.
201
201
ecx. add_goals (
202
- GoalSource :: Misc ,
202
+ GoalSource :: AliasWellFormed ,
203
203
cx. own_predicates_of ( goal. predicate . def_id ( ) )
204
204
. iter_instantiated ( cx, goal. predicate . alias . args )
205
205
. map ( |pred| goal. with ( cx, pred) ) ,
Original file line number Diff line number Diff line change @@ -83,8 +83,11 @@ pub enum GoalSource {
83
83
/// Instantiating a higher-ranked goal and re-proving it.
84
84
InstantiateHigherRanked ,
85
85
/// Predicate required for an alias projection to be well-formed.
86
- /// This is used in two places: projecting to an opaque whose hidden type
87
- /// is already registered in the opaque type storage, and for rigid projections.
86
+ /// This is used in three places:
87
+ /// 1. projecting to an opaque whose hidden type is already registered in
88
+ /// the opaque type storage,
89
+ /// 2. for rigid projections's trait goal,
90
+ /// 3. for GAT where clauses.
88
91
AliasWellFormed ,
89
92
/// In case normalizing aliases in nested goals cycles, eagerly normalizing these
90
93
/// aliases in the context of the parent may incorrectly change the cycle kind.
Original file line number Diff line number Diff line change 1
- error[E0271]: type mismatch resolving `<[()] as Bad>::Assert normalizes-to <[()] as Bad>::Assert`
2
- --> $DIR/trivial-unsized-projection.rs:20:12
3
- |
4
- LL | const FOO: <[()] as Bad>::Assert = todo!();
5
- | ^^^^^^^^^^^^^^^^^^^^^ types differ
6
- |
7
- = note: statics and constants must have a statically known size
8
-
9
1
error[E0277]: the size for values of type `[()]` cannot be known at compilation time
10
2
--> $DIR/trivial-unsized-projection.rs:20:12
11
3
|
@@ -47,15 +39,6 @@ help: consider relaxing the implicit `Sized` restriction
47
39
LL | type Assert: ?Sized
48
40
| ++++++++
49
41
50
- error[E0271]: type mismatch resolving `<[()] as Bad>::Assert normalizes-to <[()] as Bad>::Assert`
51
- --> $DIR/trivial-unsized-projection.rs:20:36
52
- |
53
- LL | const FOO: <[()] as Bad>::Assert = todo!();
54
- | ^^^^^^^ types differ
55
- |
56
- = note: this error originates in the macro `todo` (in Nightly builds, run with -Z macro-backtrace for more info)
57
-
58
- error: aborting due to 4 previous errors
42
+ error: aborting due to 2 previous errors
59
43
60
- Some errors have detailed explanations: E0271, E0277.
61
- For more information about an error, try `rustc --explain E0271`.
44
+ For more information about this error, try `rustc --explain E0277`.
Original file line number Diff line number Diff line change @@ -22,8 +22,6 @@ const FOO: <[()] as Bad>::Assert = todo!();
22
22
//[bad]~| ERROR the size for values of type `[()]` cannot be known at compilation time
23
23
//[bad_new]~^^^ ERROR the size for values of type `[()]` cannot be known at compilation time
24
24
//[bad_new]~| ERROR the size for values of type `[()]` cannot be known at compilation time
25
- //[bad_new]~| ERROR type mismatch resolving `<[()] as Bad>::Assert normalizes-to <[()] as Bad>::Assert`
26
- //[bad_new]~| ERROR type mismatch resolving `<[()] as Bad>::Assert normalizes-to <[()] as Bad>::Assert`
27
25
28
26
#[ cfg( any( good, good_new) ) ]
29
27
// Well-formed in trivially false param-env
You can’t perform that action at this time.
0 commit comments