Add test for issue #74761
This commit is contained in:
parent
9b77a6a200
commit
607d30dcfa
16
src/test/ui/type-alias-impl-trait/issue-74761.rs
Normal file
16
src/test/ui/type-alias-impl-trait/issue-74761.rs
Normal 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() {}
|
15
src/test/ui/type-alias-impl-trait/issue-74761.stderr
Normal file
15
src/test/ui/type-alias-impl-trait/issue-74761.stderr
Normal 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`.
|
Loading…
x
Reference in New Issue
Block a user