Skip to content

Commit 7e903f8

Browse files
authored
Rollup merge of #69842 - JohnTitor:more-tests, r=Centril
Add more regression tests Closes #54239 Closes #57200 Closes #57201 Closes #60473 Closes #64620 Closes #67166 r? @Centril
2 parents 2677d59 + ef98ec0 commit 7e903f8

11 files changed

+131
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Regression test for #54239, shouldn't trigger lint.
2+
// check-pass
3+
// edition:2018
4+
5+
#![deny(missing_debug_implementations)]
6+
7+
struct DontLookAtMe(i32);
8+
9+
async fn secret() -> DontLookAtMe {
10+
DontLookAtMe(41)
11+
}
12+
13+
pub async fn looking() -> i32 { // Shouldn't trigger lint here.
14+
secret().await.0
15+
}
16+
17+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// Regression test for #64620
2+
3+
#![feature(generators)]
4+
5+
pub fn crash(arr: [usize; 1]) {
6+
yield arr[0]; //~ ERROR: yield expression outside of generator literal
7+
}
8+
9+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
error[E0627]: yield expression outside of generator literal
2+
--> $DIR/issue-64620-yield-array-element.rs:6:5
3+
|
4+
LL | yield arr[0];
5+
| ^^^^^^^^^^^^
6+
7+
error: aborting due to previous error
8+
9+
For more information about this error, try `rustc --explain E0627`.

src/test/ui/impl-trait/issue-57200.rs

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Regression test for #57200
2+
// FIXME: The error is temporary hack, we'll revisit here at some point.
3+
4+
#![feature(impl_trait_in_bindings)]
5+
#![allow(incomplete_features)]
6+
7+
fn bug<'a, 'b, T>()
8+
where
9+
'a: 'b,
10+
{
11+
let f: impl Fn(&'a T) -> &'b T = |x| x;
12+
//~^ ERROR: lifetimes in impl Trait types in bindings are not currently supported
13+
}
14+
15+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
error: lifetimes in impl Trait types in bindings are not currently supported
2+
--> $DIR/issue-57200.rs:11:12
3+
|
4+
LL | let f: impl Fn(&'a T) -> &'b T = |x| x;
5+
| ^^^^^^^^^^^^^^^^^^^^^^^
6+
7+
error: aborting due to previous error
8+

src/test/ui/impl-trait/issue-57201.rs

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Regression test for #57201
2+
// FIXME: The error is temporary hack, we'll revisit here at some point.
3+
4+
#![feature(impl_trait_in_bindings)]
5+
#![allow(incomplete_features)]
6+
7+
fn bug<'a, 'b, T>()
8+
where
9+
'a: 'b,
10+
{
11+
let f: &impl Fn(&'a T) -> &'b T = &|x| x;
12+
//~^ ERROR: lifetimes in impl Trait types in bindings are not currently supported
13+
}
14+
15+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
error: lifetimes in impl Trait types in bindings are not currently supported
2+
--> $DIR/issue-57201.rs:11:13
3+
|
4+
LL | let f: &impl Fn(&'a T) -> &'b T = &|x| x;
5+
| ^^^^^^^^^^^^^^^^^^^^^^^
6+
7+
error: aborting due to previous error
8+

src/test/ui/impl-trait/issue-60473.rs

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Regression test for #60473
2+
3+
#![feature(impl_trait_in_bindings)]
4+
#![allow(incomplete_features)]
5+
6+
struct A<'a>(&'a ());
7+
8+
trait Trait<T> {
9+
}
10+
11+
impl<T> Trait<T> for () {
12+
}
13+
14+
fn main() {
15+
let x: impl Trait<A> = (); // FIXME: The error doesn't seem correct.
16+
//~^ ERROR: opaque type expands to a recursive type
17+
}
+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
error[E0720]: opaque type expands to a recursive type
2+
--> $DIR/issue-60473.rs:15:12
3+
|
4+
LL | let x: impl Trait<A> = (); // FIXME: The error doesn't seem correct.
5+
| ^^^^^^^^^^^^^ expands to a recursive type
6+
|
7+
= note: type resolves to itself
8+
9+
error: aborting due to previous error
10+
11+
For more information about this error, try `rustc --explain E0720`.

src/test/ui/impl-trait/issue-67166.rs

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// Regression test for #67166
2+
3+
#![feature(impl_trait_in_bindings)]
4+
#![allow(incomplete_features)]
5+
6+
pub fn run() {
7+
let _foo: Box<impl Copy + '_> = Box::new(()); // FIXME: The error doesn't much make sense.
8+
//~^ ERROR: opaque type expands to a recursive type
9+
}
10+
11+
fn main() {}
+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
error[E0720]: opaque type expands to a recursive type
2+
--> $DIR/issue-67166.rs:7:19
3+
|
4+
LL | let _foo: Box<impl Copy + '_> = Box::new(()); // FIXME: The error doesn't much make sense.
5+
| ^^^^^^^^^^^^^^ expands to a recursive type
6+
|
7+
= note: type resolves to itself
8+
9+
error: aborting due to previous error
10+
11+
For more information about this error, try `rustc --explain E0720`.

0 commit comments

Comments
 (0)