Skip to content

Commit

Permalink
Rollup merge of #56456 - oli-obk:private_impl_trait, r=cramertj
Browse files Browse the repository at this point in the history
Handle existential types in dead code analysis

fixes #55124

r? @cramertj
  • Loading branch information
kennytm authored Dec 4, 2018
2 parents 2d7e7cf + 1fb82b5 commit 939de36
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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 939de36

Please sign in to comment.