ICE in finalize_glob_import, at rust/resolve/rust-early-name-resolver-2.0.cc
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 2.9k
- Forks
- 231
- Avg merge
- 19h 55m
- Merged PRs (30d)
- 67
Description
auto-reduced (treereduce-rust):
//@compile-flags: -frust-incomplete-and-experimental-compiler-do-not-use
#[prelude_import]
use *;
original:
#![feature(no_core)]
#![no_core]
#[prelude_import]
use *;
Version information:
833d880c3431f45dbe426f29270b6e69e2289d2c
Possibly related line of code:
https://github.com/Rust-GCC/gccrs/blob/833d880c3431f45dbe426f29270b6e69e2289d2c/gcc/rust/resolve/rust-early-name-resolver-2.0.cc#L425-L437
Command:
/home/matthias/vcs/github/gccrs/gccrs-build/gcc/crab1 -frust-incomplete-and-experimental-compiler-do-not-use
Program output
crab1: error: failed to locate crate ‘core’
crab1: error: failed to locate crate ‘std’
crab1: error: unknown crate ‘core’
crab1: error: unknown crate ‘std’
crab1: internal compiler error: in finalize_glob_import, at rust/resolve/rust-early-name-resolver-2.0.cc:431
0x322b647 internal_error(char const*, ...)
../../gcc/diagnostic-global-context.cc:787
0xc6f3c7 fancy_abort(char const*, int, char const*)
../../gcc/diagnostics/context.cc:1813
0x916167 Rust::Resolver2_0::Early::finalize_glob_import(Rust::Resolver2_0::NameResolutionContext&, Rust::Resolver2_0::Early::ImportPair const&)
../../gcc/rust/resolve/rust-early-name-resolver-2.0.cc:431
0xfead54 Rust::Resolver2_0::Early::visit(Rust::AST::UseDeclaration&)
../../gcc/rust/resolve/rust-early-name-resolver-2.0.cc:513
0xe68e9f void Rust::AST::DefaultASTVisitor::visit<Rust::AST::Item>(std::unique_ptr<Rust::AST::Item, std::default_delete<Rust::AST::Item> >&)
../../gcc/rust/ast/rust-ast-visitor.h:421
0xe68e9f Rust::AST::DefaultASTVisitor::visit(Rust::AST::Crate&)
../../gcc/rust/ast/rust-ast-visitor.cc:39
0xfd6ccd operator()
../../gcc/rust/resolve/rust-default-resolver.cc:34
0xfd6ccd scope_inner<Rust::Resolver2_0::CanonicalPathCtx::scope_crate<Rust::Resolver2_0::DefaultResolver::visit(Rust::AST::Crate&)::<lambda()>&>(Rust::NodeId, std::string, Rust::Resolver2_0::DefaultResolver::visit(Rust::AST::Crate&)::<lambda()>&)::<lambda()>, Rust::Resolver2_0::DefaultResolver::visit(Rust::AST::Crate&)::<lambda()>&>
../../gcc/rust/resolve/rust-name-resolution-context.h:449
0xfd6ccd scope_crate<Rust::Resolver2_0::DefaultResolver::visit(Rust::AST::Crate&)::<lambda()>&>
../../gcc/rust/resolve/rust-name-resolution-context.h:424
0xfd6ccd Rust::Resolver2_0::DefaultResolver::visit(Rust::AST::Crate&)
../../gcc/rust/resolve/rust-default-resolver.cc:43
0xfe4ea3 Rust::Resolver2_0::Early::go(Rust::AST::Crate&)
../../gcc/rust/resolve/rust-early-name-resolver-2.0.cc:71
0xea1ba8 Rust::Session::expansion(Rust::AST::Crate&, Rust::Resolver2_0::NameResolutionContext&)
../../gcc/rust/rust-session-manager.cc:1078
0xeb05e7 Rust::Session::compile_crate(char const*)
../../gcc/rust/rust-session-manager.cc:738
/home/matthias/vcs/github/gccrs/gccrs-build/gcc/crab1 /tmp/icemaker_global_tempdir.IMsnqRt9kaHb/rustc_testrunner_tmpdir_reporting.HsazIpKkGNCZ/mvce.rs -o/tmp/icemaker_global_tempdir.IMsnqRt9kaHb/rustc_testrunner_tmpdir_reporting.HsazIpKkGNCZ/binaryname -frust-incomplete-and-experimental-compiler-do-not-use
Please submit a full bug report, with preprocessed source (by using -freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
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 ICE with the reduced Rust source and the command shown in the issue. Start at finalize_glob_import in gcc/rust/resolve/rust-early-name-resolver-2.0.cc, especially lines 425-437, and trace the glob import after the core and std lookup errors. Done means this input no longer reaches an internal compiler error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, rust
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100