ICE in resolve_method_address, at rust/backend/ru
Maintainers usually reply within 3 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
Research direction
The crash is raised by resolve_method_address in gcc/rust/backend/rust-compile-base.cc (around line 1160), reached from CompileExpr::visit for MethodCallExpr in rust-compile-expr.cc (around line 1907). Start with the auto-reduced reproducer: a trait with an associated type and a method sharing the name bar, called as 'a'.bar() on a char. Done means that snippet compiles without the internal compiler error. The issue does not say which fix is intended, so confirm the expected behaviour with maintainers first.
Written by the indexing model from the issue text.
Description
auto-reduced (treereduce-rust):
//@compile-flags: -frust-incomplete-and-experimental-compiler-do-not-use -frust-crate-attr=no_core
pub trait Foo {
type bar;
fn bar(&self) {}
}
impl Foo for char {
type bar = u8;
}
fn main() {
'a'.bar();
}
original:
pub trait Foo {
type bar;
fn bar(&self) {}
}
impl Foo for char {
type bar = u8;
}
fn main() {
'a'.bar();
}
Version information:
a02e9a643d591708a5de6d506ef75f3405a91a0e
Possibly related line of code:
https://github.com/Rust-GCC/gccrs/blob/a02e9a643d591708a5de6d506ef75f3405a91a0e/gcc/rust/backend/rust-compile-base.cc#L1154-L1166
Command:
/home/matthias/vcs/github/gccrs/gccrs-build/gcc/crab1 -frust-incomplete-and-experimental-compiler-do-not-use -frust-crate-attr=no_core -frust-crate-attr=feature(no_core)
Program output
crab1: internal compiler error: in resolve_method_address, at rust/backend/rust-compile-base.cc:1160
0x35dee47 internal_error(char const*, ...)
../../gcc/diagnostic-global-context.cc:787
0xd2fe75 fancy_abort(char const*, int, char const*)
../../gcc/diagnostics/context.cc:1813
0x12f45d1 Rust::Compile::HIRCompileBase::resolve_method_address(Rust::TyTy::FnType*, Rust::TyTy::BaseType*, unsigned long)
../../gcc/rust/backend/rust-compile-base.cc:1160
0x12c15ab Rust::Compile::CompileExpr::visit(Rust::HIR::MethodCallExpr&)
../../gcc/rust/backend/rust-compile-expr.cc:1907
0x12b59d6 Rust::Compile::CompileExpr::Compile(Rust::HIR::Expr&, Rust::Compile::Context*)
../../gcc/rust/backend/rust-compile-expr.cc:164
0x12ab5f0 ???
../../gcc/rust/backend/rust-compile-stmt.h:33
0x12abe7c Rust::Compile::CompileStmt::Compile(Rust::HIR::Stmt*, Rust::Compile::Context*)
../../gcc/rust/backend/rust-compile-stmt.cc:39
0x12edb8b Rust::Compile::HIRCompileBase::compile_function_body(tree_node*, Rust::HIR::BlockExpr&, Rust::TyTy::BaseType*)
../../gcc/rust/backend/rust-compile-base.cc:683
0x12ef412 Rust::Compile::HIRCompileBase::compile_function(bool, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, tl::optional<Rust::HIR::SelfParam>&, std::vector<Rust::HIR::FunctionParam, std::allocator<Rust::HIR::FunctionParam> >&, Rust::HIR::FunctionQualifiers const&, Rust::HIR::Visibility&, std::vector<Rust::AST::Attribute, std::allocator<Rust::AST::Attribute> >&, unsigned long, Rust::HIR::BlockExpr*, Rust::Resolver::CanonicalPath const&, Rust::TyTy::FnType*)
../../gcc/rust/backend/rust-compile-base.cc:922
0x12a9e4d Rust::Compile::CompileItem::visit(Rust::HIR::Function&)
../../gcc/rust/backend/rust-compile-item.cc:283
0xf98b1b Rust::Compile::CompileItem::compile(Rust::HIR::Item*, Rust::Compile::Context*, Rust::TyTy::BaseType*, unsigned long)
../../gcc/rust/backend/rust-compile-item.h:37
0xf98b1b Rust::Compile::CompileCrate::go()
../../gcc/rust/backend/rust-compile.cc:49
0xf98b1b Rust::Compile::CompileCrate::Compile(Rust::HIR::Crate&, Rust::Compile::Context*)
../../gcc/rust/backend/rust-compile.cc:42
0xf82d9c Rust::Session::compile_crate(char const*)
../../gcc/rust/rust-session-manager.cc:862
/home/matthias/vcs/github/gccrs/gccrs-build/gcc/crab1 /tmp/icemaker_global_tempdir.2Zk2ZzLJdIQG/rustc_testrunner_tmpdir_reporting.Qytqyv3iCRwl/mvce.rs -o/tmp/icemaker_global_tempdir.2Zk2ZzLJdIQG/rustc_testrunner_tmpdir_reporting.Qytqyv3iCRwl/binaryname -frust-incomplete-and-experimental-compiler-do-not-use -frust-crate-attr=no_core -frust-crate-attr=feature(no_core)
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.
- Dominant language
- C++
- Stars
- 3k
- Forks
- 238
- Avg merge
- 4d 8h
- Merged PRs (30d)
- 31
Getting set up
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing 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.
More from Rust-GCC/gccrs
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 3 days
-
Allow pattern matching of floating point literalsPossibly taken @Vivekkumar0995 claimed this 7 days ago. Opencleanup good-first-pr typechecking
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Rust-GCC/gccrs#5047 · 3 comments · 1 assignee ·
Maintainers usually reply within 3 days
-
ICE in variance analysis on core, projection field keeps the impl's type paramPossibly taken @u7k4rs6 claimed this 1 day ago. Opentypechecking
Rust-GCC/gccrs#5074 · 1 assignee ·
Maintainers usually reply within 3 days
-
subset-error typechecking
Difficulty 4/5 3-5 days Newbie friendliness 25/100
Maintainers usually reply within 3 days
-
Difficulty 3/5 1-2 days Newbie friendliness 46/100
Rust-GCC/gccrs#5060 · 2 comments ·
Maintainers usually reply within 3 days
Similar issues
-
mlir
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
llvm/llvm-project#241070 · 1 comment ·
Maintainers usually reply within 1 day
-
help wanted new command
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
tldr-pages/tldr#25111 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 1 day
-
Ask the `ServerHelper` for fresh headers on every poll in `Future::get`, as is done for cookiesOpenenhancement
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
NVIDIA/cuda-quantum#5886 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
Maintainers usually reply within 1 day