-
Notifications
You must be signed in to change notification settings - Fork 1.7k
inter panic Internal error, cycle detected #8686
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
This panic is reproduceable on my setup. It happens even on freshly It occurs on:
Currently it's just impossible to do use any IDE feature (even hover) because of this crash. Parsing and diagnostics seem to work though. EDIT: cargo: |
That sounds like it's caused by some new code in std. It might be helpful to try out older rust nightlies to see where it started. |
rust-lang/rust@f97769a...ca075d2 shows a lot of changes. Maybe you could try some previous nightlies? |
@flodiebold My bad for not realizing that beta differs a lot from nightly 😅. But |
Can you tell me the commit ID for that nightly? I'm not sure how to best find that out 😬 |
It's |
Ok, that leaves a lot less: rust-lang/rust@9684258...ca075d2 Edit: I suspect the generic default for the new |
The next step would be to try to write a test in |
Yep, this test panics: #[test]
fn issue_8686() {
check_infer(
r#"
pub trait Try: FromResidual {
type Output;
type Residual;
}
pub trait FromResidual<R = <Self as Try>::Residual> {
fn from_residual(residual: R) -> Self;
}
struct ControlFlow<B, C>;
impl<B, C> Try for ControlFlow {
type Output = C;
type Residual = ControlFlow<B, !>;
}
impl<B, C> FromResidual for ControlFlow {
fn from_residual(r: ControlFlow<B, !>) -> Self { ControlFlow }
}
fn test() {
ControlFlow::from_residual(ControlFlow::<u32, !>);
}
"#,
expect![[r#"
"#]],
);
} |
This isn't actually how it works, you have to specify the exact trait that has the associated type. Fixes rust-lang#8686.
This isn't actually how it works, you have to specify the exact trait that has the associated type. Fixes rust-lang#8686.
ok thanks |
8692: Fix panic caused by new Try trait definition r=flodiebold a=flodiebold The new Try trait definition caused a query cycle for us. This adds recovery for that cycle, but also fixes the cause, which is that we went through the supertraits when resolving `<T as Trait>::Assoc`, which isn't actually necessary. I also rewrote `all_super_trait_refs` to an iterator before I realized what the actual problem was, so I kept that. Fixes #8686. Co-authored-by: Florian Diebold <flodiebold@gmail.com>
yuyang@yuyang-PC:~/firefox$ /home/yuyang/.config/Code/User/globalStorage/matklad.rust-analyzer/rust-analyzer-linux --version
rust-analyzer dbd0cfb
Panic context:
thread '' panicked at 'Internal error, cycle detected:
DatabaseKeyIndex { group_index: 7, query_index: 10, key_index: 488 }
DatabaseKeyIndex { group_index: 7, query_index: 8, key_index: 45 }
', /home/runner/.cargo/registry/src/github.heygears.com-1ecc6299db9ec823/salsa-0.16.0/src/lib.rs:490:48
stack backtrace:
0: rust_begin_unwind
at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/panicking.rs:483
1: std::panicking::begin_panic_fmt
at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/panicking.rs:437
2: salsa::QueryTable
thread '' panicked at 'Internal error, cycle detected:
DatabaseKeyIndex { group_index: 7, query_index: 10, key_index: 488 }
DatabaseKeyIndex { group_index: 7, query_index: 8, key_index: 45 }
', /home/runner/.cargo/registry/src/github.heygears.com-1ecc6299db9ec823/salsa-0.16.0/src/lib.rs:490:48
stack backtrace:
0: rust_begin_unwind
at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/panicking.rs:483
1: std::panicking::begin_panic_fmt
at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/panicking.rs:437
2: salsa::QueryTable for &mut F>::call_once
24: <alloc::vec::Vec as alloc::vec::SpecFromIter<T,I>>::from_iter
25: hir_ty::lower::generic_defaults_query
26: salsa::runtime::Runtime::execute_query_implementation
27: salsa::derived::slot::Slot<Q,MP>::read_upgrade
28: salsa::derived::slot::Slot<Q,MP>::read
29: <salsa::derived::DerivedStorage<Q,MP> as salsa::plumbing::QueryStorageOps
thread '' panicked at 'Internal error, cycle detected:
DatabaseKeyIndex { group_index: 7, query_index: 10, key_index: 488 }
DatabaseKeyIndex { group_index: 7, query_index: 8, key_index: 45 }
', /home/runner/.cargo/registry/src/github.heygears.com-1ecc6299db9ec823/salsa-0.16.0/src/lib.rs:490:48
stack backtrace:
0: rust_begin_unwind
at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/panicking.rs:483
1: std::panicking::begin_panic_fmt
at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/panicking.rs:437
2: salsa::QueryTable for &mut F>::call_once
24: <alloc::vec::Vec as alloc::vec::SpecFromIter<T,I>>::from_iter
25: hir_ty::lower::generic_defaults_query
26: salsa::runtime::Runtime::execute_query_implementation
27: salsa::derived::slot::Slot<Q,MP>::read_upgrade
28: salsa::derived::slot::Slot<Q,MP>::read
29: <salsa::derived::DerivedStorage<Q,MP> as salsa::plumbing::QueryStorageOps
thread '' panicked at 'Internal error, cycle detected:
DatabaseKeyIndex { group_index: 7, query_index: 10, key_index: 488 }
DatabaseKeyIndex { group_index: 7, query_index: 8, key_index: 45 }
', /home/runner/.cargo/registry/src/github.heygears.com-1ecc6299db9ec823/salsa-0.16.0/src/lib.rs:490:48
stack backtrace:
0: rust_begin_unwind
at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/panicking.rs:483
1: std::panicking::begin_panic_fmt
at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/panicking.rs:437
2: salsa::QueryTable for &mut F>::call_once
24: <alloc::vec::Vec as alloc::vec::SpecFromIter<T,I>>::from_iter
25: hir_ty::lower::generic_defaults_query
26: salsa::runtime::Runtime::execute_query_implementation
27: salsa::derived::slot::Slot<Q,MP>::read_upgrade
28: salsa::derived::slot::Slot<Q,MP>::read
29: <salsa::derived::DerivedStorage<Q,MP> as salsa::plumbing::QueryStorageOps
thread '' panicked at 'Internal error, cycle detected:
DatabaseKeyIndex { group_index: 7, query_index: 10, key_index: 488 }
DatabaseKeyIndex { group_index: 7, query_index: 8, key_index: 45 }
', /home/runner/.cargo/registry/src/github.heygears.com-1ecc6299db9ec823/salsa-0.16.0/src/lib.rs:490:48
stack backtrace:
0: rust_begin_unwind
at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/panicking.rs:483
1: std::panicking::begin_panic_fmt
at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/panicking.rs:437
2: salsa::QueryTable for &mut F>::call_once
24: <alloc::vec::Vec as alloc::vec::SpecFromIter<T,I>>::from_iter
25: hir_ty::lower::generic_defaults_query
26: salsa::runtime::Runtime::execute_query_implementation
27: salsa::derived::slot::Slot<Q,MP>::read_upgrade
28: salsa::derived::slot::Slot<Q,MP>::read
29: <salsa::derived::DerivedStorage<Q,MP> as salsa::plumbing::QueryStorageOps
thread '' panicked at 'Internal error, cycle detected:
DatabaseKeyIndex { group_index: 7, query_index: 10, key_index: 488 }
DatabaseKeyIndex { group_index: 7, query_index: 8, key_index: 45 }
', /home/runner/.cargo/registry/src/github.heygears.com-1ecc6299db9ec823/salsa-0.16.0/src/lib.rs:490:48
stack backtrace:
0: rust_begin_unwind
at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/panicking.rs:483
1: std::panicking::begin_panic_fmt
at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/panicking.rs:437
2: salsa::QueryTable for &mut F>::call_once
24: <alloc::vec::Vec as alloc::vec::SpecFromIter<T,I>>::from_iter
25: hir_ty::lower::generic_defaults_query
26: salsa::runtime::Runtime::execute_query_implementation
27: salsa::derived::slot::Slot<Q,MP>::read_upgrade
28: salsa::derived::slot::Slot<Q,MP>::read
29: <salsa::derived::DerivedStorage<Q,MP> as salsa::plumbing::QueryStorageOps
The text was updated successfully, but these errors were encountered: