Stuck on the call to `def_path_str`
Open
Nobody has claimed this yet.
A-query-system
C-discussion
T-compiler
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
In rustc, I added one line of code between L754 and L755
I added this code
tracing::info!("macro_def_id: {:?}", self.r.tcx.def_path_str(span.ctxt().outer_expn_data().macro_def_id.unwrap()));
And I build it using:
./x build --stage 1
And run it on this code by rustc +stage1 xxx
struct Foo {
x: i32
}
impl Foo {
fn foo(&self) {
let _ = format!("{x}"); //~ ERROR cannot find value `x` in this scope [E0425]
}
}
fn main(){}
I expected to see this happen:
it print something
Instead, this happened:
It stucked
Meta
rustc --version --verbose:
rustc 1.89.0-dev
binary: rustc
commit-hash: unknown
commit-date: unknown
host: x86_64-unknown-linux-gnu
release: 1.89.0-dev
LLVM version: 20.1.5
Backtrace
<backtrace>
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the hang in compiler/rustc_resolve/src/late/diagnostics.rs around lines 754-755 using the reported ./x build --stage 1 command and the provided format! example. Start at the added tracing call to def_path_str and determine why execution does not return; done means identifying the cause and providing a fix or clear diagnosis.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 32/100