Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ice: None in crates/hir-def/src/generics.rs #16281

Closed
matthiaskrgr opened this issue Jan 6, 2024 · 2 comments
Closed

ice: None in crates/hir-def/src/generics.rs #16281

matthiaskrgr opened this issue Jan 6, 2024 · 2 comments
Labels
A-hir hir and hir-def related C-bug Category: bug I-panic

Comments

@matthiaskrgr
Copy link
Member

struct Foo<T>(T);

trait GoodBye {
    type Forget;
}
impl<T> GoodBye for T {
    type Forget = ();
}

trait NeedsWf<'a, 'b> {
    type Assoc;
}

impl<'a, 'b#[cfg(lifetime)] NeedsWf<'a, 'a> for Map<<&'a MessageListeners<'b> as GoodBye>::Forget> {
    type Assoc = &'a &'b ();
}

rust-analyzer highlight < file.rs

thread 'main' panicked at crates/hir-def/src/generics.rs:605:33:
called `Option::unwrap()` on a `None` value
stack backtrace:
   0: rust_begin_unwind
             at /rustc/595bc6f00369475047538fdae1ff8cea692ac385/library/std/src/panicking.rs:645:5
   1: core::panicking::panic_fmt
             at /rustc/595bc6f00369475047538fdae1ff8cea692ac385/library/core/src/panicking.rs:72:14
   2: core::panicking::panic
             at /rustc/595bc6f00369475047538fdae1ff8cea692ac385/library/core/src/panicking.rs:144:5
   3: <hir_def::GenericDefId as hir_def::child_by_source::ChildBySource>::child_by_source_to
   4: <hir::semantics::source_to_def::SourceToDefCtx>::cache_for
   5: <hir::semantics::source_to_def::SourceToDefCtx>::lifetime_param_to_def
   6: <syntax::ast::generated::nodes::LifetimeParam as hir::semantics::ToDef>::to_def
   7: <ide_db::defs::NameClass>::classify_lifetime
   8: <ide_db::defs::IdentClass>::classify_lifetime
   9: ide::syntax_highlighting::highlight
  10: <ide::Analysis>::highlight_as_html
  11: <rust_analyzer::cli::flags::Highlight>::run
  12: rust_analyzer::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
rust-analyzer 1.77.0-nightly (595bc6f 2024-01-05)

@matthiaskrgr matthiaskrgr added the C-bug Category: bug label Jan 6, 2024
@Veykril Veykril added A-hir hir and hir-def related I-panic labels Jan 6, 2024
@matthiaskrgr
Copy link
Member Author

smaller repro:

trait NeedsWf<'a, 'b> {}

impl<'a, 'b#[cfg(lifetime)] NeedsWf<'a, 'a>  {}

@matthiaskrgr matthiaskrgr mentioned this issue Jan 6, 2024
@Veykril
Copy link
Member

Veykril commented Apr 28, 2024

This is fixed now

@Veykril Veykril closed this as completed Apr 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-hir hir and hir-def related C-bug Category: bug I-panic
Projects
None yet
Development

No branches or pull requests

2 participants