Skip to content

Commit f86b46a

Browse files
committed
regression test from 121610.
1 parent a8549b4 commit f86b46a

2 files changed

+41
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
//@ check-pass
2+
use std::cell::Cell;
3+
4+
pub enum JsValue {
5+
Undefined,
6+
Object(Cell<bool>),
7+
}
8+
9+
impl ::std::ops::Drop for JsValue {
10+
fn drop(&mut self) {}
11+
}
12+
13+
const UNDEFINED: &JsValue = &JsValue::Undefined;
14+
//~^ WARN encountered mutable pointer in final value of constant
15+
//~| WARN this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
16+
17+
fn main() {
18+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
warning: encountered mutable pointer in final value of constant
2+
--> $DIR/future-incompat-mutable-in-final-value-issue-121610.rs:13:1
3+
|
4+
LL | const UNDEFINED: &JsValue = &JsValue::Undefined;
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^
6+
|
7+
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
8+
= note: for more information, see issue #122153 <https://github.com/rust-lang/rust/issues/122153>
9+
= note: `#[warn(const_eval_mutable_ptr_in_final_value)]` on by default
10+
11+
warning: 1 warning emitted
12+
13+
Future incompatibility report: Future breakage diagnostic:
14+
warning: encountered mutable pointer in final value of constant
15+
--> $DIR/future-incompat-mutable-in-final-value-issue-121610.rs:13:1
16+
|
17+
LL | const UNDEFINED: &JsValue = &JsValue::Undefined;
18+
| ^^^^^^^^^^^^^^^^^^^^^^^^^
19+
|
20+
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
21+
= note: for more information, see issue #122153 <https://github.com/rust-lang/rust/issues/122153>
22+
= note: `#[warn(const_eval_mutable_ptr_in_final_value)]` on by default
23+

0 commit comments

Comments
 (0)