Skip to content

Commit aea449e

Browse files
authored
Unrolled build for #142219
Rollup merge of #142219 - Kivooeo:tf11, r=wesleywiser `tests/ui`: A New Order [11/N] Some `tests/ui/` housekeeping, to trim down number of tests directly under `tests/ui/`. Part of #133895. r? `@jieyouxu`
2 parents 1434630 + c6c55cc commit aea449e

16 files changed

+76
-78
lines changed

tests/ui/filter-block-view-items.rs renamed to tests/ui/cfg/cfg-false-use-item.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//! Test that use items with cfg(false) are properly filtered out
2+
13
//@ run-pass
24

35
pub fn main() {

tests/ui/illegal-ufcs-drop.fixed renamed to tests/ui/drop/explicit-drop-call-error.fixed

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//! Test error for explicit destructor method calls via UFCS
2+
13
//@ run-rustfix
24

35
#![allow(dropping_references)]

tests/ui/illegal-ufcs-drop.rs renamed to tests/ui/drop/explicit-drop-call-error.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//! Test error for explicit destructor method calls via UFCS
2+
13
//@ run-rustfix
24

35
#![allow(dropping_references)]

tests/ui/illegal-ufcs-drop.stderr renamed to tests/ui/drop/explicit-drop-call-error.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0040]: explicit use of destructor method
2-
--> $DIR/illegal-ufcs-drop.rs:12:5
2+
--> $DIR/explicit-drop-call-error.rs:14:5
33
|
44
LL | Drop::drop(&mut Foo)
55
| ^^^^^^^^^^

tests/ui/format-no-std.rs renamed to tests/ui/fmt/format-macro-no-std.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//! Test format! macro functionality in no_std environment
2+
13
//@ run-pass
24
//@ ignore-emscripten no no_std executables
35
//@ ignore-wasm different `main` convention
@@ -9,7 +11,8 @@
911
// Import global allocator and panic handler.
1012
extern crate std as other;
1113

12-
#[macro_use] extern crate alloc;
14+
#[macro_use]
15+
extern crate alloc;
1316

1417
use alloc::string::ToString;
1518

@@ -21,7 +24,7 @@ extern "C" fn main(_argc: core::ffi::c_int, _argv: *const *const u8) -> core::ff
2124
let s = format!("test");
2225
assert_eq!(s, "test".to_string());
2326

24-
let s = format!("{test}", test=3_isize);
27+
let s = format!("{test}", test = 3_isize);
2528
assert_eq!(s, "3".to_string());
2629

2730
let s = format!("hello {}", "world");

tests/ui/fun-indirect-call.rs

Lines changed: 0 additions & 9 deletions
This file was deleted.

tests/ui/future-incompatible-lint-group.rs

Lines changed: 0 additions & 15 deletions
This file was deleted.

tests/ui/global-scope.rs

Lines changed: 0 additions & 13 deletions
This file was deleted.

tests/ui/hello.rs

Lines changed: 0 additions & 10 deletions
This file was deleted.

