11error[E0658]: cannot borrow here, since the borrowed element may contain interior mutability
2- --> $DIR/const-promoted-opaque.rs:29 :25
2+ --> $DIR/const-promoted-opaque.rs:28 :25
33 |
44LL | let _: &'static _ = &FOO;
55 | ^^^^
@@ -9,7 +9,7 @@ LL | let _: &'static _ = &FOO;
99 = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
1010
1111error[E0493]: destructor of `helper::Foo` cannot be evaluated at compile-time
12- --> $DIR/const-promoted-opaque.rs:29 :26
12+ --> $DIR/const-promoted-opaque.rs:28 :26
1313 |
1414LL | let _: &'static _ = &FOO;
1515 | ^^^ the destructor for this type cannot be evaluated in constants
@@ -18,13 +18,13 @@ LL | };
1818 | - value is dropped here
1919
2020error[E0492]: constants cannot refer to interior mutable data
21- --> $DIR/const-promoted-opaque.rs:34 :19
21+ --> $DIR/const-promoted-opaque.rs:33 :19
2222 |
2323LL | const BAZ: &Foo = &FOO;
2424 | ^^^^ this borrow of an interior mutable value may end up in the final value
2525
2626error[E0716]: temporary value dropped while borrowed
27- --> $DIR/const-promoted-opaque.rs:38 :26
27+ --> $DIR/const-promoted-opaque.rs:37 :26
2828 |
2929LL | let _: &'static _ = &FOO;
3030 | ---------- ^^^ creates a temporary value which is freed while still in use
3434LL | }
3535 | - temporary value is freed at the end of this statement
3636
37- error[E0391]: cycle detected when computing type of opaque `helper::Foo::{opaque#0}`
38- --> $DIR/const-promoted-opaque.rs:14:20
39- |
40- LL | pub type Foo = impl Sized;
41- | ^^^^^^^^^^
42- |
43- note: ...which requires borrow-checking `helper::FOO`...
44- --> $DIR/const-promoted-opaque.rs:21:5
45- |
46- LL | pub const FOO: Foo = std::sync::atomic::AtomicU8::new(42);
47- | ^^^^^^^^^^^^^^^^^^
48- note: ...which requires promoting constants in MIR for `helper::FOO`...
49- --> $DIR/const-promoted-opaque.rs:21:5
50- |
51- LL | pub const FOO: Foo = std::sync::atomic::AtomicU8::new(42);
52- | ^^^^^^^^^^^^^^^^^^
53- note: ...which requires const checking `helper::FOO`...
54- --> $DIR/const-promoted-opaque.rs:21:5
55- |
56- LL | pub const FOO: Foo = std::sync::atomic::AtomicU8::new(42);
57- | ^^^^^^^^^^^^^^^^^^
58- = note: ...which requires computing whether `helper::Foo` is freeze...
59- = note: ...which requires evaluating trait selection obligation `helper::Foo: core::marker::Freeze`...
60- = note: ...which again requires computing type of opaque `helper::Foo::{opaque#0}`, completing the cycle
61- note: cycle used when computing type of `helper::Foo::{opaque#0}`
62- --> $DIR/const-promoted-opaque.rs:14:20
63- |
64- LL | pub type Foo = impl Sized;
65- | ^^^^^^^^^^
66- = 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
67-
68- error: aborting due to 5 previous errors
37+ error: aborting due to 4 previous errors
6938
70- Some errors have detailed explanations: E0391, E0492, E0493, E0658, E0716.
71- For more information about an error, try `rustc --explain E0391 `.
39+ Some errors have detailed explanations: E0492, E0493, E0658, E0716.
40+ For more information about an error, try `rustc --explain E0492 `.
0 commit comments