summaryrefslogtreecommitdiffstats
path: root/tests/ui/lint
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/lint')
-rw-r--r--tests/ui/lint/dead-code/in-closure.rs16
-rw-r--r--tests/ui/lint/dead-code/in-closure.stderr20
-rw-r--r--tests/ui/lint/dead-code/issue-85255.rs12
-rw-r--r--tests/ui/lint/dead-code/issue-85255.stderr12
-rw-r--r--tests/ui/lint/dead-code/lint-dead-code-3.rs2
-rw-r--r--tests/ui/lint/dead-code/lint-dead-code-3.stderr2
-rw-r--r--tests/ui/lint/invalid_value-polymorphic.rs8
-rw-r--r--tests/ui/lint/invalid_value.stderr40
-rw-r--r--tests/ui/lint/issue-104897.rs1
-rw-r--r--tests/ui/lint/issue-104897.stderr35
-rw-r--r--tests/ui/lint/issue-106991.rs13
-rw-r--r--tests/ui/lint/issue-106991.stderr11
-rw-r--r--tests/ui/lint/lint-missing-doc.rs6
-rw-r--r--tests/ui/lint/lint-missing-doc.stderr46
-rw-r--r--tests/ui/lint/lint-stability-deprecated.rs144
-rw-r--r--tests/ui/lint/lint-stability-deprecated.stderr224
-rw-r--r--tests/ui/lint/lint_map_unit_fn.rs20
-rw-r--r--tests/ui/lint/lint_map_unit_fn.stderr66
-rw-r--r--tests/ui/lint/must_not_suspend/dedup.drop_tracking.stderr21
-rw-r--r--tests/ui/lint/must_not_suspend/dedup.drop_tracking_mir.stderr21
-rw-r--r--tests/ui/lint/must_not_suspend/dedup.no_drop_tracking.stderr33
-rw-r--r--tests/ui/lint/must_not_suspend/dedup.rs7
-rw-r--r--tests/ui/lint/must_not_suspend/dedup.stderr6
-rw-r--r--tests/ui/lint/must_not_suspend/ref.drop_tracking.stderr8
-rw-r--r--tests/ui/lint/must_not_suspend/ref.drop_tracking_mir.stderr27
-rw-r--r--tests/ui/lint/must_not_suspend/ref.no_drop_tracking.stderr8
-rw-r--r--tests/ui/lint/must_not_suspend/ref.rs8
-rw-r--r--tests/ui/lint/must_not_suspend/trait.drop_tracking.stderr37
-rw-r--r--tests/ui/lint/must_not_suspend/trait.drop_tracking_mir.stderr37
-rw-r--r--tests/ui/lint/must_not_suspend/trait.no_drop_tracking.stderr37
-rw-r--r--tests/ui/lint/must_not_suspend/trait.rs6
-rw-r--r--tests/ui/lint/must_not_suspend/trait.stderr10
-rw-r--r--tests/ui/lint/must_not_suspend/tuple-mismatch.stderr2
-rw-r--r--tests/ui/lint/must_not_suspend/unit.drop_tracking.stderr26
-rw-r--r--tests/ui/lint/must_not_suspend/unit.drop_tracking_mir.stderr26
-rw-r--r--tests/ui/lint/must_not_suspend/unit.no_drop_tracking.stderr26
-rw-r--r--tests/ui/lint/must_not_suspend/unit.rs5
-rw-r--r--tests/ui/lint/must_not_suspend/unit.stderr8
-rw-r--r--tests/ui/lint/must_not_suspend/warn.drop_tracking.stderr26
-rw-r--r--tests/ui/lint/must_not_suspend/warn.drop_tracking_mir.stderr26
-rw-r--r--tests/ui/lint/must_not_suspend/warn.no_drop_tracking.stderr26
-rw-r--r--tests/ui/lint/must_not_suspend/warn.rs4
-rw-r--r--tests/ui/lint/must_not_suspend/warn.stderr8
-rw-r--r--tests/ui/lint/reasons-forbidden.rs2
-rw-r--r--tests/ui/lint/unaligned_references.rs42
-rw-r--r--tests/ui/lint/unaligned_references.stderr214
-rw-r--r--tests/ui/lint/unaligned_references_external_macro.rs1
-rw-r--r--tests/ui/lint/unaligned_references_external_macro.stderr47
-rw-r--r--tests/ui/lint/unused/issue-103320-must-use-ops.rs27
-rw-r--r--tests/ui/lint/unused/issue-103320-must-use-ops.stderr67
-rw-r--r--tests/ui/lint/unused/issue-96606.rs8
-rw-r--r--tests/ui/lint/unused/issue-96606.stderr33
-rw-r--r--tests/ui/lint/unused_parens_multibyte_recovery.rs1
-rw-r--r--tests/ui/lint/unused_parens_multibyte_recovery.stderr35
54 files changed, 995 insertions, 609 deletions
diff --git a/tests/ui/lint/dead-code/in-closure.rs b/tests/ui/lint/dead-code/in-closure.rs
new file mode 100644
index 000000000..c55634405
--- /dev/null
+++ b/tests/ui/lint/dead-code/in-closure.rs
@@ -0,0 +1,16 @@
+// edition: 2021
+
+#![deny(dead_code)]
+
+pub fn foo() {
+ let closure = || {
+ fn a() {} //~ ERROR function `a` is never used
+ };
+ closure()
+}
+
+pub async fn async_foo() {
+ const A: usize = 1; //~ ERROR constant `A` is never used
+}
+
+fn main() {}
diff --git a/tests/ui/lint/dead-code/in-closure.stderr b/tests/ui/lint/dead-code/in-closure.stderr
new file mode 100644
index 000000000..deb276be7
--- /dev/null
+++ b/tests/ui/lint/dead-code/in-closure.stderr
@@ -0,0 +1,20 @@
+error: function `a` is never used
+ --> $DIR/in-closure.rs:7:12
+ |
+LL | fn a() {}
+ | ^
+ |
+note: the lint level is defined here
+ --> $DIR/in-closure.rs:3:9
+ |
+LL | #![deny(dead_code)]
+ | ^^^^^^^^^
+
+error: constant `A` is never used
+ --> $DIR/in-closure.rs:13:11
+ |
+LL | const A: usize = 1;
+ | ^
+
+error: aborting due to 2 previous errors
+
diff --git a/tests/ui/lint/dead-code/issue-85255.rs b/tests/ui/lint/dead-code/issue-85255.rs
index 043f68137..1978bd4e8 100644
--- a/tests/ui/lint/dead-code/issue-85255.rs
+++ b/tests/ui/lint/dead-code/issue-85255.rs
@@ -11,8 +11,8 @@ struct Foo {
struct Bar;
impl Bar {
- fn a(&self) -> i32 { 5 } //~ WARNING: associated function `a` is never used
- pub fn b(&self) -> i32 { 6 } //~ WARNING: associated function `b` is never used
+ fn a(&self) -> i32 { 5 } //~ WARNING: method `a` is never used
+ pub fn b(&self) -> i32 { 6 } //~ WARNING: method `b` is never used
}
pub(crate) struct Foo1 {
@@ -23,8 +23,8 @@ pub(crate) struct Foo1 {
pub(crate) struct Bar1;
impl Bar1 {
- fn a(&self) -> i32 { 5 } //~ WARNING: associated function `a` is never used
- pub fn b(&self) -> i32 { 6 } //~ WARNING: associated function `b` is never used
+ fn a(&self) -> i32 { 5 } //~ WARNING: method `a` is never used
+ pub fn b(&self) -> i32 { 6 } //~ WARNING: method `b` is never used
}
pub(crate) struct Foo2 {
@@ -35,8 +35,8 @@ pub(crate) struct Foo2 {
pub(crate) struct Bar2;
impl Bar2 {
- fn a(&self) -> i32 { 5 } //~ WARNING: associated function `a` is never used
- pub fn b(&self) -> i32 { 6 } //~ WARNING: associated function `b` is never used
+ fn a(&self) -> i32 { 5 } //~ WARNING: method `a` is never used
+ pub fn b(&self) -> i32 { 6 } //~ WARNING: method `b` is never used
}
diff --git a/tests/ui/lint/dead-code/issue-85255.stderr b/tests/ui/lint/dead-code/issue-85255.stderr
index 3497b952f..58a19cf3c 100644
--- a/tests/ui/lint/dead-code/issue-85255.stderr
+++ b/tests/ui/lint/dead-code/issue-85255.stderr
@@ -34,37 +34,37 @@ LL | a: i32,
LL | pub b: i32,
| ^
-warning: associated function `a` is never used
+warning: method `a` is never used
--> $DIR/issue-85255.rs:14:8
|
LL | fn a(&self) -> i32 { 5 }
| ^
-warning: associated function `b` is never used
+warning: method `b` is never used
--> $DIR/issue-85255.rs:15:12
|
LL | pub fn b(&self) -> i32 { 6 }
| ^
-warning: associated function `a` is never used
+warning: method `a` is never used
--> $DIR/issue-85255.rs:26:8
|
LL | fn a(&self) -> i32 { 5 }
| ^
-warning: associated function `b` is never used
+warning: method `b` is never used
--> $DIR/issue-85255.rs:27:12
|
LL | pub fn b(&self) -> i32 { 6 }
| ^
-warning: associated function `a` is never used
+warning: method `a` is never used
--> $DIR/issue-85255.rs:38:8
|
LL | fn a(&self) -> i32 { 5 }
| ^
-warning: associated function `b` is never used
+warning: method `b` is never used
--> $DIR/issue-85255.rs:39:12
|
LL | pub fn b(&self) -> i32 { 6 }
diff --git a/tests/ui/lint/dead-code/lint-dead-code-3.rs b/tests/ui/lint/dead-code/lint-dead-code-3.rs
index 293fcdbc5..20b568054 100644
--- a/tests/ui/lint/dead-code/lint-dead-code-3.rs
+++ b/tests/ui/lint/dead-code/lint-dead-code-3.rs
@@ -13,7 +13,7 @@ extern "C" {
struct Foo; //~ ERROR: struct `Foo` is never constructed
impl Foo {
- fn foo(&self) { //~ ERROR: associated function `foo` is never used
+ fn foo(&self) { //~ ERROR: method `foo` is never used
bar()
}
}
diff --git a/tests/ui/lint/dead-code/lint-dead-code-3.stderr b/tests/ui/lint/dead-code/lint-dead-code-3.stderr
index 26fc13bae..797b7559c 100644
--- a/tests/ui/lint/dead-code/lint-dead-code-3.stderr
+++ b/tests/ui/lint/dead-code/lint-dead-code-3.stderr
@@ -34,7 +34,7 @@ error: function `blah` is never used
LL | fn blah() {}
| ^^^^
-error: associated function `foo` is never used
+error: method `foo` is never used
--> $DIR/lint-dead-code-3.rs:16:8
|
LL | fn foo(&self) {
diff --git a/tests/ui/lint/invalid_value-polymorphic.rs b/tests/ui/lint/invalid_value-polymorphic.rs
new file mode 100644
index 000000000..055173e98
--- /dev/null
+++ b/tests/ui/lint/invalid_value-polymorphic.rs
@@ -0,0 +1,8 @@
+// compile-flags: --crate-type=lib -Zmir-enable-passes=+InstCombine
+// build-pass
+
+#![feature(core_intrinsics)]
+
+pub fn generic<T>() {
+ core::intrinsics::assert_mem_uninitialized_valid::<&T>();
+}
diff --git a/tests/ui/lint/invalid_value.stderr b/tests/ui/lint/invalid_value.stderr
index 48fd4169d..57531b096 100644
--- a/tests/ui/lint/invalid_value.stderr
+++ b/tests/ui/lint/invalid_value.stderr
@@ -61,10 +61,7 @@ error: the type `!` does not permit zero-initialization
--> $DIR/invalid_value.rs:65:23
|
LL | let _val: ! = mem::zeroed();
- | ^^^^^^^^^^^^^
- | |
- | this code causes undefined behavior when executed
- | help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
+ | ^^^^^^^^^^^^^ this code causes undefined behavior when executed
|
= note: the `!` type has no valid value
@@ -72,10 +69,7 @@ error: the type `!` does not permit being left uninitialized
--> $DIR/invalid_value.rs:66:23
|
LL | let _val: ! = mem::uninitialized();
- | ^^^^^^^^^^^^^^^^^^^^
- | |
- | this code causes undefined behavior when executed
- | help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
+ | ^^^^^^^^^^^^^^^^^^^^ this code causes undefined behavior when executed
|
= note: the `!` type has no valid value
@@ -83,10 +77,7 @@ error: the type `(i32, !)` does not permit zero-initialization
--> $DIR/invalid_value.rs:68:30
|
LL | let _val: (i32, !) = mem::zeroed();
- | ^^^^^^^^^^^^^
- | |
- | this code causes undefined behavior when executed
- | help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
+ | ^^^^^^^^^^^^^ this code causes undefined behavior when executed
|
= note: the `!` type has no valid value
@@ -94,10 +85,7 @@ error: the type `(i32, !)` does not permit being left uninitialized
--> $DIR/invalid_value.rs:69:30
|
LL | let _val: (i32, !) = mem::uninitialized();
- | ^^^^^^^^^^^^^^^^^^^^
- | |
- | this code causes undefined behavior when executed
- | help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
+ | ^^^^^^^^^^^^^^^^^^^^ this code causes undefined behavior when executed
|
= note: integers must be initialized
@@ -105,10 +93,7 @@ error: the type `Void` does not permit zero-initialization
--> $DIR/invalid_value.rs:71:26
|
LL | let _val: Void = mem::zeroed();
- | ^^^^^^^^^^^^^
- | |
- | this code causes undefined behavior when executed
- | help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
+ | ^^^^^^^^^^^^^ this code causes undefined behavior when executed
|
note: enums with no inhabited variants have no valid value
--> $DIR/invalid_value.rs:12:1
@@ -120,10 +105,7 @@ error: the type `Void` does not permit being left uninitialized
--> $DIR/invalid_value.rs:72:26
|
LL | let _val: Void = mem::uninitialized();
- | ^^^^^^^^^^^^^^^^^^^^
- | |
- | this code causes undefined behavior when executed
- | help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
+ | ^^^^^^^^^^^^^^^^^^^^ this code causes undefined behavior when executed
|
note: enums with no inhabited variants have no valid value
--> $DIR/invalid_value.rs:12:1
@@ -405,10 +387,7 @@ error: the type `TwoUninhabited` does not permit zero-initialization
--> $DIR/invalid_value.rs:104:36
|
LL | let _val: TwoUninhabited = mem::zeroed();
- | ^^^^^^^^^^^^^
- | |
- | this code causes undefined behavior when executed
- | help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
+ | ^^^^^^^^^^^^^ this code causes undefined behavior when executed
|
note: enums with no inhabited variants have no valid value
--> $DIR/invalid_value.rs:42:1
@@ -420,10 +399,7 @@ error: the type `TwoUninhabited` does not permit being left uninitialized
--> $DIR/invalid_value.rs:105:36
|
LL | let _val: TwoUninhabited = mem::uninitialized();
- | ^^^^^^^^^^^^^^^^^^^^
- | |
- | this code causes undefined behavior when executed
- | help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
+ | ^^^^^^^^^^^^^^^^^^^^ this code causes undefined behavior when executed
|
note: enums with no inhabited variants have no valid value
--> $DIR/invalid_value.rs:42:1
diff --git a/tests/ui/lint/issue-104897.rs b/tests/ui/lint/issue-104897.rs
index 5fbc658f1..2d298aff9 100644
--- a/tests/ui/lint/issue-104897.rs
+++ b/tests/ui/lint/issue-104897.rs
@@ -1,6 +1,5 @@
// error-pattern: this file contains an unclosed delimiter
// error-pattern: this file contains an unclosed delimiter
// error-pattern: this file contains an unclosed delimiter
-// error-pattern: format argument must be a string literal
fn f(){(print!(á
diff --git a/tests/ui/lint/issue-104897.stderr b/tests/ui/lint/issue-104897.stderr
index 817a93c2f..728d51f34 100644
--- a/tests/ui/lint/issue-104897.stderr
+++ b/tests/ui/lint/issue-104897.stderr
@@ -1,5 +1,5 @@
error: this file contains an unclosed delimiter
- --> $DIR/issue-104897.rs:6:18
+ --> $DIR/issue-104897.rs:5:18
|
LL | fn f(){(print!(á
| -- - ^
@@ -8,36 +8,5 @@ LL | fn f(){(print!(á
| |unclosed delimiter
| unclosed delimiter
-error: this file contains an unclosed delimiter
- --> $DIR/issue-104897.rs:6:18
- |
-LL | fn f(){(print!(á
- | -- - ^
- | || |
- | || unclosed delimiter
- | |unclosed delimiter
- | unclosed delimiter
-
-error: this file contains an unclosed delimiter
- --> $DIR/issue-104897.rs:6:18
- |
-LL | fn f(){(print!(á
- | -- - ^
- | || |
- | || unclosed delimiter
- | |unclosed delimiter
- | unclosed delimiter
-
-error: format argument must be a string literal
- --> $DIR/issue-104897.rs:6:16
- |
-LL | fn f(){(print!(á
- | ^
- |
-help: you might be missing a string literal to format with
- |
-LL | fn f(){(print!("{}", á
- | +++++
-
-error: aborting due to 4 previous errors
+error: aborting due to previous error
diff --git a/tests/ui/lint/issue-106991.rs b/tests/ui/lint/issue-106991.rs
new file mode 100644
index 000000000..e4d7f765b
--- /dev/null
+++ b/tests/ui/lint/issue-106991.rs
@@ -0,0 +1,13 @@
+fn foo(items: &mut Vec<u8>) {
+ items.sort();
+}
+
+fn bar() -> impl Iterator<Item = i32> {
+ //~^ ERROR expected `foo` to be a fn item that returns `i32`, but it returns `()` [E0271]
+ let mut x: Vec<Vec<u8>> = vec![vec![0, 2, 1], vec![5, 4, 3]];
+ x.iter_mut().map(foo)
+}
+
+fn main() {
+ bar();
+}
diff --git a/tests/ui/lint/issue-106991.stderr b/tests/ui/lint/issue-106991.stderr
new file mode 100644
index 000000000..7b43f0b2c
--- /dev/null
+++ b/tests/ui/lint/issue-106991.stderr
@@ -0,0 +1,11 @@
+error[E0271]: expected `foo` to be a fn item that returns `i32`, but it returns `()`
+ --> $DIR/issue-106991.rs:5:13
+ |
+LL | fn bar() -> impl Iterator<Item = i32> {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found `i32`
+ |
+ = note: required for `Map<std::slice::IterMut<'_, Vec<u8>>, for<'a> fn(&'a mut Vec<u8>) {foo}>` to implement `Iterator`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0271`.
diff --git a/tests/ui/lint/lint-missing-doc.rs b/tests/ui/lint/lint-missing-doc.rs
index 229725791..4a234d265 100644
--- a/tests/ui/lint/lint-missing-doc.rs
+++ b/tests/ui/lint/lint-missing-doc.rs
@@ -50,8 +50,10 @@ trait B {
}
pub trait C { //~ ERROR: missing documentation for a trait
- fn foo(&self); //~ ERROR: missing documentation for an associated function
- fn foo_with_impl(&self) {} //~ ERROR: missing documentation for an associated function
+ fn foo(&self); //~ ERROR: missing documentation for a method
+ fn foo_with_impl(&self) {} //~ ERROR: missing documentation for a method
+ fn foo_no_self(); //~ ERROR: missing documentation for an associated function
+ fn foo_no_self_with_impl() {} //~ ERROR: missing documentation for an associated function
}
#[allow(missing_docs)]
diff --git a/tests/ui/lint/lint-missing-doc.stderr b/tests/ui/lint/lint-missing-doc.stderr
index d68472d4b..733d062a0 100644
--- a/tests/ui/lint/lint-missing-doc.stderr
+++ b/tests/ui/lint/lint-missing-doc.stderr
@@ -40,101 +40,113 @@ error: missing documentation for a trait
LL | pub trait C {
| ^^^^^^^^^^^
-error: missing documentation for an associated function
+error: missing documentation for a method
--> $DIR/lint-missing-doc.rs:53:5
|
LL | fn foo(&self);
| ^^^^^^^^^^^^^^
-error: missing documentation for an associated function
+error: missing documentation for a method
--> $DIR/lint-missing-doc.rs:54:5
|
LL | fn foo_with_impl(&self) {}
| ^^^^^^^^^^^^^^^^^^^^^^^
+error: missing documentation for an associated function
+ --> $DIR/lint-missing-doc.rs:55:5
+ |
+LL | fn foo_no_self();
+ | ^^^^^^^^^^^^^^^^^
+
+error: missing documentation for an associated function
+ --> $DIR/lint-missing-doc.rs:56:5
+ |
+LL | fn foo_no_self_with_impl() {}
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+
error: missing documentation for an associated type
- --> $DIR/lint-missing-doc.rs:64:5
+ --> $DIR/lint-missing-doc.rs:66:5
|
LL | type AssociatedType;
| ^^^^^^^^^^^^^^^^^^^
error: missing documentation for an associated type
- --> $DIR/lint-missing-doc.rs:65:5
+ --> $DIR/lint-missing-doc.rs:67:5
|
LL | type AssociatedTypeDef = Self;
| ^^^^^^^^^^^^^^^^^^^^^^
error: missing documentation for an associated function
- --> $DIR/lint-missing-doc.rs:81:5
+ --> $DIR/lint-missing-doc.rs:83:5
|
LL | pub fn foo() {}
| ^^^^^^^^^^^^
error: missing documentation for an enum
- --> $DIR/lint-missing-doc.rs:118:1
+ --> $DIR/lint-missing-doc.rs:120:1
|
LL | pub enum PubBaz {
| ^^^^^^^^^^^^^^^
error: missing documentation for a variant
- --> $DIR/lint-missing-doc.rs:119:5
+ --> $DIR/lint-missing-doc.rs:121:5
|
LL | PubBazA {
| ^^^^^^^
error: missing documentation for a struct field
- --> $DIR/lint-missing-doc.rs:120:9
+ --> $DIR/lint-missing-doc.rs:122:9
|
LL | a: isize,
| ^^^^^^^^
error: missing documentation for a constant
- --> $DIR/lint-missing-doc.rs:151:1
+ --> $DIR/lint-missing-doc.rs:153:1
|
LL | pub const FOO4: u32 = 0;
| ^^^^^^^^^^^^^^^^^^^
error: missing documentation for a static
- --> $DIR/lint-missing-doc.rs:161:1
+ --> $DIR/lint-missing-doc.rs:163:1
|
LL | pub static BAR4: u32 = 0;
| ^^^^^^^^^^^^^^^^^^^^
error: missing documentation for a function
- --> $DIR/lint-missing-doc.rs:167:5
+ --> $DIR/lint-missing-doc.rs:169:5
|
LL | pub fn undocumented1() {}
| ^^^^^^^^^^^^^^^^^^^^^^
error: missing documentation for a function
- --> $DIR/lint-missing-doc.rs:168:5
+ --> $DIR/lint-missing-doc.rs:170:5
|
LL | pub fn undocumented2() {}
| ^^^^^^^^^^^^^^^^^^^^^^
error: missing documentation for a function
- --> $DIR/lint-missing-doc.rs:174:9
+ --> $DIR/lint-missing-doc.rs:176:9
|
LL | pub fn also_undocumented1() {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: missing documentation for a function
- --> $DIR/lint-missing-doc.rs:189:5
+ --> $DIR/lint-missing-doc.rs:191:5
|
LL | pub fn extern_fn_undocumented(f: f32) -> f32;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: missing documentation for a static
- --> $DIR/lint-missing-doc.rs:194:5
+ --> $DIR/lint-missing-doc.rs:196:5
|
LL | pub static EXTERN_STATIC_UNDOCUMENTED: u8;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: missing documentation for a foreign type
- --> $DIR/lint-missing-doc.rs:199:5
+ --> $DIR/lint-missing-doc.rs:201:5
|
LL | pub type ExternTyUndocumented;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-error: aborting due to 22 previous errors
+error: aborting due to 24 previous errors
diff --git a/tests/ui/lint/lint-stability-deprecated.rs b/tests/ui/lint/lint-stability-deprecated.rs
index 74c35083e..a56a37228 100644
--- a/tests/ui/lint/lint-stability-deprecated.rs
+++ b/tests/ui/lint/lint-stability-deprecated.rs
@@ -22,40 +22,40 @@ mod cross_crate {
let foo = MethodTester;
deprecated(); //~ WARN use of deprecated function `lint_stability::deprecated`
- foo.method_deprecated(); //~ WARN use of deprecated associated function `lint_stability::MethodTester::method_deprecated`
- Foo::method_deprecated(&foo); //~ WARN use of deprecated associated function `lint_stability::MethodTester::method_deprecated`
- <Foo>::method_deprecated(&foo); //~ WARN use of deprecated associated function `lint_stability::MethodTester::method_deprecated`
- foo.trait_deprecated(); //~ WARN use of deprecated associated function `lint_stability::Trait::trait_deprecated`
- Trait::trait_deprecated(&foo); //~ WARN use of deprecated associated function `lint_stability::Trait::trait_deprecated`
- <Foo>::trait_deprecated(&foo); //~ WARN use of deprecated associated function `lint_stability::Trait::trait_deprecated`
- <Foo as Trait>::trait_deprecated(&foo); //~ WARN use of deprecated associated function `lint_stability::Trait::trait_deprecated`
+ foo.method_deprecated(); //~ WARN use of deprecated method `lint_stability::MethodTester::method_deprecated`
+ Foo::method_deprecated(&foo); //~ WARN use of deprecated method `lint_stability::MethodTester::method_deprecated`
+ <Foo>::method_deprecated(&foo); //~ WARN use of deprecated method `lint_stability::MethodTester::method_deprecated`
+ foo.trait_deprecated(); //~ WARN use of deprecated method `lint_stability::Trait::trait_deprecated`
+ Trait::trait_deprecated(&foo); //~ WARN use of deprecated method `lint_stability::Trait::trait_deprecated`
+ <Foo>::trait_deprecated(&foo); //~ WARN use of deprecated method `lint_stability::Trait::trait_deprecated`
+ <Foo as Trait>::trait_deprecated(&foo); //~ WARN use of deprecated method `lint_stability::Trait::trait_deprecated`
deprecated_text(); //~ WARN use of deprecated function `lint_stability::deprecated_text`: text
- foo.method_deprecated_text(); //~ WARN use of deprecated associated function `lint_stability::MethodTester::method_deprecated_text`: text
- Foo::method_deprecated_text(&foo); //~ WARN use of deprecated associated function `lint_stability::MethodTester::method_deprecated_text`: text
- <Foo>::method_deprecated_text(&foo); //~ WARN use of deprecated associated function `lint_stability::MethodTester::method_deprecated_text`: text
- foo.trait_deprecated_text(); //~ WARN use of deprecated associated function `lint_stability::Trait::trait_deprecated_text`: text
- Trait::trait_deprecated_text(&foo); //~ WARN use of deprecated associated function `lint_stability::Trait::trait_deprecated_text`: text
- <Foo>::trait_deprecated_text(&foo); //~ WARN use of deprecated associated function `lint_stability::Trait::trait_deprecated_text`: text
- <Foo as Trait>::trait_deprecated_text(&foo); //~ WARN use of deprecated associated function `lint_stability::Trait::trait_deprecated_text`: text
+ foo.method_deprecated_text(); //~ WARN use of deprecated method `lint_stability::MethodTester::method_deprecated_text`: text
+ Foo::method_deprecated_text(&foo); //~ WARN use of deprecated method `lint_stability::MethodTester::method_deprecated_text`: text
+ <Foo>::method_deprecated_text(&foo); //~ WARN use of deprecated method `lint_stability::MethodTester::method_deprecated_text`: text
+ foo.trait_deprecated_text(); //~ WARN use of deprecated method `lint_stability::Trait::trait_deprecated_text`: text
+ Trait::trait_deprecated_text(&foo); //~ WARN use of deprecated method `lint_stability::Trait::trait_deprecated_text`: text
+ <Foo>::trait_deprecated_text(&foo); //~ WARN use of deprecated method `lint_stability::Trait::trait_deprecated_text`: text
+ <Foo as Trait>::trait_deprecated_text(&foo); //~ WARN use of deprecated method `lint_stability::Trait::trait_deprecated_text`: text
deprecated_unstable(); //~ WARN use of deprecated function `lint_stability::deprecated_unstable`
- foo.method_deprecated_unstable(); //~ WARN use of deprecated associated function `lint_stability::MethodTester::method_deprecated_unstable`
- Foo::method_deprecated_unstable(&foo); //~ WARN use of deprecated associated function `lint_stability::MethodTester::method_deprecated_unstable`
- <Foo>::method_deprecated_unstable(&foo); //~ WARN use of deprecated associated function `lint_stability::MethodTester::method_deprecated_unstable`
- foo.trait_deprecated_unstable(); //~ WARN use of deprecated associated function `lint_stability::Trait::trait_deprecated_unstable`
- Trait::trait_deprecated_unstable(&foo); //~ WARN use of deprecated associated function `lint_stability::Trait::trait_deprecated_unstable`
- <Foo>::trait_deprecated_unstable(&foo); //~ WARN use of deprecated associated function `lint_stability::Trait::trait_deprecated_unstable`
- <Foo as Trait>::trait_deprecated_unstable(&foo); //~ WARN use of deprecated associated function `lint_stability::Trait::trait_deprecated_unstable`
+ foo.method_deprecated_unstable(); //~ WARN use of deprecated method `lint_stability::MethodTester::method_deprecated_unstable`
+ Foo::method_deprecated_unstable(&foo); //~ WARN use of deprecated method `lint_stability::MethodTester::method_deprecated_unstable`
+ <Foo>::method_deprecated_unstable(&foo); //~ WARN use of deprecated method `lint_stability::MethodTester::method_deprecated_unstable`
+ foo.trait_deprecated_unstable(); //~ WARN use of deprecated method `lint_stability::Trait::trait_deprecated_unstable`
+ Trait::trait_deprecated_unstable(&foo); //~ WARN use of deprecated method `lint_stability::Trait::trait_deprecated_unstable`
+ <Foo>::trait_deprecated_unstable(&foo); //~ WARN use of deprecated method `lint_stability::Trait::trait_deprecated_unstable`
+ <Foo as Trait>::trait_deprecated_unstable(&foo); //~ WARN use of deprecated method `lint_stability::Trait::trait_deprecated_unstable`
deprecated_unstable_text(); //~ WARN use of deprecated function `lint_stability::deprecated_unstable_text`: text
- foo.method_deprecated_unstable_text(); //~ WARN use of deprecated associated function `lint_stability::MethodTester::method_deprecated_unstable_text`: text
- Foo::method_deprecated_unstable_text(&foo); //~ WARN use of deprecated associated function `lint_stability::MethodTester::method_deprecated_unstable_text`: text
- <Foo>::method_deprecated_unstable_text(&foo); //~ WARN use of deprecated associated function `lint_stability::MethodTester::method_deprecated_unstable_text`: text
- foo.trait_deprecated_unstable_text(); //~ WARN use of deprecated associated function `lint_stability::Trait::trait_deprecated_unstable_text`: text
- Trait::trait_deprecated_unstable_text(&foo); //~ WARN use of deprecated associated function `lint_stability::Trait::trait_deprecated_unstable_text`: text
- <Foo>::trait_deprecated_unstable_text(&foo); //~ WARN use of deprecated associated function `lint_stability::Trait::trait_deprecated_unstable_text`: text
- <Foo as Trait>::trait_deprecated_unstable_text(&foo); //~ WARN use of deprecated associated function `lint_stability::Trait::trait_deprecated_unstable_text`: text
+ foo.method_deprecated_unstable_text(); //~ WARN use of deprecated method `lint_stability::MethodTester::method_deprecated_unstable_text`: text
+ Foo::method_deprecated_unstable_text(&foo); //~ WARN use of deprecated method `lint_stability::MethodTester::method_deprecated_unstable_text`: text
+ <Foo>::method_deprecated_unstable_text(&foo); //~ WARN use of deprecated method `lint_stability::MethodTester::method_deprecated_unstable_text`: text
+ foo.trait_deprecated_unstable_text(); //~ WARN use of deprecated method `lint_stability::Trait::trait_deprecated_unstable_text`: text
+ Trait::trait_deprecated_unstable_text(&foo); //~ WARN use of deprecated method `lint_stability::Trait::trait_deprecated_unstable_text`: text
+ <Foo>::trait_deprecated_unstable_text(&foo); //~ WARN use of deprecated method `lint_stability::Trait::trait_deprecated_unstable_text`: text
+ <Foo as Trait>::trait_deprecated_unstable_text(&foo); //~ WARN use of deprecated method `lint_stability::Trait::trait_deprecated_unstable_text`: text
unstable();
foo.method_unstable();
@@ -141,22 +141,22 @@ mod cross_crate {
}
fn test_method_param<Foo: Trait>(foo: Foo) {
- foo.trait_deprecated(); //~ WARN use of deprecated associated function `lint_stability::Trait::trait_deprecated`
- Trait::trait_deprecated(&foo); //~ WARN use of deprecated associated function `lint_stability::Trait::trait_deprecated`
- <Foo>::trait_deprecated(&foo); //~ WARN use of deprecated associated function `lint_stability::Trait::trait_deprecated`
- <Foo as Trait>::trait_deprecated(&foo); //~ WARN use of deprecated associated function `lint_stability::Trait::trait_deprecated`
- foo.trait_deprecated_text(); //~ WARN use of deprecated associated function `lint_stability::Trait::trait_deprecated_text`: text
- Trait::trait_deprecated_text(&foo); //~ WARN use of deprecated associated function `lint_stability::Trait::trait_deprecated_text`: text
- <Foo>::trait_deprecated_text(&foo); //~ WARN use of deprecated associated function `lint_stability::Trait::trait_deprecated_text`: text
- <Foo as Trait>::trait_deprecated_text(&foo); //~ WARN use of deprecated associated function `lint_stability::Trait::trait_deprecated_text`: text
- foo.trait_deprecated_unstable(); //~ WARN use of deprecated associated function `lint_stability::Trait::trait_deprecated_unstable`
- Trait::trait_deprecated_unstable(&foo); //~ WARN use of deprecated associated function `lint_stability::Trait::trait_deprecated_unstable`
- <Foo>::trait_deprecated_unstable(&foo); //~ WARN use of deprecated associated function `lint_stability::Trait::trait_deprecated_unstable`
- <Foo as Trait>::trait_deprecated_unstable(&foo); //~ WARN use of deprecated associated function `lint_stability::Trait::trait_deprecated_unstable`
- foo.trait_deprecated_unstable_text(); //~ WARN use of deprecated associated function `lint_stability::Trait::trait_deprecated_unstable_text`: text
- Trait::trait_deprecated_unstable_text(&foo); //~ WARN use of deprecated associated function `lint_stability::Trait::trait_deprecated_unstable_text`: text
- <Foo>::trait_deprecated_unstable_text(&foo); //~ WARN use of deprecated associated function `lint_stability::Trait::trait_deprecated_unstable_text`: text
- <Foo as Trait>::trait_deprecated_unstable_text(&foo); //~ WARN use of deprecated associated function `lint_stability::Trait::trait_deprecated_unstable_text`: text
+ foo.trait_deprecated(); //~ WARN use of deprecated method `lint_stability::Trait::trait_deprecated`
+ Trait::trait_deprecated(&foo); //~ WARN use of deprecated method `lint_stability::Trait::trait_deprecated`
+ <Foo>::trait_deprecated(&foo); //~ WARN use of deprecated method `lint_stability::Trait::trait_deprecated`
+ <Foo as Trait>::trait_deprecated(&foo); //~ WARN use of deprecated method `lint_stability::Trait::trait_deprecated`
+ foo.trait_deprecated_text(); //~ WARN use of deprecated method `lint_stability::Trait::trait_deprecated_text`: text
+ Trait::trait_deprecated_text(&foo); //~ WARN use of deprecated method `lint_stability::Trait::trait_deprecated_text`: text
+ <Foo>::trait_deprecated_text(&foo); //~ WARN use of deprecated method `lint_stability::Trait::trait_deprecated_text`: text
+ <Foo as Trait>::trait_deprecated_text(&foo); //~ WARN use of deprecated method `lint_stability::Trait::trait_deprecated_text`: text
+ foo.trait_deprecated_unstable(); //~ WARN use of deprecated method `lint_stability::Trait::trait_deprecated_unstable`
+ Trait::trait_deprecated_unstable(&foo); //~ WARN use of deprecated method `lint_stability::Trait::trait_deprecated_unstable`
+ <Foo>::trait_deprecated_unstable(&foo); //~ WARN use of deprecated method `lint_stability::Trait::trait_deprecated_unstable`
+ <Foo as Trait>::trait_deprecated_unstable(&foo); //~ WARN use of deprecated method `lint_stability::Trait::trait_deprecated_unstable`
+ foo.trait_deprecated_unstable_text(); //~ WARN use of deprecated method `lint_stability::Trait::trait_deprecated_unstable_text`: text
+ Trait::trait_deprecated_unstable_text(&foo); //~ WARN use of deprecated method `lint_stability::Trait::trait_deprecated_unstable_text`: text
+ <Foo>::trait_deprecated_unstable_text(&foo); //~ WARN use of deprecated method `lint_stability::Trait::trait_deprecated_unstable_text`: text
+ <Foo as Trait>::trait_deprecated_unstable_text(&foo); //~ WARN use of deprecated method `lint_stability::Trait::trait_deprecated_unstable_text`: text
foo.trait_unstable();
Trait::trait_unstable(&foo);
<Foo>::trait_unstable(&foo);
@@ -172,10 +172,10 @@ mod cross_crate {
}
fn test_method_object(foo: &dyn Trait) {
- foo.trait_deprecated(); //~ WARN use of deprecated associated function `lint_stability::Trait::trait_deprecated`
- foo.trait_deprecated_text(); //~ WARN use of deprecated associated function `lint_stability::Trait::trait_deprecated_text`: text
- foo.trait_deprecated_unstable(); //~ WARN use of deprecated associated function `lint_stability::Trait::trait_deprecated_unstable`
- foo.trait_deprecated_unstable_text(); //~ WARN use of deprecated associated function `lint_stability::Trait::trait_deprecated_unstable_text`: text
+ foo.trait_deprecated(); //~ WARN use of deprecated method `lint_stability::Trait::trait_deprecated`
+ foo.trait_deprecated_text(); //~ WARN use of deprecated method `lint_stability::Trait::trait_deprecated_text`: text
+ foo.trait_deprecated_unstable(); //~ WARN use of deprecated method `lint_stability::Trait::trait_deprecated_unstable`
+ foo.trait_deprecated_unstable_text(); //~ WARN use of deprecated method `lint_stability::Trait::trait_deprecated_unstable_text`: text
foo.trait_unstable();
foo.trait_unstable_text();
foo.trait_stable();
@@ -328,22 +328,22 @@ mod this_crate {
let foo = MethodTester;
deprecated(); //~ WARN use of deprecated function `this_crate::deprecated`
- foo.method_deprecated(); //~ WARN use of deprecated associated function `this_crate::MethodTester::method_deprecated`
- Foo::method_deprecated(&foo); //~ WARN use of deprecated associated function `this_crate::MethodTester::method_deprecated`
- <Foo>::method_deprecated(&foo); //~ WARN use of deprecated associated function `this_crate::MethodTester::method_deprecated`
- foo.trait_deprecated(); //~ WARN use of deprecated associated function `this_crate::Trait::trait_deprecated`
- Trait::trait_deprecated(&foo); //~ WARN use of deprecated associated function `this_crate::Trait::trait_deprecated`
- <Foo>::trait_deprecated(&foo); //~ WARN use of deprecated associated function `this_crate::Trait::trait_deprecated`
- <Foo as Trait>::trait_deprecated(&foo); //~ WARN use of deprecated associated function `this_crate::Trait::trait_deprecated`
+ foo.method_deprecated(); //~ WARN use of deprecated method `this_crate::MethodTester::method_deprecated`
+ Foo::method_deprecated(&foo); //~ WARN use of deprecated method `this_crate::MethodTester::method_deprecated`
+ <Foo>::method_deprecated(&foo); //~ WARN use of deprecated method `this_crate::MethodTester::method_deprecated`
+ foo.trait_deprecated(); //~ WARN use of deprecated method `this_crate::Trait::trait_deprecated`
+ Trait::trait_deprecated(&foo); //~ WARN use of deprecated method `this_crate::Trait::trait_deprecated`
+ <Foo>::trait_deprecated(&foo); //~ WARN use of deprecated method `this_crate::Trait::trait_deprecated`
+ <Foo as Trait>::trait_deprecated(&foo); //~ WARN use of deprecated method `this_crate::Trait::trait_deprecated`
deprecated_text(); //~ WARN use of deprecated function `this_crate::deprecated_text`: text
- foo.method_deprecated_text(); //~ WARN use of deprecated associated function `this_crate::MethodTester::method_deprecated_text`: text
- Foo::method_deprecated_text(&foo); //~ WARN use of deprecated associated function `this_crate::MethodTester::method_deprecated_text`: text
- <Foo>::method_deprecated_text(&foo); //~ WARN use of deprecated associated function `this_crate::MethodTester::method_deprecated_text`: text
- foo.trait_deprecated_text(); //~ WARN use of deprecated associated function `this_crate::Trait::trait_deprecated_text`: text
- Trait::trait_deprecated_text(&foo); //~ WARN use of deprecated associated function `this_crate::Trait::trait_deprecated_text`: text
- <Foo>::trait_deprecated_text(&foo); //~ WARN use of deprecated associated function `this_crate::Trait::trait_deprecated_text`: text
- <Foo as Trait>::trait_deprecated_text(&foo); //~ WARN use of deprecated associated function `this_crate::Trait::trait_deprecated_text`: text
+ foo.method_deprecated_text(); //~ WARN use of deprecated method `this_crate::MethodTester::method_deprecated_text`: text
+ Foo::method_deprecated_text(&foo); //~ WARN use of deprecated method `this_crate::MethodTester::method_deprecated_text`: text
+ <Foo>::method_deprecated_text(&foo); //~ WARN use of deprecated method `this_crate::MethodTester::method_deprecated_text`: text
+ foo.trait_deprecated_text(); //~ WARN use of deprecated method `this_crate::Trait::trait_deprecated_text`: text
+ Trait::trait_deprecated_text(&foo); //~ WARN use of deprecated method `this_crate::Trait::trait_deprecated_text`: text
+ <Foo>::trait_deprecated_text(&foo); //~ WARN use of deprecated method `this_crate::Trait::trait_deprecated_text`: text
+ <Foo as Trait>::trait_deprecated_text(&foo); //~ WARN use of deprecated method `this_crate::Trait::trait_deprecated_text`: text
unstable();
foo.method_unstable();
@@ -402,14 +402,14 @@ mod this_crate {
}
fn test_method_param<Foo: Trait>(foo: Foo) {
- foo.trait_deprecated(); //~ WARN use of deprecated associated function `this_crate::Trait::trait_deprecated`
- Trait::trait_deprecated(&foo); //~ WARN use of deprecated associated function `this_crate::Trait::trait_deprecated`
- <Foo>::trait_deprecated(&foo); //~ WARN use of deprecated associated function `this_crate::Trait::trait_deprecated`
- <Foo as Trait>::trait_deprecated(&foo); //~ WARN use of deprecated associated function `this_crate::Trait::trait_deprecated`
- foo.trait_deprecated_text(); //~ WARN use of deprecated associated function `this_crate::Trait::trait_deprecated_text`: text
- Trait::trait_deprecated_text(&foo); //~ WARN use of deprecated associated function `this_crate::Trait::trait_deprecated_text`: text
- <Foo>::trait_deprecated_text(&foo); //~ WARN use of deprecated associated function `this_crate::Trait::trait_deprecated_text`: text
- <Foo as Trait>::trait_deprecated_text(&foo); //~ WARN use of deprecated associated function `this_crate::Trait::trait_deprecated_text`: text
+ foo.trait_deprecated(); //~ WARN use of deprecated method `this_crate::Trait::trait_deprecated`
+ Trait::trait_deprecated(&foo); //~ WARN use of deprecated method `this_crate::Trait::trait_deprecated`
+ <Foo>::trait_deprecated(&foo); //~ WARN use of deprecated method `this_crate::Trait::trait_deprecated`
+ <Foo as Trait>::trait_deprecated(&foo); //~ WARN use of deprecated method `this_crate::Trait::trait_deprecated`
+ foo.trait_deprecated_text(); //~ WARN use of deprecated method `this_crate::Trait::trait_deprecated_text`: text
+ Trait::trait_deprecated_text(&foo); //~ WARN use of deprecated method `this_crate::Trait::trait_deprecated_text`: text
+ <Foo>::trait_deprecated_text(&foo); //~ WARN use of deprecated method `this_crate::Trait::trait_deprecated_text`: text
+ <Foo as Trait>::trait_deprecated_text(&foo); //~ WARN use of deprecated method `this_crate::Trait::trait_deprecated_text`: text
foo.trait_unstable();
Trait::trait_unstable(&foo);
<Foo>::trait_unstable(&foo);
@@ -425,8 +425,8 @@ mod this_crate {
}
fn test_method_object(foo: &dyn Trait) {
- foo.trait_deprecated(); //~ WARN use of deprecated associated function `this_crate::Trait::trait_deprecated`
- foo.trait_deprecated_text(); //~ WARN use of deprecated associated function `this_crate::Trait::trait_deprecated_text`: text
+ foo.trait_deprecated(); //~ WARN use of deprecated method `this_crate::Trait::trait_deprecated`
+ foo.trait_deprecated_text(); //~ WARN use of deprecated method `this_crate::Trait::trait_deprecated_text`: text
foo.trait_unstable();
foo.trait_unstable_text();
foo.trait_stable();
diff --git a/tests/ui/lint/lint-stability-deprecated.stderr b/tests/ui/lint/lint-stability-deprecated.stderr
index 9f1e7b281..19a4649e1 100644
--- a/tests/ui/lint/lint-stability-deprecated.stderr
+++ b/tests/ui/lint/lint-stability-deprecated.stderr
@@ -10,13 +10,13 @@ note: the lint level is defined here
LL | #![warn(deprecated)]
| ^^^^^^^^^^
-warning: use of deprecated associated function `lint_stability::Trait::trait_deprecated`: text
+warning: use of deprecated method `lint_stability::Trait::trait_deprecated`: text
--> $DIR/lint-stability-deprecated.rs:29:16
|
LL | Trait::trait_deprecated(&foo);
| ^^^^^^^^^^^^^^^^
-warning: use of deprecated associated function `lint_stability::Trait::trait_deprecated`: text
+warning: use of deprecated method `lint_stability::Trait::trait_deprecated`: text
--> $DIR/lint-stability-deprecated.rs:31:25
|
LL | <Foo as Trait>::trait_deprecated(&foo);
@@ -28,17 +28,17 @@ warning: use of deprecated function `lint_stability::deprecated_text`: text
LL | deprecated_text();
| ^^^^^^^^^^^^^^^
-warning: use of deprecated associated function `lint_stability::Trait::trait_deprecated_text`: text
+warning: use of deprecated method `lint_stability::Trait::trait_deprecated_text`: text
--> $DIR/lint-stability-deprecated.rs:38:16
|
-LL | ... Trait::trait_deprecated_text(&foo);
- | ^^^^^^^^^^^^^^^^^^^^^
+LL | Trait::trait_deprecated_text(&foo);
+ | ^^^^^^^^^^^^^^^^^^^^^
-warning: use of deprecated associated function `lint_stability::Trait::trait_deprecated_text`: text
+warning: use of deprecated method `lint_stability::Trait::trait_deprecated_text`: text
--> $DIR/lint-stability-deprecated.rs:40:25
|
-LL | ... <Foo as Trait>::trait_deprecated_text(&foo);
- | ^^^^^^^^^^^^^^^^^^^^^
+LL | <Foo as Trait>::trait_deprecated_text(&foo);
+ | ^^^^^^^^^^^^^^^^^^^^^
warning: use of deprecated function `lint_stability::deprecated_unstable`: text
--> $DIR/lint-stability-deprecated.rs:42:9
@@ -46,13 +46,13 @@ warning: use of deprecated function `lint_stability::deprecated_unstable`: text
LL | deprecated_unstable();
| ^^^^^^^^^^^^^^^^^^^
-warning: use of deprecated associated function `lint_stability::Trait::trait_deprecated_unstable`: text
+warning: use of deprecated method `lint_stability::Trait::trait_deprecated_unstable`: text
--> $DIR/lint-stability-deprecated.rs:47:16
|
-LL | ... Trait::trait_deprecated_unstable(&foo);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+LL | Trait::trait_deprecated_unstable(&foo);
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
-warning: use of deprecated associated function `lint_stability::Trait::trait_deprecated_unstable`: text
+warning: use of deprecated method `lint_stability::Trait::trait_deprecated_unstable`: text
--> $DIR/lint-stability-deprecated.rs:49:25
|
LL | ... <Foo as Trait>::trait_deprecated_unstable(&foo);
@@ -64,13 +64,13 @@ warning: use of deprecated function `lint_stability::deprecated_unstable_text`:
LL | deprecated_unstable_text();
| ^^^^^^^^^^^^^^^^^^^^^^^^
-warning: use of deprecated associated function `lint_stability::Trait::trait_deprecated_unstable_text`: text
+warning: use of deprecated method `lint_stability::Trait::trait_deprecated_unstable_text`: text
--> $DIR/lint-stability-deprecated.rs:56:16
|
LL | ... Trait::trait_deprecated_unstable_text(&foo);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-warning: use of deprecated associated function `lint_stability::Trait::trait_deprecated_unstable_text`: text
+warning: use of deprecated method `lint_stability::Trait::trait_deprecated_unstable_text`: text
--> $DIR/lint-stability-deprecated.rs:58:25
|
LL | ... <Foo as Trait>::trait_deprecated_unstable_text(&foo);
@@ -142,49 +142,49 @@ warning: use of deprecated function `lint_stability::deprecated_text`: text
LL | macro_test_arg!(macro_test_arg!(deprecated_text()));
| ^^^^^^^^^^^^^^^
-warning: use of deprecated associated function `lint_stability::Trait::trait_deprecated`: text
+warning: use of deprecated method `lint_stability::Trait::trait_deprecated`: text
--> $DIR/lint-stability-deprecated.rs:145:16
|
LL | Trait::trait_deprecated(&foo);
| ^^^^^^^^^^^^^^^^
-warning: use of deprecated associated function `lint_stability::Trait::trait_deprecated`: text
+warning: use of deprecated method `lint_stability::Trait::trait_deprecated`: text
--> $DIR/lint-stability-deprecated.rs:147:25
|
LL | <Foo as Trait>::trait_deprecated(&foo);
| ^^^^^^^^^^^^^^^^
-warning: use of deprecated associated function `lint_stability::Trait::trait_deprecated_text`: text
+warning: use of deprecated method `lint_stability::Trait::trait_deprecated_text`: text
--> $DIR/lint-stability-deprecated.rs:149:16
|
-LL | ... Trait::trait_deprecated_text(&foo);
- | ^^^^^^^^^^^^^^^^^^^^^
+LL | Trait::trait_deprecated_text(&foo);
+ | ^^^^^^^^^^^^^^^^^^^^^
-warning: use of deprecated associated function `lint_stability::Trait::trait_deprecated_text`: text
+warning: use of deprecated method `lint_stability::Trait::trait_deprecated_text`: text
--> $DIR/lint-stability-deprecated.rs:151:25
|
-LL | ... <Foo as Trait>::trait_deprecated_text(&foo);
- | ^^^^^^^^^^^^^^^^^^^^^
+LL | <Foo as Trait>::trait_deprecated_text(&foo);
+ | ^^^^^^^^^^^^^^^^^^^^^
-warning: use of deprecated associated function `lint_stability::Trait::trait_deprecated_unstable`: text
+warning: use of deprecated method `lint_stability::Trait::trait_deprecated_unstable`: text
--> $DIR/lint-stability-deprecated.rs:153:16
|
-LL | ... Trait::trait_deprecated_unstable(&foo);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+LL | Trait::trait_deprecated_unstable(&foo);
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
-warning: use of deprecated associated function `lint_stability::Trait::trait_deprecated_unstable`: text
+warning: use of deprecated method `lint_stability::Trait::trait_deprecated_unstable`: text
--> $DIR/lint-stability-deprecated.rs:155:25
|
LL | ... <Foo as Trait>::trait_deprecated_unstable(&foo);
| ^^^^^^^^^^^^^^^^^^^^^^^^^
-warning: use of deprecated associated function `lint_stability::Trait::trait_deprecated_unstable_text`: text
+warning: use of deprecated method `lint_stability::Trait::trait_deprecated_unstable_text`: text
--> $DIR/lint-stability-deprecated.rs:157:16
|
LL | ... Trait::trait_deprecated_unstable_text(&foo);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-warning: use of deprecated associated function `lint_stability::Trait::trait_deprecated_unstable_text`: text
+warning: use of deprecated method `lint_stability::Trait::trait_deprecated_unstable_text`: text
--> $DIR/lint-stability-deprecated.rs:159:25
|
LL | ... <Foo as Trait>::trait_deprecated_unstable_text(&foo);
@@ -214,13 +214,13 @@ warning: use of deprecated function `this_crate::deprecated`: text
LL | deprecated();
| ^^^^^^^^^^
-warning: use of deprecated associated function `this_crate::Trait::trait_deprecated`: text
+warning: use of deprecated method `this_crate::Trait::trait_deprecated`: text
--> $DIR/lint-stability-deprecated.rs:335:16
|
LL | Trait::trait_deprecated(&foo);
| ^^^^^^^^^^^^^^^^
-warning: use of deprecated associated function `this_crate::Trait::trait_deprecated`: text
+warning: use of deprecated method `this_crate::Trait::trait_deprecated`: text
--> $DIR/lint-stability-deprecated.rs:337:25
|
LL | <Foo as Trait>::trait_deprecated(&foo);
@@ -232,17 +232,17 @@ warning: use of deprecated function `this_crate::deprecated_text`: text
LL | deprecated_text();
| ^^^^^^^^^^^^^^^
-warning: use of deprecated associated function `this_crate::Trait::trait_deprecated_text`: text
+warning: use of deprecated method `this_crate::Trait::trait_deprecated_text`: text
--> $DIR/lint-stability-deprecated.rs:344:16
|
LL | Trait::trait_deprecated_text(&foo);
| ^^^^^^^^^^^^^^^^^^^^^
-warning: use of deprecated associated function `this_crate::Trait::trait_deprecated_text`: text
+warning: use of deprecated method `this_crate::Trait::trait_deprecated_text`: text
--> $DIR/lint-stability-deprecated.rs:346:25
|
-LL | ... <Foo as Trait>::trait_deprecated_text(&foo);
- | ^^^^^^^^^^^^^^^^^^^^^
+LL | <Foo as Trait>::trait_deprecated_text(&foo);
+ | ^^^^^^^^^^^^^^^^^^^^^
warning: use of deprecated struct `this_crate::DeprecatedStruct`: text
--> $DIR/lint-stability-deprecated.rs:384:17
@@ -268,29 +268,29 @@ warning: use of deprecated tuple struct `this_crate::DeprecatedTupleStruct`: tex
LL | let _ = DeprecatedTupleStruct (1);
| ^^^^^^^^^^^^^^^^^^^^^
-warning: use of deprecated associated function `this_crate::Trait::trait_deprecated`: text
+warning: use of deprecated method `this_crate::Trait::trait_deprecated`: text
--> $DIR/lint-stability-deprecated.rs:406:16
|
LL | Trait::trait_deprecated(&foo);
| ^^^^^^^^^^^^^^^^
-warning: use of deprecated associated function `this_crate::Trait::trait_deprecated`: text
+warning: use of deprecated method `this_crate::Trait::trait_deprecated`: text
--> $DIR/lint-stability-deprecated.rs:408:25
|
LL | <Foo as Trait>::trait_deprecated(&foo);
| ^^^^^^^^^^^^^^^^
-warning: use of deprecated associated function `this_crate::Trait::trait_deprecated_text`: text
+warning: use of deprecated method `this_crate::Trait::trait_deprecated_text`: text
--> $DIR/lint-stability-deprecated.rs:410:16
|
LL | Trait::trait_deprecated_text(&foo);
| ^^^^^^^^^^^^^^^^^^^^^
-warning: use of deprecated associated function `this_crate::Trait::trait_deprecated_text`: text
+warning: use of deprecated method `this_crate::Trait::trait_deprecated_text`: text
--> $DIR/lint-stability-deprecated.rs:412:25
|
-LL | ... <Foo as Trait>::trait_deprecated_text(&foo);
- | ^^^^^^^^^^^^^^^^^^^^^
+LL | <Foo as Trait>::trait_deprecated_text(&foo);
+ | ^^^^^^^^^^^^^^^^^^^^^
warning: use of deprecated function `this_crate::test_fn_body::fn_in_body`: text
--> $DIR/lint-stability-deprecated.rs:439:9
@@ -328,121 +328,121 @@ warning: use of deprecated associated type `lint_stability::TraitWithAssociatedT
LL | TypeDeprecated = u16,
| ^^^^^^^^^^^^^^^^^^^^
-warning: use of deprecated associated function `lint_stability::MethodTester::method_deprecated`: text
+warning: use of deprecated method `lint_stability::MethodTester::method_deprecated`: text
--> $DIR/lint-stability-deprecated.rs:25:13
|
LL | foo.method_deprecated();
| ^^^^^^^^^^^^^^^^^
-warning: use of deprecated associated function `lint_stability::MethodTester::method_deprecated`: text
+warning: use of deprecated method `lint_stability::MethodTester::method_deprecated`: text
--> $DIR/lint-stability-deprecated.rs:26:14
|
LL | Foo::method_deprecated(&foo);
| ^^^^^^^^^^^^^^^^^
-warning: use of deprecated associated function `lint_stability::MethodTester::method_deprecated`: text
+warning: use of deprecated method `lint_stability::MethodTester::method_deprecated`: text
--> $DIR/lint-stability-deprecated.rs:27:16
|
LL | <Foo>::method_deprecated(&foo);
| ^^^^^^^^^^^^^^^^^
-warning: use of deprecated associated function `lint_stability::Trait::trait_deprecated`: text
+warning: use of deprecated method `lint_stability::Trait::trait_deprecated`: text
--> $DIR/lint-stability-deprecated.rs:28:13
|
LL | foo.trait_deprecated();
| ^^^^^^^^^^^^^^^^
-warning: use of deprecated associated function `lint_stability::Trait::trait_deprecated`: text
+warning: use of deprecated method `lint_stability::Trait::trait_deprecated`: text
--> $DIR/lint-stability-deprecated.rs:30:16
|
LL | <Foo>::trait_deprecated(&foo);
| ^^^^^^^^^^^^^^^^
-warning: use of deprecated associated function `lint_stability::MethodTester::method_deprecated_text`: text
+warning: use of deprecated method `lint_stability::MethodTester::method_deprecated_text`: text
--> $DIR/lint-stability-deprecated.rs:34:13
|
-LL | ... foo.method_deprecated_text();
- | ^^^^^^^^^^^^^^^^^^^^^^
+LL | foo.method_deprecated_text();
+ | ^^^^^^^^^^^^^^^^^^^^^^
-warning: use of deprecated associated function `lint_stability::MethodTester::method_deprecated_text`: text
+warning: use of deprecated method `lint_stability::MethodTester::method_deprecated_text`: text
--> $DIR/lint-stability-deprecated.rs:35:14
|
-LL | ... Foo::method_deprecated_text(&foo);
- | ^^^^^^^^^^^^^^^^^^^^^^
+LL | Foo::method_deprecated_text(&foo);
+ | ^^^^^^^^^^^^^^^^^^^^^^
-warning: use of deprecated associated function `lint_stability::MethodTester::method_deprecated_text`: text
+warning: use of deprecated method `lint_stability::MethodTester::method_deprecated_text`: text
--> $DIR/lint-stability-deprecated.rs:36:16
|
-LL | ... <Foo>::method_deprecated_text(&foo);
- | ^^^^^^^^^^^^^^^^^^^^^^
+LL | <Foo>::method_deprecated_text(&foo);
+ | ^^^^^^^^^^^^^^^^^^^^^^
-warning: use of deprecated associated function `lint_stability::Trait::trait_deprecated_text`: text
+warning: use of deprecated method `lint_stability::Trait::trait_deprecated_text`: text
--> $DIR/lint-stability-deprecated.rs:37:13
|
LL | foo.trait_deprecated_text();
| ^^^^^^^^^^^^^^^^^^^^^
-warning: use of deprecated associated function `lint_stability::Trait::trait_deprecated_text`: text
+warning: use of deprecated method `lint_stability::Trait::trait_deprecated_text`: text
--> $DIR/lint-stability-deprecated.rs:39:16
|
-LL | ... <Foo>::trait_deprecated_text(&foo);
- | ^^^^^^^^^^^^^^^^^^^^^
+LL | <Foo>::trait_deprecated_text(&foo);
+ | ^^^^^^^^^^^^^^^^^^^^^
-warning: use of deprecated associated function `lint_stability::MethodTester::method_deprecated_unstable`: text
+warning: use of deprecated method `lint_stability::MethodTester::method_deprecated_unstable`: text
--> $DIR/lint-stability-deprecated.rs:43:13
|
-LL | ... foo.method_deprecated_unstable();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL | foo.method_deprecated_unstable();
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^
-warning: use of deprecated associated function `lint_stability::MethodTester::method_deprecated_unstable`: text
+warning: use of deprecated method `lint_stability::MethodTester::method_deprecated_unstable`: text
--> $DIR/lint-stability-deprecated.rs:44:14
|
-LL | ... Foo::method_deprecated_unstable(&foo);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL | Foo::method_deprecated_unstable(&foo);
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^
-warning: use of deprecated associated function `lint_stability::MethodTester::method_deprecated_unstable`: text
+warning: use of deprecated method `lint_stability::MethodTester::method_deprecated_unstable`: text
--> $DIR/lint-stability-deprecated.rs:45:16
|
LL | ... <Foo>::method_deprecated_unstable(&foo);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
-warning: use of deprecated associated function `lint_stability::Trait::trait_deprecated_unstable`: text
+warning: use of deprecated method `lint_stability::Trait::trait_deprecated_unstable`: text
--> $DIR/lint-stability-deprecated.rs:46:13
|
LL | foo.trait_deprecated_unstable();
| ^^^^^^^^^^^^^^^^^^^^^^^^^
-warning: use of deprecated associated function `lint_stability::Trait::trait_deprecated_unstable`: text
+warning: use of deprecated method `lint_stability::Trait::trait_deprecated_unstable`: text
--> $DIR/lint-stability-deprecated.rs:48:16
|
-LL | ... <Foo>::trait_deprecated_unstable(&foo);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+LL | <Foo>::trait_deprecated_unstable(&foo);
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
-warning: use of deprecated associated function `lint_stability::MethodTester::method_deprecated_unstable_text`: text
+warning: use of deprecated method `lint_stability::MethodTester::method_deprecated_unstable_text`: text
--> $DIR/lint-stability-deprecated.rs:52:13
|
LL | ... foo.method_deprecated_unstable_text();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-warning: use of deprecated associated function `lint_stability::MethodTester::method_deprecated_unstable_text`: text
+warning: use of deprecated method `lint_stability::MethodTester::method_deprecated_unstable_text`: text
--> $DIR/lint-stability-deprecated.rs:53:14
|
LL | ... Foo::method_deprecated_unstable_text(&foo);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-warning: use of deprecated associated function `lint_stability::MethodTester::method_deprecated_unstable_text`: text
+warning: use of deprecated method `lint_stability::MethodTester::method_deprecated_unstable_text`: text
--> $DIR/lint-stability-deprecated.rs:54:16
|
LL | ... <Foo>::method_deprecated_unstable_text(&foo);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-warning: use of deprecated associated function `lint_stability::Trait::trait_deprecated_unstable_text`: text
+warning: use of deprecated method `lint_stability::Trait::trait_deprecated_unstable_text`: text
--> $DIR/lint-stability-deprecated.rs:55:13
|
LL | ... foo.trait_deprecated_unstable_text();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-warning: use of deprecated associated function `lint_stability::Trait::trait_deprecated_unstable_text`: text
+warning: use of deprecated method `lint_stability::Trait::trait_deprecated_unstable_text`: text
--> $DIR/lint-stability-deprecated.rs:57:16
|
LL | ... <Foo>::trait_deprecated_unstable_text(&foo);
@@ -460,133 +460,133 @@ warning: use of deprecated field `lint_stability::DeprecatedUnstableStruct::i`:
LL | i: 0
| ^^^^
-warning: use of deprecated associated function `lint_stability::Trait::trait_deprecated`: text
+warning: use of deprecated method `lint_stability::Trait::trait_deprecated`: text
--> $DIR/lint-stability-deprecated.rs:144:13
|
LL | foo.trait_deprecated();
| ^^^^^^^^^^^^^^^^
-warning: use of deprecated associated function `lint_stability::Trait::trait_deprecated`: text
+warning: use of deprecated method `lint_stability::Trait::trait_deprecated`: text
--> $DIR/lint-stability-deprecated.rs:146:16
|
LL | <Foo>::trait_deprecated(&foo);
| ^^^^^^^^^^^^^^^^
-warning: use of deprecated associated function `lint_stability::Trait::trait_deprecated_text`: text
+warning: use of deprecated method `lint_stability::Trait::trait_deprecated_text`: text
--> $DIR/lint-stability-deprecated.rs:148:13
|
LL | foo.trait_deprecated_text();
| ^^^^^^^^^^^^^^^^^^^^^
-warning: use of deprecated associated function `lint_stability::Trait::trait_deprecated_text`: text
+warning: use of deprecated method `lint_stability::Trait::trait_deprecated_text`: text
--> $DIR/lint-stability-deprecated.rs:150:16
|
-LL | ... <Foo>::trait_deprecated_text(&foo);
- | ^^^^^^^^^^^^^^^^^^^^^
+LL | <Foo>::trait_deprecated_text(&foo);
+ | ^^^^^^^^^^^^^^^^^^^^^
-warning: use of deprecated associated function `lint_stability::Trait::trait_deprecated_unstable`: text
+warning: use of deprecated method `lint_stability::Trait::trait_deprecated_unstable`: text
--> $DIR/lint-stability-deprecated.rs:152:13
|
LL | foo.trait_deprecated_unstable();
| ^^^^^^^^^^^^^^^^^^^^^^^^^
-warning: use of deprecated associated function `lint_stability::Trait::trait_deprecated_unstable`: text
+warning: use of deprecated method `lint_stability::Trait::trait_deprecated_unstable`: text
--> $DIR/lint-stability-deprecated.rs:154:16
|
-LL | ... <Foo>::trait_deprecated_unstable(&foo);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+LL | <Foo>::trait_deprecated_unstable(&foo);
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
-warning: use of deprecated associated function `lint_stability::Trait::trait_deprecated_unstable_text`: text
+warning: use of deprecated method `lint_stability::Trait::trait_deprecated_unstable_text`: text
--> $DIR/lint-stability-deprecated.rs:156:13
|
LL | ... foo.trait_deprecated_unstable_text();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-warning: use of deprecated associated function `lint_stability::Trait::trait_deprecated_unstable_text`: text
+warning: use of deprecated method `lint_stability::Trait::trait_deprecated_unstable_text`: text
--> $DIR/lint-stability-deprecated.rs:158:16
|
LL | ... <Foo>::trait_deprecated_unstable_text(&foo);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-warning: use of deprecated associated function `lint_stability::Trait::trait_deprecated`: text
+warning: use of deprecated method `lint_stability::Trait::trait_deprecated`: text
--> $DIR/lint-stability-deprecated.rs:175:13
|
LL | foo.trait_deprecated();
| ^^^^^^^^^^^^^^^^
-warning: use of deprecated associated function `lint_stability::Trait::trait_deprecated_text`: text
+warning: use of deprecated method `lint_stability::Trait::trait_deprecated_text`: text
--> $DIR/lint-stability-deprecated.rs:176:13
|
LL | foo.trait_deprecated_text();
| ^^^^^^^^^^^^^^^^^^^^^
-warning: use of deprecated associated function `lint_stability::Trait::trait_deprecated_unstable`: text
+warning: use of deprecated method `lint_stability::Trait::trait_deprecated_unstable`: text
--> $DIR/lint-stability-deprecated.rs:177:13
|
LL | foo.trait_deprecated_unstable();
| ^^^^^^^^^^^^^^^^^^^^^^^^^
-warning: use of deprecated associated function `lint_stability::Trait::trait_deprecated_unstable_text`: text
+warning: use of deprecated method `lint_stability::Trait::trait_deprecated_unstable_text`: text
--> $DIR/lint-stability-deprecated.rs:178:13
|
LL | ... foo.trait_deprecated_unstable_text();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-warning: use of deprecated associated function `this_crate::MethodTester::method_deprecated`: text
+warning: use of deprecated method `this_crate::MethodTester::method_deprecated`: text
--> $DIR/lint-stability-deprecated.rs:331:13
|
LL | foo.method_deprecated();
| ^^^^^^^^^^^^^^^^^
-warning: use of deprecated associated function `this_crate::MethodTester::method_deprecated`: text
+warning: use of deprecated method `this_crate::MethodTester::method_deprecated`: text
--> $DIR/lint-stability-deprecated.rs:332:14
|
LL | Foo::method_deprecated(&foo);
| ^^^^^^^^^^^^^^^^^
-warning: use of deprecated associated function `this_crate::MethodTester::method_deprecated`: text
+warning: use of deprecated method `this_crate::MethodTester::method_deprecated`: text
--> $DIR/lint-stability-deprecated.rs:333:16
|
LL | <Foo>::method_deprecated(&foo);
| ^^^^^^^^^^^^^^^^^
-warning: use of deprecated associated function `this_crate::Trait::trait_deprecated`: text
+warning: use of deprecated method `this_crate::Trait::trait_deprecated`: text
--> $DIR/lint-stability-deprecated.rs:334:13
|
LL | foo.trait_deprecated();
| ^^^^^^^^^^^^^^^^
-warning: use of deprecated associated function `this_crate::Trait::trait_deprecated`: text
+warning: use of deprecated method `this_crate::Trait::trait_deprecated`: text
--> $DIR/lint-stability-deprecated.rs:336:16
|
LL | <Foo>::trait_deprecated(&foo);
| ^^^^^^^^^^^^^^^^
-warning: use of deprecated associated function `this_crate::MethodTester::method_deprecated_text`: text
+warning: use of deprecated method `this_crate::MethodTester::method_deprecated_text`: text
--> $DIR/lint-stability-deprecated.rs:340:13
|
-LL | ... foo.method_deprecated_text();
- | ^^^^^^^^^^^^^^^^^^^^^^
+LL | foo.method_deprecated_text();
+ | ^^^^^^^^^^^^^^^^^^^^^^
-warning: use of deprecated associated function `this_crate::MethodTester::method_deprecated_text`: text
+warning: use of deprecated method `this_crate::MethodTester::method_deprecated_text`: text
--> $DIR/lint-stability-deprecated.rs:341:14
|
-LL | ... Foo::method_deprecated_text(&foo);
- | ^^^^^^^^^^^^^^^^^^^^^^
+LL | Foo::method_deprecated_text(&foo);
+ | ^^^^^^^^^^^^^^^^^^^^^^
-warning: use of deprecated associated function `this_crate::MethodTester::method_deprecated_text`: text
+warning: use of deprecated method `this_crate::MethodTester::method_deprecated_text`: text
--> $DIR/lint-stability-deprecated.rs:342:16
|
-LL | ... <Foo>::method_deprecated_text(&foo);
- | ^^^^^^^^^^^^^^^^^^^^^^
+LL | <Foo>::method_deprecated_text(&foo);
+ | ^^^^^^^^^^^^^^^^^^^^^^
-warning: use of deprecated associated function `this_crate::Trait::trait_deprecated_text`: text
+warning: use of deprecated method `this_crate::Trait::trait_deprecated_text`: text
--> $DIR/lint-stability-deprecated.rs:343:13
|
LL | foo.trait_deprecated_text();
| ^^^^^^^^^^^^^^^^^^^^^
-warning: use of deprecated associated function `this_crate::Trait::trait_deprecated_text`: text
+warning: use of deprecated method `this_crate::Trait::trait_deprecated_text`: text
--> $DIR/lint-stability-deprecated.rs:345:16
|
LL | <Foo>::trait_deprecated_text(&foo);
@@ -598,37 +598,37 @@ warning: use of deprecated field `this_crate::DeprecatedStruct::i`: text
LL | i: 0
| ^^^^
-warning: use of deprecated associated function `this_crate::Trait::trait_deprecated`: text
+warning: use of deprecated method `this_crate::Trait::trait_deprecated`: text
--> $DIR/lint-stability-deprecated.rs:405:13
|
LL | foo.trait_deprecated();
| ^^^^^^^^^^^^^^^^
-warning: use of deprecated associated function `this_crate::Trait::trait_deprecated`: text
+warning: use of deprecated method `this_crate::Trait::trait_deprecated`: text
--> $DIR/lint-stability-deprecated.rs:407:16
|
LL | <Foo>::trait_deprecated(&foo);
| ^^^^^^^^^^^^^^^^
-warning: use of deprecated associated function `this_crate::Trait::trait_deprecated_text`: text
+warning: use of deprecated method `this_crate::Trait::trait_deprecated_text`: text
--> $DIR/lint-stability-deprecated.rs:409:13
|
LL | foo.trait_deprecated_text();
| ^^^^^^^^^^^^^^^^^^^^^
-warning: use of deprecated associated function `this_crate::Trait::trait_deprecated_text`: text
+warning: use of deprecated method `this_crate::Trait::trait_deprecated_text`: text
--> $DIR/lint-stability-deprecated.rs:411:16
|
LL | <Foo>::trait_deprecated_text(&foo);
| ^^^^^^^^^^^^^^^^^^^^^
-warning: use of deprecated associated function `this_crate::Trait::trait_deprecated`: text
+warning: use of deprecated method `this_crate::Trait::trait_deprecated`: text
--> $DIR/lint-stability-deprecated.rs:428:13
|
LL | foo.trait_deprecated();
| ^^^^^^^^^^^^^^^^
-warning: use of deprecated associated function `this_crate::Trait::trait_deprecated_text`: text
+warning: use of deprecated method `this_crate::Trait::trait_deprecated_text`: text
--> $DIR/lint-stability-deprecated.rs:429:13
|
LL | foo.trait_deprecated_text();
diff --git a/tests/ui/lint/lint_map_unit_fn.rs b/tests/ui/lint/lint_map_unit_fn.rs
new file mode 100644
index 000000000..dc1ecbf84
--- /dev/null
+++ b/tests/ui/lint/lint_map_unit_fn.rs
@@ -0,0 +1,20 @@
+#![deny(map_unit_fn)]
+
+fn foo(items: &mut Vec<u8>) {
+ items.sort();
+}
+
+fn main() {
+ let mut x: Vec<Vec<u8>> = vec![vec![0, 2, 1], vec![5, 4, 3]];
+ x.iter_mut().map(foo);
+ //~^ ERROR `Iterator::map` call that discard the iterator's values
+ x.iter_mut().map(|items| {
+ //~^ ERROR `Iterator::map` call that discard the iterator's values
+ items.sort();
+ });
+ let f = |items: &mut Vec<u8>| {
+ items.sort();
+ };
+ x.iter_mut().map(f);
+ //~^ ERROR `Iterator::map` call that discard the iterator's values
+}
diff --git a/tests/ui/lint/lint_map_unit_fn.stderr b/tests/ui/lint/lint_map_unit_fn.stderr
new file mode 100644
index 000000000..fbf689c54
--- /dev/null
+++ b/tests/ui/lint/lint_map_unit_fn.stderr
@@ -0,0 +1,66 @@
+error: `Iterator::map` call that discard the iterator's values
+ --> $DIR/lint_map_unit_fn.rs:9:18
+ |
+LL | fn foo(items: &mut Vec<u8>) {
+ | --------------------------- this function returns `()`, which is likely not what you wanted
+...
+LL | x.iter_mut().map(foo);
+ | ^^^^---^
+ | | |
+ | | called `Iterator::map` with callable that returns `()`
+ | after this call to map, the resulting iterator is `impl Iterator<Item = ()>`, which means the only information carried by the iterator is the number of items
+ |
+ = note: `Iterator::map`, like many of the methods on `Iterator`, gets executed lazily, meaning that its effects won't be visible until it is iterated
+note: the lint level is defined here
+ --> $DIR/lint_map_unit_fn.rs:1:9
+ |
+LL | #![deny(map_unit_fn)]
+ | ^^^^^^^^^^^
+help: you might have meant to use `Iterator::for_each`
+ |
+LL | x.iter_mut().for_each(foo);
+ | ~~~~~~~~
+
+error: `Iterator::map` call that discard the iterator's values
+ --> $DIR/lint_map_unit_fn.rs:11:18
+ |
+LL | x.iter_mut().map(|items| {
+ | ^ -------
+ | | |
+ | ____________________|___this function returns `()`, which is likely not what you wanted
+ | | __________________|
+ | | |
+LL | | |
+LL | | | items.sort();
+LL | | | });
+ | | | -^ after this call to map, the resulting iterator is `impl Iterator<Item = ()>`, which means the only information carried by the iterator is the number of items
+ | | |_____||
+ | |_______|
+ | called `Iterator::map` with callable that returns `()`
+ |
+ = note: `Iterator::map`, like many of the methods on `Iterator`, gets executed lazily, meaning that its effects won't be visible until it is iterated
+help: you might have meant to use `Iterator::for_each`
+ |
+LL | x.iter_mut().for_each(|items| {
+ | ~~~~~~~~
+
+error: `Iterator::map` call that discard the iterator's values
+ --> $DIR/lint_map_unit_fn.rs:18:18
+ |
+LL | let f = |items: &mut Vec<u8>| {
+ | --------------------- this function returns `()`, which is likely not what you wanted
+...
+LL | x.iter_mut().map(f);
+ | ^^^^-^
+ | | |
+ | | called `Iterator::map` with callable that returns `()`
+ | after this call to map, the resulting iterator is `impl Iterator<Item = ()>`, which means the only information carried by the iterator is the number of items
+ |
+ = note: `Iterator::map`, like many of the methods on `Iterator`, gets executed lazily, meaning that its effects won't be visible until it is iterated
+help: you might have meant to use `Iterator::for_each`
+ |
+LL | x.iter_mut().for_each(f);
+ | ~~~~~~~~
+
+error: aborting due to 3 previous errors
+
diff --git a/tests/ui/lint/must_not_suspend/dedup.drop_tracking.stderr b/tests/ui/lint/must_not_suspend/dedup.drop_tracking.stderr
new file mode 100644
index 000000000..262657da5
--- /dev/null
+++ b/tests/ui/lint/must_not_suspend/dedup.drop_tracking.stderr
@@ -0,0 +1,21 @@
+error: `No` held across a suspend point, but should not be
+ --> $DIR/dedup.rs:19:9
+ |
+LL | let no = No {};
+ | ^^
+LL | wheeee(&no).await;
+ | ------ the value is held across this suspend point
+ |
+help: consider using a block (`{ ... }`) to shrink the value's scope, ending before the suspend point
+ --> $DIR/dedup.rs:19:9
+ |
+LL | let no = No {};
+ | ^^
+note: the lint level is defined here
+ --> $DIR/dedup.rs:6:9
+ |
+LL | #![deny(must_not_suspend)]
+ | ^^^^^^^^^^^^^^^^
+
+error: aborting due to previous error
+
diff --git a/tests/ui/lint/must_not_suspend/dedup.drop_tracking_mir.stderr b/tests/ui/lint/must_not_suspend/dedup.drop_tracking_mir.stderr
new file mode 100644
index 000000000..262657da5
--- /dev/null
+++ b/tests/ui/lint/must_not_suspend/dedup.drop_tracking_mir.stderr
@@ -0,0 +1,21 @@
+error: `No` held across a suspend point, but should not be
+ --> $DIR/dedup.rs:19:9
+ |
+LL | let no = No {};
+ | ^^
+LL | wheeee(&no).await;
+ | ------ the value is held across this suspend point
+ |
+help: consider using a block (`{ ... }`) to shrink the value's scope, ending before the suspend point
+ --> $DIR/dedup.rs:19:9
+ |
+LL | let no = No {};
+ | ^^
+note: the lint level is defined here
+ --> $DIR/dedup.rs:6:9
+ |
+LL | #![deny(must_not_suspend)]
+ | ^^^^^^^^^^^^^^^^
+
+error: aborting due to previous error
+
diff --git a/tests/ui/lint/must_not_suspend/dedup.no_drop_tracking.stderr b/tests/ui/lint/must_not_suspend/dedup.no_drop_tracking.stderr
new file mode 100644
index 000000000..7ed43d257
--- /dev/null
+++ b/tests/ui/lint/must_not_suspend/dedup.no_drop_tracking.stderr
@@ -0,0 +1,33 @@
+error: `No` held across a suspend point, but should not be
+ --> $DIR/dedup.rs:19:9
+ |
+LL | let no = No {};
+ | ^^
+LL | wheeee(&no).await;
+ | ------ the value is held across this suspend point
+ |
+help: consider using a block (`{ ... }`) to shrink the value's scope, ending before the suspend point
+ --> $DIR/dedup.rs:19:9
+ |
+LL | let no = No {};
+ | ^^
+note: the lint level is defined here
+ --> $DIR/dedup.rs:6:9
+ |
+LL | #![deny(must_not_suspend)]
+ | ^^^^^^^^^^^^^^^^
+
+error: `No` held across a suspend point, but should not be
+ --> $DIR/dedup.rs:20:13
+ |
+LL | wheeee(&no).await;
+ | ^^ ------ the value is held across this suspend point
+ |
+help: consider using a block (`{ ... }`) to shrink the value's scope, ending before the suspend point
+ --> $DIR/dedup.rs:20:13
+ |
+LL | wheeee(&no).await;
+ | ^^
+
+error: aborting due to 2 previous errors
+
diff --git a/tests/ui/lint/must_not_suspend/dedup.rs b/tests/ui/lint/must_not_suspend/dedup.rs
index 81a08579b..96bdb7715 100644
--- a/tests/ui/lint/must_not_suspend/dedup.rs
+++ b/tests/ui/lint/must_not_suspend/dedup.rs
@@ -1,3 +1,6 @@
+// revisions: no_drop_tracking drop_tracking drop_tracking_mir
+// [drop_tracking] compile-flags: -Zdrop-tracking
+// [drop_tracking_mir] compile-flags: -Zdrop-tracking-mir
// edition:2018
#![feature(must_not_suspend)]
#![deny(must_not_suspend)]
@@ -13,7 +16,9 @@ async fn wheeee<T>(t: T) {
}
async fn yes() {
- wheeee(&No {}).await; //~ ERROR `No` held across
+ let no = No {}; //~ ERROR `No` held across
+ wheeee(&no).await; //[no_drop_tracking]~ ERROR `No` held across
+ drop(no);
}
fn main() {
diff --git a/tests/ui/lint/must_not_suspend/dedup.stderr b/tests/ui/lint/must_not_suspend/dedup.stderr
index f8978ba57..18880f5a7 100644
--- a/tests/ui/lint/must_not_suspend/dedup.stderr
+++ b/tests/ui/lint/must_not_suspend/dedup.stderr
@@ -1,16 +1,16 @@
error: `No` held across a suspend point, but should not be
- --> $DIR/dedup.rs:16:13
+ --> $DIR/dedup.rs:19:13
|
LL | wheeee(&No {}).await;
| ^^^^^ ------ the value is held across this suspend point
|
help: consider using a block (`{ ... }`) to shrink the value's scope, ending before the suspend point
- --> $DIR/dedup.rs:16:13
+ --> $DIR/dedup.rs:19:13
|
LL | wheeee(&No {}).await;
| ^^^^^
note: the lint level is defined here
- --> $DIR/dedup.rs:3:9
+ --> $DIR/dedup.rs:6:9
|
LL | #![deny(must_not_suspend)]
| ^^^^^^^^^^^^^^^^
diff --git a/tests/ui/lint/must_not_suspend/ref.drop_tracking.stderr b/tests/ui/lint/must_not_suspend/ref.drop_tracking.stderr
index abf76711b..e3628ca5e 100644
--- a/tests/ui/lint/must_not_suspend/ref.drop_tracking.stderr
+++ b/tests/ui/lint/must_not_suspend/ref.drop_tracking.stderr
@@ -1,5 +1,5 @@
error: reference to `Umm` held across a suspend point, but should not be
- --> $DIR/ref.rs:21:13
+ --> $DIR/ref.rs:22:13
|
LL | let guard = &mut self.u;
| ^^^^^
@@ -8,17 +8,17 @@ LL | other().await;
| ------ the value is held across this suspend point
|
note: You gotta use Umm's, ya know?
- --> $DIR/ref.rs:21:13
+ --> $DIR/ref.rs:22:13
|
LL | let guard = &mut self.u;
| ^^^^^
help: consider using a block (`{ ... }`) to shrink the value's scope, ending before the suspend point
- --> $DIR/ref.rs:21:13
+ --> $DIR/ref.rs:22:13
|
LL | let guard = &mut self.u;
| ^^^^^
note: the lint level is defined here
- --> $DIR/ref.rs:6:9
+ --> $DIR/ref.rs:7:9
|
LL | #![deny(must_not_suspend)]
| ^^^^^^^^^^^^^^^^
diff --git a/tests/ui/lint/must_not_suspend/ref.drop_tracking_mir.stderr b/tests/ui/lint/must_not_suspend/ref.drop_tracking_mir.stderr
new file mode 100644
index 000000000..e3628ca5e
--- /dev/null
+++ b/tests/ui/lint/must_not_suspend/ref.drop_tracking_mir.stderr
@@ -0,0 +1,27 @@
+error: reference to `Umm` held across a suspend point, but should not be
+ --> $DIR/ref.rs:22:13
+ |
+LL | let guard = &mut self.u;
+ | ^^^^^
+LL |
+LL | other().await;
+ | ------ the value is held across this suspend point
+ |
+note: You gotta use Umm's, ya know?
+ --> $DIR/ref.rs:22:13
+ |
+LL | let guard = &mut self.u;
+ | ^^^^^
+help: consider using a block (`{ ... }`) to shrink the value's scope, ending before the suspend point
+ --> $DIR/ref.rs:22:13
+ |
+LL | let guard = &mut self.u;
+ | ^^^^^
+note: the lint level is defined here
+ --> $DIR/ref.rs:7:9
+ |
+LL | #![deny(must_not_suspend)]
+ | ^^^^^^^^^^^^^^^^
+
+error: aborting due to previous error
+
diff --git a/tests/ui/lint/must_not_suspend/ref.no_drop_tracking.stderr b/tests/ui/lint/must_not_suspend/ref.no_drop_tracking.stderr
index 41ac09ea7..e9bfa08b5 100644
--- a/tests/ui/lint/must_not_suspend/ref.no_drop_tracking.stderr
+++ b/tests/ui/lint/must_not_suspend/ref.no_drop_tracking.stderr
@@ -1,5 +1,5 @@
error: `Umm` held across a suspend point, but should not be
- --> $DIR/ref.rs:21:26
+ --> $DIR/ref.rs:22:26
|
LL | let guard = &mut self.u;
| ^^^^^^
@@ -8,17 +8,17 @@ LL | other().await;
| ------ the value is held across this suspend point
|
note: You gotta use Umm's, ya know?
- --> $DIR/ref.rs:21:26
+ --> $DIR/ref.rs:22:26
|
LL | let guard = &mut self.u;
| ^^^^^^
help: consider using a block (`{ ... }`) to shrink the value's scope, ending before the suspend point
- --> $DIR/ref.rs:21:26
+ --> $DIR/ref.rs:22:26
|
LL | let guard = &mut self.u;
| ^^^^^^
note: the lint level is defined here
- --> $DIR/ref.rs:6:9
+ --> $DIR/ref.rs:7:9
|
LL | #![deny(must_not_suspend)]
| ^^^^^^^^^^^^^^^^
diff --git a/tests/ui/lint/must_not_suspend/ref.rs b/tests/ui/lint/must_not_suspend/ref.rs
index f6b23746f..d05dcb83a 100644
--- a/tests/ui/lint/must_not_suspend/ref.rs
+++ b/tests/ui/lint/must_not_suspend/ref.rs
@@ -1,7 +1,8 @@
// edition:2018
-// revisions: no_drop_tracking drop_tracking
-// [drop_tracking] compile-flags: -Zdrop-tracking=yes
-// [no_drop_tracking] compile-flags: -Zdrop-tracking=no
+// revisions: no_drop_tracking drop_tracking drop_tracking_mir
+// [drop_tracking] compile-flags: -Zdrop-tracking
+// [drop_tracking_mir] compile-flags: -Zdrop-tracking-mir
+
#![feature(must_not_suspend)]
#![deny(must_not_suspend)]
@@ -22,6 +23,7 @@ impl Bar {
other().await;
+ let _g = &*guard;
*guard = Umm { i: 2 }
}
}
diff --git a/tests/ui/lint/must_not_suspend/trait.drop_tracking.stderr b/tests/ui/lint/must_not_suspend/trait.drop_tracking.stderr
new file mode 100644
index 000000000..6e62a228a
--- /dev/null
+++ b/tests/ui/lint/must_not_suspend/trait.drop_tracking.stderr
@@ -0,0 +1,37 @@
+error: implementer of `Wow` held across a suspend point, but should not be
+ --> $DIR/trait.rs:24:9
+ |
+LL | let _guard1 = r#impl();
+ | ^^^^^^^
+...
+LL | other().await;
+ | ------ the value is held across this suspend point
+ |
+help: consider using a block (`{ ... }`) to shrink the value's scope, ending before the suspend point
+ --> $DIR/trait.rs:24:9
+ |
+LL | let _guard1 = r#impl();
+ | ^^^^^^^
+note: the lint level is defined here
+ --> $DIR/trait.rs:6:9
+ |
+LL | #![deny(must_not_suspend)]
+ | ^^^^^^^^^^^^^^^^
+
+error: boxed `Wow` trait object held across a suspend point, but should not be
+ --> $DIR/trait.rs:25:9
+ |
+LL | let _guard2 = r#dyn();
+ | ^^^^^^^
+LL |
+LL | other().await;
+ | ------ the value is held across this suspend point
+ |
+help: consider using a block (`{ ... }`) to shrink the value's scope, ending before the suspend point
+ --> $DIR/trait.rs:25:9
+ |
+LL | let _guard2 = r#dyn();
+ | ^^^^^^^
+
+error: aborting due to 2 previous errors
+
diff --git a/tests/ui/lint/must_not_suspend/trait.drop_tracking_mir.stderr b/tests/ui/lint/must_not_suspend/trait.drop_tracking_mir.stderr
new file mode 100644
index 000000000..6e62a228a
--- /dev/null
+++ b/tests/ui/lint/must_not_suspend/trait.drop_tracking_mir.stderr
@@ -0,0 +1,37 @@
+error: implementer of `Wow` held across a suspend point, but should not be
+ --> $DIR/trait.rs:24:9
+ |
+LL | let _guard1 = r#impl();
+ | ^^^^^^^
+...
+LL | other().await;
+ | ------ the value is held across this suspend point
+ |
+help: consider using a block (`{ ... }`) to shrink the value's scope, ending before the suspend point
+ --> $DIR/trait.rs:24:9
+ |
+LL | let _guard1 = r#impl();
+ | ^^^^^^^
+note: the lint level is defined here
+ --> $DIR/trait.rs:6:9
+ |
+LL | #![deny(must_not_suspend)]
+ | ^^^^^^^^^^^^^^^^
+
+error: boxed `Wow` trait object held across a suspend point, but should not be
+ --> $DIR/trait.rs:25:9
+ |
+LL | let _guard2 = r#dyn();
+ | ^^^^^^^
+LL |
+LL | other().await;
+ | ------ the value is held across this suspend point
+ |
+help: consider using a block (`{ ... }`) to shrink the value's scope, ending before the suspend point
+ --> $DIR/trait.rs:25:9
+ |
+LL | let _guard2 = r#dyn();
+ | ^^^^^^^
+
+error: aborting due to 2 previous errors
+
diff --git a/tests/ui/lint/must_not_suspend/trait.no_drop_tracking.stderr b/tests/ui/lint/must_not_suspend/trait.no_drop_tracking.stderr
new file mode 100644
index 000000000..6e62a228a
--- /dev/null
+++ b/tests/ui/lint/must_not_suspend/trait.no_drop_tracking.stderr
@@ -0,0 +1,37 @@
+error: implementer of `Wow` held across a suspend point, but should not be
+ --> $DIR/trait.rs:24:9
+ |
+LL | let _guard1 = r#impl();
+ | ^^^^^^^
+...
+LL | other().await;
+ | ------ the value is held across this suspend point
+ |
+help: consider using a block (`{ ... }`) to shrink the value's scope, ending before the suspend point
+ --> $DIR/trait.rs:24:9
+ |
+LL | let _guard1 = r#impl();
+ | ^^^^^^^
+note: the lint level is defined here
+ --> $DIR/trait.rs:6:9
+ |
+LL | #![deny(must_not_suspend)]
+ | ^^^^^^^^^^^^^^^^
+
+error: boxed `Wow` trait object held across a suspend point, but should not be
+ --> $DIR/trait.rs:25:9
+ |
+LL | let _guard2 = r#dyn();
+ | ^^^^^^^
+LL |
+LL | other().await;
+ | ------ the value is held across this suspend point
+ |
+help: consider using a block (`{ ... }`) to shrink the value's scope, ending before the suspend point
+ --> $DIR/trait.rs:25:9
+ |
+LL | let _guard2 = r#dyn();
+ | ^^^^^^^
+
+error: aborting due to 2 previous errors
+
diff --git a/tests/ui/lint/must_not_suspend/trait.rs b/tests/ui/lint/must_not_suspend/trait.rs
index 6c911cb4b..cc3ae298d 100644
--- a/tests/ui/lint/must_not_suspend/trait.rs
+++ b/tests/ui/lint/must_not_suspend/trait.rs
@@ -1,3 +1,6 @@
+// revisions: no_drop_tracking drop_tracking drop_tracking_mir
+// [drop_tracking] compile-flags: -Zdrop-tracking
+// [drop_tracking_mir] compile-flags: -Zdrop-tracking-mir
// edition:2018
#![feature(must_not_suspend)]
#![deny(must_not_suspend)]
@@ -22,6 +25,9 @@ pub async fn uhoh() {
let _guard2 = r#dyn(); //~ ERROR boxed `Wow` trait object held across
other().await;
+
+ drop(_guard1);
+ drop(_guard2);
}
fn main() {
diff --git a/tests/ui/lint/must_not_suspend/trait.stderr b/tests/ui/lint/must_not_suspend/trait.stderr
index d64d25aae..6e62a228a 100644
--- a/tests/ui/lint/must_not_suspend/trait.stderr
+++ b/tests/ui/lint/must_not_suspend/trait.stderr
@@ -1,5 +1,5 @@
error: implementer of `Wow` held across a suspend point, but should not be
- --> $DIR/trait.rs:21:9
+ --> $DIR/trait.rs:24:9
|
LL | let _guard1 = r#impl();
| ^^^^^^^
@@ -8,18 +8,18 @@ LL | other().await;
| ------ the value is held across this suspend point
|
help: consider using a block (`{ ... }`) to shrink the value's scope, ending before the suspend point
- --> $DIR/trait.rs:21:9
+ --> $DIR/trait.rs:24:9
|
LL | let _guard1 = r#impl();
| ^^^^^^^
note: the lint level is defined here
- --> $DIR/trait.rs:3:9
+ --> $DIR/trait.rs:6:9
|
LL | #![deny(must_not_suspend)]
| ^^^^^^^^^^^^^^^^
error: boxed `Wow` trait object held across a suspend point, but should not be
- --> $DIR/trait.rs:22:9
+ --> $DIR/trait.rs:25:9
|
LL | let _guard2 = r#dyn();
| ^^^^^^^
@@ -28,7 +28,7 @@ LL | other().await;
| ------ the value is held across this suspend point
|
help: consider using a block (`{ ... }`) to shrink the value's scope, ending before the suspend point
- --> $DIR/trait.rs:22:9
+ --> $DIR/trait.rs:25:9
|
LL | let _guard2 = r#dyn();
| ^^^^^^^
diff --git a/tests/ui/lint/must_not_suspend/tuple-mismatch.stderr b/tests/ui/lint/must_not_suspend/tuple-mismatch.stderr
index cca8cd9bd..294476107 100644
--- a/tests/ui/lint/must_not_suspend/tuple-mismatch.stderr
+++ b/tests/ui/lint/must_not_suspend/tuple-mismatch.stderr
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
--> $DIR/tuple-mismatch.rs:6:20
|
LL | yield ((), ());
- | ^^ expected tuple, found `()`
+ | ^^ expected `((), ())`, found `()`
|
= note: expected tuple `((), ())`
found unit type `()`
diff --git a/tests/ui/lint/must_not_suspend/unit.drop_tracking.stderr b/tests/ui/lint/must_not_suspend/unit.drop_tracking.stderr
new file mode 100644
index 000000000..f89b3e341
--- /dev/null
+++ b/tests/ui/lint/must_not_suspend/unit.drop_tracking.stderr
@@ -0,0 +1,26 @@
+error: `Umm` held across a suspend point, but should not be
+ --> $DIR/unit.rs:22:9
+ |
+LL | let _guard = bar();
+ | ^^^^^^
+LL | other().await;
+ | ------ the value is held across this suspend point
+ |
+note: You gotta use Umm's, ya know?
+ --> $DIR/unit.rs:22:9
+ |
+LL | let _guard = bar();
+ | ^^^^^^
+help: consider using a block (`{ ... }`) to shrink the value's scope, ending before the suspend point
+ --> $DIR/unit.rs:22:9
+ |
+LL | let _guard = bar();
+ | ^^^^^^
+note: the lint level is defined here
+ --> $DIR/unit.rs:6:9
+ |
+LL | #![deny(must_not_suspend)]
+ | ^^^^^^^^^^^^^^^^
+
+error: aborting due to previous error
+
diff --git a/tests/ui/lint/must_not_suspend/unit.drop_tracking_mir.stderr b/tests/ui/lint/must_not_suspend/unit.drop_tracking_mir.stderr
new file mode 100644
index 000000000..f89b3e341
--- /dev/null
+++ b/tests/ui/lint/must_not_suspend/unit.drop_tracking_mir.stderr
@@ -0,0 +1,26 @@
+error: `Umm` held across a suspend point, but should not be
+ --> $DIR/unit.rs:22:9
+ |
+LL | let _guard = bar();
+ | ^^^^^^
+LL | other().await;
+ | ------ the value is held across this suspend point
+ |
+note: You gotta use Umm's, ya know?
+ --> $DIR/unit.rs:22:9
+ |
+LL | let _guard = bar();
+ | ^^^^^^
+help: consider using a block (`{ ... }`) to shrink the value's scope, ending before the suspend point
+ --> $DIR/unit.rs:22:9
+ |
+LL | let _guard = bar();
+ | ^^^^^^
+note: the lint level is defined here
+ --> $DIR/unit.rs:6:9
+ |
+LL | #![deny(must_not_suspend)]
+ | ^^^^^^^^^^^^^^^^
+
+error: aborting due to previous error
+
diff --git a/tests/ui/lint/must_not_suspend/unit.no_drop_tracking.stderr b/tests/ui/lint/must_not_suspend/unit.no_drop_tracking.stderr
new file mode 100644
index 000000000..f89b3e341
--- /dev/null
+++ b/tests/ui/lint/must_not_suspend/unit.no_drop_tracking.stderr
@@ -0,0 +1,26 @@
+error: `Umm` held across a suspend point, but should not be
+ --> $DIR/unit.rs:22:9
+ |
+LL | let _guard = bar();
+ | ^^^^^^
+LL | other().await;
+ | ------ the value is held across this suspend point
+ |
+note: You gotta use Umm's, ya know?
+ --> $DIR/unit.rs:22:9
+ |
+LL | let _guard = bar();
+ | ^^^^^^
+help: consider using a block (`{ ... }`) to shrink the value's scope, ending before the suspend point
+ --> $DIR/unit.rs:22:9
+ |
+LL | let _guard = bar();
+ | ^^^^^^
+note: the lint level is defined here
+ --> $DIR/unit.rs:6:9
+ |
+LL | #![deny(must_not_suspend)]
+ | ^^^^^^^^^^^^^^^^
+
+error: aborting due to previous error
+
diff --git a/tests/ui/lint/must_not_suspend/unit.rs b/tests/ui/lint/must_not_suspend/unit.rs
index d3a19f704..fbc51b366 100644
--- a/tests/ui/lint/must_not_suspend/unit.rs
+++ b/tests/ui/lint/must_not_suspend/unit.rs
@@ -1,3 +1,6 @@
+// revisions: no_drop_tracking drop_tracking drop_tracking_mir
+// [drop_tracking] compile-flags: -Zdrop-tracking
+// [drop_tracking_mir] compile-flags: -Zdrop-tracking-mir
// edition:2018
#![feature(must_not_suspend)]
#![deny(must_not_suspend)]
@@ -7,7 +10,6 @@ struct Umm {
i: i64
}
-
fn bar() -> Umm {
Umm {
i: 1
@@ -19,6 +21,7 @@ async fn other() {}
pub async fn uhoh() {
let _guard = bar(); //~ ERROR `Umm` held across
other().await;
+ drop(_guard);
}
fn main() {
diff --git a/tests/ui/lint/must_not_suspend/unit.stderr b/tests/ui/lint/must_not_suspend/unit.stderr
index c967dbac5..50ca292c2 100644
--- a/tests/ui/lint/must_not_suspend/unit.stderr
+++ b/tests/ui/lint/must_not_suspend/unit.stderr
@@ -1,5 +1,5 @@
error: `Umm` held across a suspend point, but should not be
- --> $DIR/unit.rs:20:9
+ --> $DIR/unit.rs:23:9
|
LL | let _guard = bar();
| ^^^^^^
@@ -7,17 +7,17 @@ LL | other().await;
| ------ the value is held across this suspend point
|
note: You gotta use Umm's, ya know?
- --> $DIR/unit.rs:20:9
+ --> $DIR/unit.rs:23:9
|
LL | let _guard = bar();
| ^^^^^^
help: consider using a block (`{ ... }`) to shrink the value's scope, ending before the suspend point
- --> $DIR/unit.rs:20:9
+ --> $DIR/unit.rs:23:9
|
LL | let _guard = bar();
| ^^^^^^
note: the lint level is defined here
- --> $DIR/unit.rs:3:9
+ --> $DIR/unit.rs:6:9
|
LL | #![deny(must_not_suspend)]
| ^^^^^^^^^^^^^^^^
diff --git a/tests/ui/lint/must_not_suspend/warn.drop_tracking.stderr b/tests/ui/lint/must_not_suspend/warn.drop_tracking.stderr
new file mode 100644
index 000000000..7a422891a
--- /dev/null
+++ b/tests/ui/lint/must_not_suspend/warn.drop_tracking.stderr
@@ -0,0 +1,26 @@
+warning: `Umm` held across a suspend point, but should not be
+ --> $DIR/warn.rs:24:9
+ |
+LL | let _guard = bar();
+ | ^^^^^^
+LL | other().await;
+ | ------ the value is held across this suspend point
+ |
+note: You gotta use Umm's, ya know?
+ --> $DIR/warn.rs:24:9
+ |
+LL | let _guard = bar();
+ | ^^^^^^
+help: consider using a block (`{ ... }`) to shrink the value's scope, ending before the suspend point
+ --> $DIR/warn.rs:24:9
+ |
+LL | let _guard = bar();
+ | ^^^^^^
+note: the lint level is defined here
+ --> $DIR/warn.rs:7:9
+ |
+LL | #![warn(must_not_suspend)]
+ | ^^^^^^^^^^^^^^^^
+
+warning: 1 warning emitted
+
diff --git a/tests/ui/lint/must_not_suspend/warn.drop_tracking_mir.stderr b/tests/ui/lint/must_not_suspend/warn.drop_tracking_mir.stderr
new file mode 100644
index 000000000..7a422891a
--- /dev/null
+++ b/tests/ui/lint/must_not_suspend/warn.drop_tracking_mir.stderr
@@ -0,0 +1,26 @@
+warning: `Umm` held across a suspend point, but should not be
+ --> $DIR/warn.rs:24:9
+ |
+LL | let _guard = bar();
+ | ^^^^^^
+LL | other().await;
+ | ------ the value is held across this suspend point
+ |
+note: You gotta use Umm's, ya know?
+ --> $DIR/warn.rs:24:9
+ |
+LL | let _guard = bar();
+ | ^^^^^^
+help: consider using a block (`{ ... }`) to shrink the value's scope, ending before the suspend point
+ --> $DIR/warn.rs:24:9
+ |
+LL | let _guard = bar();
+ | ^^^^^^
+note: the lint level is defined here
+ --> $DIR/warn.rs:7:9
+ |
+LL | #![warn(must_not_suspend)]
+ | ^^^^^^^^^^^^^^^^
+
+warning: 1 warning emitted
+
diff --git a/tests/ui/lint/must_not_suspend/warn.no_drop_tracking.stderr b/tests/ui/lint/must_not_suspend/warn.no_drop_tracking.stderr
new file mode 100644
index 000000000..7a422891a
--- /dev/null
+++ b/tests/ui/lint/must_not_suspend/warn.no_drop_tracking.stderr
@@ -0,0 +1,26 @@
+warning: `Umm` held across a suspend point, but should not be
+ --> $DIR/warn.rs:24:9
+ |
+LL | let _guard = bar();
+ | ^^^^^^
+LL | other().await;
+ | ------ the value is held across this suspend point
+ |
+note: You gotta use Umm's, ya know?
+ --> $DIR/warn.rs:24:9
+ |
+LL | let _guard = bar();
+ | ^^^^^^
+help: consider using a block (`{ ... }`) to shrink the value's scope, ending before the suspend point
+ --> $DIR/warn.rs:24:9
+ |
+LL | let _guard = bar();
+ | ^^^^^^
+note: the lint level is defined here
+ --> $DIR/warn.rs:7:9
+ |
+LL | #![warn(must_not_suspend)]
+ | ^^^^^^^^^^^^^^^^
+
+warning: 1 warning emitted
+
diff --git a/tests/ui/lint/must_not_suspend/warn.rs b/tests/ui/lint/must_not_suspend/warn.rs
index 7fdea66a2..5a4863169 100644
--- a/tests/ui/lint/must_not_suspend/warn.rs
+++ b/tests/ui/lint/must_not_suspend/warn.rs
@@ -1,3 +1,6 @@
+// revisions: no_drop_tracking drop_tracking drop_tracking_mir
+// [drop_tracking] compile-flags: -Zdrop-tracking
+// [drop_tracking_mir] compile-flags: -Zdrop-tracking-mir
// edition:2018
// run-pass
#![feature(must_not_suspend)]
@@ -20,6 +23,7 @@ async fn other() {}
pub async fn uhoh() {
let _guard = bar(); //~ WARNING `Umm` held across
other().await;
+ drop(_guard);
}
fn main() {
diff --git a/tests/ui/lint/must_not_suspend/warn.stderr b/tests/ui/lint/must_not_suspend/warn.stderr
index fe551c652..7a422891a 100644
--- a/tests/ui/lint/must_not_suspend/warn.stderr
+++ b/tests/ui/lint/must_not_suspend/warn.stderr
@@ -1,5 +1,5 @@
warning: `Umm` held across a suspend point, but should not be
- --> $DIR/warn.rs:21:9
+ --> $DIR/warn.rs:24:9
|
LL | let _guard = bar();
| ^^^^^^
@@ -7,17 +7,17 @@ LL | other().await;
| ------ the value is held across this suspend point
|
note: You gotta use Umm's, ya know?
- --> $DIR/warn.rs:21:9
+ --> $DIR/warn.rs:24:9
|
LL | let _guard = bar();
| ^^^^^^
help: consider using a block (`{ ... }`) to shrink the value's scope, ending before the suspend point
- --> $DIR/warn.rs:21:9
+ --> $DIR/warn.rs:24:9
|
LL | let _guard = bar();
| ^^^^^^
note: the lint level is defined here
- --> $DIR/warn.rs:4:9
+ --> $DIR/warn.rs:7:9
|
LL | #![warn(must_not_suspend)]
| ^^^^^^^^^^^^^^^^
diff --git a/tests/ui/lint/reasons-forbidden.rs b/tests/ui/lint/reasons-forbidden.rs
index 9c2edec4d..947099fdd 100644
--- a/tests/ui/lint/reasons-forbidden.rs
+++ b/tests/ui/lint/reasons-forbidden.rs
@@ -8,7 +8,7 @@
//
// The test is much cleaner if we deduplicate, though.
-// compile-flags: -Z deduplicate-diagnostics=yes
+// compile-flags: -Z deduplicate-diagnostics=true
#![forbid(
unsafe_code,
diff --git a/tests/ui/lint/unaligned_references.rs b/tests/ui/lint/unaligned_references.rs
index e547f031a..0c9c79c08 100644
--- a/tests/ui/lint/unaligned_references.rs
+++ b/tests/ui/lint/unaligned_references.rs
@@ -1,5 +1,3 @@
-#![deny(unaligned_references)]
-
#[repr(packed)]
pub struct Good {
data: u64,
@@ -15,25 +13,33 @@ pub struct Packed2 {
z: u8,
}
+trait Foo {
+ fn evil(&self);
+}
+
+// Test for #108122
+#[automatically_derived]
+impl Foo for Packed2 {
+ fn evil(&self) {
+ unsafe {
+ &self.x; //~ ERROR reference to packed field
+ }
+ }
+}
+
fn main() {
unsafe {
let good = Good { data: 0, ptr: &0, data2: [0, 0], aligned: [0; 32] };
let _ = &good.ptr; //~ ERROR reference to packed field
- //~^ previously accepted
let _ = &good.data; //~ ERROR reference to packed field
- //~^ previously accepted
// Error even when turned into raw pointer immediately.
let _ = &good.data as *const _; //~ ERROR reference to packed field
- //~^ previously accepted
let _: *const _ = &good.data; //~ ERROR reference to packed field
- //~^ previously accepted
// Error on method call.
let _ = good.data.clone(); //~ ERROR reference to packed field
- //~^ previously accepted
// Error for nested fields.
let _ = &good.data2[0]; //~ ERROR reference to packed field
- //~^ previously accepted
let _ = &*good.ptr; // ok, behind a pointer
let _ = &good.aligned; // ok, has align 1
@@ -43,9 +49,9 @@ fn main() {
unsafe {
let packed2 = Packed2 { x: 0, y: 0, z: 0 };
let _ = &packed2.x; //~ ERROR reference to packed field
- //~^ previously accepted
let _ = &packed2.y; // ok, has align 2 in packed(2) struct
let _ = &packed2.z; // ok, has align 1
+ packed2.evil();
}
unsafe {
@@ -80,24 +86,10 @@ fn main() {
#[repr(packed)]
struct Misalign<T>(u8, T);
- let m1 = Misalign(
- 0,
- Wrapper {
- a: U16(10),
- b: HasDrop,
- },
- );
+ let m1 = Misalign(0, Wrapper { a: U16(10), b: HasDrop });
let _ref = &m1.1.a; //~ ERROR reference to packed field
- //~^ previously accepted
- let m2 = Misalign(
- 0,
- Wrapper2 {
- a: U16(10),
- b: HasDrop,
- },
- );
+ let m2 = Misalign(0, Wrapper2 { a: U16(10), b: HasDrop });
let _ref = &m2.1.a; //~ ERROR reference to packed field
- //~^ previously accepted
}
}
diff --git a/tests/ui/lint/unaligned_references.stderr b/tests/ui/lint/unaligned_references.stderr
index 346f49b92..775dcac67 100644
--- a/tests/ui/lint/unaligned_references.stderr
+++ b/tests/ui/lint/unaligned_references.stderr
@@ -1,259 +1,93 @@
-error: reference to packed field is unaligned
- --> $DIR/unaligned_references.rs:22:17
+error[E0793]: reference to packed field is unaligned
+ --> $DIR/unaligned_references.rs:25:13
|
-LL | let _ = &good.ptr;
- | ^^^^^^^^^
- |
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
- = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
- = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
-note: the lint level is defined here
- --> $DIR/unaligned_references.rs:1:9
- |
-LL | #![deny(unaligned_references)]
- | ^^^^^^^^^^^^^^^^^^^^
-
-error: reference to packed field is unaligned
- --> $DIR/unaligned_references.rs:24:17
- |
-LL | let _ = &good.data;
- | ^^^^^^^^^^
- |
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
- = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
- = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
-
-error: reference to packed field is unaligned
- --> $DIR/unaligned_references.rs:27:17
- |
-LL | let _ = &good.data as *const _;
- | ^^^^^^^^^^
- |
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
- = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
- = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
-
-error: reference to packed field is unaligned
- --> $DIR/unaligned_references.rs:29:27
- |
-LL | let _: *const _ = &good.data;
- | ^^^^^^^^^^
- |
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
- = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
- = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
-
-error: reference to packed field is unaligned
- --> $DIR/unaligned_references.rs:32:17
- |
-LL | let _ = good.data.clone();
- | ^^^^^^^^^^^^^^^^^
- |
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
- = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
- = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
-
-error: reference to packed field is unaligned
- --> $DIR/unaligned_references.rs:35:17
- |
-LL | let _ = &good.data2[0];
- | ^^^^^^^^^^^^^^
- |
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
- = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
- = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
-
-error: reference to packed field is unaligned
- --> $DIR/unaligned_references.rs:45:17
+LL | &self.x;
+ | ^^^^^^^
|
-LL | let _ = &packed2.x;
- | ^^^^^^^^^^
- |
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
= note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
= help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
-error: reference to packed field is unaligned
- --> $DIR/unaligned_references.rs:90:20
- |
-LL | let _ref = &m1.1.a;
- | ^^^^^^^
- |
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
- = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
- = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
-
-error: reference to packed field is unaligned
- --> $DIR/unaligned_references.rs:100:20
- |
-LL | let _ref = &m2.1.a;
- | ^^^^^^^
- |
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
- = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
- = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
-
-error: aborting due to 9 previous errors
-
-Future incompatibility report: Future breakage diagnostic:
-error: reference to packed field is unaligned
- --> $DIR/unaligned_references.rs:22:17
+error[E0793]: reference to packed field is unaligned
+ --> $DIR/unaligned_references.rs:34:17
|
LL | let _ = &good.ptr;
| ^^^^^^^^^
|
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
= note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
= help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
-note: the lint level is defined here
- --> $DIR/unaligned_references.rs:1:9
- |
-LL | #![deny(unaligned_references)]
- | ^^^^^^^^^^^^^^^^^^^^
-Future breakage diagnostic:
-error: reference to packed field is unaligned
- --> $DIR/unaligned_references.rs:24:17
+error[E0793]: reference to packed field is unaligned
+ --> $DIR/unaligned_references.rs:35:17
|
LL | let _ = &good.data;
| ^^^^^^^^^^
|
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
= note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
= help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
-note: the lint level is defined here
- --> $DIR/unaligned_references.rs:1:9
- |
-LL | #![deny(unaligned_references)]
- | ^^^^^^^^^^^^^^^^^^^^
-Future breakage diagnostic:
-error: reference to packed field is unaligned
- --> $DIR/unaligned_references.rs:27:17
+error[E0793]: reference to packed field is unaligned
+ --> $DIR/unaligned_references.rs:37:17
|
LL | let _ = &good.data as *const _;
| ^^^^^^^^^^
|
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
= note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
= help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
-note: the lint level is defined here
- --> $DIR/unaligned_references.rs:1:9
- |
-LL | #![deny(unaligned_references)]
- | ^^^^^^^^^^^^^^^^^^^^
-Future breakage diagnostic:
-error: reference to packed field is unaligned
- --> $DIR/unaligned_references.rs:29:27
+error[E0793]: reference to packed field is unaligned
+ --> $DIR/unaligned_references.rs:38:27
|
LL | let _: *const _ = &good.data;
| ^^^^^^^^^^
|
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
= note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
= help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
-note: the lint level is defined here
- --> $DIR/unaligned_references.rs:1:9
- |
-LL | #![deny(unaligned_references)]
- | ^^^^^^^^^^^^^^^^^^^^
-Future breakage diagnostic:
-error: reference to packed field is unaligned
- --> $DIR/unaligned_references.rs:32:17
+error[E0793]: reference to packed field is unaligned
+ --> $DIR/unaligned_references.rs:40:17
|
LL | let _ = good.data.clone();
| ^^^^^^^^^^^^^^^^^
|
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
= note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
= help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
-note: the lint level is defined here
- --> $DIR/unaligned_references.rs:1:9
- |
-LL | #![deny(unaligned_references)]
- | ^^^^^^^^^^^^^^^^^^^^
-Future breakage diagnostic:
-error: reference to packed field is unaligned
- --> $DIR/unaligned_references.rs:35:17
+error[E0793]: reference to packed field is unaligned
+ --> $DIR/unaligned_references.rs:42:17
|
LL | let _ = &good.data2[0];
| ^^^^^^^^^^^^^^
|
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
= note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
= help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
-note: the lint level is defined here
- --> $DIR/unaligned_references.rs:1:9
- |
-LL | #![deny(unaligned_references)]
- | ^^^^^^^^^^^^^^^^^^^^
-Future breakage diagnostic:
-error: reference to packed field is unaligned
- --> $DIR/unaligned_references.rs:45:17
+error[E0793]: reference to packed field is unaligned
+ --> $DIR/unaligned_references.rs:51:17
|
LL | let _ = &packed2.x;
| ^^^^^^^^^^
|
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
= note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
= help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
-note: the lint level is defined here
- --> $DIR/unaligned_references.rs:1:9
- |
-LL | #![deny(unaligned_references)]
- | ^^^^^^^^^^^^^^^^^^^^
-Future breakage diagnostic:
-error: reference to packed field is unaligned
+error[E0793]: reference to packed field is unaligned
--> $DIR/unaligned_references.rs:90:20
|
LL | let _ref = &m1.1.a;
| ^^^^^^^
|
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
= note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
= help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
-note: the lint level is defined here
- --> $DIR/unaligned_references.rs:1:9
- |
-LL | #![deny(unaligned_references)]
- | ^^^^^^^^^^^^^^^^^^^^
-Future breakage diagnostic:
-error: reference to packed field is unaligned
- --> $DIR/unaligned_references.rs:100:20
+error[E0793]: reference to packed field is unaligned
+ --> $DIR/unaligned_references.rs:93:20
|
LL | let _ref = &m2.1.a;
| ^^^^^^^
|
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
= note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
= help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
-note: the lint level is defined here
- --> $DIR/unaligned_references.rs:1:9
- |
-LL | #![deny(unaligned_references)]
- | ^^^^^^^^^^^^^^^^^^^^
+error: aborting due to 10 previous errors
+
+For more information about this error, try `rustc --explain E0793`.
diff --git a/tests/ui/lint/unaligned_references_external_macro.rs b/tests/ui/lint/unaligned_references_external_macro.rs
index cb597c38e..b655a2a8f 100644
--- a/tests/ui/lint/unaligned_references_external_macro.rs
+++ b/tests/ui/lint/unaligned_references_external_macro.rs
@@ -3,7 +3,6 @@
extern crate unaligned_references_external_crate;
unaligned_references_external_crate::mac! { //~ERROR reference to packed field is unaligned
- //~^ previously accepted
#[repr(packed)]
pub struct X {
pub field: u16
diff --git a/tests/ui/lint/unaligned_references_external_macro.stderr b/tests/ui/lint/unaligned_references_external_macro.stderr
index c46ca6742..5b08f433e 100644
--- a/tests/ui/lint/unaligned_references_external_macro.stderr
+++ b/tests/ui/lint/unaligned_references_external_macro.stderr
@@ -1,8 +1,7 @@
-error: reference to packed field is unaligned
+error[E0793]: reference to packed field is unaligned
--> $DIR/unaligned_references_external_macro.rs:5:1
|
LL | / unaligned_references_external_crate::mac! {
-LL | |
LL | | #[repr(packed)]
LL | | pub struct X {
LL | | pub field: u16
@@ -10,52 +9,10 @@ LL | | }
LL | | }
| |_^
|
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
= note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
= help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
-note: the lint level is defined here
- --> $DIR/unaligned_references_external_macro.rs:5:1
- |
-LL | / unaligned_references_external_crate::mac! {
-LL | |
-LL | | #[repr(packed)]
-LL | | pub struct X {
-LL | | pub field: u16
-LL | | }
-LL | | }
- | |_^
= note: this error originates in the macro `unaligned_references_external_crate::mac` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to previous error
-Future incompatibility report: Future breakage diagnostic:
-error: reference to packed field is unaligned
- --> $DIR/unaligned_references_external_macro.rs:5:1
- |
-LL | / unaligned_references_external_crate::mac! {
-LL | |
-LL | | #[repr(packed)]
-LL | | pub struct X {
-LL | | pub field: u16
-LL | | }
-LL | | }
- | |_^
- |
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
- = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
- = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
-note: the lint level is defined here
- --> $DIR/unaligned_references_external_macro.rs:5:1
- |
-LL | / unaligned_references_external_crate::mac! {
-LL | |
-LL | | #[repr(packed)]
-LL | | pub struct X {
-LL | | pub field: u16
-LL | | }
-LL | | }
- | |_^
- = note: this error originates in the macro `unaligned_references_external_crate::mac` (in Nightly builds, run with -Z macro-backtrace for more info)
-
+For more information about this error, try `rustc --explain E0793`.
diff --git a/tests/ui/lint/unused/issue-103320-must-use-ops.rs b/tests/ui/lint/unused/issue-103320-must-use-ops.rs
new file mode 100644
index 000000000..597d312fa
--- /dev/null
+++ b/tests/ui/lint/unused/issue-103320-must-use-ops.rs
@@ -0,0 +1,27 @@
+// check-pass
+
+#![warn(unused_must_use)]
+#![feature(never_type)]
+
+use std::ops::Add;
+use std::ops::Sub;
+use std::ops::Mul;
+use std::ops::Div;
+use std::ops::Rem;
+
+fn main() {
+ let x = 2_u32;
+ (x.add(4), x.sub(4), x.mul(4), x.div(4), x.rem(4));
+
+ x.add(4); //~ WARN unused return value of `add` that must be used
+
+ x.sub(4); //~ WARN unused return value of `sub` that must be used
+
+ x.mul(4); //~ WARN unused return value of `mul` that must be used
+
+ x.div(4); //~ WARN unused return value of `div` that must be used
+
+ x.rem(4); //~ WARN unused return value of `rem` that must be used
+
+ println!("{}", x);
+}
diff --git a/tests/ui/lint/unused/issue-103320-must-use-ops.stderr b/tests/ui/lint/unused/issue-103320-must-use-ops.stderr
new file mode 100644
index 000000000..57439ec6a
--- /dev/null
+++ b/tests/ui/lint/unused/issue-103320-must-use-ops.stderr
@@ -0,0 +1,67 @@
+warning: unused return value of `add` that must be used
+ --> $DIR/issue-103320-must-use-ops.rs:16:5
+ |
+LL | x.add(4);
+ | ^^^^^^^^
+ |
+ = note: this returns the result of the operation, without modifying the original
+note: the lint level is defined here
+ --> $DIR/issue-103320-must-use-ops.rs:3:9
+ |
+LL | #![warn(unused_must_use)]
+ | ^^^^^^^^^^^^^^^
+help: use `let _ = ...` to ignore the resulting value
+ |
+LL | let _ = x.add(4);
+ | +++++++
+
+warning: unused return value of `sub` that must be used
+ --> $DIR/issue-103320-must-use-ops.rs:18:5
+ |
+LL | x.sub(4);
+ | ^^^^^^^^
+ |
+ = note: this returns the result of the operation, without modifying the original
+help: use `let _ = ...` to ignore the resulting value
+ |
+LL | let _ = x.sub(4);
+ | +++++++
+
+warning: unused return value of `mul` that must be used
+ --> $DIR/issue-103320-must-use-ops.rs:20:5
+ |
+LL | x.mul(4);
+ | ^^^^^^^^
+ |
+ = note: this returns the result of the operation, without modifying the original
+help: use `let _ = ...` to ignore the resulting value
+ |
+LL | let _ = x.mul(4);
+ | +++++++
+
+warning: unused return value of `div` that must be used
+ --> $DIR/issue-103320-must-use-ops.rs:22:5
+ |
+LL | x.div(4);
+ | ^^^^^^^^
+ |
+ = note: this returns the result of the operation, without modifying the original
+help: use `let _ = ...` to ignore the resulting value
+ |
+LL | let _ = x.div(4);
+ | +++++++
+
+warning: unused return value of `rem` that must be used
+ --> $DIR/issue-103320-must-use-ops.rs:24:5
+ |
+LL | x.rem(4);
+ | ^^^^^^^^
+ |
+ = note: this returns the result of the operation, without modifying the original
+help: use `let _ = ...` to ignore the resulting value
+ |
+LL | let _ = x.rem(4);
+ | +++++++
+
+warning: 5 warnings emitted
+
diff --git a/tests/ui/lint/unused/issue-96606.rs b/tests/ui/lint/unused/issue-96606.rs
new file mode 100644
index 000000000..4e7c290fa
--- /dev/null
+++ b/tests/ui/lint/unused/issue-96606.rs
@@ -0,0 +1,8 @@
+#[deny(unused)]
+fn main() {
+ let arr = [0; 10];
+ let _ = arr[(0)]; //~ ERROR unnecessary parentheses around index expression
+ let _ = arr[{0}]; //~ ERROR unnecessary braces around index expression
+ let _ = arr[1 + (0)];
+ let _ = arr[{ let x = 0; x }];
+}
diff --git a/tests/ui/lint/unused/issue-96606.stderr b/tests/ui/lint/unused/issue-96606.stderr
new file mode 100644
index 000000000..e36277181
--- /dev/null
+++ b/tests/ui/lint/unused/issue-96606.stderr
@@ -0,0 +1,33 @@
+error: unnecessary parentheses around index expression
+ --> $DIR/issue-96606.rs:4:17
+ |
+LL | let _ = arr[(0)];
+ | ^ ^
+ |
+note: the lint level is defined here
+ --> $DIR/issue-96606.rs:1:8
+ |
+LL | #[deny(unused)]
+ | ^^^^^^
+ = note: `#[deny(unused_parens)]` implied by `#[deny(unused)]`
+help: remove these parentheses
+ |
+LL - let _ = arr[(0)];
+LL + let _ = arr[0];
+ |
+
+error: unnecessary braces around index expression
+ --> $DIR/issue-96606.rs:5:17
+ |
+LL | let _ = arr[{0}];
+ | ^ ^
+ |
+ = note: `#[deny(unused_braces)]` implied by `#[deny(unused)]`
+help: remove these braces
+ |
+LL - let _ = arr[{0}];
+LL + let _ = arr[0];
+ |
+
+error: aborting due to 2 previous errors
+
diff --git a/tests/ui/lint/unused_parens_multibyte_recovery.rs b/tests/ui/lint/unused_parens_multibyte_recovery.rs
index 8fcfae22a..bc03faf3f 100644
--- a/tests/ui/lint/unused_parens_multibyte_recovery.rs
+++ b/tests/ui/lint/unused_parens_multibyte_recovery.rs
@@ -3,7 +3,6 @@
// error-pattern: this file contains an unclosed delimiter
// error-pattern: this file contains an unclosed delimiter
// error-pattern: this file contains an unclosed delimiter
-// error-pattern: format argument must be a string literal
//
// Verify that unused parens lint does not try to create a span
// which points in the middle of a multibyte character.
diff --git a/tests/ui/lint/unused_parens_multibyte_recovery.stderr b/tests/ui/lint/unused_parens_multibyte_recovery.stderr
index a0302b17e..adbf27fcc 100644
--- a/tests/ui/lint/unused_parens_multibyte_recovery.stderr
+++ b/tests/ui/lint/unused_parens_multibyte_recovery.stderr
@@ -1,5 +1,5 @@
error: this file contains an unclosed delimiter
- --> $DIR/unused_parens_multibyte_recovery.rs:11:17
+ --> $DIR/unused_parens_multibyte_recovery.rs:10:17
|
LL | fn f(){(print!(á
| -- - ^
@@ -8,36 +8,5 @@ LL | fn f(){(print!(á
| |unclosed delimiter
| unclosed delimiter
-error: this file contains an unclosed delimiter
- --> $DIR/unused_parens_multibyte_recovery.rs:11:17
- |
-LL | fn f(){(print!(á
- | -- - ^
- | || |
- | || unclosed delimiter
- | |unclosed delimiter
- | unclosed delimiter
-
-error: this file contains an unclosed delimiter
- --> $DIR/unused_parens_multibyte_recovery.rs:11:17
- |
-LL | fn f(){(print!(á
- | -- - ^
- | || |
- | || unclosed delimiter
- | |unclosed delimiter
- | unclosed delimiter
-
-error: format argument must be a string literal
- --> $DIR/unused_parens_multibyte_recovery.rs:11:16
- |
-LL | fn f(){(print!(á
- | ^
- |
-help: you might be missing a string literal to format with
- |
-LL | fn f(){(print!("{}", á
- | +++++
-
-error: aborting due to 4 previous errors
+error: aborting due to previous error