forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#109914 - compiler-errors:rtn-bad-parens, r=…
…oli-obk Emit feature error for parenthesized generics in associated type bounds We don't actually do AST->HIR lowering with some `-Zunpretty` flags, so it's not correct to just delay a bug instead of emitting a feature error. Some diagnostics regressed because of the new errors, but oh well. 🤷 Fixes rust-lang#109898
- Loading branch information
Showing
6 changed files
with
64 additions
and
12 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
11 changes: 11 additions & 0 deletions
11
tests/ui/associated-type-bounds/return-type-notation/unpretty-parenthesized.rs
This file contains 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 @@ | ||
// edition: 2021 | ||
// compile-flags: -Zunpretty=expanded | ||
|
||
trait Trait { | ||
async fn method() {} | ||
} | ||
|
||
fn foo<T: Trait<method(i32): Send>>() {} | ||
//~^ ERROR associated type bounds are unstable | ||
|
||
fn main() {} |
12 changes: 12 additions & 0 deletions
12
tests/ui/associated-type-bounds/return-type-notation/unpretty-parenthesized.stderr
This file contains 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,12 @@ | ||
error[E0658]: associated type bounds are unstable | ||
--> $DIR/unpretty-parenthesized.rs:8:17 | ||
| | ||
LL | fn foo<T: Trait<method(i32): Send>>() {} | ||
| ^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: see issue #52662 <https://github.com/rust-lang/rust/issues/52662> for more information | ||
= help: add `#![feature(associated_type_bounds)]` to the crate attributes to enable | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0658`. |
15 changes: 15 additions & 0 deletions
15
tests/ui/associated-type-bounds/return-type-notation/unpretty-parenthesized.stdout
This file contains 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,15 @@ | ||
#![feature(prelude_import)] | ||
#[prelude_import] | ||
use std::prelude::rust_2021::*; | ||
#[macro_use] | ||
extern crate std; | ||
// edition: 2021 | ||
// compile-flags: -Zunpretty=expanded | ||
|
||
trait Trait { | ||
async fn method() {} | ||
} | ||
|
||
fn foo<T: Trait<method(i32) : Send>>() {} | ||
|
||
fn main() {} |