Rollup merge of #56456 - oli-obk:private_impl_trait, r=cramertj
Handle existential types in dead code analysis fixes #55124 r? @cramertj
This commit is contained in:
commit
1276ffeba2
2 changed files with 14 additions and 0 deletions
|
@ -166,6 +166,7 @@ impl<'a, 'tcx> MarkSymbolVisitor<'a, 'tcx> {
|
|||
hir::ItemKind::Fn(..)
|
||||
| hir::ItemKind::Ty(..)
|
||||
| hir::ItemKind::Static(..)
|
||||
| hir::ItemKind::Existential(..)
|
||||
| hir::ItemKind::Const(..) => {
|
||||
intravisit::walk_item(self, &item);
|
||||
}
|
||||
|
|
13
src/test/ui/existential_types/private_unused.rs
Normal file
13
src/test/ui/existential_types/private_unused.rs
Normal file
|
@ -0,0 +1,13 @@
|
|||
// compile-pass
|
||||
|
||||
#[deny(warnings)]
|
||||
|
||||
enum Empty { }
|
||||
trait Bar<T> {}
|
||||
impl Bar<Empty> for () {}
|
||||
|
||||
fn boo() -> impl Bar<Empty> {}
|
||||
|
||||
fn main() {
|
||||
boo();
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue