Skip to content

compiler unexpectedly panicked #10387

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

Closed
Hefeweizen opened this issue Feb 22, 2023 · 3 comments · Fixed by #10403
Closed

compiler unexpectedly panicked #10387

Hefeweizen opened this issue Feb 22, 2023 · 3 comments · Fixed by #10403
Labels
C-bug Category: Clippy is not doing the correct thing

Comments

@Hefeweizen
Copy link

Summary

Just started exploring gitoxide. At start, it suggests make tests check-size. Doing so, I hit:

thread 'rustc' panicked at 'Box<dyn Any>', compiler/rustc_errors/src/lib.rs:1610:13

Reproducer

I tried this code:

git clone https://github.com/Byron/gitoxide.git
cd gitoxide/
less README.md 
make tests check-size

I expected to see this happen:
I expected a clean build

Instead, this happened:
Instead the compiler panicked

full panic output in this file:
clippy_bug_report.20230221.txt

Version

$ rustc -Vv
rustc 1.67.1 (d5a82bbd2 2023-02-07)
binary: rustc
commit-hash: d5a82bbd26e1ad8b7401f6a718a9c57c96905483
commit-date: 2023-02-07
host: x86_64-unknown-linux-gnu
release: 1.67.1
LLVM version: 15.0.6

Additional Labels

No response

@Hefeweizen Hefeweizen added the C-bug Category: Clippy is not doing the correct thing label Feb 22, 2023
@matthiaskrgr
Copy link
Member

Can't download the stack trace right now, but this looks like another duplicate of #10009 (comment)

@Hefeweizen
Copy link
Author

Hefeweizen commented Feb 22, 2023

@matthiaskrgr Thanks for linking to that!

That issue notes no issue if run with --tests. That didn't work for me:

$ g diff
diff --git a/Makefile b/Makefile
index 64abd08db..dcc1e612a 100644
--- a/Makefile
+++ b/Makefile
@@ -52,9 +52,9 @@ doc: ## Run cargo doc on all crates
 
 clippy: ## Run cargo clippy on all crates
        cargo clippy --all --tests --examples
-       cargo clippy --all --no-default-features --features small
-       cargo clippy --all --no-default-features --features max-pure
-       cargo clippy --all --no-default-features --features lean-async --tests
+       cargo clippy --all --tests --no-default-features --features small
+       cargo clippy --all --tests --no-default-features --features max-pure
+       cargo clippy --all --tests --no-default-features --features lean-async --tests
 
 check-msrv: ## run cargo msrv to validate the current msrv requirements, similar to what CI does
        cd gix && cargo check --package gix --no-default-features --features async-network-client,max-performance
[ovo@lima-rust gitoxide]$ make tests check-size
cargo clippy --all --tests --examples
    Checking gix v0.37.1 (/home/ovo.linux/gitoxide/gix)
    Checking gix-ref-tests v0.0.0 (/home/ovo.linux/gitoxide/gix-ref/tests)
    Checking gix-glob v0.5.5 (/home/ovo.linux/gitoxide/gix-glob)
    Checking gix-ref v0.24.1 (/home/ovo.linux/gitoxide/gix-ref)
error: internal compiler error: no errors encountered even though `delay_span_bug` issued

error: internal compiler error: unexpected ambiguity: Canonical { max_universe: U0, variables: [], value: ParamEnvAnd { param_env: ParamEnv { caller_bounds: [], reveal: UserFacing, constness: NotConst }, value: ProjectionTy { substs: [std::string::String], item_def_id: DefId(2:2478 ~ core[e6a2]::convert::TryInto::Error) } } } Canonical { max_universe: U0, variables: [CanonicalVarInfo { kind: Ty(General(U0)) }], value: QueryResponse { var_values: CanonicalVarValues { var_values: [] }, region_constraints: QueryRegionConstraints { outlives: [], member_constraints: [] }, certainty: Ambiguous, opaque_types: [], value: NormalizationResult { normalized_ty: ^0 } } }
  |
  = note: delayed at compiler/rustc_trait_selection/src/traits/query/normalize.rs:266:34

error: internal compiler error: unexpected ambiguity: Canonical { max_universe: U0, variables: [], value: ParamEnvAnd { param_env: ParamEnv { caller_bounds: [], reveal: UserFacing, constness: NotConst }, value: ProjectionTy { substs: [gix_ref::PartialName], item_def_id: DefId(2:2478 ~ core[e6a2]::convert::TryInto::Error) } } } Canonical { max_universe: U0, variables: [CanonicalVarInfo { kind: Ty(General(U0)) }], value: QueryResponse { var_values: CanonicalVarValues { var_values: [] }, region_constraints: QueryRegionConstraints { outlives: [], member_constraints: [] }, certainty: Ambiguous, opaque_types: [], value: NormalizationResult { normalized_ty: ^0 } } }
  |
  = note: delayed at compiler/rustc_trait_selection/src/traits/query/normalize.rs:266:34

error: internal compiler error: unexpected ambiguity: Canonical { max_universe: U0, variables: [], value: ParamEnvAnd { param_env: ParamEnv { caller_bounds: [], reveal: UserFacing, constness: NotConst }, value: ProjectionTy { substs: [gix_ref::FullName], item_def_id: DefId(2:2478 ~ core[e6a2]::convert::TryInto::Error) } } } Canonical { max_universe: U0, variables: [CanonicalVarInfo { kind: Ty(General(U0)) }], value: QueryResponse { var_values: CanonicalVarValues { var_values: [] }, region_constraints: QueryRegionConstraints { outlives: [], member_constraints: [] }, certainty: Ambiguous, opaque_types: [], value: NormalizationResult { normalized_ty: ^0 } } }
  |
  = note: delayed at compiler/rustc_trait_selection/src/traits/query/normalize.rs:266:34

thread 'rustc' panicked at 'Box<dyn Any>', compiler/rustc_errors/src/lib.rs:1610:13
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.67 (d5a82bb 2023-02-07)

query stack during panic:
end of query stack
error: could not compile `gix-ref-tests`
warning: build failed, waiting for other jobs to finish...
thread 'rustc' panicked at 'Box<dyn Any>', compiler/rustc_errors/src/lib.rs:1610:13
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.67 (d5a82bb 2023-02-07)

query stack during panic:
end of query stack
error: could not compile `gix`
thread 'rustc' panicked at 'Box<dyn Any>', compiler/rustc_errors/src/lib.rs:1610:13
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.67 (d5a82bb 2023-02-07)

query stack during panic:
end of query stack
error: could not compile `gix`
make: *** [Makefile:54: clippy] Error 101

** I don't know if --tests makes any sense on those other clippy commands, just using a brute-force approach. **

@Hefeweizen
Copy link
Author

#10009 mentions the error does not exist on an older version of clippy. I'm happy to test. That said, I'm very new to the rust ecosystem, so I'll happily accept suggestions on the easiest way to downgrade to clippy 1.64

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: Clippy is not doing the correct thing
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants