in which we include attributes in unused extern crate suggestion spans
Resolves #54400.
This commit is contained in:
parent
af50e3822c
commit
7cbe0605fa
4 changed files with 74 additions and 1 deletions
|
|
@ -0,0 +1,24 @@
|
|||
// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// aux-build:edition-lint-paths.rs
|
||||
// run-rustfix
|
||||
// compile-flags:--extern edition_lint_paths --cfg blandiloquence
|
||||
// edition:2018
|
||||
|
||||
#![deny(rust_2018_idioms)]
|
||||
#![allow(dead_code)]
|
||||
|
||||
// The suggestion span should include the attribute.
|
||||
|
||||
|
||||
//~^ ERROR unused extern crate
|
||||
|
||||
fn main() {}
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// aux-build:edition-lint-paths.rs
|
||||
// run-rustfix
|
||||
// compile-flags:--extern edition_lint_paths --cfg blandiloquence
|
||||
// edition:2018
|
||||
|
||||
#![deny(rust_2018_idioms)]
|
||||
#![allow(dead_code)]
|
||||
|
||||
// The suggestion span should include the attribute.
|
||||
|
||||
#[cfg(blandiloquence)] //~ HELP remove it
|
||||
extern crate edition_lint_paths;
|
||||
//~^ ERROR unused extern crate
|
||||
|
||||
fn main() {}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
error: unused extern crate
|
||||
--> $DIR/issue-54400-unused-extern-crate-attr-span.rs:22:1
|
||||
|
|
||||
LL | / #[cfg(blandiloquence)] //~ HELP remove it
|
||||
LL | | extern crate edition_lint_paths;
|
||||
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
|
||||
| |________________________________|
|
||||
| help: remove it
|
||||
|
|
||||
note: lint level defined here
|
||||
--> $DIR/issue-54400-unused-extern-crate-attr-span.rs:16:9
|
||||
|
|
||||
LL | #![deny(rust_2018_idioms)]
|
||||
| ^^^^^^^^^^^^^^^^
|
||||
= note: #[deny(unused_extern_crates)] implied by #[deny(rust_2018_idioms)]
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue