Skip to content

Clean UI tests 4 of n #139995

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
5 changes: 0 additions & 5 deletions src/tools/tidy/src/issues.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1397,7 +1397,6 @@ ui/issues/auxiliary/issue-13620-1.rs
ui/issues/auxiliary/issue-13620-2.rs
ui/issues/auxiliary/issue-14344-1.rs
ui/issues/auxiliary/issue-14344-2.rs
ui/issues/auxiliary/issue-14421.rs
ui/issues/auxiliary/issue-14422.rs
ui/issues/auxiliary/issue-15562.rs
ui/issues/auxiliary/issue-16643.rs
Expand Down Expand Up @@ -1564,7 +1563,6 @@ ui/issues/issue-14366.rs
ui/issues/issue-14382.rs
ui/issues/issue-14393.rs
ui/issues/issue-14399.rs
ui/issues/issue-14421.rs
ui/issues/issue-14422.rs
ui/issues/issue-14541.rs
ui/issues/issue-14721.rs
Expand Down Expand Up @@ -1629,7 +1627,6 @@ ui/issues/issue-16774.rs
ui/issues/issue-16783.rs
ui/issues/issue-16819.rs
ui/issues/issue-16922-rpass.rs
ui/issues/issue-16939.rs
ui/issues/issue-16966.rs
ui/issues/issue-16994.rs
ui/issues/issue-17001.rs
Expand Down Expand Up @@ -1867,7 +1864,6 @@ ui/issues/issue-23550.rs
ui/issues/issue-23589.rs
ui/issues/issue-23699.rs
ui/issues/issue-2380-b.rs
ui/issues/issue-23808.rs
ui/issues/issue-2383.rs
ui/issues/issue-23891.rs
ui/issues/issue-23898.rs
Expand Down Expand Up @@ -2607,7 +2603,6 @@ ui/issues/issue-9249.rs
ui/issues/issue-9259.rs
ui/issues/issue-92741.rs
ui/issues/issue-9446.rs
ui/issues/issue-9719.rs
ui/issues/issue-9725.rs
ui/issues/issue-9737.rs
ui/issues/issue-9814.rs
Expand Down
2 changes: 1 addition & 1 deletion src/tools/tidy/src/ui_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 = 1631;
const ISSUES_ENTRY_LIMIT: u32 = 1626;

