Skip to content

Commit 8888488

Browse files
authored
Rollup merge of #140205 - reddevilmidzy:clean-up-test, r=jieyouxu
Tidying up UI tests [2/N] Part of #133895 Moved the location of the tests that were in `tests/ui` and added descriptions! I'll squash before merge! r? jieyouxu
2 parents 7f27d16 + db2a73e commit 8888488

11 files changed

+44
-41
lines changed

tests/ui/copy-a-resource.rs

-21
This file was deleted.
File renamed without changes.

tests/ui/fail-simple.stderr renamed to tests/ui/macros/no-matching-rule.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: no rules expected `@`
2-
--> $DIR/fail-simple.rs:2:12
2+
--> $DIR/no-matching-rule.rs:2:12
33
|
44
LL | panic!(@);
55
| ^ no rules expected this token in macro call

tests/ui/methods/clone-missing.rs

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// This test checks that calling `.clone()` on a type that does not implement the `Clone` trait
2+
// results in a compilation error. The `Foo` struct does not derive or implement `Clone`,
3+
// so attempting to clone it should fail.
4+
5+
struct Foo {
6+
i: isize,
7+
}
8+
9+
fn foo(i:isize) -> Foo {
10+
Foo {
11+
i: i
12+
}
13+
}
14+
15+
fn main() {
16+
let x = foo(10);
17+
let _y = x.clone();
18+
//~^ ERROR no method named `clone` found
19+
}

tests/ui/copy-a-resource.stderr renamed to tests/ui/methods/clone-missing.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0599]: no method named `clone` found for struct `Foo` in the current scope
2-
--> $DIR/copy-a-resource.rs:18:16
2+
--> $DIR/clone-missing.rs:17:16
33
|
44
LL | struct Foo {
55
| ---------- method `clone` not found for this struct

tests/ui/modules/mod-pub-access.rs

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
//@ run-pass
2+
// This is a name resolution smoke test that ensures paths with more than one
3+
// segment (e.g., `foo::bar`) resolve correctly.
4+
// It also serves as a basic visibility test — confirming that a `pub` item
5+
// inside a private module can still be accessed from outside that module.
6+
7+
mod foo {
8+
pub fn bar(_offset: usize) {}
9+
}
10+
11+
fn main() { foo::bar(0); }

tests/ui/path.rs

-7
This file was deleted.

tests/ui/capture1.stderr renamed to tests/ui/resolve/fn-item-cant-capture-dynamic-env.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0434]: can't capture dynamic environment in a fn item
2-
--> $DIR/capture1.rs:3:32
2+
--> $DIR/fn-item-cant-capture-dynamic-env.rs:3:32
33
|
44
LL | fn foo() -> isize { return bar; }
55
| ^^^

tests/ui/type-alias/type-param.rs

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
//@ run-pass
2+
// This is a smoke test to ensure that type aliases with type parameters
3+
// are accepted by the compiler and that the parameters are correctly
4+
// resolved in the aliased item type.
5+
6+
#![allow(dead_code)]
7+
8+
type Foo<T> = extern "C" fn(T) -> bool;
9+
type Bar<T> = fn(T) -> bool;
10+
11+
fn main() {}

tests/ui/type-param.rs

-10
This file was deleted.

0 commit comments

Comments
 (0)