-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Add more regression tests #69842
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
Merged
Merged
Add more regression tests #69842
Changes from 6 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
af0c44c
Add test for issue-54239
JohnTitor fc8be08
Add test for issue-57200
JohnTitor 437c07f
Add test for issue-57201
JohnTitor 0005f29
Add test for issue-60473
JohnTitor 95d4785
Add test for issue-64620
JohnTitor 579ce86
Add test for issue-67166
JohnTitor ef98ec0
Add FIXMEs
JohnTitor File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
src/test/ui/async-await/issue-54239-private-type-triggers-lint.rs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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() {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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() {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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`. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// Regression test for #57200 | ||
|
||
#![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() {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
error: lifetimes in impl Trait types in bindings are not currently supported | ||
--> $DIR/issue-57200.rs:10:12 | ||
| | ||
LL | let f: impl Fn(&'a T) -> &'b T = |x| x; | ||
| ^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to previous error | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// Regression test for #57201 | ||
JohnTitor marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
#![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() {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
error: lifetimes in impl Trait types in bindings are not currently supported | ||
--> $DIR/issue-57201.rs:10:13 | ||
| | ||
LL | let f: &impl Fn(&'a T) -> &'b T = &|x| x; | ||
| ^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to previous error | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// 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> = (); //~ ERROR: opaque type expands to a recursive type | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
error[E0720]: opaque type expands to a recursive type | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This doesn't look correct to me, please leave a FIXME to revaluate. |
||
--> $DIR/issue-60473.rs:15:12 | ||
| | ||
LL | let x: impl Trait<A> = (); | ||
| ^^^^^^^^^^^^^ 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`. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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(()); | ||
//~^ ERROR: opaque type expands to a recursive type | ||
} | ||
|
||
fn main() {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
error[E0720]: opaque type expands to a recursive type | ||
JohnTitor marked this conversation as resolved.
Show resolved
Hide resolved
|
||
--> $DIR/issue-67166.rs:7:19 | ||
| | ||
LL | let _foo: Box<impl Copy + '_> = Box::new(()); | ||
| ^^^^^^^^^^^^^^ 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`. |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.