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 /rust/deps/chalk-ir-0.95.0/src/lib.rs, return_type_notation #16283

Closed
matthiaskrgr opened this issue Jan 6, 2024 · 1 comment
Closed
Labels
C-bug Category: bug I-panic

Comments

@matthiaskrgr
Copy link
Member

rust-analyzer 1.77.0-nightly (595bc6f 2024-01-05)

// revisions: with without
// edition: 2021
// [with] check-pass

#![feature(return_type_notation)]
//~^ WARN the feature `return_type_notation` is incomplete

trait Foo {
    async fn method() -> Result<(), ()>;
}

async fn foo<T: Foo>() -> Result<(), ()> {
    T::method().await?;
    Ok(())
}

fn is_send(_: impl Send) {}

fn test<
    #[cfg(with)] T: Foo<method(): Send>,
    #[cfg(without)] T: Foo,
>() {
    is_send(foo::<T>());
    //[without]~^ ERROR future cannot be sent between threads safely
}

fn main() {}

rust-analyzer highlight < basic.rs

thread 'main' panicked at /rust/deps/chalk-ir-0.95.0/src/lib.rs:1679:47:
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_ty::db::TraitEnvironmentQuery as salsa::plumbing::QueryFunction>::execute
   4: <salsa::derived::slot::Slot<hir_ty::db::TraitEnvironmentQuery, salsa::derived::AlwaysMemoizeValue>>::execute
   5: <_ as hir_ty::db::HirDatabase>::trait_environment::__shim
   6: hir_ty::lower::trait_environment_for_body_query
   7: hir_ty::infer::infer_query
   8: <salsa::derived::slot::Slot<hir_ty::db::InferQueryQuery, salsa::derived::AlwaysMemoizeValue>>::execute
   9: <_ as hir_ty::db::HirDatabase>::infer_query::__shim
  10: hir_ty::db::infer_wait
  11: <hir::semantics::SemanticsImpl>::analyze_impl
  12: <hir::semantics::SemanticsImpl>::resolve_path
  13: <ide_db::defs::NameRefClass>::classify
  14: ide::syntax_highlighting::highlight
  15: <ide::Analysis>::highlight_as_html
  16: <rust_analyzer::cli::flags::Highlight>::run
  17: rust_analyzer::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
@matthiaskrgr matthiaskrgr added the C-bug Category: bug label Jan 6, 2024
@lnicola lnicola added the I-panic label Jan 6, 2024
@matthiaskrgr
Copy link
Member Author

smaller repro:

trait Foo {}
fn test<
    #[cfg(with)]
     T: Foo,
>()

@matthiaskrgr matthiaskrgr mentioned this issue Jan 6, 2024
@Veykril Veykril closed this as completed Jul 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug I-panic
Projects
None yet
Development

No branches or pull requests

3 participants