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
26 changes: 0 additions & 26 deletions tests/ui/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,6 @@ See [Tracking Issue for autodiff #124509](https://github.com/rust-lang/rust/issu

Tests for automatic referencing and dereferencing behavior, such as automatically adding reference operations (`&` or `&mut`) to make a value match a method's receiver type. Sometimes abbreviated as "auto-ref" or "auto-deref".

## `tests/ui/auxiliary/`: Auxiliary files for tests directly under `tests/ui`.

This top-level `auxiliary` subdirectory contains support files for tests immediately under `tests/ui/`.

**FIXME(#133895)**: tests immediately under `tests/ui/` should be rehomed to more suitable subdirectories, after which this subdirectory can be removed.

## `tests/ui/backtrace/`: Backtraces

Runtime panics and error handling generate backtraces to assist in debugging and diagnostics.
Expand Down Expand Up @@ -542,12 +536,6 @@ These tests are about very different topics, only unified by the fact that they

Accompanies `tests/ui/error-codes/`, exercises the `--explain` cli flag.

## `tests/ui/explicit/`: Errors involving the concept of "explicit"

This category contains three tests: two which are about the specific error `explicit use of destructor method`, and one which is about explicit annotation of lifetimes: https://doc.rust-lang.org/stable/rust-by-example/scope/lifetime/explicit.html.

**FIXME**: Rehome the two tests about the destructor method with `drop`-related categories, and rehome the last test with a category related to lifetimes.

## `tests/ui/explicit-tail-calls/`

Exercises `#![feature(explicit_tail_calls)]` and the `become` keyword. See [Explicit Tail Calls #3407](https://github.com/rust-lang/rfcs/pull/3407).
Expand Down Expand Up @@ -733,10 +721,6 @@ See [Instrument coverage | The rustc book](https://doc.rust-lang.org/rustc/instr

See [Tracking issue for `-Z instrument-xray` #102921](https://github.com/rust-lang/rust/issues/102921).

## `tests/ui/interior-mutability/`

**FIXME**: contains a single test, probably better rehomed.

## `tests/ui/internal/`

Tests for `internal_unstable` and the attribute header `#![feature(allow_internal_unstable)]`, which lets compiler developers mark features as internal to the compiler, and unstable for standard library use.
Expand All @@ -759,16 +743,6 @@ Various tests related to rejecting invalid inputs.

Tests for checking that invalid usage of compiler flags are rejected.

## `tests/ui/invalid-module-declaration/`

**FIXME**: Consider merging into module/resolve directories.

## `tests/ui/invalid-self-argument/`: `self` as a function argument incorrectly

Tests with erroneous ways of using `self`, such as having it not be the first argument, or using it in a non-associated function (no `impl` or `trait`).

**FIXME**: Maybe merge with `ui/self`.

## `tests/ui/io-checks/`

Contains a single test. The test tries to output a file into an invalid directory with `-o`, then checks that the result is an error, not an internal compiler error.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//@ run-rustfix
struct Foo {
x: isize
x: isize,
}

impl Drop for Foo {
Expand All @@ -12,5 +12,5 @@ impl Drop for Foo {
fn main() {
let x = Foo { x: 3 };
println!("{}", x.x);
drop(x); //~ ERROR explicit use of destructor method
drop(x); //~ ERROR explicit use of destructor method
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//@ run-rustfix
struct Foo {
x: isize
x: isize,
}

impl Drop for Foo {
Expand All @@ -12,5 +12,5 @@ impl Drop for Foo {
fn main() {
let x = Foo { x: 3 };
println!("{}", x.x);
x.drop(); //~ ERROR explicit use of destructor method
x.drop(); //~ ERROR explicit use of destructor method
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#![allow(dropping_references)]

struct Foo {
x: isize
x: isize,
}

#[allow(drop_bounds)]
Expand All @@ -20,7 +20,7 @@ impl Drop for Foo {

impl Bar for Foo {
fn blah(&self) {
drop(self); //~ ERROR explicit use of destructor method
drop(self); //~ ERROR explicit use of destructor method
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#![allow(dropping_references)]

struct Foo {
x: isize
x: isize,
}

#[allow(drop_bounds)]
Expand All @@ -20,7 +20,7 @@ impl Drop for Foo {

impl Bar for Foo {
fn blah(&self) {
self.drop(); //~ ERROR explicit use of destructor method
self.drop(); //~ ERROR explicit use of destructor method
}
}

Expand Down
22 changes: 0 additions & 22 deletions tests/ui/explicit/explicit-self-lifetime-mismatch.rs

This file was deleted.

41 changes: 0 additions & 41 deletions tests/ui/explicit/explicit-self-lifetime-mismatch.stderr

This file was deleted.

1 change: 0 additions & 1 deletion tests/ui/invalid-module-declaration/auxiliary/foo/bar.rs

This file was deleted.

1 change: 0 additions & 1 deletion tests/ui/invalid-module-declaration/auxiliary/foo/mod.rs

This file was deleted.

This file was deleted.

This file was deleted.

6 changes: 0 additions & 6 deletions tests/ui/invalid-self-argument/bare-fn-start.rs

This file was deleted.

10 changes: 0 additions & 10 deletions tests/ui/invalid-self-argument/bare-fn-start.stderr

This file was deleted.

5 changes: 0 additions & 5 deletions tests/ui/invalid-self-argument/bare-fn.rs

This file was deleted.

8 changes: 0 additions & 8 deletions tests/ui/invalid-self-argument/bare-fn.stderr

This file was deleted.

11 changes: 0 additions & 11 deletions tests/ui/invalid-self-argument/trait-fn.rs

This file was deleted.

8 changes: 0 additions & 8 deletions tests/ui/invalid-self-argument/trait-fn.stderr

This file was deleted.

20 changes: 0 additions & 20 deletions tests/ui/issues/issue-17740.rs

This file was deleted.

41 changes: 0 additions & 41 deletions tests/ui/issues/issue-17740.stderr

This file was deleted.

41 changes: 41 additions & 0 deletions tests/ui/lifetimes/explicit-self-lifetime-mismatch.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
//@ dont-require-annotations: NOTE
//! regression test for <https://github.com/rust-lang/rust/issues/17740>
struct Foo<'a, 'b> {
x: &'a isize,
y: &'b isize,
}

impl<'a, 'b> Foo<'a, 'b> {
fn bar(
self: Foo<'b, 'a>,
//~^ ERROR mismatched `self` parameter type
//~| NOTE expected struct `Foo<'a, 'b>`
//~| NOTE found struct `Foo<'b, 'a>`
//~| NOTE lifetime mismatch
//~| ERROR mismatched `self` parameter type
//~| NOTE expected struct `Foo<'a, 'b>`
//~| NOTE found struct `Foo<'b, 'a>`
//~| NOTE lifetime mismatch
) {
}
}

struct Bar<'a> {
data: &'a [u8],
}

impl<'a> Bar<'a> {
fn bar(self: &mut Bar) {
//~^ ERROR mismatched `self` parameter type
//~| NOTE expected struct `Bar<'a>`
//~| NOTE found struct `Bar<'_>`
//~| NOTE lifetime mismatch
//~| ERROR mismatched `self` parameter type
//~| NOTE expected struct `Bar<'a>`
//~| NOTE found struct `Bar<'_>`
//~| NOTE lifetime mismatch
}
Comment on lines +24 to +38
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I merged tests/ui/issues/issue-17740.rs with tests/ui/lifetimes/explicit-self-lifetime-mismatch.rs to organize them. Is that okay? If you think it's unnecessary, I'll revert it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, no need to revert, moving tests out of tests/ui/issues is always welcome, this directory is a total mess and must be removed as a long term plan (there is 500+ tests remains or something, haven't visited this one for a while)

}

fn main() {}
Loading
Loading