const EXPECTED_TEST_FILE_EXTENSIONS: &[&str] = &[
"rs", // test source files
Expand Down
10 changes: 10 additions & 0 deletions tests/ui/argument-suggestions/exotic-calls.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
//! Checks variations of E0057, which is the incorrect number of agruments passed into a closure

//@ check-fail

fn foo<T: Fn()>(t: T) {
t(1i32);
//~^ ERROR function takes 0 arguments but 1 argument was supplied
}

/// Regression test for <https://github.com/rust-lang/rust/issues/16939>
fn foo2<T: Fn()>(f: T) {
|t| f(t);
//~^ ERROR function takes 0 arguments but 1 argument was supplied
}

fn bar(t: impl Fn()) {
t(1i32);
//~^ ERROR function takes 0 arguments but 1 argument was supplied
Expand Down
35 changes: 26 additions & 9 deletions tests/ui/argument-suggestions/exotic-calls.stderr
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
error[E0057]: this function takes 0 arguments but 1 argument was supplied
--> $DIR/exotic-calls.rs:2:5
--> $DIR/exotic-calls.rs:6:5
|
LL | t(1i32);
| ^ ---- unexpected argument of type `i32`
|
note: callable defined here
--> $DIR/exotic-calls.rs:1:11
--> $DIR/exotic-calls.rs:5:11
|
LL | fn foo<T: Fn()>(t: T) {
| ^^^^
Expand All @@ -16,13 +16,30 @@ LL + t();
|

error[E0057]: this function takes 0 arguments but 1 argument was supplied
--> $DIR/exotic-calls.rs:7:5
--> $DIR/exotic-calls.rs:12:9
|
LL | |t| f(t);
| ^ - unexpected argument
|
note: callable defined here
--> $DIR/exotic-calls.rs:11:12
|
LL | fn foo2<T: Fn()>(f: T) {
| ^^^^
help: remove the extra argument
|
LL - |t| f(t);
LL + |t| f();
|

error[E0057]: this function takes 0 arguments but 1 argument was supplied
--> $DIR/exotic-calls.rs:17:5
|
LL | t(1i32);
| ^ ---- unexpected argument of type `i32`
|
note: type parameter defined here
--> $DIR/exotic-calls.rs:6:11
--> $DIR/exotic-calls.rs:16:11
|
LL | fn bar(t: impl Fn()) {
| ^^^^^^^^^
Expand All @@ -33,13 +50,13 @@ LL + t();
|

error[E0057]: this function takes 0 arguments but 1 argument was supplied
--> $DIR/exotic-calls.rs:16:5
--> $DIR/exotic-calls.rs:26:5
|
LL | baz()(1i32)
| ^^^^^ ---- unexpected argument of type `i32`
|
note: opaque type defined here
--> $DIR/exotic-calls.rs:11:13
--> $DIR/exotic-calls.rs:21:13
|
LL | fn baz() -> impl Fn() {
| ^^^^^^^^^
Expand All @@ -50,13 +67,13 @@ LL + baz()()
|

error[E0057]: this function takes 0 arguments but 1 argument was supplied
--> $DIR/exotic-calls.rs:22:5
--> $DIR/exotic-calls.rs:32:5
|
LL | x(1i32);
| ^ ---- unexpected argument of type `i32`
|
note: closure defined here
--> $DIR/exotic-calls.rs:21:13
--> $DIR/exotic-calls.rs:31:13
|
LL | let x = || {};
| ^^
Expand All @@ -66,6 +83,6 @@ LL - x(1i32);
LL + x();
|

error: aborting due to 4 previous errors
error: aborting due to 5 previous errors

For more information about this error, try `rustc --explain E0057`.
54 changes: 54 additions & 0 deletions tests/ui/codegen/ref-dyn-trait-in-structs-and-enums.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
//! Regression test for an LLVM assertion that used to be hit when:
//!
//! - There's a generic enum contained within a tuple struct
//! - When the tuple struct is parameterized by some lifetime `'a`
//! - The enum is concretized with its type argument being a reference to a trait object (of
//! lifetime `'a`)
//!
//! Issue: <https://github.com/rust-lang/rust/issues/9719>

//@ build-pass

// Dummy trait implemented for `isize` to use in the test cases
pub trait MyTrait {
fn dummy(&self) {}
}
impl MyTrait for isize {}

// `&dyn MyTrait` contained in enum variant
pub struct EnumRefDynTrait<'a>(Enum<&'a (dyn MyTrait + 'a)>);
pub enum Enum<T> {
Variant(T),
}

fn enum_dyn_trait() {
let x: isize = 42;
let y = EnumRefDynTrait(Enum::Variant(&x as &dyn MyTrait));
let _ = y;
}

// `&dyn MyTrait` contained behind `Option` in named field of struct
struct RefDynTraitNamed<'a> {
x: Option<&'a (dyn MyTrait + 'a)>,
}

fn named_option_dyn_trait() {
let x: isize = 42;
let y = RefDynTraitNamed { x: Some(&x as &dyn MyTrait) };
let _ = y;
}

// `&dyn MyTrait` contained behind `Option` in unnamed field of struct
pub struct RefDynTraitUnnamed<'a>(Option<&'a (dyn MyTrait + 'a)>);

fn unnamed_option_dyn_trait() {
let x: isize = 42;
let y = RefDynTraitUnnamed(Some(&x as &dyn MyTrait));
let _ = y;
}

pub fn main() {
enum_dyn_trait();
named_option_dyn_trait();
unnamed_option_dyn_trait();
}
25 changes: 0 additions & 25 deletions tests/ui/issues/auxiliary/issue-14421.rs

This file was deleted.

15 changes: 0 additions & 15 deletions tests/ui/issues/issue-14421.rs

This file was deleted.

8 changes: 0 additions & 8 deletions tests/ui/issues/issue-16939.rs

This file was deleted.

20 changes: 0 additions & 20 deletions tests/ui/issues/issue-16939.stderr

This file was deleted.

59 changes: 0 additions & 59 deletions tests/ui/issues/issue-23808.rs

This file was deleted.

40 changes: 0 additions & 40 deletions tests/ui/issues/issue-9719.rs

This file was deleted.

Loading
Loading