Skip to content

Commit 939de36

Browse files
authored
Rollup merge of rust-lang#56456 - oli-obk:private_impl_trait, r=cramertj
Handle existential types in dead code analysis fixes rust-lang#55124 r? @cramertj
2 parents 2d7e7cf + 1fb82b5 commit 939de36

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

src/librustc/middle/dead.rs

+1
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ impl<'a, 'tcx> MarkSymbolVisitor<'a, 'tcx> {
166166
hir::ItemKind::Fn(..)
167167
| hir::ItemKind::Ty(..)
168168
| hir::ItemKind::Static(..)
169+
| hir::ItemKind::Existential(..)
169170
| hir::ItemKind::Const(..) => {
170171
intravisit::walk_item(self, &item);
171172
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// compile-pass
2+
3+
#[deny(warnings)]
4+
5+
enum Empty { }
6+
trait Bar<T> {}
7+
impl Bar<Empty> for () {}
8+
9+
fn boo() -> impl Bar<Empty> {}
10+
11+
fn main() {
12+
boo();
13+
}

0 commit comments

Comments
 (0)