1
Fork 0

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.
This commit is contained in:
Jonas Schievink 2020-09-30 20:56:22 +02:00 committed by GitHub
commit 4202c60a59
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 31 additions and 0 deletions

View file

@ -0,0 +1,16 @@
#![feature(member_constraints)]
#![feature(type_alias_impl_trait)]
pub trait A {
type B;
fn f(&self) -> Self::B;
}
impl<'a, 'b> A for () {
//~^ ERROR the lifetime parameter `'a` is not constrained
//~| ERROR the lifetime parameter `'b` is not constrained
type B = impl core::fmt::Debug;
fn f(&self) -> Self::B {}
}
fn main() {}

View file

@ -0,0 +1,15 @@
error[E0207]: the lifetime parameter `'a` is not constrained by the impl trait, self type, or predicates
--> $DIR/issue-74761.rs:8:6
|
LL | impl<'a, 'b> A for () {
| ^^ unconstrained lifetime parameter
error[E0207]: the lifetime parameter `'b` is not constrained by the impl trait, self type, or predicates
--> $DIR/issue-74761.rs:8:10
|
LL | impl<'a, 'b> A for () {
| ^^ unconstrained lifetime parameter
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0207`.