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

Add test for getting parent HIR for synthetic HIR node #123218

Merged
merged 1 commit into from
Apr 4, 2024
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
11 changes: 11 additions & 0 deletions tests/ui/impl-trait/in-trait/synthetic-hir-has-parent.rs
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 tests/ui/impl-trait/in-trait/synthetic-hir-has-parent.stderr
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`.
Loading