Open matthiaskrgr opened 1 year ago
@matthiaskrgr I think I can take this up. Before I do, just some questions:
help: elide the unused lifetime
part:
and there's no ICE for me. rustc --version --verbose
for me:
rustc 1.69.0-nightly (7aa413d59 2023-02-19)
binary: rustc
commit-hash: 7aa413d59206fd511137728df3d9e0fd377429bd
commit-date: 2023-02-19
host: aarch64-apple-darwin
release: 1.69.0-nightly
LLVM version: 15.0.7
Edit : I'm on the latest nightly
You need to build with debug assertions, and invoke with -Wunused-lifetimes
. I believe the bad span is created around https://github.com/rust-lang/rust/blob/e7eaed21d50d7bfb8d614d6ee7fcea940b39185d/compiler/rustc_resolve/src/late.rs#L739
I tried modifying that span to instead contain the generics, which fixes this case but regresses a few other cases
very good
Code
The problem is this first garbage span:
Meta
rustc --version --verbose
:Error output
unused_lifetime.txt