summaryrefslogtreecommitdiffstats
path: root/src/test/ui/consts/qualif-indirect-mutation-fail.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/test/ui/consts/qualif-indirect-mutation-fail.rs18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/test/ui/consts/qualif-indirect-mutation-fail.rs b/src/test/ui/consts/qualif-indirect-mutation-fail.rs
index f74a25a34..a6d293404 100644
--- a/src/test/ui/consts/qualif-indirect-mutation-fail.rs
+++ b/src/test/ui/consts/qualif-indirect-mutation-fail.rs
@@ -6,13 +6,13 @@
// Mutable borrow of a field with drop impl.
pub const fn f() {
- let mut a: (u32, Option<String>) = (0, None); //~ ERROR destructors cannot be evaluated
+ let mut a: (u32, Option<String>) = (0, None); //~ ERROR destructor of
let _ = &mut a.1;
}
// Mutable borrow of a type with drop impl.
pub const A1: () = {
- let mut x = None; //~ ERROR destructors cannot be evaluated
+ let mut x = None; //~ ERROR destructor of
let mut y = Some(String::new());
let a = &mut x;
let b = &mut y;
@@ -28,12 +28,12 @@ pub const A2: () = {
let b = &mut y;
std::mem::swap(a, b);
std::mem::forget(y);
- let _z = x; //~ ERROR destructors cannot be evaluated
+ let _z = x; //~ ERROR destructor of
};
// Shared borrow of a type that might be !Freeze and Drop.
pub const fn g1<T>() {
- let x: Option<T> = None; //~ ERROR destructors cannot be evaluated
+ let x: Option<T> = None; //~ ERROR destructor of
let _ = x.is_some();
}
@@ -41,24 +41,24 @@ pub const fn g1<T>() {
pub const fn g2<T>() {
let x: Option<T> = None;
let _ = x.is_some();
- let _y = x; //~ ERROR destructors cannot be evaluated
+ let _y = x; //~ ERROR destructor of
}
// Mutable raw reference to a Drop type.
pub const fn address_of_mut() {
- let mut x: Option<String> = None; //~ ERROR destructors cannot be evaluated
+ let mut x: Option<String> = None; //~ ERROR destructor of
&raw mut x;
- let mut y: Option<String> = None; //~ ERROR destructors cannot be evaluated
+ let mut y: Option<String> = None; //~ ERROR destructor of
std::ptr::addr_of_mut!(y);
}
// Const raw reference to a Drop type. Conservatively assumed to allow mutation
// until resolution of https://github.com/rust-lang/rust/issues/56604.
pub const fn address_of_const() {
- let x: Option<String> = None; //~ ERROR destructors cannot be evaluated
+ let x: Option<String> = None; //~ ERROR destructor of
&raw const x;
- let y: Option<String> = None; //~ ERROR destructors cannot be evaluated
+ let y: Option<String> = None; //~ ERROR destructor of
std::ptr::addr_of!(y);
}