Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/tools/tidy/src/issues.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/tools/tidy/src/ui_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 8 additions & 1 deletion tests/ui/used.rs → tests/ui/attributes/positions/used.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//! Checks that `#[used]` cannot be used on invalid positions.
#![crate_type = "lib"]

#[used]
static FOO: u32 = 0; // OK

Expand All @@ -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 <https://github.com/rust-lang/rust/issues/126789>.
extern "C" {
#[used] //~ ERROR attribute must be applied to a `static` variable
static BAR: i32;
}
18 changes: 13 additions & 5 deletions tests/ui/used.stderr → tests/ui/attributes/positions/used.stderr
Original file line number Diff line number Diff line change
@@ -1,34 +1,42 @@
error: attribute must be applied to a `static` variable
--> $DIR/used.rs:4:1
--> $DIR/used.rs:7:1
|
LL | #[used]
| ^^^^^^^
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]
| ^^^^^^^
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]
| ^^^^^^^
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

6 changes: 0 additions & 6 deletions tests/ui/attributes/used-issue-126789.rs

This file was deleted.

10 changes: 0 additions & 10 deletions tests/ui/attributes/used-issue-126789.stderr

This file was deleted.

10 changes: 10 additions & 0 deletions tests/ui/attributes/used/used-not-dead-code-lint.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
//! Checks that the `dead_code` lint does not consider `#[used]` items unused.
//! Regression test for <https://github.com/rust-lang/rust/issues/41628>.

//@ check-pass
#![deny(dead_code)]

#[used]
static FOO: u32 = 0;

fn main() {}
File renamed without changes.
7 changes: 0 additions & 7 deletions tests/ui/issues/issue-41628.rs

This file was deleted.

Original file line number Diff line number Diff line change
@@ -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() {
Expand Down
Loading