1
Fork 0

Don't consider regions in deref_into_dyn_supertrait lint

This commit is contained in:
Michael Goulet 2023-11-17 22:05:42 +00:00
parent 46ecc10c69
commit 63b34cf480
7 changed files with 104 additions and 11 deletions

View file

@ -1,15 +1,13 @@
#![deny(deref_into_dyn_supertrait)]
extern crate core;
use core::ops::Deref;
use std::ops::Deref;
// issue 89190
trait A {}
trait B: A {}
impl<'a> Deref for dyn 'a + B {
//~^ ERROR `(dyn B + 'a)` implements `Deref` with supertrait `A` as target
//~^ ERROR `dyn B` implements `Deref` with supertrait `A` as target
//~| WARN this was previously accepted by the compiler but is being phased out;
type Target = dyn A;