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
This commit is contained in:
commit
7e903f82ff
@ -0,0 +1,17 @@
|
||||
// Regression test for #54239, shouldn't trigger lint.
|
||||
// check-pass
|
||||
// edition:2018
|
||||
|
||||
#![deny(missing_debug_implementations)]
|
||||
|
||||
struct DontLookAtMe(i32);
|
||||
|
||||
async fn secret() -> DontLookAtMe {
|
||||
DontLookAtMe(41)
|
||||
}
|
||||
|
||||
pub async fn looking() -> i32 { // Shouldn't trigger lint here.
|
||||
secret().await.0
|
||||
}
|
||||
|
||||
fn main() {}
|
9
src/test/ui/generator/issue-64620-yield-array-element.rs
Normal file
9
src/test/ui/generator/issue-64620-yield-array-element.rs
Normal file
@ -0,0 +1,9 @@
|
||||
// Regression test for #64620
|
||||
|
||||
#![feature(generators)]
|
||||
|
||||
pub fn crash(arr: [usize; 1]) {
|
||||
yield arr[0]; //~ ERROR: yield expression outside of generator literal
|
||||
}
|
||||
|
||||
fn main() {}
|
@ -0,0 +1,9 @@
|
||||
error[E0627]: yield expression outside of generator literal
|
||||
--> $DIR/issue-64620-yield-array-element.rs:6:5
|
||||
|
|
||||
LL | yield arr[0];
|
||||
| ^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0627`.
|
15
src/test/ui/impl-trait/issue-57200.rs
Normal file
15
src/test/ui/impl-trait/issue-57200.rs
Normal file
@ -0,0 +1,15 @@
|
||||
// Regression test for #57200
|
||||
// FIXME: The error is temporary hack, we'll revisit here at some point.
|
||||
|
||||
#![feature(impl_trait_in_bindings)]
|
||||
#![allow(incomplete_features)]
|
||||
|
||||
fn bug<'a, 'b, T>()
|
||||
where
|
||||
'a: 'b,
|
||||
{
|
||||
let f: impl Fn(&'a T) -> &'b T = |x| x;
|
||||
//~^ ERROR: lifetimes in impl Trait types in bindings are not currently supported
|
||||
}
|
||||
|
||||
fn main() {}
|
8
src/test/ui/impl-trait/issue-57200.stderr
Normal file
8
src/test/ui/impl-trait/issue-57200.stderr
Normal file
@ -0,0 +1,8 @@
|
||||
error: lifetimes in impl Trait types in bindings are not currently supported
|
||||
--> $DIR/issue-57200.rs:11:12
|
||||
|
|
||||
LL | let f: impl Fn(&'a T) -> &'b T = |x| x;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to previous error
|
||||
|
15
src/test/ui/impl-trait/issue-57201.rs
Normal file
15
src/test/ui/impl-trait/issue-57201.rs
Normal file
@ -0,0 +1,15 @@
|
||||
// Regression test for #57201
|
||||
// FIXME: The error is temporary hack, we'll revisit here at some point.
|
||||
|
||||
#![feature(impl_trait_in_bindings)]
|
||||
#![allow(incomplete_features)]
|
||||
|
||||
fn bug<'a, 'b, T>()
|
||||
where
|
||||
'a: 'b,
|
||||
{
|
||||
let f: &impl Fn(&'a T) -> &'b T = &|x| x;
|
||||
//~^ ERROR: lifetimes in impl Trait types in bindings are not currently supported
|
||||
}
|
||||
|
||||
fn main() {}
|
8
src/test/ui/impl-trait/issue-57201.stderr
Normal file
8
src/test/ui/impl-trait/issue-57201.stderr
Normal file
@ -0,0 +1,8 @@
|
||||
error: lifetimes in impl Trait types in bindings are not currently supported
|
||||
--> $DIR/issue-57201.rs:11:13
|
||||
|
|
||||
LL | let f: &impl Fn(&'a T) -> &'b T = &|x| x;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to previous error
|
||||
|
17
src/test/ui/impl-trait/issue-60473.rs
Normal file
17
src/test/ui/impl-trait/issue-60473.rs
Normal file
@ -0,0 +1,17 @@
|
||||
// Regression test for #60473
|
||||
|
||||
#![feature(impl_trait_in_bindings)]
|
||||
#![allow(incomplete_features)]
|
||||
|
||||
struct A<'a>(&'a ());
|
||||
|
||||
trait Trait<T> {
|
||||
}
|
||||
|
||||
impl<T> Trait<T> for () {
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let x: impl Trait<A> = (); // FIXME: The error doesn't seem correct.
|
||||
//~^ ERROR: opaque type expands to a recursive type
|
||||
}
|
11
src/test/ui/impl-trait/issue-60473.stderr
Normal file
11
src/test/ui/impl-trait/issue-60473.stderr
Normal file
@ -0,0 +1,11 @@
|
||||
error[E0720]: opaque type expands to a recursive type
|
||||
--> $DIR/issue-60473.rs:15:12
|
||||
|
|
||||
LL | let x: impl Trait<A> = (); // FIXME: The error doesn't seem correct.
|
||||
| ^^^^^^^^^^^^^ expands to a recursive type
|
||||
|
|
||||
= note: type resolves to itself
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0720`.
|
11
src/test/ui/impl-trait/issue-67166.rs
Normal file
11
src/test/ui/impl-trait/issue-67166.rs
Normal file
@ -0,0 +1,11 @@
|
||||
// Regression test for #67166
|
||||
|
||||
#![feature(impl_trait_in_bindings)]
|
||||
#![allow(incomplete_features)]
|
||||
|
||||
pub fn run() {
|
||||
let _foo: Box<impl Copy + '_> = Box::new(()); // FIXME: The error doesn't much make sense.
|
||||
//~^ ERROR: opaque type expands to a recursive type
|
||||
}
|
||||
|
||||
fn main() {}
|
11
src/test/ui/impl-trait/issue-67166.stderr
Normal file
11
src/test/ui/impl-trait/issue-67166.stderr
Normal file
@ -0,0 +1,11 @@
|
||||
error[E0720]: opaque type expands to a recursive type
|
||||
--> $DIR/issue-67166.rs:7:19
|
||||
|
|
||||
LL | let _foo: Box<impl Copy + '_> = Box::new(()); // FIXME: The error doesn't much make sense.
|
||||
| ^^^^^^^^^^^^^^ expands to a recursive type
|
||||
|
|
||||
= note: type resolves to itself
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0720`.
|
Loading…
x
Reference in New Issue
Block a user