mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-06 12:04:36 +00:00
Fix ICE when negative impl is collected during eager mono
This commit is contained in:
parent
215e3cd218
commit
1013ee8df5
@ -1336,6 +1336,10 @@ fn create_mono_items_for_default_impls<'tcx>(
|
||||
) {
|
||||
match item.kind {
|
||||
hir::ItemKind::Impl(ref impl_) => {
|
||||
if matches!(impl_.polarity, hir::ImplPolarity::Negative(_)) {
|
||||
return;
|
||||
}
|
||||
|
||||
for param in impl_.generics.params {
|
||||
match param.kind {
|
||||
hir::GenericParamKind::Lifetime { .. } => {}
|
||||
|
12
src/test/ui/traits/negative-impls/eager-mono.rs
Normal file
12
src/test/ui/traits/negative-impls/eager-mono.rs
Normal file
@ -0,0 +1,12 @@
|
||||
// build-pass
|
||||
// compile-flags:-C link-dead-code=y
|
||||
|
||||
#![feature(negative_impls)]
|
||||
|
||||
trait Foo {
|
||||
fn foo() {}
|
||||
}
|
||||
|
||||
impl !Foo for () {}
|
||||
|
||||
fn main() {}
|
Loading…
Reference in New Issue
Block a user