Skip to content

Commit 28f72a7

Browse files
committed
Add minimal reproducer for ICE in #6179
1 parent 047f3e1 commit 28f72a7

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

tests/ui/use_self.fixed

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -458,3 +458,21 @@ mod nested_paths {
458458
}
459459
}
460460
}
461+
462+
/// This is a minimal reproducer for ICE in https://github.com/rust-lang/rust-clippy/pull/6179.
463+
/// The ICE is mainly caused by using `hir_ty_to_ty`. See the discussion in the PR for details.
464+
mod pr6179_ice {
465+
struct Foo {}
466+
467+
impl Foo {
468+
fn foo() -> Self {
469+
impl Foo {
470+
fn bar() {}
471+
}
472+
473+
let _: _ = 1;
474+
475+
Self {}
476+
}
477+
}
478+
}

tests/ui/use_self.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -458,3 +458,21 @@ mod nested_paths {
458458
}
459459
}
460460
}
461+
462+
/// This is a minimal reproducer for ICE in https://github.com/rust-lang/rust-clippy/pull/6179.
463+
/// The ICE is mainly caused by using `hir_ty_to_ty`. See the discussion in the PR for details.
464+
mod pr6179_ice {
465+
struct Foo {}
466+
467+
impl Foo {
468+
fn foo() -> Self {
469+
impl Foo {
470+
fn bar() {}
471+
}
472+
473+
let _: _ = 1;
474+
475+
Self {}
476+
}
477+
}
478+
}

0 commit comments

Comments
 (0)