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.
Do not attempt to access HIR parent of Synthetic node
Fix rust-lang#122991. Follow up to rust-lang#122158.
- Loading branch information
Showing
4 changed files
with
59 additions
and
3 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
12 changes: 12 additions & 0 deletions
12
tests/ui/suggestions/dont-panic-by-accessing-parent-hir-of-synthetic.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,12 @@ | ||
pub trait Foo<'a> { | ||
type Assoc; | ||
|
||
fn demo() -> impl Foo | ||
//~^ ERROR missing lifetime specifier | ||
//~| ERROR the trait bound `String: Copy` is not satisfied | ||
where | ||
String: Copy; | ||
//~^ ERROR the trait bound `String: Copy` is not satisfied | ||
} | ||
|
||
fn main() {} |
37 changes: 37 additions & 0 deletions
37
tests/ui/suggestions/dont-panic-by-accessing-parent-hir-of-synthetic.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,37 @@ | ||
error[E0106]: missing lifetime specifier | ||
--> $DIR/dont-panic-by-accessing-parent-hir-of-synthetic.rs:4:23 | ||
| | ||
LL | fn demo() -> impl Foo | ||
| ^^^ expected named lifetime parameter | ||
| | ||
= help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from | ||
help: consider using the `'a` lifetime | ||
| | ||
LL | fn demo() -> impl Foo<'a> | ||
| ++++ | ||
|
||
error[E0277]: the trait bound `String: Copy` is not satisfied | ||
--> $DIR/dont-panic-by-accessing-parent-hir-of-synthetic.rs:8:9 | ||
| | ||
LL | String: Copy; | ||
| ^^^^^^^^^^^^ the trait `Copy` is not implemented for `String` | ||
| | ||
= help: see issue #48214 | ||
help: add `#![feature(trivial_bounds)]` to the crate attributes to enable | ||
| | ||
LL + #![feature(trivial_bounds)] | ||
| | ||
|
||
error[E0277]: the trait bound `String: Copy` is not satisfied | ||
--> $DIR/dont-panic-by-accessing-parent-hir-of-synthetic.rs:4:18 | ||
| | ||
LL | fn demo() -> impl Foo | ||
| ^^^^^^^^ the trait `Copy` is not implemented for `String` | ||
| | ||
= help: see issue #48214 | ||
= help: add `#![feature(trivial_bounds)]` to the crate attributes to enable | ||
|
||
error: aborting due to 3 previous errors | ||
|
||
Some errors have detailed explanations: E0106, E0277. | ||
For more information about an error, try `rustc --explain E0106`. |