If suggestion would leave an empty line, delete it
This commit is contained in:
parent
b0696a5160
commit
367126d49a
17 changed files with 67 additions and 27 deletions
|
@ -21,7 +21,6 @@ impl Grault for () {
|
|||
|
||||
impl<T: Grault> Grault for (T,)
|
||||
//~^ ERROR overflow evaluating the requirement `<(T,) as Grault>::A == _`
|
||||
|
||||
{
|
||||
type A = ();
|
||||
type B = bool;
|
||||
|
|
|
@ -2,10 +2,8 @@
|
|||
#![allow(dead_code)]
|
||||
#![deny(no_mangle_generic_items)]
|
||||
|
||||
|
||||
pub fn foo<T>() {} //~ ERROR functions generic over types or consts must be mangled
|
||||
|
||||
|
||||
pub extern "C" fn bar<T>() {} //~ ERROR functions generic over types or consts must be mangled
|
||||
|
||||
#[no_mangle]
|
||||
|
|
|
@ -27,10 +27,8 @@ use issue_52891::{l,
|
|||
use issue_52891::a::inner;
|
||||
use issue_52891::b::inner as other_inner; //~ ERROR `inner` is defined multiple times
|
||||
|
||||
|
||||
//~^ ERROR `issue_52891` is defined multiple times
|
||||
|
||||
|
||||
#[macro_use]
|
||||
use issue_52891::n; //~ ERROR `n` is defined multiple times
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
#![deny(unused_imports)]
|
||||
|
||||
// Check that attributes get removed too. See #87973.
|
||||
|
||||
//~^ ERROR unused import
|
||||
|
||||
fn main() {}
|
||||
|
|
|
@ -7,11 +7,9 @@
|
|||
// Check that we *reject* leading where-clauses on lazy type aliases.
|
||||
|
||||
pub type Leading0<T>
|
||||
|
||||
= T where String: From<T>;
|
||||
|
||||
pub type Leading1<T, U>
|
||||
|
||||
= (T, U)
|
||||
where
|
||||
U: Copy, String: From<T>;
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
//~^ ERROR const items should never be `#[no_mangle]`
|
||||
//~| HELP try a static value
|
||||
|
||||
|
||||
//~^ HELP remove this attribute
|
||||
pub fn defiant<T>(_t: T) {}
|
||||
//~^ WARN functions generic over types or consts must be mangled
|
||||
|
|
11
tests/ui/lint/unused/import_remove_line.fixed
Normal file
11
tests/ui/lint/unused/import_remove_line.fixed
Normal file
|
@ -0,0 +1,11 @@
|
|||
//@ run-rustfix
|
||||
//@ check-pass
|
||||
|
||||
#![crate_type = "lib"]
|
||||
#![warn(unused_imports)]
|
||||
|
||||
//~^ WARN unused imports
|
||||
//~^ WARN unused import
|
||||
|
||||
//~^ WARN unused import
|
||||
//~| WARN unused import
|
13
tests/ui/lint/unused/import_remove_line.rs
Normal file
13
tests/ui/lint/unused/import_remove_line.rs
Normal file
|
@ -0,0 +1,13 @@
|
|||
//@ run-rustfix
|
||||
//@ check-pass
|
||||
|
||||
#![crate_type = "lib"]
|
||||
#![warn(unused_imports)]
|
||||
|
||||
use std::time::{Duration, Instant};
|
||||
//~^ WARN unused imports
|
||||
use std::time::SystemTime;
|
||||
//~^ WARN unused import
|
||||
use std::time::SystemTimeError;use std::time::TryFromFloatSecsError;
|
||||
//~^ WARN unused import
|
||||
//~| WARN unused import
|
32
tests/ui/lint/unused/import_remove_line.stderr
Normal file
32
tests/ui/lint/unused/import_remove_line.stderr
Normal file
|
@ -0,0 +1,32 @@
|
|||
warning: unused imports: `Duration`, `Instant`
|
||||
--> $DIR/import_remove_line.rs:7:17
|
||||
|
|
||||
LL | use std::time::{Duration, Instant};
|
||||
| ^^^^^^^^ ^^^^^^^
|
||||
|
|
||||
note: the lint level is defined here
|
||||
--> $DIR/import_remove_line.rs:5:9
|
||||
|
|
||||
LL | #![warn(unused_imports)]
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
||||
warning: unused import: `std::time::SystemTime`
|
||||
--> $DIR/import_remove_line.rs:9:5
|
||||
|
|
||||
LL | use std::time::SystemTime;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
warning: unused import: `std::time::SystemTimeError`
|
||||
--> $DIR/import_remove_line.rs:11:5
|
||||
|
|
||||
LL | use std::time::SystemTimeError;use std::time::TryFromFloatSecsError;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
warning: unused import: `std::time::TryFromFloatSecsError`
|
||||
--> $DIR/import_remove_line.rs:11:36
|
||||
|
|
||||
LL | use std::time::SystemTimeError;use std::time::TryFromFloatSecsError;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
warning: 4 warnings emitted
|
||||
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
#[allow(unused_imports)]
|
||||
use std::mem::transmute;
|
||||
|
||||
//~^ ERROR the name `transmute` is defined multiple times
|
||||
|
||||
fn main() {
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
#![deny(rust_2018_idioms)]
|
||||
#![allow(dead_code)]
|
||||
|
||||
|
||||
//~^ ERROR unused extern crate
|
||||
|
||||
// Shouldn't suggest changing to `use`, as `bar`
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
|
||||
// The suggestion span should include the attribute.
|
||||
|
||||
|
||||
//~^ ERROR unused extern crate
|
||||
|
||||
fn main() {}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue