-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tests for getting parent of synthetic HIR
- Loading branch information
1 parent
98efd80
commit f029602
Showing
2 changed files
with
38 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// Don't panic when iterating through the `hir::Map::parent_iter` of an RPITIT. | ||
|
||
pub trait Foo { | ||
fn demo() -> impl Foo | ||
//~^ ERROR the trait bound `String: Copy` is not satisfied | ||
where | ||
String: Copy; | ||
//~^ ERROR the trait bound `String: Copy` is not satisfied | ||
} | ||
|
||
fn main() {} |
27 changes: 27 additions & 0 deletions
27
tests/ui/impl-trait/in-trait/synthetic-hir-has-parent.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,27 @@ | ||
error[E0277]: the trait bound `String: Copy` is not satisfied | ||
--> $DIR/synthetic-hir-has-parent.rs:7: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/synthetic-hir-has-parent.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 | ||
| | ||
LL + #![feature(trivial_bounds)] | ||
| | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0277`. |