Update uitests

This commit is contained in:
Jonathan Brouwer 2025-08-16 17:13:15 +02:00
parent c1c204d707
commit d5dc797dce
No known key found for this signature in database
GPG key ID: F13E55D38C971DEF
8 changed files with 520 additions and 323 deletions

View file

@ -45,4 +45,5 @@ impl Bar {
#[rustc_confusables("blah")]
//~^ ERROR attribute cannot be used on
//~| HELP can only be applied to
//~| HELP remove the attribute
fn not_inherent_impl_method() {}

View file

@ -4,12 +4,14 @@
//~^ WARN attribute cannot be used on
//~| WARN previously accepted
//~| HELP can be applied to
//~| HELP remove the attribute
struct Foo;
#[link_name = "foobar"]
//~^ WARN attribute cannot be used on
//~| WARN previously accepted
//~| HELP can be applied to
//~| HELP remove the attribute
extern "C" {
fn foo() -> u32;
}
@ -19,6 +21,7 @@ extern "C" {
//~| HELP must be of the form
//~| WARN attribute cannot be used on
//~| WARN previously accepted
//~| HELP remove the attribute
//~| HELP can be applied to
//~| NOTE for more information, visit
extern "C" {

View file

@ -1,5 +1,5 @@
error[E0539]: malformed `link_name` attribute input
--> $DIR/issue-47725.rs:17:1
--> $DIR/issue-47725.rs:19:1
|
LL | #[link_name]
| ^^^^^^^^^^^^ help: must be of the form: `#[link_name = "name"]`
@ -21,7 +21,7 @@ LL | #![warn(unused_attributes)]
| ^^^^^^^^^^^^^^^^^
warning: `#[link_name]` attribute cannot be used on foreign modules
--> $DIR/issue-47725.rs:9:1
--> $DIR/issue-47725.rs:10:1
|
LL | #[link_name = "foobar"]
| ^^^^^^^^^^^^^^^^^^^^^^^
@ -30,7 +30,7 @@ LL | #[link_name = "foobar"]
= help: `#[link_name]` can be applied to foreign functions, foreign statics
warning: `#[link_name]` attribute cannot be used on foreign modules
--> $DIR/issue-47725.rs:17:1
--> $DIR/issue-47725.rs:19:1
|
LL | #[link_name]
| ^^^^^^^^^^^^

View file

@ -50,9 +50,11 @@
#![should_panic] //~ WARN attribute cannot be used on
//~| WARN previously accepted
//~| HELP can only be applied to
//~| HELP remove the attribute
#![ignore] //~ WARN attribute cannot be used on
//~| WARN previously accepted
//~| HELP can only be applied to
//~| HELP remove the attribute
#![no_implicit_prelude]
#![reexport_test_harness_main = "2900"]
// see gated-link-args.rs
@ -61,22 +63,28 @@
#![proc_macro_derive(Test)] //~ WARN attribute cannot be used on
//~| WARN previously accepted
//~| HELP can only be applied to
//~| HELP remove the attribute
#![doc = "2400"]
#![cold] //~ WARN attribute cannot be used on
//~| WARN previously accepted
//~| HELP can only be applied to
//~| HELP remove the attribute
#![link()] //~ WARN attribute should be applied to an `extern` block
//~^ WARN this was previously accepted
#![link_name = "1900"]
//~^ WARN attribute cannot be used on
//~| WARN previously accepted
//~| HELP can be applied to
//~| HELP remove the attribute
#![link_section = "1800"]
//~^ WARN attribute cannot be used on
//~| WARN previously accepted
//~| HELP can be applied to
//~| HELP remove the attribute
#![must_use]
//~^ WARN `#[must_use]` has no effect
//~^ WARN attribute cannot be used on
//~| WARN previously accepted
//~| HELP can be applied to
//~| HELP remove the attribute
// see issue-43106-gating-of-stable.rs
// see issue-43106-gating-of-unstable.rs
@ -184,21 +192,25 @@ mod macro_use {
//~^ WARN attribute cannot be used on
//~| WARN previously accepted
//~| HELP can be applied to
//~| HELP remove the attribute
#[macro_use] struct S;
//~^ WARN attribute cannot be used on
//~| WARN previously accepted
//~| HELP can be applied to
//~| HELP remove the attribute
#[macro_use] type T = S;
//~^ WARN attribute cannot be used on
//~| WARN previously accepted
//~| HELP can be applied to
//~| HELP remove the attribute
#[macro_use] impl S { }
//~^ WARN attribute cannot be used on
//~| WARN previously accepted
//~| HELP can be applied to
//~| HELP remove the attribute
}
#[macro_export]
@ -260,57 +272,68 @@ mod path {
//~^ WARN attribute cannot be used on
//~| WARN previously accepted
//~| HELP can only be applied to
//~| HELP remove the attribute
#[path = "3800"] struct S;
//~^ WARN attribute cannot be used on
//~| WARN previously accepted
//~| HELP can only be applied to
//~| HELP remove the attribute
#[path = "3800"] type T = S;
//~^ WARN attribute cannot be used on
//~| WARN previously accepted
//~| HELP can only be applied to
//~| HELP remove the attribute
#[path = "3800"] impl S { }
//~^ WARN attribute cannot be used on
//~| WARN previously accepted
//~| HELP can only be applied to
//~| HELP remove the attribute
}
#[automatically_derived]
//~^ WARN attribute cannot be used on
//~| WARN previously accepted
//~| HELP can only be applied to
//~| HELP remove the attribute
mod automatically_derived {
mod inner { #![automatically_derived] }
//~^ WARN attribute cannot be used on
//~| WARN previously accepted
//~| HELP can only be applied to
//~| HELP remove the attribute
#[automatically_derived] fn f() { }
//~^ WARN attribute cannot be used on
//~| WARN previously accepted
//~| HELP can only be applied to
//~| HELP remove the attribute
#[automatically_derived] struct S;
//~^ WARN attribute cannot be used on
//~| WARN previously accepted
//~| HELP can only be applied to
//~| HELP remove the attribute
#[automatically_derived] type T = S;
//~^ WARN attribute cannot be used on
//~| WARN previously accepted
//~| HELP can only be applied to
//~| HELP remove the attribute
#[automatically_derived] trait W { }
//~^ WARN attribute cannot be used on
//~| WARN previously accepted
//~| HELP can only be applied to
//~| HELP remove the attribute
#[automatically_derived] impl S { }
//~^ WARN attribute cannot be used on
//~| WARN previously accepted
//~| HELP can only be applied to
//~| HELP remove the attribute
#[automatically_derived] impl W for S { }
}
@ -319,11 +342,13 @@ mod automatically_derived {
//~^ WARN attribute cannot be used on
//~| WARN previously accepted
//~| HELP can be applied to
//~| HELP remove the attribute
mod no_mangle {
mod inner { #![no_mangle] }
//~^ WARN attribute cannot be used on
//~| WARN previously accepted
//~| HELP can be applied to
//~| HELP remove the attribute
#[no_mangle] fn f() { }
@ -331,27 +356,32 @@ mod no_mangle {
//~^ WARN attribute cannot be used on
//~| WARN previously accepted
//~| HELP can be applied to
//~| HELP remove the attribute
#[no_mangle] type T = S;
//~^ WARN attribute cannot be used on
//~| WARN previously accepted
//~| HELP can be applied to
//~| HELP remove the attribute
#[no_mangle] impl S { }
//~^ WARN attribute cannot be used on
//~| WARN previously accepted
//~| HELP can be applied to
//~| HELP remove the attribute
trait Tr {
#[no_mangle] fn foo();
//~^ WARN attribute cannot be used on
//~| WARN previously accepted
//~| HELP can be applied to
//~| HELP remove the attribute
#[no_mangle] fn bar() {}
//~^ WARN attribute cannot be used on
//~| WARN previously accepted
//~| HELP can be applied to
//~| HELP remove the attribute
}
}
@ -359,11 +389,13 @@ mod no_mangle {
//~^ WARN attribute cannot be used on
//~| WARN previously accepted
//~| HELP can only be applied to
//~| HELP remove the attribute
mod should_panic {
mod inner { #![should_panic] }
//~^ WARN attribute cannot be used on
//~| WARN previously accepted
//~| HELP can only be applied to
//~| HELP remove the attribute
#[should_panic] fn f() { }
@ -371,27 +403,32 @@ mod should_panic {
//~^ WARN attribute cannot be used on
//~| WARN previously accepted
//~| HELP can only be applied to
//~| HELP remove the attribute
#[should_panic] type T = S;
//~^ WARN attribute cannot be used on
//~| WARN previously accepted
//~| HELP can only be applied to
//~| HELP remove the attribute
#[should_panic] impl S { }
//~^ WARN attribute cannot be used on
//~| WARN previously accepted
//~| HELP can only be applied to
//~| HELP remove the attribute
}
#[ignore]
//~^ WARN attribute cannot be used on
//~| WARN previously accepted
//~| HELP can only be applied to
//~| HELP remove the attribute
mod ignore {
mod inner { #![ignore] }
//~^ WARN attribute cannot be used on
//~| WARN previously accepted
//~| HELP can only be applied to
//~| HELP remove the attribute
#[ignore] fn f() { }
@ -399,16 +436,19 @@ mod ignore {
//~^ WARN attribute cannot be used on
//~| WARN previously accepted
//~| HELP can only be applied to
//~| HELP remove the attribute
#[ignore] type T = S;
//~^ WARN attribute cannot be used on
//~| WARN previously accepted
//~| HELP can only be applied to
//~| HELP remove the attribute
#[ignore] impl S { }
//~^ WARN attribute cannot be used on
//~| WARN previously accepted
//~| HELP can only be applied to
//~| HELP remove the attribute
}
#[no_implicit_prelude]
@ -419,21 +459,25 @@ mod no_implicit_prelude {
//~^ WARN attribute cannot be used on
//~| WARN previously accepted
//~| HELP can be applied to
//~| HELP remove the attribute
#[no_implicit_prelude] struct S;
//~^ WARN attribute cannot be used on
//~| WARN previously accepted
//~| HELP can be applied to
//~| HELP remove the attribute
#[no_implicit_prelude] type T = S;
//~^ WARN attribute cannot be used on
//~| WARN previously accepted
//~| HELP can be applied to
//~| HELP remove the attribute
#[no_implicit_prelude] impl S { }
//~^ WARN attribute cannot be used on
//~| WARN previously accepted
//~| HELP can be applied to
//~| HELP remove the attribute
}
#[reexport_test_harness_main = "2900"]
@ -467,21 +511,25 @@ mod macro_escape {
//~^ WARN attribute cannot be used on
//~| WARN previously accepted
//~| HELP can be applied to
//~| HELP remove the attribute
#[macro_escape] struct S;
//~^ WARN attribute cannot be used on
//~| WARN previously accepted
//~| HELP can be applied to
//~| HELP remove the attribute
#[macro_escape] type T = S;
//~^ WARN attribute cannot be used on
//~| WARN previously accepted
//~| HELP can be applied to
//~| HELP remove the attribute
#[macro_escape] impl S { }
//~^ WARN attribute cannot be used on
//~| WARN previously accepted
//~| HELP can be applied to
//~| HELP remove the attribute
}
#[no_std]
@ -524,12 +572,14 @@ mod doc {
//~^ WARN attribute cannot be used on
//~| WARN previously accepted
//~| HELP can only be applied to
//~| HELP remove the attribute
mod cold {
mod inner { #![cold] }
//~^ WARN attribute cannot be used on
//~| WARN previously accepted
//~| HELP can only be applied to
//~| HELP remove the attribute
#[cold] fn f() { }
@ -537,64 +587,76 @@ mod cold {
//~^ WARN attribute cannot be used on
//~| WARN previously accepted
//~| HELP can only be applied to
//~| HELP remove the attribute
#[cold] type T = S;
//~^ WARN attribute cannot be used on
//~| WARN previously accepted
//~| HELP can only be applied to
//~| HELP remove the attribute
#[cold] impl S { }
//~^ WARN attribute cannot be used on
//~| WARN previously accepted
//~| HELP can only be applied to
//~| HELP remove the attribute
}
#[link_name = "1900"]
//~^ WARN attribute cannot be used on
//~| WARN previously accepted
//~| HELP can be applied to
//~| HELP remove the attribute
mod link_name {
#[link_name = "1900"]
//~^ WARN attribute cannot be used on
//~| WARN previously accepted
//~| HELP can be applied to
//~| HELP remove the attribute
extern "C" { }
mod inner { #![link_name="1900"] }
//~^ WARN attribute cannot be used on
//~| WARN previously accepted
//~| HELP can be applied to
//~| HELP remove the attribute
#[link_name = "1900"] fn f() { }
//~^ WARN attribute cannot be used on
//~| WARN previously accepted
//~| HELP can be applied to
//~| HELP remove the attribute
#[link_name = "1900"] struct S;
//~^ WARN attribute cannot be used on
//~| WARN previously accepted
//~| HELP can be applied to
//~| HELP remove the attribute
#[link_name = "1900"] type T = S;
//~^ WARN attribute cannot be used on
//~| WARN previously accepted
//~| HELP can be applied to
//~| HELP remove the attribute
#[link_name = "1900"] impl S { }
//~^ WARN attribute cannot be used on
//~| WARN previously accepted
//~| HELP can be applied to
//~| HELP remove the attribute
}
#[link_section = "1800"]
//~^ WARN attribute cannot be used on
//~| WARN previously accepted
//~| HELP can be applied to
//~| HELP remove the attribute
mod link_section {
mod inner { #![link_section="1800"] }
//~^ WARN attribute cannot be used on
//~| WARN previously accepted
//~| HELP can be applied to
//~| HELP remove the attribute
#[link_section = "1800"] fn f() { }
@ -602,16 +664,19 @@ mod link_section {
//~^ WARN attribute cannot be used on
//~| WARN previously accepted
//~| HELP can be applied to
//~| HELP remove the attribute
#[link_section = "1800"] type T = S;
//~^ WARN attribute cannot be used on
//~| WARN previously accepted
//~| HELP can be applied to
//~| HELP remove the attribute
#[link_section = "1800"] impl S { }
//~^ WARN attribute cannot be used on
//~| WARN previously accepted
//~| HELP can be applied to
//~| HELP remove the attribute
}
@ -668,21 +733,29 @@ mod deprecated {
#[deprecated] impl super::StructForDeprecated { }
}
#[must_use] //~ WARN `#[must_use]` has no effect
//~^ HELP remove the attribute
#[must_use] //~ WARN attribute cannot be used on
//~| WARN previously accepted
//~| HELP can be applied to
//~| HELP remove the attribute
mod must_use {
mod inner { #![must_use] } //~ WARN `#[must_use]` has no effect
//~^ HELP remove the attribute
mod inner { #![must_use] } //~ WARN attribute cannot be used on
//~| WARN previously accepted
//~| HELP can be applied to
//~| HELP remove the attribute
#[must_use] fn f() { }
#[must_use] struct S;
#[must_use] type T = S; //~ WARN `#[must_use]` has no effect
//~^ HELP remove the attribute
#[must_use] type T = S; //~ WARN attribute cannot be used on
//~| WARN previously accepted
//~| HELP can be applied to
//~| HELP remove the attribute
#[must_use] impl S { } //~ WARN `#[must_use]` has no effect
//~^ HELP remove the attribute
#[must_use] impl S { } //~ WARN attribute cannot be used on
//~| WARN previously accepted
//~| HELP can be applied to
//~| HELP remove the attribute
}
#[windows_subsystem = "windows"]

View file

@ -4,18 +4,23 @@
#![deny(unused_attributes, unused_must_use)]
#![feature(asm_experimental_arch, stmt_expr_attributes, trait_alias)]
//~ ERROR `#[must_use]` has no effect
//~ ERROR attribute cannot be used on
//~| WARN previously accepted
extern crate std as std2;
//~ ERROR `#[must_use]` has no effect
//~ ERROR attribute cannot be used on
//~| WARN previously accepted
mod test_mod {}
//~ ERROR `#[must_use]` has no effect
//~ ERROR attribute cannot be used on
//~| WARN previously accepted
use std::arch::global_asm;
//~ ERROR `#[must_use]` has no effect
//~ ERROR attribute cannot be used on
//~| WARN previously accepted
const CONST: usize = 4;
//~ ERROR `#[must_use]` has no effect
//~ ERROR attribute cannot be used on
//~| WARN previously accepted
#[no_mangle]
static STATIC: usize = 4;
@ -32,7 +37,8 @@ union U {
unit: (),
}
//~ ERROR `#[must_use]` has no effect
//~ ERROR attribute cannot be used on
//~| WARN previously accepted
impl U {
#[must_use]
fn method() -> i32 {
@ -46,10 +52,12 @@ fn foo() -> i64 {
4
}
//~ ERROR `#[must_use]` has no effect
//~ ERROR attribute cannot be used on
//~| WARN previously accepted
extern "Rust" {
#[link_name = "STATIC"]
//~ ERROR `#[must_use]` has no effect
//~ ERROR attribute cannot be used on
//~| WARN previously accepted
static FOREIGN_STATIC: usize;
#[link_name = "foo"]
@ -60,16 +68,20 @@ extern "Rust" {
//~ ERROR unused attribute
global_asm!("");
//~ ERROR `#[must_use]` has no effect
//~ ERROR attribute cannot be used on
//~| WARN previously accepted
type UseMe = ();
fn qux< T>(_: T) {} //~ ERROR `#[must_use]` has no effect
fn qux< T>(_: T) {} //~ ERROR attribute cannot be used on
//~| WARN previously accepted
#[must_use]
trait Use {
//~ ERROR `#[must_use]` has no effect
//~ ERROR attribute cannot be used on
//~| WARN previously accepted
const ASSOC_CONST: usize = 4;
//~ ERROR `#[must_use]` has no effect
//~ ERROR attribute cannot be used on
//~| WARN previously accepted
type AssocTy;
#[must_use]
@ -78,20 +90,24 @@ trait Use {
}
}
//~ ERROR `#[must_use]` has no effect
//~ ERROR attribute cannot be used on
//~| WARN previously accepted
impl Use for () {
type AssocTy = ();
//~ ERROR `#[must_use]` has no effect
//~ ERROR attribute cannot be used on
//~| WARN previously accepted
fn get_four(&self) -> usize {
4
}
}
//~ ERROR `#[must_use]` has no effect
//~ ERROR attribute cannot be used on
//~| WARN previously accepted
trait Alias = Use;
//~ ERROR `#[must_use]` has no effect
//~ ERROR attribute cannot be used on
//~| WARN previously accepted
macro_rules! cool_macro {
() => {
4
@ -99,11 +115,13 @@ macro_rules! cool_macro {
}
fn main() {
//~ ERROR `#[must_use]` has no effect
//~ ERROR attribute cannot be used on
//~| WARN previously accepted
let x = || {};
x();
let x = //~ ERROR `#[must_use]` has no effect
let x = //~ ERROR attribute cannot be used on
//~| WARN previously accepted
|| {};
x();
@ -125,7 +143,8 @@ fn main() {
let _ = ().get_four(); //~ ERROR that must be used
match Some(4) {
//~ ERROR `#[must_use]` has no effect
//~ ERROR attribute cannot be used on
//~| WARN previously accepted
Some(res) => res,
None => 0,
};
@ -133,7 +152,9 @@ fn main() {
struct PatternField {
foo: i32,
}
let s = PatternField { foo: 123 }; //~ ERROR `#[must_use]` has no effect
let PatternField { foo } = s; //~ ERROR `#[must_use]` has no effect
let s = PatternField { foo: 123 }; //~ ERROR attribute cannot be used on
//~| WARN previously accepted
let PatternField { foo } = s; //~ ERROR attribute cannot be used on
//~| WARN previously accepted
let _ = foo;
}

View file

@ -4,18 +4,23 @@
#![deny(unused_attributes, unused_must_use)]
#![feature(asm_experimental_arch, stmt_expr_attributes, trait_alias)]
#[must_use] //~ ERROR `#[must_use]` has no effect
#[must_use] //~ ERROR attribute cannot be used on
//~| WARN previously accepted
extern crate std as std2;
#[must_use] //~ ERROR `#[must_use]` has no effect
#[must_use] //~ ERROR attribute cannot be used on
//~| WARN previously accepted
mod test_mod {}
#[must_use] //~ ERROR `#[must_use]` has no effect
#[must_use] //~ ERROR attribute cannot be used on
//~| WARN previously accepted
use std::arch::global_asm;
#[must_use] //~ ERROR `#[must_use]` has no effect
#[must_use] //~ ERROR attribute cannot be used on
//~| WARN previously accepted
const CONST: usize = 4;
#[must_use] //~ ERROR `#[must_use]` has no effect
#[must_use] //~ ERROR attribute cannot be used on
//~| WARN previously accepted
#[no_mangle]
static STATIC: usize = 4;
@ -32,7 +37,8 @@ union U {
unit: (),
}
#[must_use] //~ ERROR `#[must_use]` has no effect
#[must_use] //~ ERROR attribute cannot be used on
//~| WARN previously accepted
impl U {
#[must_use]
fn method() -> i32 {
@ -46,10 +52,12 @@ fn foo() -> i64 {
4
}
#[must_use] //~ ERROR `#[must_use]` has no effect
#[must_use] //~ ERROR attribute cannot be used on
//~| WARN previously accepted
extern "Rust" {
#[link_name = "STATIC"]
#[must_use] //~ ERROR `#[must_use]` has no effect
#[must_use] //~ ERROR attribute cannot be used on
//~| WARN previously accepted
static FOREIGN_STATIC: usize;
#[link_name = "foo"]
@ -60,16 +68,20 @@ extern "Rust" {
#[must_use] //~ ERROR unused attribute
global_asm!("");
#[must_use] //~ ERROR `#[must_use]` has no effect
#[must_use] //~ ERROR attribute cannot be used on
//~| WARN previously accepted
type UseMe = ();
fn qux<#[must_use] T>(_: T) {} //~ ERROR `#[must_use]` has no effect
fn qux<#[must_use] T>(_: T) {} //~ ERROR attribute cannot be used on
//~| WARN previously accepted
#[must_use]
trait Use {
#[must_use] //~ ERROR `#[must_use]` has no effect
#[must_use] //~ ERROR attribute cannot be used on
//~| WARN previously accepted
const ASSOC_CONST: usize = 4;
#[must_use] //~ ERROR `#[must_use]` has no effect
#[must_use] //~ ERROR attribute cannot be used on
//~| WARN previously accepted
type AssocTy;
#[must_use]
@ -78,20 +90,24 @@ trait Use {
}
}
#[must_use] //~ ERROR `#[must_use]` has no effect
#[must_use] //~ ERROR attribute cannot be used on
//~| WARN previously accepted
impl Use for () {
type AssocTy = ();
#[must_use] //~ ERROR `#[must_use]` has no effect
#[must_use] //~ ERROR attribute cannot be used on
//~| WARN previously accepted
fn get_four(&self) -> usize {
4
}
}
#[must_use] //~ ERROR `#[must_use]` has no effect
#[must_use] //~ ERROR attribute cannot be used on
//~| WARN previously accepted
trait Alias = Use;
#[must_use] //~ ERROR `#[must_use]` has no effect
#[must_use] //~ ERROR attribute cannot be used on
//~| WARN previously accepted
macro_rules! cool_macro {
() => {
4
@ -99,11 +115,13 @@ macro_rules! cool_macro {
}
fn main() {
#[must_use] //~ ERROR `#[must_use]` has no effect
#[must_use] //~ ERROR attribute cannot be used on
//~| WARN previously accepted
let x = || {};
x();
let x = #[must_use] //~ ERROR `#[must_use]` has no effect
let x = #[must_use] //~ ERROR attribute cannot be used on
//~| WARN previously accepted
|| {};
x();
@ -125,7 +143,8 @@ fn main() {
().get_four(); //~ ERROR that must be used
match Some(4) {
#[must_use] //~ ERROR `#[must_use]` has no effect
#[must_use] //~ ERROR attribute cannot be used on
//~| WARN previously accepted
Some(res) => res,
None => 0,
};
@ -133,7 +152,9 @@ fn main() {
struct PatternField {
foo: i32,
}
let s = PatternField { #[must_use] foo: 123 }; //~ ERROR `#[must_use]` has no effect
let PatternField { #[must_use] foo } = s; //~ ERROR `#[must_use]` has no effect
let s = PatternField { #[must_use] foo: 123 }; //~ ERROR attribute cannot be used on
//~| WARN previously accepted
let PatternField { #[must_use] foo } = s; //~ ERROR attribute cannot be used on
//~| WARN previously accepted
let _ = foo;
}

View file

@ -1,11 +1,11 @@
error: unused attribute `must_use`
--> $DIR/unused_attributes-must_use.rs:60:1
--> $DIR/unused_attributes-must_use.rs:68:1
|
LL | #[must_use]
| ^^^^^^^^^^^
|
note: the built-in attribute `must_use` will be ignored, since it's applied to the macro invocation `global_asm`
--> $DIR/unused_attributes-must_use.rs:61:1
--> $DIR/unused_attributes-must_use.rs:69:1
|
LL | global_asm!("");
| ^^^^^^^^^^
@ -15,134 +15,197 @@ note: the lint level is defined here
LL | #![deny(unused_attributes, unused_must_use)]
| ^^^^^^^^^^^^^^^^^
error: `#[must_use]` has no effect when applied to extern crates
error: `#[must_use]` attribute cannot be used on extern crates
--> $DIR/unused_attributes-must_use.rs:7:1
|
LL | #[must_use]
| ^^^^^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= help: `#[must_use]` can be applied to functions, data types, unions, traits
error: `#[must_use]` has no effect when applied to modules
--> $DIR/unused_attributes-must_use.rs:10:1
error: `#[must_use]` attribute cannot be used on modules
--> $DIR/unused_attributes-must_use.rs:11:1
|
LL | #[must_use]
| ^^^^^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= help: `#[must_use]` can be applied to functions, data types, unions, traits
error: `#[must_use]` has no effect when applied to use statements
--> $DIR/unused_attributes-must_use.rs:13:1
error: `#[must_use]` attribute cannot be used on use statements
--> $DIR/unused_attributes-must_use.rs:15:1
|
LL | #[must_use]
| ^^^^^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= help: `#[must_use]` can be applied to functions, data types, unions, traits
error: `#[must_use]` has no effect when applied to constants
--> $DIR/unused_attributes-must_use.rs:16:1
error: `#[must_use]` attribute cannot be used on constants
--> $DIR/unused_attributes-must_use.rs:19:1
|
LL | #[must_use]
| ^^^^^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= help: `#[must_use]` can be applied to functions, data types, unions, traits
error: `#[must_use]` has no effect when applied to statics
--> $DIR/unused_attributes-must_use.rs:18:1
error: `#[must_use]` attribute cannot be used on statics
--> $DIR/unused_attributes-must_use.rs:22:1
|
LL | #[must_use]
| ^^^^^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= help: `#[must_use]` can be applied to functions, data types, unions, traits
error: `#[must_use]` has no effect when applied to inherent impl blocks
--> $DIR/unused_attributes-must_use.rs:35:1
error: `#[must_use]` attribute cannot be used on inherent impl blocks
--> $DIR/unused_attributes-must_use.rs:40:1
|
LL | #[must_use]
| ^^^^^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= help: `#[must_use]` can be applied to functions, data types, unions, traits
error: `#[must_use]` has no effect when applied to foreign modules
--> $DIR/unused_attributes-must_use.rs:49:1
error: `#[must_use]` attribute cannot be used on foreign modules
--> $DIR/unused_attributes-must_use.rs:55:1
|
LL | #[must_use]
| ^^^^^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= help: `#[must_use]` can be applied to functions, data types, unions, traits
error: `#[must_use]` has no effect when applied to type aliases
--> $DIR/unused_attributes-must_use.rs:63:1
error: `#[must_use]` attribute cannot be used on foreign statics
--> $DIR/unused_attributes-must_use.rs:59:5
|
LL | #[must_use]
| ^^^^^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= help: `#[must_use]` can be applied to functions, data types, unions, traits
error: `#[must_use]` attribute cannot be used on type aliases
--> $DIR/unused_attributes-must_use.rs:71:1
|
LL | #[must_use]
| ^^^^^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= help: `#[must_use]` can be applied to functions, data types, unions, traits
error: `#[must_use]` has no effect when applied to type parameters
--> $DIR/unused_attributes-must_use.rs:66:8
error: `#[must_use]` attribute cannot be used on function params
--> $DIR/unused_attributes-must_use.rs:75:8
|
LL | fn qux<#[must_use] T>(_: T) {}
| ^^^^^^^^^^^
error: `#[must_use]` has no effect when applied to trait impl blocks
--> $DIR/unused_attributes-must_use.rs:81:1
|
LL | #[must_use]
| ^^^^^^^^^^^
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= help: `#[must_use]` can be applied to functions, data types, unions, traits
error: `#[must_use]` has no effect when applied to trait aliases
--> $DIR/unused_attributes-must_use.rs:91:1
|
LL | #[must_use]
| ^^^^^^^^^^^
error: `#[must_use]` has no effect when applied to macro defs
--> $DIR/unused_attributes-must_use.rs:94:1
|
LL | #[must_use]
| ^^^^^^^^^^^
error: `#[must_use]` has no effect when applied to statements
--> $DIR/unused_attributes-must_use.rs:102:5
error: `#[must_use]` attribute cannot be used on associated consts
--> $DIR/unused_attributes-must_use.rs:80:5
|
LL | #[must_use]
| ^^^^^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= help: `#[must_use]` can be applied to functions, data types, unions, traits
error: `#[must_use]` has no effect when applied to closures
--> $DIR/unused_attributes-must_use.rs:106:13
error: `#[must_use]` attribute cannot be used on associated types
--> $DIR/unused_attributes-must_use.rs:83:5
|
LL | #[must_use]
| ^^^^^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= help: `#[must_use]` can be applied to functions, data types, unions, traits
error: `#[must_use]` attribute cannot be used on trait impl blocks
--> $DIR/unused_attributes-must_use.rs:93:1
|
LL | #[must_use]
| ^^^^^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= help: `#[must_use]` can be applied to functions, data types, unions, traits
error: `#[must_use]` attribute cannot be used on trait methods in impl blocks
--> $DIR/unused_attributes-must_use.rs:98:5
|
LL | #[must_use]
| ^^^^^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= help: `#[must_use]` can be applied to data types, functions, unions, required trait methods, provided trait methods, inherent methods, foreign functions, traits
error: `#[must_use]` attribute cannot be used on trait aliases
--> $DIR/unused_attributes-must_use.rs:105:1
|
LL | #[must_use]
| ^^^^^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= help: `#[must_use]` can be applied to functions, data types, unions, traits
error: `#[must_use]` attribute cannot be used on macro defs
--> $DIR/unused_attributes-must_use.rs:109:1
|
LL | #[must_use]
| ^^^^^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= help: `#[must_use]` can be applied to functions, data types, unions, traits
error: `#[must_use]` attribute cannot be used on statements
--> $DIR/unused_attributes-must_use.rs:118:5
|
LL | #[must_use]
| ^^^^^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= help: `#[must_use]` can be applied to functions, data types, unions, traits
error: `#[must_use]` attribute cannot be used on closures
--> $DIR/unused_attributes-must_use.rs:123:13
|
LL | let x = #[must_use]
| ^^^^^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= help: `#[must_use]` can be applied to methods, data types, functions, unions, foreign functions, traits
error: `#[must_use]` has no effect when applied to match arms
--> $DIR/unused_attributes-must_use.rs:128:9
error: `#[must_use]` attribute cannot be used on match arms
--> $DIR/unused_attributes-must_use.rs:146:9
|
LL | #[must_use]
| ^^^^^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= help: `#[must_use]` can be applied to functions, data types, unions, traits
error: `#[must_use]` has no effect when applied to struct fields
--> $DIR/unused_attributes-must_use.rs:136:28
error: `#[must_use]` attribute cannot be used on struct fields
--> $DIR/unused_attributes-must_use.rs:155:28
|
LL | let s = PatternField { #[must_use] foo: 123 };
| ^^^^^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= help: `#[must_use]` can be applied to functions, data types, unions, traits
error: `#[must_use]` has no effect when applied to pattern fields
--> $DIR/unused_attributes-must_use.rs:137:24
error: `#[must_use]` attribute cannot be used on pattern fields
--> $DIR/unused_attributes-must_use.rs:157:24
|
LL | let PatternField { #[must_use] foo } = s;
| ^^^^^^^^^^^
error: `#[must_use]` has no effect when applied to associated consts
--> $DIR/unused_attributes-must_use.rs:70:5
|
LL | #[must_use]
| ^^^^^^^^^^^
error: `#[must_use]` has no effect when applied to associated types
--> $DIR/unused_attributes-must_use.rs:72:5
|
LL | #[must_use]
| ^^^^^^^^^^^
error: `#[must_use]` has no effect when applied to provided trait methods
--> $DIR/unused_attributes-must_use.rs:85:5
|
LL | #[must_use]
| ^^^^^^^^^^^
error: `#[must_use]` has no effect when applied to foreign statics
--> $DIR/unused_attributes-must_use.rs:52:5
|
LL | #[must_use]
| ^^^^^^^^^^^
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= help: `#[must_use]` can be applied to functions, data types, unions, traits
error: unused `X` that must be used
--> $DIR/unused_attributes-must_use.rs:110:5
--> $DIR/unused_attributes-must_use.rs:128:5
|
LL | X;
| ^
@ -158,7 +221,7 @@ LL | let _ = X;
| +++++++
error: unused `Y` that must be used
--> $DIR/unused_attributes-must_use.rs:111:5
--> $DIR/unused_attributes-must_use.rs:129:5
|
LL | Y::Z;
| ^^^^
@ -169,7 +232,7 @@ LL | let _ = Y::Z;
| +++++++
error: unused `U` that must be used
--> $DIR/unused_attributes-must_use.rs:112:5
--> $DIR/unused_attributes-must_use.rs:130:5
|
LL | U { unit: () };
| ^^^^^^^^^^^^^^
@ -180,7 +243,7 @@ LL | let _ = U { unit: () };
| +++++++
error: unused return value of `U::method` that must be used
--> $DIR/unused_attributes-must_use.rs:113:5
--> $DIR/unused_attributes-must_use.rs:131:5
|
LL | U::method();
| ^^^^^^^^^^^
@ -191,7 +254,7 @@ LL | let _ = U::method();
| +++++++
error: unused return value of `foo` that must be used
--> $DIR/unused_attributes-must_use.rs:114:5
--> $DIR/unused_attributes-must_use.rs:132:5
|
LL | foo();
| ^^^^^
@ -202,7 +265,7 @@ LL | let _ = foo();
| +++++++
error: unused return value of `foreign_foo` that must be used
--> $DIR/unused_attributes-must_use.rs:117:9
--> $DIR/unused_attributes-must_use.rs:135:9
|
LL | foreign_foo();
| ^^^^^^^^^^^^^
@ -213,7 +276,7 @@ LL | let _ = foreign_foo();
| +++++++
error: unused return value of `Use::get_four` that must be used
--> $DIR/unused_attributes-must_use.rs:125:5
--> $DIR/unused_attributes-must_use.rs:143:5
|
LL | ().get_four();
| ^^^^^^^^^^^^^