Skip to content

ice: None /rust/deps/chalk-ir-0.95.0/src/lib.rs, return_type_notation #16283

@matthiaskrgr

Description

@matthiaskrgr

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions