Skip to content

Commit

Permalink
Handle existential types in dead code analysis
Browse files Browse the repository at this point in the history
  • Loading branch information
oli-obk committed Dec 3, 2018
1 parent 7139e1c commit 1fb82b5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/librustc/middle/dead.rs
Expand Up @@ -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);
}
Expand Down
13 changes: 13 additions & 0 deletions src/test/ui/existential_types/private_unused.rs
@@ -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();
}

0 comments on commit 1fb82b5

Please sign in to comment.