File tree Expand file tree Collapse file tree 4 files changed +24
-14
lines changed
compiler/rustc_ty_utils/src Expand file tree Collapse file tree 4 files changed +24
-14
lines changed Original file line number Diff line number Diff line change @@ -611,7 +611,7 @@ fn layout_of_uncached<'tcx>(
611611 }
612612
613613 // Types with no meaningful known layout.
614- ty:: Param ( _) => {
614+ ty:: Param ( _) | ty :: Placeholder ( .. ) => {
615615 return Err ( error ( cx, LayoutError :: TooGeneric ( ty) ) ) ;
616616 }
617617
@@ -628,11 +628,7 @@ fn layout_of_uncached<'tcx>(
628628 return Err ( error ( cx, err) ) ;
629629 }
630630
631- ty:: Placeholder ( ..)
632- | ty:: Bound ( ..)
633- | ty:: CoroutineWitness ( ..)
634- | ty:: Infer ( _)
635- | ty:: Error ( _) => {
631+ ty:: Bound ( ..) | ty:: CoroutineWitness ( ..) | ty:: Infer ( _) | ty:: Error ( _) => {
636632 // `ty::Error` is handled at the top of this function.
637633 bug ! ( "layout_of: unexpected type `{ty}`" )
638634 }
Original file line number Diff line number Diff line change 11error: constant expression depends on a generic parameter
2- --> $DIR/too_generic_eval_ice.rs:7 :13
2+ --> $DIR/too_generic_eval_ice.rs:11 :13
33 |
44LL | [5; Self::HOST_SIZE] == [6; 0]
55 | ^^^^^^^^^^^^^^^
66 |
77 = note: this may fail depending on what value the parameter takes
88
99error: constant expression depends on a generic parameter
10- --> $DIR/too_generic_eval_ice.rs:7 :9
10+ --> $DIR/too_generic_eval_ice.rs:11 :9
1111 |
1212LL | [5; Self::HOST_SIZE] == [6; 0]
1313 | ^^^^^^^^^^^^^^^^^^^^
1414 |
1515 = note: this may fail depending on what value the parameter takes
1616
1717error: constant expression depends on a generic parameter
18- --> $DIR/too_generic_eval_ice.rs:7 :30
18+ --> $DIR/too_generic_eval_ice.rs:11 :30
1919 |
2020LL | [5; Self::HOST_SIZE] == [6; 0]
2121 | ^^
2222 |
2323 = note: this may fail depending on what value the parameter takes
2424
2525error[E0277]: can't compare `[{integer}; Self::HOST_SIZE]` with `[{integer}; 0]`
26- --> $DIR/too_generic_eval_ice.rs:7 :30
26+ --> $DIR/too_generic_eval_ice.rs:11 :30
2727 |
2828LL | [5; Self::HOST_SIZE] == [6; 0]
2929 | ^^ no implementation for `[{integer}; Self::HOST_SIZE] == [{integer}; 0]`
Original file line number Diff line number Diff line change 1+ error[E0284]: type annotations needed: cannot satisfy `the constant `Self::HOST_SIZE` can be evaluated`
2+ --> $DIR/too_generic_eval_ice.rs:11:13
3+ |
4+ LL | [5; Self::HOST_SIZE] == [6; 0]
5+ | ^^^^^^^^^^^^^^^ cannot satisfy `the constant `Self::HOST_SIZE` can be evaluated`
6+
7+ error: aborting due to 1 previous error
8+
9+ For more information about this error, try `rustc --explain E0284`.
Original file line number Diff line number Diff line change 1+ //@ revisions: current next
2+ //@ ignore-compare-mode-next-solver (explicit revisions)
3+ //@[next] compile-flags: -Znext-solver
4+
15pub struct Foo < A , B > ( A , B ) ;
26
37impl < A , B > Foo < A , B > {
48 const HOST_SIZE : usize = std:: mem:: size_of :: < B > ( ) ;
59
610 pub fn crash ( ) -> bool {
711 [ 5 ; Self :: HOST_SIZE ] == [ 6 ; 0 ]
8- //~^ ERROR constant expression depends on a generic parameter
9- //~| ERROR constant expression depends on a generic parameter
10- //~| ERROR constant expression depends on a generic parameter
11- //~| ERROR can't compare `[{integer}; Self::HOST_SIZE]` with `[{integer}; 0]`
12+ //[current]~^ ERROR constant expression depends on a generic parameter
13+ //[current]~| ERROR constant expression depends on a generic parameter
14+ //[current]~| ERROR constant expression depends on a generic parameter
15+ //[current]~| ERROR can't compare `[{integer}; Self::HOST_SIZE]` with `[{integer}; 0]`
16+ //[next]~^^^^^ ERROR type annotations needed
1217 }
1318}
1419
You can’t perform that action at this time.
0 commit comments