summaryrefslogtreecommitdiffstats
path: root/tests/ui/liveness
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/liveness')
-rw-r--r--tests/ui/liveness/liveness-assign/liveness-assign-imm-local-with-drop.rs1
-rw-r--r--tests/ui/liveness/liveness-consts.stderr53
-rw-r--r--tests/ui/liveness/liveness-unused.rs2
3 files changed, 28 insertions, 28 deletions
diff --git a/tests/ui/liveness/liveness-assign/liveness-assign-imm-local-with-drop.rs b/tests/ui/liveness/liveness-assign/liveness-assign-imm-local-with-drop.rs
index 293fdca1c..c9b16e439 100644
--- a/tests/ui/liveness/liveness-assign/liveness-assign-imm-local-with-drop.rs
+++ b/tests/ui/liveness/liveness-assign/liveness-assign-imm-local-with-drop.rs
@@ -5,7 +5,6 @@ fn test() {
drop(b);
b = Box::new(2); //~ ERROR cannot assign twice to immutable variable `b`
//~| NOTE cannot assign twice to immutable
- //~| NOTE in this expansion of desugaring of drop and replace
drop(b);
}
diff --git a/tests/ui/liveness/liveness-consts.stderr b/tests/ui/liveness/liveness-consts.stderr
index 6199ea96c..016debdd3 100644
--- a/tests/ui/liveness/liveness-consts.stderr
+++ b/tests/ui/liveness/liveness-consts.stderr
@@ -1,10 +1,9 @@
-warning: variable `a` is assigned to, but never used
- --> $DIR/liveness-consts.rs:7:13
+warning: unused variable: `e`
+ --> $DIR/liveness-consts.rs:24:13
|
-LL | let mut a = 0;
- | ^
+LL | let e = 1;
+ | ^ help: if this is intentional, prefix it with an underscore: `_e`
|
- = note: consider using `_a` instead
note: the lint level is defined here
--> $DIR/liveness-consts.rs:2:9
|
@@ -12,21 +11,6 @@ LL | #![warn(unused)]
| ^^^^^^
= note: `#[warn(unused_variables)]` implied by `#[warn(unused)]`
-warning: value assigned to `b` is never read
- --> $DIR/liveness-consts.rs:17:5
- |
-LL | b += 1;
- | ^
- |
- = help: maybe it is overwritten before being read?
- = note: `#[warn(unused_assignments)]` implied by `#[warn(unused)]`
-
-warning: unused variable: `e`
- --> $DIR/liveness-consts.rs:24:13
- |
-LL | let e = 1;
- | ^ help: if this is intentional, prefix it with an underscore: `_e`
-
warning: unused variable: `s`
--> $DIR/liveness-consts.rs:33:24
|
@@ -39,6 +23,29 @@ warning: unused variable: `z`
LL | pub fn f(x: [u8; { let s = 17; 100 }]) -> [u8; { let z = 18; 100 }] {
| ^ help: if this is intentional, prefix it with an underscore: `_z`
+warning: unused variable: `z`
+ --> $DIR/liveness-consts.rs:60:13
+ |
+LL | let z = 42;
+ | ^ help: if this is intentional, prefix it with an underscore: `_z`
+
+warning: variable `a` is assigned to, but never used
+ --> $DIR/liveness-consts.rs:7:13
+ |
+LL | let mut a = 0;
+ | ^
+ |
+ = note: consider using `_a` instead
+
+warning: value assigned to `b` is never read
+ --> $DIR/liveness-consts.rs:17:5
+ |
+LL | b += 1;
+ | ^
+ |
+ = help: maybe it is overwritten before being read?
+ = note: `#[warn(unused_assignments)]` implied by `#[warn(unused)]`
+
warning: value assigned to `t` is never read
--> $DIR/liveness-consts.rs:42:9
|
@@ -53,11 +60,5 @@ warning: unused variable: `w`
LL | let w = 10;
| ^ help: if this is intentional, prefix it with an underscore: `_w`
-warning: unused variable: `z`
- --> $DIR/liveness-consts.rs:60:13
- |
-LL | let z = 42;
- | ^ help: if this is intentional, prefix it with an underscore: `_z`
-
warning: 8 warnings emitted
diff --git a/tests/ui/liveness/liveness-unused.rs b/tests/ui/liveness/liveness-unused.rs
index 9c7be15fc..ba635e663 100644
--- a/tests/ui/liveness/liveness-unused.rs
+++ b/tests/ui/liveness/liveness-unused.rs
@@ -1,7 +1,7 @@
#![warn(unused)]
#![deny(unused_variables)]
#![deny(unused_assignments)]
-#![allow(dead_code, non_camel_case_types, trivial_numeric_casts)]
+#![allow(dead_code, non_camel_case_types, trivial_numeric_casts, dropping_copy_types)]
use std::ops::AddAssign;