tests/ui/include-macros/parent_dir.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
fn main() {
44
let _ = include_str!("include-macros/file.txt"); //~ ERROR couldn't read
55
//~^HELP different directory
6-
let _ = include_str!("hello.rs"); //~ ERROR couldn't read
7-
//~^HELP different directory
86
let _ = include_bytes!("../../data.bin"); //~ ERROR couldn't read
97
//~^HELP different directory
108
let _ = include_str!("tests/ui/include-macros/file.txt"); //~ ERROR couldn't read

tests/ui/include-macros/parent_dir.stderr

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,8 @@ LL - let _ = include_str!("include-macros/file.txt");
1010
LL + let _ = include_str!("file.txt");
1111
|
1212

13-
error: couldn't read `$DIR/hello.rs`: $FILE_NOT_FOUND_MSG
14-
--> $DIR/parent_dir.rs:6:13
15-
|
16-
LL | let _ = include_str!("hello.rs");
17-
| ^^^^^^^^^^^^^^^^^^^^^^^^
18-
|
19-
help: there is a file with the same name in a different directory
20-
|
21-
LL | let _ = include_str!("../hello.rs");
22-
| +++
23-
2413
error: couldn't read `$DIR/../../data.bin`: $FILE_NOT_FOUND_MSG
25-
--> $DIR/parent_dir.rs:8:13
14+
--> $DIR/parent_dir.rs:6:13
2615
|
2716
LL | let _ = include_bytes!("../../data.bin");
2817
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -34,7 +23,7 @@ LL + let _ = include_bytes!("data.bin");
3423
|
3524

3625
error: couldn't read `$DIR/tests/ui/include-macros/file.txt`: $FILE_NOT_FOUND_MSG
37-
--> $DIR/parent_dir.rs:10:13
26+
--> $DIR/parent_dir.rs:8:13
3827
|
3928
LL | let _ = include_str!("tests/ui/include-macros/file.txt");
4029
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -45,5 +34,5 @@ LL - let _ = include_str!("tests/ui/include-macros/file.txt");
4534
LL + let _ = include_str!("file.txt");
4635
|
4736

48-
error: aborting due to 4 previous errors
37+
error: aborting due to 3 previous errors
4938

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
//! Test that future_incompatible lint group only includes edition-independent lints
2+
3+
// Ensure that the future_incompatible lint group only includes
4+
// lints for changes that are not tied to an edition
5+
#![deny(future_incompatible)]
6+
7+
// Error since this is a `future_incompatible` lint
8+
macro_rules! m {
9+
($i) => {};
10+
//~^ ERROR missing fragment specifier
11+
//~| WARN this was previously accepted
12+
}
13+
14+
trait Tr {
15+
// Warn only since this is not a `future_incompatible` lint
16+
fn f(u8) {}
17+
//~^ WARN anonymous parameters are deprecated
18+
//~| WARN this is accepted in the current edition
19+
}
20+
21+
fn main() {}

tests/ui/future-incompatible-lint-group.stderr renamed to tests/ui/lint/future-incompatible-lint-group.stderr

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
error: missing fragment specifier
2-
--> $DIR/future-incompatible-lint-group.rs:6:19
2+
--> $DIR/future-incompatible-lint-group.rs:9:6
33
|
4-
LL | macro_rules! m { ($i) => {} }
5-
| ^^
4+
LL | ($i) => {};
5+
| ^^
66
|
77
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
88
= note: for more information, see issue #40107 <https://github.com/rust-lang/rust/issues/40107>
99
note: the lint level is defined here
10-
--> $DIR/future-incompatible-lint-group.rs:3:9
10+
--> $DIR/future-incompatible-lint-group.rs:5:9
1111
|
1212
LL | #![deny(future_incompatible)]
1313
| ^^^^^^^^^^^^^^^^^^^
1414
= note: `#[deny(missing_fragment_specifier)]` implied by `#[deny(future_incompatible)]`
1515

1616
warning: anonymous parameters are deprecated and will be removed in the next edition
17-
--> $DIR/future-incompatible-lint-group.rs:11:10
17+
--> $DIR/future-incompatible-lint-group.rs:16:10
1818
|
1919
LL | fn f(u8) {}
2020
| ^^ help: try naming the parameter or explicitly ignoring it: `_: u8`
@@ -27,15 +27,15 @@ error: aborting due to 1 previous error; 1 warning emitted
2727

2828
Future incompatibility report: Future breakage diagnostic:
2929
error: missing fragment specifier
30-
--> $DIR/future-incompatible-lint-group.rs:6:19
30+
--> $DIR/future-incompatible-lint-group.rs:9:6
3131
|
32-
LL | macro_rules! m { ($i) => {} }
33-
| ^^
32+
LL | ($i) => {};
33+
| ^^
3434
|
3535
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
3636
= note: for more information, see issue #40107 <https://github.com/rust-lang/rust/issues/40107>
3737
note: the lint level is defined here
38-
--> $DIR/future-incompatible-lint-group.rs:3:9
38+
--> $DIR/future-incompatible-lint-group.rs:5:9
3939
|
4040
LL | #![deny(future_incompatible)]
4141
| ^^^^^^^^^^^^^^^^^^^

tests/ui/impl-inherent-non-conflict.rs renamed to tests/ui/methods/inherent-methods-same-name.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,22 @@
1+
//! Test multiple inherent methods with same name on different type parameters
2+
13
//@ run-pass
24
// Ensure that a user-defined type admits multiple inherent methods
35
// with the same name, which can be called on values that have a
46
// precise enough type to allow distinguishing between the methods.
57

6-
78
struct Foo<T>(T);
89

910
impl Foo<usize> {
10-
fn bar(&self) -> i32 { self.0 as i32 }
11+
fn bar(&self) -> i32 {
12+
self.0 as i32
13+
}
1114
}
1215

1316
impl Foo<isize> {
14-
fn bar(&self) -> i32 { -(self.0 as i32) }
17+
fn bar(&self) -> i32 {
18+
-(self.0 as i32)
19+
}
1520
}
1621

1722
fn main() {

tests/ui/impl-not-adjacent-to-type.rs renamed to tests/ui/modules/impl-cross-module.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//! Test implementing methods for types defined in other modules
2+
13
//@ run-pass
24

35
mod foo {
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
//! Test global scope resolution with :: operator
2+
3+
//@ run-pass
4+
5+
pub fn f() -> isize {
6+
return 1;
7+
}
8+
9+
pub mod foo {
10+
pub fn f() -> isize {
11+
return 2;
12+
}
13+
pub fn g() {
14+
assert_eq!(f(), 2);
15+
assert_eq!(::f(), 1);
16+
}
17+
}
18+
19+
pub fn main() {
20+
return foo::g();
21+
}

0 commit comments

Comments
 (0)