forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconst-promoted-opaque.string.stderr
More file actions
39 lines (37 loc) · 1.34 KB
/
const-promoted-opaque.string.stderr
File metadata and controls
39 lines (37 loc) · 1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
error[E0391]: cycle detected when computing type of `Foo::{opaque#0}`
--> $DIR/const-promoted-opaque.rs:13:12
|
LL | type Foo = impl Sized;
| ^^^^^^^^^^
|
note: ...which requires borrow-checking `FOO`...
--> $DIR/const-promoted-opaque.rs:17:1
|
LL | const FOO: Foo = String::new();
| ^^^^^^^^^^^^^^
note: ...which requires promoting constants in MIR for `FOO`...
--> $DIR/const-promoted-opaque.rs:17:1
|
LL | const FOO: Foo = String::new();
| ^^^^^^^^^^^^^^
note: ...which requires const checking `FOO`...
--> $DIR/const-promoted-opaque.rs:17:1
|
LL | const FOO: Foo = String::new();
| ^^^^^^^^^^^^^^
= note: ...which requires computing whether `Foo` is freeze...
= note: ...which requires evaluating trait selection obligation `Foo: core::marker::Freeze`...
= note: ...which again requires computing type of `Foo::{opaque#0}`, completing the cycle
note: cycle used when checking item types in top-level module
--> $DIR/const-promoted-opaque.rs:2:1
|
LL | / #![feature(type_alias_impl_trait)]
LL | |
LL | | //! Check that we do not cause cycle errors when trying to
LL | | //! obtain information about interior mutability of an opaque type.
... |
LL | | let _: &'static _ = &FOO;
LL | | }
| |_^
error: aborting due to previous error
For more information about this error, try `rustc --explain E0391`.