Skip to content

Commit 3eaa4b9

Browse files
committed
Cleaned up 4 tests in tests/ui/issues
1 parent 38c560a commit 3eaa4b9

14 files changed

+202
-182
lines changed

Diff for: src/tools/tidy/src/issues.txt

-5
Original file line numberDiff line numberDiff line change
@@ -1397,7 +1397,6 @@ ui/issues/auxiliary/issue-13620-1.rs
13971397
ui/issues/auxiliary/issue-13620-2.rs
13981398
ui/issues/auxiliary/issue-14344-1.rs
13991399
ui/issues/auxiliary/issue-14344-2.rs
1400-
ui/issues/auxiliary/issue-14421.rs
14011400
ui/issues/auxiliary/issue-14422.rs
14021401
ui/issues/auxiliary/issue-15562.rs
14031402
ui/issues/auxiliary/issue-16643.rs
@@ -1564,7 +1563,6 @@ ui/issues/issue-14366.rs
15641563
ui/issues/issue-14382.rs
15651564
ui/issues/issue-14393.rs
15661565
ui/issues/issue-14399.rs
1567-
ui/issues/issue-14421.rs
15681566
ui/issues/issue-14422.rs
15691567
ui/issues/issue-14541.rs
15701568
ui/issues/issue-14721.rs
@@ -1629,7 +1627,6 @@ ui/issues/issue-16774.rs
16291627
ui/issues/issue-16783.rs
16301628
ui/issues/issue-16819.rs
16311629
ui/issues/issue-16922-rpass.rs
1632-
ui/issues/issue-16939.rs
16331630
ui/issues/issue-16966.rs
16341631
ui/issues/issue-16994.rs
16351632
ui/issues/issue-17001.rs
@@ -1867,7 +1864,6 @@ ui/issues/issue-23550.rs
18671864
ui/issues/issue-23589.rs
18681865
ui/issues/issue-23699.rs
18691866
ui/issues/issue-2380-b.rs
1870-
ui/issues/issue-23808.rs
18711867
ui/issues/issue-2383.rs
18721868
ui/issues/issue-23891.rs
18731869
ui/issues/issue-23898.rs
@@ -2607,7 +2603,6 @@ ui/issues/issue-9249.rs
26072603
ui/issues/issue-9259.rs
26082604
ui/issues/issue-92741.rs
26092605
ui/issues/issue-9446.rs
2610-
ui/issues/issue-9719.rs
26112606
ui/issues/issue-9725.rs
26122607
ui/issues/issue-9737.rs
26132608
ui/issues/issue-9814.rs

Diff for: src/tools/tidy/src/ui_tests.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use ignore::Walk;
1717
const ENTRY_LIMIT: u32 = 901;
1818
// FIXME: The following limits should be reduced eventually.
1919

20-
const ISSUES_ENTRY_LIMIT: u32 = 1631;
20+
const ISSUES_ENTRY_LIMIT: u32 = 1626;
2121

