Handle fully-qualified paths and add test cases
This commit is contained in:
parent
3712dfc677
commit
53d96b5159
8 changed files with 404 additions and 98 deletions
|
@ -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() {}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue