Skip to content
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

[ICE clippy]: 'rustc' panicked at compiler/rustc_infer/src/infer/at.rs:453:17 #11952

Closed
1 task done
StackOverflowExcept1on opened this issue Dec 9, 2023 · 3 comments · Fixed by #11953
Closed
1 task done
Labels
C-bug Category: Clippy is not doing the correct thing I-ICE Issue: Clippy panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@StackOverflowExcept1on
Copy link
Contributor

StackOverflowExcept1on commented Dec 9, 2023

Description

I can't reproduce on my local machine, but our CI doesn't work: https://github.com/gear-tech/gear/actions/runs/7150275036/job/19473393593#step:8:2002

Affected release channels

  • Current Nightly

Rust Version

rustc 1.76.0-nightly (f967532a4 2023-12-08)
binary: rustc
commit-hash: f967532a47eb728ada44473a5c4c2eca1a45fe30
commit-date: 2023-12-08
host: x86_64-unknown-linux-gnu
release: 1.76.0-nightly
LLVM version: 17.0.5

Current error output

No response

Backtrace

Checking gear-node-loader v1.0.3 (/home/runner/work/gear/gear/utils/node-loader)
thread 'rustc' panicked at compiler/rustc_infer/src/infer/at.rs:453:17:
`<impl futures::Future<Output = gstd::Result<(gear_core::ids::MessageId, gear_core::ids::ProgramId, primitive_types::H256), gclient::Error>> as std::future::IntoFuture>` has escaping bound vars, so it cannot be wrapped in a dummy binder.
stack backtrace:
   0: rust_begin_unwind
             at /rustc/f967532a47eb728ada44473a5c4c2eca1a45fe30/library/std/src/panicking.rs:645:5
   1: core::panicking::panic_fmt
             at /rustc/f967532a47eb728ada44473a5c4c2eca1a45fe30/library/core/src/panicking.rs:72:14
   2: <rustc_trait_selection::traits::select::SelectionContext>::match_impl
   3: <rustc_trait_selection::traits::select::SelectionContext>::assemble_candidates_from_impls
   4: <rustc_trait_selection::traits::select::SelectionContext>::candidate_from_obligation_no_cache
   5: <rustc_trait_selection::traits::select::SelectionContext>::candidate_from_obligation
   6: <rustc_trait_selection::traits::select::SelectionContext>::evaluate_trait_predicate_recursively
   7: <rustc_trait_selection::traits::select::SelectionContext>::evaluation_probe::<<rustc_trait_selection::traits::select::SelectionContext>::evaluate_root_obligation::{closure#0}>
   8: rustc_traits::evaluate_obligation::evaluate_obligation
      [... omitted 1 frame ...]
   9: <rustc_infer::infer::InferCtxt as rustc_trait_selection::traits::query::evaluate_obligation::InferCtxtExt>::evaluate_obligation_no_overflow
  10: <rustc_infer::infer::InferCtxt as rustc_trait_selection::traits::query::evaluate_obligation::InferCtxtExt>::predicate_must_hold_modulo_regions
  11: clippy_lints::methods::unnecessary_to_owned::can_change_type
  12: <clippy_lints::methods::Methods as rustc_lint::passes::LateLintPass>::check_expr
  13: <rustc_lint::late::LateContextAndPass<rustc_lint::late::RuntimeCombinedLateLintPass> as rustc_hir::intravisit::Visitor>::visit_expr::{closure#0}
  14: <rustc_lint::late::LateContextAndPass<rustc_lint::late::RuntimeCombinedLateLintPass> as rustc_hir::intravisit::Visitor>::visit_expr
  15: <rustc_lint::late::LateContextAndPass<rustc_lint::late::RuntimeCombinedLateLintPass> as rustc_hir::intravisit::Visitor>::visit_expr::{closure#0}
  16: <rustc_lint::late::LateContextAndPass<rustc_lint::late::RuntimeCombinedLateLintPass> as rustc_hir::intravisit::Visitor>::visit_expr
  17: <rustc_lint::late::LateContextAndPass<rustc_lint::late::RuntimeCombinedLateLintPass> as rustc_hir::intravisit::Visitor>::visit_expr::{closure#0}
  18: <rustc_lint::late::LateContextAndPass<rustc_lint::late::RuntimeCombinedLateLintPass> as rustc_hir::intravisit::Visitor>::visit_expr
  19: <rustc_lint::late::LateContextAndPass<rustc_lint::late::RuntimeCombinedLateLintPass> as rustc_hir::intravisit::Visitor>::visit_expr::{closure#0}
  20: <rustc_lint::late::LateContextAndPass<rustc_lint::late::RuntimeCombinedLateLintPass> as rustc_hir::intravisit::Visitor>::visit_expr
  21: <rustc_lint::late::LateContextAndPass<rustc_lint::late::RuntimeCombinedLateLintPass> as rustc_hir::intravisit::Visitor>::visit_expr::{closure#0}
  22: <rustc_lint::late::LateContextAndPass<rustc_lint::late::RuntimeCombinedLateLintPass> as rustc_hir::intravisit::Visitor>::visit_expr
  23: <rustc_lint::late::LateContextAndPass<rustc_lint::late::RuntimeCombinedLateLintPass> as rustc_hir::intravisit::Visitor>::visit_expr::{closure#0}
  24: <rustc_lint::late::LateContextAndPass<rustc_lint::late::RuntimeCombinedLateLintPass> as rustc_hir::intravisit::Visitor>::visit_expr
  25: <rustc_lint::late::LateContextAndPass<rustc_lint::late::RuntimeCombinedLateLintPass> as rustc_hir::intravisit::Visitor>::visit_block
  26: <rustc_lint::late::LateContextAndPass<rustc_lint::late::RuntimeCombinedLateLintPass> as rustc_hir::intravisit::Visitor>::visit_expr::{closure#0}
  27: <rustc_lint::late::LateContextAndPass<rustc_lint::late::RuntimeCombinedLateLintPass> as rustc_hir::intravisit::Visitor>::visit_expr
  28: <rustc_lint::late::LateContextAndPass<rustc_lint::late::RuntimeCombinedLateLintPass> as rustc_hir::intravisit::Visitor>::visit_nested_body
  29: <rustc_lint::late::LateContextAndPass<rustc_lint::late::RuntimeCombinedLateLintPass> as rustc_hir::intravisit::Visitor>::visit_fn
  30: <rustc_lint::late::LateContextAndPass<rustc_lint::late::RuntimeCombinedLateLintPass> as rustc_hir::intravisit::Visitor>::visit_expr::{closure#0}
  31: <rustc_lint::late::LateContextAndPass<rustc_lint::late::RuntimeCombinedLateLintPass> as rustc_hir::intravisit::Visitor>::visit_expr
  32: <rustc_lint::late::LateContextAndPass<rustc_lint::late::RuntimeCombinedLateLintPass> as rustc_hir::intravisit::Visitor>::visit_block
  33: <rustc_lint::late::LateContextAndPass<rustc_lint::late::RuntimeCombinedLateLintPass> as rustc_hir::intravisit::Visitor>::visit_expr::{closure#0}
  34: <rustc_lint::late::LateContextAndPass<rustc_lint::late::RuntimeCombinedLateLintPass> as rustc_hir::intravisit::Visitor>::visit_expr
  35: <rustc_lint::late::LateContextAndPass<rustc_lint::late::RuntimeCombinedLateLintPass> as rustc_hir::intravisit::Visitor>::visit_nested_body
  36: <rustc_lint::late::LateContextAndPass<rustc_lint::late::RuntimeCombinedLateLintPass> as rustc_hir::intravisit::Visitor>::visit_fn
  37: <rustc_lint::late::LateContextAndPass<rustc_lint::late::RuntimeCombinedLateLintPass> as rustc_hir::intravisit::Visitor>::visit_item
  38: <rustc_lint::late::LateContextAndPass<rustc_lint::late::RuntimeCombinedLateLintPass> as rustc_hir::intravisit::Visitor>::visit_mod
  39: rustc_lint::late::check_crate::{closure#0}
  40: rustc_lint::late::check_crate
  41: rustc_interface::passes::analysis
      [... omitted 1 frame ...]
  42: rustc_interface::interface::run_compiler::<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#0}
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

error: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust-clippy/issues/new?template=ice.yml

note: please attach the file at `/home/runner/work/gear/gear/rustc-ice-2023-12-09T09_13_10-22245.txt` to your bug report

note: compiler flags: -C embed-bitcode=no -C debuginfo=2

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
#0 [evaluate_obligation] evaluating trait selection obligation `gclient::api::calls::<impl gclient::api::GearApi>::upload_program_bytes::{opaque#0}: core::future::into_future::IntoFuture`
rust-lang/rust#1 [analysis] running analysis passes on this crate
end of query stack
note: Clippy version: clippy 0.1.76 (f967532 2023-12-08)

Anything else?

No response

@StackOverflowExcept1on StackOverflowExcept1on added C-bug Category: Clippy is not doing the correct thing I-ICE Issue: Clippy panicked, giving an Internal Compilation Error (ICE) ❄️ labels Dec 9, 2023
@StackOverflowExcept1on StackOverflowExcept1on changed the title [ICE]: 'rustc' panicked at compiler/rustc_infer/src/infer/at.rs:453:17 [ICE clippy]: 'rustc' panicked at compiler/rustc_infer/src/infer/at.rs:453:17 Dec 9, 2023
@StackOverflowExcept1on
Copy link
Contributor Author

I did minimal example for that:

#[derive(Clone)]
pub struct MyApi;

impl MyApi {
    pub async fn new() -> Result<Self, ()> {
        Ok(Self)
    }

    pub async fn foo(&self, bytes: impl AsRef<[u8]>) -> Result<(), ()> {
        todo!()
    }
}

async fn foo() -> Result<(), ()> {
    let api = MyApi::new().await.unwrap();
    let _ = api.foo([].to_vec()).await; //when using .to_vec() on [] clippy panics

    Ok(())
}
cargo +nightly-2023-12-11 clippy

@matthiaskrgr
Copy link
Member

Thanks! Seems to be a problem with the unnecessary_to_owned lint:
30: 0x564350c9a408 - clippy_lints[b764d8081ba1a0ba]::methods::unnecessary_to_owned::can_change_typ

clippy-driver a.rs --edition=2021 --crate-type lib

@matthiaskrgr
Copy link
Member

I will move this to the clippy repo

@matthiaskrgr matthiaskrgr transferred this issue from rust-lang/rust Dec 11, 2023
@bors bors closed this as completed in 29bdc8b Dec 13, 2023
bors pushed a commit to rust-lang-ci/rust that referenced this issue Dec 29, 2023
bors added a commit to rust-lang-ci/rust that referenced this issue Dec 29, 2023
tmandry added a commit to tmandry/rust that referenced this issue Dec 29, 2023
bors added a commit to rust-lang-ci/rust that referenced this issue Dec 29, 2023
tmandry added a commit to tmandry/rust that referenced this issue Jan 3, 2024
bors added a commit to rust-lang-ci/rust that referenced this issue Jan 23, 2024
bors added a commit to rust-lang-ci/rust that referenced this issue Jan 24, 2024
bors added a commit to rust-lang-ci/rust that referenced this issue Jan 25, 2024
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Jan 27, 2024
…ark-Simulacrum

Bump Fuchsia, build tests, and use 8 core bots

- Build Fuchsia on 8 cores instead of 16
- Skip building cranelift for Fuchsia
- Bump Fuchsia (includes building tests)

This includes a change to the upstream build_fuchsia_from_rust_ci script that builds a minimal set of tests, to improve coverage on this builder. This would have caught rust-lang/rust-clippy#11952 and rust-lang#119593.

See prior discussion on rust-lang#119400 about building on 8 cores instead of 16. This PR combines changes from that and rust-lang#119399, plus clean up.

r? `@Mark-Simulacrum`
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Jan 27, 2024
…ark-Simulacrum

Bump Fuchsia, build tests, and use 8 core bots

- Build Fuchsia on 8 cores instead of 16
- Skip building cranelift for Fuchsia
- Bump Fuchsia (includes building tests)

This includes a change to the upstream build_fuchsia_from_rust_ci script that builds a minimal set of tests, to improve coverage on this builder. This would have caught rust-lang/rust-clippy#11952 and rust-lang#119593.

See prior discussion on rust-lang#119400 about building on 8 cores instead of 16. This PR combines changes from that and rust-lang#119399, plus clean up.

r? ``@Mark-Simulacrum``
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Jan 27, 2024
…ark-Simulacrum

Bump Fuchsia, build tests, and use 8 core bots

- Build Fuchsia on 8 cores instead of 16
- Skip building cranelift for Fuchsia
- Bump Fuchsia (includes building tests)

This includes a change to the upstream build_fuchsia_from_rust_ci script that builds a minimal set of tests, to improve coverage on this builder. This would have caught rust-lang/rust-clippy#11952 and rust-lang#119593.

See prior discussion on rust-lang#119400 about building on 8 cores instead of 16. This PR combines changes from that and rust-lang#119399, plus clean up.

r? ```@Mark-Simulacrum```
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Jan 28, 2024
…ark-Simulacrum

Bump Fuchsia, build tests, and use 8 core bots

- Build Fuchsia on 8 cores instead of 16
- Skip building cranelift for Fuchsia
- Bump Fuchsia (includes building tests)

This includes a change to the upstream build_fuchsia_from_rust_ci script that builds a minimal set of tests, to improve coverage on this builder. This would have caught rust-lang/rust-clippy#11952 and rust-lang#119593.

See prior discussion on rust-lang#119400 about building on 8 cores instead of 16. This PR combines changes from that and rust-lang#119399, plus clean up.

r? ````@Mark-Simulacrum````
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Jan 28, 2024
…ark-Simulacrum

Bump Fuchsia, build tests, and use 8 core bots

- Build Fuchsia on 8 cores instead of 16
- Skip building cranelift for Fuchsia
- Bump Fuchsia (includes building tests)

This includes a change to the upstream build_fuchsia_from_rust_ci script that builds a minimal set of tests, to improve coverage on this builder. This would have caught rust-lang/rust-clippy#11952 and rust-lang#119593.

See prior discussion on rust-lang#119400 about building on 8 cores instead of 16. This PR combines changes from that and rust-lang#119399, plus clean up.

r? `````@Mark-Simulacrum`````
bors added a commit to rust-lang-ci/rust that referenced this issue Jan 31, 2024
…k-Simulacrum

Bump Fuchsia, build tests, and use 8 core bots

- Build Fuchsia on 8 cores instead of 16
- Skip building cranelift for Fuchsia
- Bump Fuchsia (includes building tests)

This includes a change to the upstream build_fuchsia_from_rust_ci script that builds a minimal set of tests, to improve coverage on this builder. This would have caught rust-lang/rust-clippy#11952 and rust-lang#119593.

See prior discussion on rust-lang#119400 about building on 8 cores instead of 16. This PR combines changes from that and rust-lang#119399, plus clean up.

r? `@Mark-Simulacrum`
github-actions bot pushed a commit to rust-lang/miri that referenced this issue Feb 6, 2024
Bump Fuchsia, build tests, and use 8 core bots

- Build Fuchsia on 8 cores instead of 16
- Skip building cranelift for Fuchsia
- Bump Fuchsia (includes building tests)

This includes a change to the upstream build_fuchsia_from_rust_ci script that builds a minimal set of tests, to improve coverage on this builder. This would have caught rust-lang/rust-clippy#11952 and #119593.

See prior discussion on #119400 about building on 8 cores instead of 16. This PR combines changes from that and #119399, plus clean up.

r? `@Mark-Simulacrum`
lnicola pushed a commit to lnicola/rust-analyzer that referenced this issue Apr 7, 2024
Bump Fuchsia, build tests, and use 8 core bots

- Build Fuchsia on 8 cores instead of 16
- Skip building cranelift for Fuchsia
- Bump Fuchsia (includes building tests)

This includes a change to the upstream build_fuchsia_from_rust_ci script that builds a minimal set of tests, to improve coverage on this builder. This would have caught rust-lang/rust-clippy#11952 and #119593.

See prior discussion on #119400 about building on 8 cores instead of 16. This PR combines changes from that and #119399, plus clean up.

r? `@Mark-Simulacrum`
RalfJung pushed a commit to RalfJung/rust-analyzer that referenced this issue Apr 27, 2024
Bump Fuchsia, build tests, and use 8 core bots

- Build Fuchsia on 8 cores instead of 16
- Skip building cranelift for Fuchsia
- Bump Fuchsia (includes building tests)

This includes a change to the upstream build_fuchsia_from_rust_ci script that builds a minimal set of tests, to improve coverage on this builder. This would have caught rust-lang/rust-clippy#11952 and #119593.

See prior discussion on #119400 about building on 8 cores instead of 16. This PR combines changes from that and #119399, plus clean up.

r? `@Mark-Simulacrum`
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 I-ICE Issue: Clippy panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants