Skip to content

Commit 4202c60

Browse files
Rollup merge of #77345 - samlich:test-issue-74761, r=lcnr
Add test for issue #74761 Adds test for and closes #74761 which previously crashed compiler.
2 parents fea2ad8 + 607d30d commit 4202c60

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#![feature(member_constraints)]
2+
#![feature(type_alias_impl_trait)]
3+
4+
pub trait A {
5+
type B;
6+
fn f(&self) -> Self::B;
7+
}
8+
impl<'a, 'b> A for () {
9+
//~^ ERROR the lifetime parameter `'a` is not constrained
10+
//~| ERROR the lifetime parameter `'b` is not constrained
11+
type B = impl core::fmt::Debug;
12+
13+
fn f(&self) -> Self::B {}
14+
}
15+
16+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
error[E0207]: the lifetime parameter `'a` is not constrained by the impl trait, self type, or predicates
2+
--> $DIR/issue-74761.rs:8:6
3+
|
4+
LL | impl<'a, 'b> A for () {
5+
| ^^ unconstrained lifetime parameter
6+
7+
error[E0207]: the lifetime parameter `'b` is not constrained by the impl trait, self type, or predicates
8+
--> $DIR/issue-74761.rs:8:10
9+
|
10+
LL | impl<'a, 'b> A for () {
11+
| ^^ unconstrained lifetime parameter
12+
13+
error: aborting due to 2 previous errors
14+
15+
For more information about this error, try `rustc --explain E0207`.

0 commit comments

Comments
 (0)