-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Cycle when computing type of recursive opaque type #87850
Comments
Potentially related: use Send as SomeAutoTrait;
macro_rules! SomeExistential {() => ( impl Sized )}
fn foo() -> SomeExistential!() {
// check if `typeof![foo()] : SomeAutoTrait`
let _: &dyn SomeAutoTrait = &foo();
} |
@danielhenrymantilla Interestingly, the code you provided is a different cycle (it doesn't involve Ultimately I think both issues have the same root cause, i.e. the type system and the MIR builder being dependent on each other. Maybe fixing #78649 will fix this issue as well. |
I've ran into this in kornelski/cargo-deb@e814497 using rustc 1.60.0-nightly (ec4bcaa 2022-01-15) on macOS aarch64 and it's a weird case, because it only affects
It doesn't like this: struct CargoDeb {
pub variants: Option<HashMap<String, CargoDeb>>,
} It compiles if I change it to: struct CargoDeb {
pub variants: Option<HashMap<String, Box<CargoDeb>>>,
} but given the odd nature of this bug, that may just be a coincidence. |
@kornelski This is #92725, you can look there for details. Thanks anyway for the report. |
I can't reproduce this with the THIR unsafety checker (which is the default since #117673) on recent nightlies - I think this issue should be closed. The only error I get is (ignoring warnings):
|
I tried this code:
rustc
gives the following output:This affects both the MIR and the THIR unsafety checkers. However, since the code is obviously wrong and the relevant errors are still emitted, I'd expect this to be closed as wontfix.
Meta
rustc --version --verbose
:The text was updated successfully, but these errors were encountered: