File tree 4 files changed +24
-14
lines changed
compiler/rustc_ty_utils/src
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>(
611
611
}
612
612
613
613
// Types with no meaningful known layout.
614
- ty:: Param ( _) => {
614
+ ty:: Param ( _) | ty :: Placeholder ( .. ) => {
615
615
return Err ( error ( cx, LayoutError :: TooGeneric ( ty) ) ) ;
616
616
}
617
617
@@ -628,11 +628,7 @@ fn layout_of_uncached<'tcx>(
628
628
return Err ( error ( cx, err) ) ;
629
629
}
630
630
631
- ty:: Placeholder ( ..)
632
- | ty:: Bound ( ..)
633
- | ty:: CoroutineWitness ( ..)
634
- | ty:: Infer ( _)
635
- | ty:: Error ( _) => {
631
+ ty:: Bound ( ..) | ty:: CoroutineWitness ( ..) | ty:: Infer ( _) | ty:: Error ( _) => {
636
632
// `ty::Error` is handled at the top of this function.
637
633
bug ! ( "layout_of: unexpected type `{ty}`" )
638
634
}
Original file line number Diff line number Diff line change 1
1
error: 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
3
3
|
4
4
LL | [5; Self::HOST_SIZE] == [6; 0]
5
5
| ^^^^^^^^^^^^^^^
6
6
|
7
7
= note: this may fail depending on what value the parameter takes
8
8
9
9
error: 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
11
11
|
12
12
LL | [5; Self::HOST_SIZE] == [6; 0]
13
13
| ^^^^^^^^^^^^^^^^^^^^
14
14
|
15
15
= note: this may fail depending on what value the parameter takes
16
16
17
17
error: 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
19
19
|
20
20
LL | [5; Self::HOST_SIZE] == [6; 0]
21
21
| ^^
22
22
|
23
23
= note: this may fail depending on what value the parameter takes
24
24
25
25
error[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
27
27
|
28
28
LL | [5; Self::HOST_SIZE] == [6; 0]
29
29
| ^^ 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
+
1
5
pub struct Foo < A , B > ( A , B ) ;
2
6
3
7
impl < A , B > Foo < A , B > {
4
8
const HOST_SIZE : usize = std:: mem:: size_of :: < B > ( ) ;
5
9
6
10
pub fn crash ( ) -> bool {
7
11
[ 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
12
17
}
13
18
}
14
19
You can’t perform that action at this time.
0 commit comments