Closed
Description
Code example from #6792,
the pr (#6812) doesn't seem to fix it
Code
struct Test {}
trait SomeTrait {
type Outer;
fn broken() -> Self::Outer;
}
struct Inner {}
impl SomeTrait for Inner {
type Outer = Test;
fn broken() -> Self::Outer {
Self::Outer{}
}
}
fn main() {}
Meta
cargo clippy -V
: clippy 0.1.52 (3a5d45f 2021-03-09)rustc -Vv
:
rustc 1.52.0-nightly (3a5d45f68 2021-03-09)
binary: rustc
commit-hash: 3a5d45f68cadc8fff4fbb557780f92b403b19c19
commit-date: 2021-03-09
host: x86_64-unknown-linux-gnu
release: 1.52.0-nightly
LLVM version: 12.0.0
Error output
error: internal compiler error: compiler/rustc_typeck/src/collect/type_of.rs:278:17: associated type missing default
--> src/main.rs:22:3
|
22 | type Outer;
| ^^^^^^^^^^^
thread 'rustc' panicked at 'Box<Any>', /rustc/3a5d45f68cadc8fff4fbb557780f92b403b19c19/library/std/src/panic.rs:59:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust-clippy/issues/new
note: Clippy version: clippy 0.1.52 (3a5d45f 2021-03-09)
query stack during panic:
#0 [type_of] computing type of `SomeTrait::Outer`
#1 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to previous error
error: could not compile `rust_test`
To learn more, run the command again with --verbose.
Backtrace
<backtrace>
Metadata
Metadata
Assignees
Labels
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
Y-Nak commentedon Mar 11, 2021
This is fixed but the change is not synced yet.
Y-Nak commentedon Mar 11, 2021
You can assure that by pasting the code to this file and running
cargo dev fmt && cargo test
in the clippy root.XiangpengHao commentedon Mar 11, 2021
I see, thanks! How long usually does it take to sync? Before that, I need to pin the nightly version to 20 days ago.
Y-Nak commentedon Mar 11, 2021
Today! (the sync is done every other week.)
Y-Nak commentedon Mar 12, 2021
Unfortunately, minor conflicts have occurred in the sync process, see #83012.
But It would be available in a few days, maybe.
2021-03-09
in veloren #6890XiangpengHao commentedon Mar 13, 2021
Just found out the sync is merged and no more internal error observed.
Thank you for the great work!