Skip to content

Tidying up UI tests [2/N] #140205

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 25, 2025
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
21 changes: 0 additions & 21 deletions tests/ui/copy-a-resource.rs

This file was deleted.

File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error: no rules expected `@`
--> $DIR/fail-simple.rs:2:12
--> $DIR/no-matching-rule.rs:2:12
|
LL | panic!(@);
| ^ no rules expected this token in macro call
Expand Down
19 changes: 19 additions & 0 deletions tests/ui/methods/clone-missing.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// This test checks that calling `.clone()` on a type that does not implement the `Clone` trait
// results in a compilation error. The `Foo` struct does not derive or implement `Clone`,
// so attempting to clone it should fail.

struct Foo {
i: isize,
}

fn foo(i:isize) -> Foo {
Foo {
i: i
}
}

fn main() {
let x = foo(10);
let _y = x.clone();
//~^ ERROR no method named `clone` found
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0599]: no method named `clone` found for struct `Foo` in the current scope
--> $DIR/copy-a-resource.rs:18:16
--> $DIR/clone-missing.rs:17:16
|
LL | struct Foo {
| ---------- method `clone` not found for this struct
Expand Down
11 changes: 11 additions & 0 deletions tests/ui/modules/mod-pub-access.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
//@ run-pass
// This is a name resolution smoke test that ensures paths with more than one
// segment (e.g., `foo::bar`) resolve correctly.
// It also serves as a basic visibility test — confirming that a `pub` item
// inside a private module can still be accessed from outside that module.

mod foo {
pub fn bar(_offset: usize) {}
}

fn main() { foo::bar(0); }
7 changes: 0 additions & 7 deletions tests/ui/path.rs

This file was deleted.

File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0434]: can't capture dynamic environment in a fn item
--> $DIR/capture1.rs:3:32
--> $DIR/fn-item-cant-capture-dynamic-env.rs:3:32
|
LL | fn foo() -> isize { return bar; }
| ^^^
Expand Down
11 changes: 11 additions & 0 deletions tests/ui/type-alias/type-param.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
//@ run-pass
// This is a smoke test to ensure that type aliases with type parameters
// are accepted by the compiler and that the parameters are correctly
// resolved in the aliased item type.

#![allow(dead_code)]

type Foo<T> = extern "C" fn(T) -> bool;
type Bar<T> = fn(T) -> bool;

fn main() {}
10 changes: 0 additions & 10 deletions tests/ui/type-param.rs

This file was deleted.

Loading