-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
save-analysis with cgmath leads to ICE #41478
Comments
@nrc would you like to take a look? |
+1 This stops me from using https://github.com/editor-rs/vscode-rust for ZoC's development: |
Reduced, but not sure if it's the same bug, since it is a compile-fail case, but // rustc -Zsave-analysis 1.rs
struct B<S> {
}
fn f<S>() -> B<S> {
B{}
}
fn main() {
} |
OK this should be the actual code causing the error. Reduced case: struct V<S>(S);
trait An {
type U;
}
trait F<A> {
}
impl<A: An> F<A> for V<<A as An>::U> {
} These are reduced from https://github.com/brendanzab/cgmath/blob/bfd9fc1e66dfa27713fbb7890159b2499826c4db/src/matrix.rs#L1136-L1149. The panic comes from rust/src/librustc_save_analysis/lib.rs Line 301 in 526d399
The ICE no longer happens if |
The ICE is changed to an error output like #43796 some time between 1.19 and 1.20. The output at the current nightly (1.21) for my reduced test case is:
I think this bug should be turned into E-needstest, or be closed and the reduced test case be transferred to #43796. |
Use the `span` field in PathSegment and TyParam instead. Fix rust-lang#43796. Close rust-lang#41478.
…ochenkov Fix "Mis-calculated spans" errors from `-Z save-analysis` + refactoring Removed the path span extraction methods from `SpanUtils`: * spans_with_brackets * spans_for_path_segments * spans_for_ty_params Use the `span` fields in `PathSegment` and `TyParam` instead. (Note that since it processes `ast::Path` not a qualified path (`hir::QPath` / `ast::QSelf`), UFCS path will be flattened: `<Foo as a::b::c::Trait>::D::E::F::g` will be seen as `a::b::c::Trait::D::E::F::g`.) Fix #43796. Close #41478. r? @nrc
The text was updated successfully, but these errors were encountered: