@@ -9,11 +9,48 @@ note: ...which requires computing type of opaque `Foo::{opaque#0}`...
9
9
|
10
10
LL | type Foo = impl Sized;
11
11
| ^^^^^^^^^^
12
- note: ...which requires type -checking `with_bound`...
13
- --> $DIR/opaque_type.rs:11:35
12
+ note: ...which requires borrow -checking `with_bound`...
13
+ --> $DIR/opaque_type.rs:7:1
14
14
|
15
- LL | let _: [u8; (N / 2) as Foo] = [0; (N / 2) as usize];
16
- | ^^^^^^^^^^^^^^^^^^^^^
15
+ LL | / fn with_bound<const N: usize>() -> Foo
16
+ LL | | where
17
+ LL | | [u8; (N / 2) as usize]: Sized,
18
+ | |__________________________________^
19
+ note: ...which requires promoting constants in MIR for `with_bound`...
20
+ --> $DIR/opaque_type.rs:7:1
21
+ |
22
+ LL | / fn with_bound<const N: usize>() -> Foo
23
+ LL | | where
24
+ LL | | [u8; (N / 2) as usize]: Sized,
25
+ | |__________________________________^
26
+ note: ...which requires preparing `with_bound` for borrow checking...
27
+ --> $DIR/opaque_type.rs:7:1
28
+ |
29
+ LL | / fn with_bound<const N: usize>() -> Foo
30
+ LL | | where
31
+ LL | | [u8; (N / 2) as usize]: Sized,
32
+ | |__________________________________^
33
+ note: ...which requires checking if `with_bound` contains FFI-unwind calls...
34
+ --> $DIR/opaque_type.rs:7:1
35
+ |
36
+ LL | / fn with_bound<const N: usize>() -> Foo
37
+ LL | | where
38
+ LL | | [u8; (N / 2) as usize]: Sized,
39
+ | |__________________________________^
40
+ note: ...which requires building MIR for `with_bound`...
41
+ --> $DIR/opaque_type.rs:7:1
42
+ |
43
+ LL | / fn with_bound<const N: usize>() -> Foo
44
+ LL | | where
45
+ LL | | [u8; (N / 2) as usize]: Sized,
46
+ | |__________________________________^
47
+ note: ...which requires match-checking `with_bound`...
48
+ --> $DIR/opaque_type.rs:7:1
49
+ |
50
+ LL | / fn with_bound<const N: usize>() -> Foo
51
+ LL | | where
52
+ LL | | [u8; (N / 2) as usize]: Sized,
53
+ | |__________________________________^
17
54
note: ...which requires evaluating type-level constant...
18
55
--> $DIR/opaque_type.rs:11:17
19
56
|
@@ -43,16 +80,6 @@ LL | type Foo = impl Sized;
43
80
| ^^^^^^^^^^
44
81
= note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
45
82
46
- error[E0308]: mismatched types
47
- --> $DIR/opaque_type.rs:11:35
48
- |
49
- LL | let _: [u8; (N / 2) as Foo] = [0; (N / 2) as usize];
50
- | ^^^^^^^^^^^^^^^^^^^^^ expected `(N / 2) as Foo`, found `(N / 2) as usize`
51
- |
52
- = note: expected constant `(N / 2) as Foo`
53
- found constant `(N / 2) as usize`
54
-
55
- error: aborting due to 2 previous errors
83
+ error: aborting due to 1 previous error
56
84
57
- Some errors have detailed explanations: E0308, E0391.
58
- For more information about an error, try `rustc --explain E0308`.
85
+ For more information about this error, try `rustc --explain E0391`.
0 commit comments