diff --git a/src/tools/tidy/src/issues.txt b/src/tools/tidy/src/issues.txt index 2f0158609e088..2c20e21f451ab 100644 --- a/src/tools/tidy/src/issues.txt +++ b/src/tools/tidy/src/issues.txt @@ -2212,7 +2212,6 @@ ui/issues/issue-41479.rs ui/issues/issue-41498.rs ui/issues/issue-41549.rs ui/issues/issue-41604.rs -ui/issues/issue-41628.rs ui/issues/issue-41652/auxiliary/issue-41652-b.rs ui/issues/issue-41652/issue-41652.rs ui/issues/issue-41677.rs diff --git a/src/tools/tidy/src/ui_tests.rs b/src/tools/tidy/src/ui_tests.rs index 44dd1e50f5b04..8f9b07c49acbe 100644 --- a/src/tools/tidy/src/ui_tests.rs +++ b/src/tools/tidy/src/ui_tests.rs @@ -17,7 +17,7 @@ use ignore::Walk; const ENTRY_LIMIT: u32 = 901; // FIXME: The following limits should be reduced eventually. -const ISSUES_ENTRY_LIMIT: u32 = 1624; +const ISSUES_ENTRY_LIMIT: u32 = 1623; const EXPECTED_TEST_FILE_EXTENSIONS: &[&str] = &[ "rs", // test source files diff --git a/tests/ui/used.rs b/tests/ui/attributes/positions/used.rs similarity index 57% rename from tests/ui/used.rs rename to tests/ui/attributes/positions/used.rs index f008724f428b3..7950fa773a109 100644 --- a/tests/ui/used.rs +++ b/tests/ui/attributes/positions/used.rs @@ -1,3 +1,6 @@ +//! Checks that `#[used]` cannot be used on invalid positions. +#![crate_type = "lib"] + #[used] static FOO: u32 = 0; // OK @@ -13,4 +16,8 @@ trait Bar {} #[used] //~ ERROR attribute must be applied to a `static` variable impl Bar for Foo {} -fn main() {} +// Regression test for . +extern "C" { + #[used] //~ ERROR attribute must be applied to a `static` variable + static BAR: i32; +} diff --git a/tests/ui/used.stderr b/tests/ui/attributes/positions/used.stderr similarity index 71% rename from tests/ui/used.stderr rename to tests/ui/attributes/positions/used.stderr index c586dc722932f..96dd43a3a937f 100644 --- a/tests/ui/used.stderr +++ b/tests/ui/attributes/positions/used.stderr @@ -1,5 +1,5 @@ error: attribute must be applied to a `static` variable - --> $DIR/used.rs:4:1 + --> $DIR/used.rs:7:1 | LL | #[used] | ^^^^^^^ @@ -7,7 +7,7 @@ LL | fn foo() {} | ----------- but this is a function error: attribute must be applied to a `static` variable - --> $DIR/used.rs:7:1 + --> $DIR/used.rs:10:1 | LL | #[used] | ^^^^^^^ @@ -15,7 +15,7 @@ LL | struct Foo {} | ------------- but this is a struct error: attribute must be applied to a `static` variable - --> $DIR/used.rs:10:1 + --> $DIR/used.rs:13:1 | LL | #[used] | ^^^^^^^ @@ -23,12 +23,20 @@ LL | trait Bar {} | ------------ but this is a trait error: attribute must be applied to a `static` variable - --> $DIR/used.rs:13:1 + --> $DIR/used.rs:16:1 | LL | #[used] | ^^^^^^^ LL | impl Bar for Foo {} | ------------------- but this is a implementation block -error: aborting due to 4 previous errors +error: attribute must be applied to a `static` variable + --> $DIR/used.rs:21:5 + | +LL | #[used] + | ^^^^^^^ +LL | static BAR: i32; + | ---------------- but this is a foreign static item + +error: aborting due to 5 previous errors diff --git a/tests/ui/attributes/used-issue-126789.rs b/tests/ui/attributes/used-issue-126789.rs deleted file mode 100644 index 90a1aa8d5cc3d..0000000000000 --- a/tests/ui/attributes/used-issue-126789.rs +++ /dev/null @@ -1,6 +0,0 @@ -extern "C" { - #[used] //~ ERROR attribute must be applied to a `static` variable - static FOO: i32; -} - -fn main() {} diff --git a/tests/ui/attributes/used-issue-126789.stderr b/tests/ui/attributes/used-issue-126789.stderr deleted file mode 100644 index 6014f7af95c55..0000000000000 --- a/tests/ui/attributes/used-issue-126789.stderr +++ /dev/null @@ -1,10 +0,0 @@ -error: attribute must be applied to a `static` variable - --> $DIR/used-issue-126789.rs:2:5 - | -LL | #[used] - | ^^^^^^^ -LL | static FOO: i32; - | ---------------- but this is a foreign static item - -error: aborting due to 1 previous error - diff --git a/tests/ui/attributes/used/used-not-dead-code-lint.rs b/tests/ui/attributes/used/used-not-dead-code-lint.rs new file mode 100644 index 0000000000000..ece40ed219d4a --- /dev/null +++ b/tests/ui/attributes/used/used-not-dead-code-lint.rs @@ -0,0 +1,10 @@ +//! Checks that the `dead_code` lint does not consider `#[used]` items unused. +//! Regression test for . + +//@ check-pass +#![deny(dead_code)] + +#[used] +static FOO: u32 = 0; + +fn main() {} diff --git a/tests/ui/utf8-bom.rs b/tests/ui/codemap_tests/utf8-bom.rs similarity index 100% rename from tests/ui/utf8-bom.rs rename to tests/ui/codemap_tests/utf8-bom.rs diff --git a/tests/ui/issues/issue-41628.rs b/tests/ui/issues/issue-41628.rs deleted file mode 100644 index 255e4243e0119..0000000000000 --- a/tests/ui/issues/issue-41628.rs +++ /dev/null @@ -1,7 +0,0 @@ -//@ check-pass -#![deny(dead_code)] - -#[used] -static FOO: u32 = 0; - -fn main() {} diff --git a/tests/ui/utf8_idents.rs b/tests/ui/rfcs/rfc-2457-non-ascii-idents/utf8_idents.rs similarity index 62% rename from tests/ui/utf8_idents.rs rename to tests/ui/rfcs/rfc-2457-non-ascii-idents/utf8_idents.rs index 0c34529d2de43..3997e27bc9f99 100644 --- a/tests/ui/utf8_idents.rs +++ b/tests/ui/rfcs/rfc-2457-non-ascii-idents/utf8_idents.rs @@ -1,14 +1,13 @@ +//! Check that non-ascii-idents are allowed. + //@ check-pass // #![allow(mixed_script_confusables, non_camel_case_types)] -fn foo< - 'β, - γ ->() {} +fn foo<'β, γ>() {} struct X { - δ: usize + δ: usize, } pub fn main() {