Skip to content
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

Clean up some bad UI testing annotations #114830

Merged
merged 1 commit into from
Aug 15, 2023
Merged
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
1 change: 0 additions & 1 deletion tests/ui/generic-associated-types/issue-86218.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ trait Yay<AdditionalValue> {

impl<'a> Yay<&'a ()> for () {
type InnerStream<'s> = impl Stream<Item = i32> + 's;
//^ ERROR does not fulfill the required lifetime
fn foo<'s>() -> Self::InnerStream<'s> {
()
}
Expand Down
1 change: 0 additions & 1 deletion tests/ui/generic-associated-types/issue-90014-tait.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ struct Foo<'a>(&'a mut ());

impl Foo<'_> {
type Fut<'a> = impl Future<Output = ()>;
//^ ERROR: the type `&mut ()` does not fulfill the required lifetime
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure that removing these is the right call? Whoever added them probably intended the error to be shown...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test is marked as a known-bug, which doesn't allow error annotations anyways


fn make_fut<'a>(&'a self) -> Self::Fut<'a> {
async { () }
Expand Down
8 changes: 4 additions & 4 deletions tests/ui/generic-associated-types/issue-90014-tait.stderr
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
error[E0308]: mismatched types
--> $DIR/issue-90014-tait.rs:19:9
--> $DIR/issue-90014-tait.rs:18:9
|
LL | type Fut<'a> = impl Future<Output = ()>;
| ------------------------ the expected future
...
LL |
LL | fn make_fut<'a>(&'a self) -> Self::Fut<'a> {
| ------------- expected `Foo<'_>::Fut<'a>` because of return type
LL | async { () }
| ^^^^^^^^^^^^ expected future, found `async` block
|
= note: expected opaque type `Foo<'_>::Fut<'a>`
found `async` block `[async block@$DIR/issue-90014-tait.rs:19:9: 19:21]`
found `async` block `[async block@$DIR/issue-90014-tait.rs:18:9: 18:21]`
note: this item must have the opaque type in its signature in order to be able to register hidden types
--> $DIR/issue-90014-tait.rs:18:8
--> $DIR/issue-90014-tait.rs:17:8
|
LL | fn make_fut<'a>(&'a self) -> Self::Fut<'a> {
| ^^^^^^^^
Expand Down
2 changes: 0 additions & 2 deletions tests/ui/internal/internal-unstable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ extern crate internal_unstable;

struct Baz {
#[allow_internal_unstable]
//^ WARN `#[allow_internal_unstable]` is ignored on struct fields and match arms
baz: u8,
}

Expand Down Expand Up @@ -50,7 +49,6 @@ fn main() {

match true {
#[allow_internal_unstable]
//^ WARN `#[allow_internal_unstable]` is ignored on struct fields and match arms
_ => {}
}
}
10 changes: 5 additions & 5 deletions tests/ui/internal/internal-unstable.stderr
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
error[E0658]: use of unstable library feature 'function'
--> $DIR/internal-unstable.rs:41:25
--> $DIR/internal-unstable.rs:40:25
|
LL | pass_through_allow!(internal_unstable::unstable());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: add `#![feature(function)]` to the crate attributes to enable

error[E0658]: use of unstable library feature 'function'
--> $DIR/internal-unstable.rs:43:27
--> $DIR/internal-unstable.rs:42:27
|
LL | pass_through_noallow!(internal_unstable::unstable());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: add `#![feature(function)]` to the crate attributes to enable

error[E0658]: use of unstable library feature 'function'
--> $DIR/internal-unstable.rs:47:22
--> $DIR/internal-unstable.rs:46:22
|
LL | println!("{:?}", internal_unstable::unstable());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: add `#![feature(function)]` to the crate attributes to enable

error[E0658]: use of unstable library feature 'function'
--> $DIR/internal-unstable.rs:49:10
--> $DIR/internal-unstable.rs:48:10
|
LL | bar!(internal_unstable::unstable());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: add `#![feature(function)]` to the crate attributes to enable

error[E0658]: use of unstable library feature 'function'
--> $DIR/internal-unstable.rs:19:9
--> $DIR/internal-unstable.rs:18:9
|
LL | internal_unstable::unstable();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down
8 changes: 6 additions & 2 deletions tests/ui/parser/issues/issue-70583-block-is-empty-2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,13 @@ pub enum ErrorHandled {
impl ErrorHandled {
pub fn assert_reported(self) {
match self {
//~^ NOTE this delimiter might not be properly closed...
ErrorHandled::Reported => {}}
//^~ ERROR block is empty, you might have not meant to close it
//~^ NOTE block is empty, you might have not meant to close it
//~| NOTE as it matches this but it has different indentation
ErrorHandled::TooGeneric => panic!(),
}
}
} //~ ERROR unexpected closing delimiter: `}`
}
//~^ ERROR unexpected closing delimiter: `}`
//~| NOTE unexpected closing delimiter
3 changes: 2 additions & 1 deletion tests/ui/parser/issues/issue-70583-block-is-empty-2.stderr
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
error: unexpected closing delimiter: `}`
--> $DIR/issue-70583-block-is-empty-2.rs:14:1
--> $DIR/issue-70583-block-is-empty-2.rs:16:1
|
LL | match self {
| - this delimiter might not be properly closed...
LL |
LL | ErrorHandled::Reported => {}}
| --- ...as it matches this but it has different indentation
| |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ trait Trait {

impl Trait for bool {
fn a<T: Bound>(&self, _: T) {}
//^~ This gets rejected but should be accepted
fn b<T>(&self, _: T) where T: Bound {}
fn c<T: Bound>(&self, _: T) {}
fn d<T>(&self, _: T) where T: Bound {}
Expand Down
Loading