Auto merge of #140927 - mejrs:test5, r=jieyouxu

chore: move more ui tests

r? `@jieyouxu`
This commit is contained in:
bors 2025-05-13 00:03:33 +00:00
commit 3ae0b2e2ed
10 changed files with 36 additions and 36 deletions

View file

@ -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

View file

@ -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

View file

@ -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 <https://github.com/rust-lang/rust/issues/126789>.
extern "C" {
#[used] //~ ERROR attribute must be applied to a `static` variable
static BAR: i32;
}

View file

@ -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

View file

@ -1,6 +0,0 @@
extern "C" {
#[used] //~ ERROR attribute must be applied to a `static` variable
static FOO: i32;
}
fn main() {}

View file

@ -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

View file

@ -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() {}

View file

@ -1,7 +0,0 @@
//@ check-pass
#![deny(dead_code)]
#[used]
static FOO: u32 = 0;
fn main() {}

View file

@ -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() {