Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit c2ca80e

Browse files
authoredApr 4, 2024
Unrolled build for rust-lang#123218
Rollup merge of rust-lang#123218 - compiler-errors:synthetic-hir-parent, r=petrochenkov Add test for getting parent HIR for synthetic HIR node Fixes rust-lang#122991, which was actually fixed by rust-lang#123415
2 parents ca7d34e + f029602 commit c2ca80e

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed
 
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// Don't panic when iterating through the `hir::Map::parent_iter` of an RPITIT.
2+
3+
pub trait Foo {
4+
fn demo() -> impl Foo
5+
//~^ ERROR the trait bound `String: Copy` is not satisfied
6+
where
7+
String: Copy;
8+
//~^ ERROR the trait bound `String: Copy` is not satisfied
9+
}
10+
11+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
error[E0277]: the trait bound `String: Copy` is not satisfied
2+
--> $DIR/synthetic-hir-has-parent.rs:7:9
3+
|
4+
LL | String: Copy;
5+
| ^^^^^^^^^^^^ the trait `Copy` is not implemented for `String`
6+
|
7+
= help: see issue #48214
8+
help: add `#![feature(trivial_bounds)]` to the crate attributes to enable
9+
|
10+
LL + #![feature(trivial_bounds)]
11+
|
12+
13+
error[E0277]: the trait bound `String: Copy` is not satisfied
14+
--> $DIR/synthetic-hir-has-parent.rs:4:18
15+
|
16+
LL | fn demo() -> impl Foo
17+
| ^^^^^^^^ the trait `Copy` is not implemented for `String`
18+
|
19+
= help: see issue #48214
20+
help: add `#![feature(trivial_bounds)]` to the crate attributes to enable
21+
|
22+
LL + #![feature(trivial_bounds)]
23+
|
24+
25+
error: aborting due to 2 previous errors
26+
27+
For more information about this error, try `rustc --explain E0277`.

0 commit comments

Comments
 (0)
Failed to load comments.