2222
const EXPECTED_TEST_FILE_EXTENSIONS: &[&str] = &[
2323
"rs", // test source files

Diff for: tests/ui/argument-suggestions/exotic-calls.rs

+10
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,18 @@
1+
//! Checks variations of E0057, which is the incorrect number of agruments passed into a closure
2+
3+
//@ check-fail
4+
15
fn foo<T: Fn()>(t: T) {
26
t(1i32);
37
//~^ ERROR function takes 0 arguments but 1 argument was supplied
48
}
59

10+
/// Regression test for <https://github.com/rust-lang/rust/issues/16939>
11+
fn foo2<T: Fn()>(f: T) {
12+
|t| f(t);
13+
//~^ ERROR function takes 0 arguments but 1 argument was supplied
14+
}
15+
616
fn bar(t: impl Fn()) {
717
t(1i32);
818
//~^ ERROR function takes 0 arguments but 1 argument was supplied

Diff for: tests/ui/argument-suggestions/exotic-calls.stderr

+26-9
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
error[E0057]: this function takes 0 arguments but 1 argument was supplied
2-
--> $DIR/exotic-calls.rs:2:5
2+
--> $DIR/exotic-calls.rs:6:5
33
|
44
LL | t(1i32);
55
| ^ ---- unexpected argument of type `i32`
66
|
77
note: callable defined here
8-
--> $DIR/exotic-calls.rs:1:11
8+
--> $DIR/exotic-calls.rs:5:11
99
|
1010
LL | fn foo<T: Fn()>(t: T) {
1111
| ^^^^
@@ -16,13 +16,30 @@ LL + t();
1616
|
1717

1818
error[E0057]: this function takes 0 arguments but 1 argument was supplied
19-
--> $DIR/exotic-calls.rs:7:5
19+
--> $DIR/exotic-calls.rs:12:9
20+
|
21+
LL | |t| f(t);
22+
| ^ - unexpected argument
23+
|
24+
note: callable defined here
25+
--> $DIR/exotic-calls.rs:11:12
26+
|
27+
LL | fn foo2<T: Fn()>(f: T) {
28+
| ^^^^
29+
help: remove the extra argument
30+
|
31+
LL - |t| f(t);
32+
LL + |t| f();
33+
|
34+
35+
error[E0057]: this function takes 0 arguments but 1 argument was supplied
36+
--> $DIR/exotic-calls.rs:17:5
2037
|
2138
LL | t(1i32);
2239
| ^ ---- unexpected argument of type `i32`
2340
|
2441
note: type parameter defined here
25-
--> $DIR/exotic-calls.rs:6:11
42+
--> $DIR/exotic-calls.rs:16:11
2643
|
2744
LL | fn bar(t: impl Fn()) {
2845
| ^^^^^^^^^
@@ -33,13 +50,13 @@ LL + t();
3350
|
3451

3552
error[E0057]: this function takes 0 arguments but 1 argument was supplied
36-
--> $DIR/exotic-calls.rs:16:5
53+
--> $DIR/exotic-calls.rs:26:5
3754
|
3855
LL | baz()(1i32)
3956
| ^^^^^ ---- unexpected argument of type `i32`
4057
|
4158
note: opaque type defined here
42-
--> $DIR/exotic-calls.rs:11:13
59+
--> $DIR/exotic-calls.rs:21:13
4360
|
4461
LL | fn baz() -> impl Fn() {
4562
| ^^^^^^^^^
@@ -50,13 +67,13 @@ LL + baz()()
5067
|
5168

5269
error[E0057]: this function takes 0 arguments but 1 argument was supplied
53-
--> $DIR/exotic-calls.rs:22:5
70+
--> $DIR/exotic-calls.rs:32:5
5471
|
5572
LL | x(1i32);
5673
| ^ ---- unexpected argument of type `i32`
5774
|
5875
note: closure defined here
59-
--> $DIR/exotic-calls.rs:21:13
76+
--> $DIR/exotic-calls.rs:31:13
6077
|
6178
LL | let x = || {};
6279
| ^^
@@ -66,6 +83,6 @@ LL - x(1i32);
6683
LL + x();
6784
|
6885

69-
error: aborting due to 4 previous errors
86+
error: aborting due to 5 previous errors
7087

7188
For more information about this error, try `rustc --explain E0057`.
+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
//! Regression test for an LLVM assertion that used to be hit when:
2+
//!
3+
//! - There's a generic enum contained within a tuple struct
4+
//! - When the tuple struct is parameterized by some lifetime `'a`
5+
//! - The enum is concretized with its type argument being a reference to a trait object (of
6+
//! lifetime `'a`)
7+
//!
8+
//! Issue: <https://github.com/rust-lang/rust/issues/9719>
9+
10+
//@ build-pass
11+
12+
// Dummy trait implemented for `isize` to use in the test cases
13+
pub trait MyTrait {
14+
fn dummy(&self) {}
15+
}
16+
impl MyTrait for isize {}
17+
18+
// `&dyn MyTrait` contained in enum variant
19+
pub struct EnumRefDynTrait<'a>(Enum<&'a (dyn MyTrait + 'a)>);
20+
pub enum Enum<T> {
21+
Variant(T),
22+
}
23+
24+
fn enum_dyn_trait() {
25+
let x: isize = 42;
26+
let y = EnumRefDynTrait(Enum::Variant(&x as &dyn MyTrait));
27+
let _ = y;
28+
}
29+
30+
// `&dyn MyTrait` contained behind `Option` in named field of struct
31+
struct RefDynTraitNamed<'a> {
32+
x: Option<&'a (dyn MyTrait + 'a)>,
33+
}
34+
35+
fn named_option_dyn_trait() {
36+
let x: isize = 42;
37+
let y = RefDynTraitNamed { x: Some(&x as &dyn MyTrait) };
38+
let _ = y;
39+
}
40+
41+
// `&dyn MyTrait` contained behind `Option` in unnamed field of struct
42+
pub struct RefDynTraitUnnamed<'a>(Option<&'a (dyn MyTrait + 'a)>);
43+
44+
fn unnamed_option_dyn_trait() {
45+
let x: isize = 42;
46+
let y = RefDynTraitUnnamed(Some(&x as &dyn MyTrait));
47+
let _ = y;
48+
}
49+
50+
pub fn main() {
51+
enum_dyn_trait();
52+
named_option_dyn_trait();
53+
unnamed_option_dyn_trait();
54+
}

Diff for: tests/ui/issues/auxiliary/issue-14421.rs

-25
This file was deleted.

Diff for: tests/ui/issues/issue-14421.rs

-15
This file was deleted.

Diff for: tests/ui/issues/issue-16939.rs

-8
This file was deleted.

Diff for: tests/ui/issues/issue-16939.stderr

-20
This file was deleted.

Diff for: tests/ui/issues/issue-23808.rs

-59
This file was deleted.

Diff for: tests/ui/issues/issue-9719.rs

-40
This file was deleted.

0 commit comments

Comments
 (0)