We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 215e3cd commit 1013ee8Copy full SHA for 1013ee8
compiler/rustc_monomorphize/src/collector.rs
@@ -1336,6 +1336,10 @@ fn create_mono_items_for_default_impls<'tcx>(
1336
) {
1337
match item.kind {
1338
hir::ItemKind::Impl(ref impl_) => {
1339
+ if matches!(impl_.polarity, hir::ImplPolarity::Negative(_)) {
1340
+ return;
1341
+ }
1342
+
1343
for param in impl_.generics.params {
1344
match param.kind {
1345
hir::GenericParamKind::Lifetime { .. } => {}
src/test/ui/traits/negative-impls/eager-mono.rs
@@ -0,0 +1,12 @@
1
+// build-pass
2
+// compile-flags:-C link-dead-code=y
3
4
+#![feature(negative_impls)]
5
6
+trait Foo {
7
+ fn foo() {}
8
+}
9
10
+impl !Foo for () {}
11
12
+fn main() {}
0 commit comments