Skip to content

ICE: internal compiler error: no type-dependent def for method call #138166

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

Open
matthiaskrgr opened this issue Mar 7, 2025 · 0 comments · May be fixed by #140247
Open

ICE: internal compiler error: no type-dependent def for method call #138166

matthiaskrgr opened this issue Mar 7, 2025 · 0 comments · May be fixed by #140247
Labels
C-bug Category: This is a bug. F-inherent_associated_types `#![feature(inherent_associated_types)]` F-min_generic_const_args `#![feature(min_generic_const_args)]` I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ S-bug-has-test Status: This bug is tracked inside the repo by a `known-bug` test. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@matthiaskrgr
Copy link
Member

code

#![feature(min_generic_const_args)]
#![feature(inherent_associated_types)]
struct a(Box<[u8; Box::b]>);
impl a {
  fn c(self) { self.0.d() }
}
fn main() {}

Version information

rustc 1.87.0-nightly (b74da9613 2025-03-06)
binary: rustc
commit-hash: b74da9613a8cb5ba67a985f71325be0b7b16c0dd
commit-date: 2025-03-06
host: x86_64-unknown-linux-gnu
release: 1.87.0-nightly
LLVM version: 20.1.0

Command:
/home/matthias/.rustup/toolchains/master/bin/rustc

Program output

warning: the feature `min_generic_const_args` is incomplete and may not be safe to use and/or cause compiler crashes
 --> a.rs:1:12
  |
1 | #![feature(min_generic_const_args)]
  |            ^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: see issue #132980 <https://github.com/rust-lang/rust/issues/132980> for more information
  = note: `#[warn(incomplete_features)]` on by default

warning: the feature `inherent_associated_types` is incomplete and may not be safe to use and/or cause compiler crashes
 --> a.rs:2:12
  |
2 | #![feature(inherent_associated_types)]
  |            ^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: see issue #8995 <https://github.com/rust-lang/rust/issues/8995> for more information

warning: type `a` should have an upper camel case name
 --> a.rs:3:8
  |
3 | struct a(Box<[u8; Box::b]>);
  |        ^ help: convert the identifier to upper camel case: `A`
  |
  = note: `#[warn(non_camel_case_types)]` on by default

warning: struct `a` is never constructed
 --> a.rs:3:8
  |
3 | struct a(Box<[u8; Box::b]>);
  |        ^
  |
  = note: `#[warn(dead_code)]` on by default

warning: method `c` is never used
 --> a.rs:5:6
  |
4 | impl a {
  | ------ method in this implementation
5 |   fn c(self) { self.0.d() }
  |      ^

warning: 5 warnings emitted

note: no errors encountered even though delayed bugs were created

note: those delayed bugs will now be shown as internal compiler errors

error: internal compiler error: bad placeholder type
 --> a.rs:3:19
  |
3 | struct a(Box<[u8; Box::b]>);
  |                   ^^^
  |
note: delayed at compiler/rustc_hir_analysis/src/collect.rs:422:9 - disabled backtrace
 --> a.rs:3:19
  |
3 | struct a(Box<[u8; Box::b]>);
  |                   ^^^

error: internal compiler error: no type-dependent def for method call
 --> a.rs:5:16
  |
5 |   fn c(self) { self.0.d() }
  |                ^^^^^^^^^^
  |
note: delayed at compiler/rustc_privacy/src/lib.rs:1237:26 - disabled backtrace
 --> a.rs:5:16
  |
5 |   fn c(self) { self.0.d() }
  |                ^^^^^^^^^^

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: please make sure that you have updated to the latest nightly

note: please attach the file at `/tmp/crashes/rustc-ice-2025-03-07T16_04_27-3398785.txt` to your bug report

query stack during panic:
end of query stack

@rustbot label +F-min_generic_const_args +F-inherent_associated_types

@matthiaskrgr matthiaskrgr added C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Mar 7, 2025
@rustbot rustbot added needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. F-inherent_associated_types `#![feature(inherent_associated_types)]` F-min_generic_const_args `#![feature(min_generic_const_args)]` labels Mar 7, 2025
@matthiaskrgr matthiaskrgr added the S-bug-has-test Status: This bug is tracked inside the repo by a `known-bug` test. label Mar 9, 2025
@jieyouxu jieyouxu removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Apr 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. F-inherent_associated_types `#![feature(inherent_associated_types)]` F-min_generic_const_args `#![feature(min_generic_const_args)]` I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ S-bug-has-test Status: This bug is tracked inside the repo by a `known-bug` test. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants