Handle fully-qualified paths and add test cases
This commit is contained in:
@@ -78,14 +78,35 @@ mod ban {
|
||||
trait MyTrait {
|
||||
fn use_self(&self) -> &() { panic!() }
|
||||
}
|
||||
trait Irrelevant {}
|
||||
trait Irrelevant {
|
||||
fn use_self(&self) -> &() { panic!() }
|
||||
}
|
||||
|
||||
impl MyTrait for dyn ObjectTrait {}
|
||||
impl Irrelevant for dyn ObjectTrait {}
|
||||
|
||||
fn use_it<'a>(val: &'a dyn ObjectTrait) -> impl OtherTrait<'a> {
|
||||
val.use_self() //~ ERROR E0759
|
||||
}
|
||||
}
|
||||
|
||||
mod bal {
|
||||
trait OtherTrait<'a> {}
|
||||
impl<'a> OtherTrait<'a> for &'a () {}
|
||||
|
||||
trait ObjectTrait {}
|
||||
trait MyTrait {
|
||||
fn use_self(&self) -> &() { panic!() }
|
||||
}
|
||||
trait Irrelevant {
|
||||
fn use_self(&self) -> &() { panic!() }
|
||||
}
|
||||
|
||||
impl MyTrait for dyn ObjectTrait {}
|
||||
impl Irrelevant for dyn ObjectTrait {}
|
||||
|
||||
fn use_it<'a>(val: &'a dyn ObjectTrait) -> impl OtherTrait<'a> + 'a {
|
||||
MyTrait::use_self(val) //~ ERROR E0759
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
|
||||
Reference in New Issue
Block a user