Skip to content

ICE resolve_path #4411

@matthiaskrgr

Description

@matthiaskrgr

auto-reduced (treereduce-rust):

//@compile-flags: -frust-incomplete-and-experimental-compiler-do-not-use
mod framing {

    pub use ::*;
}

original:

// https://github.com/rust-lang/rust/pull/113099

mod framing {
    mod public_message {
        use super::super::*;

        #[derive(Debug)]
        pub struct ConfirmedTranscriptHashInput;
    }

    mod public_message_in {
        use super::*;

        #[derive(Debug)]
        pub struct ConfirmedTranscriptHashInput;
    }

    pub use self::public_message::*;
    pub use self::public_message_in::*;
}

use crate::framing::ConfirmedTranscriptHashInput;
//~^ ERROR `ConfirmedTranscriptHashInput` is ambiguous
//~| WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!

fn main() { }

Version information:

145e66e

Possibly related line of code:

ForeverStack<N>::resolve_path (
const std::vector<S> &segments, ResolutionMode mode,
std::function<void (const S &, NodeId)> insert_segment_resolution,
std::vector<Error> &collect_errors,
std::reference_wrapper<Node> starting_point)
{
rust_assert (!segments.empty ());
switch (mode)
{
case ResolutionMode::Normal:
break; // default
case ResolutionMode::FromRoot:

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: unknown crate ‘core’
crab1: internal compiler error: in resolve_path, at rust/resolve/rust-forever-stack.hxx:716
0x30d80b9 internal_error(char const*, ...)
	../../gcc/diagnostic-global-context.cc:787
0xc3ae5d fancy_abort(char const*, int, char const*)
	../../gcc/diagnostics/context.cc:1805
0x10022c3 tl::optional<Rust::Resolver2_0::Rib::Definition> Rust::Resolver2_0::ForeverStack<(Rust::Resolver2_0::Namespace)1>::resolve_path<Rust::AST::SimplePathSegment>(std::vector<Rust::AST::SimplePathSegment, std::allocator<Rust::AST::SimplePathSegment> > const&, Rust::Resolver2_0::ResolutionMode, std::function<void (Rust::AST::SimplePathSegment const&, unsigned int)>, std::vector<Rust::Error, std::allocator<Rust::Error> >&, std::reference_wrapper<Rust::Resolver2_0::ForeverStack<(Rust::Resolver2_0::Namespace)1>::Node>)
	../../gcc/rust/resolve/rust-forever-stack.hxx:716
0x1004c64 tl::optional<Rust::Resolver2_0::Rib::Definition> Rust::Resolver2_0::ForeverStack<(Rust::Resolver2_0::Namespace)1>::resolve_path<Rust::AST::SimplePathSegment>(std::vector<Rust::AST::SimplePathSegment, std::allocator<Rust::AST::SimplePathSegment> > const&, Rust::Resolver2_0::ResolutionMode, std::function<void (Rust::AST::SimplePathSegment const&, unsigned int)>, std::vector<Rust::Error, std::allocator<Rust::Error> >&)
	../../gcc/rust/resolve/rust-forever-stack.hxx:704
0x1004c64 tl::optional<Rust::Resolver2_0::Rib::Definition> Rust::Resolver2_0::NameResolutionContext::resolve_path<Rust::AST::SimplePathSegment>(std::vector<Rust::AST::SimplePathSegment, std::allocator<Rust::AST::SimplePathSegment> > const&, Rust::Resolver2_0::ResolutionMode, std::vector<Rust::Error, std::allocator<Rust::Error> >&, Rust::Resolver2_0::Namespace)
	../../gcc/rust/resolve/rust-name-resolution-context.h:575
0xffa585 tl::optional<Rust::Resolver2_0::Rib::Definition> Rust::Resolver2_0::NameResolutionContext::resolve_path<Rust::AST::SimplePathSegment>(std::vector<Rust::AST::SimplePathSegment, std::allocator<Rust::AST::SimplePathSegment> > const&, Rust::Resolver2_0::ResolutionMode, tl::optional<std::vector<Rust::Error, std::allocator<Rust::Error> >&>, Rust::Resolver2_0::Namespace)
	../../gcc/rust/resolve/rust-name-resolution-context.h:633
0xffa585 tl::optional<Rust::Resolver2_0::Rib::Definition> Rust::Resolver2_0::NameResolutionContext::resolve_path<Rust::AST::SimplePathSegment>(std::vector<Rust::AST::SimplePathSegment, std::allocator<Rust::AST::SimplePathSegment> > const&, bool, tl::optional<std::vector<Rust::Error, std::allocator<Rust::Error> >&>, Rust::Resolver2_0::Namespace)
	../../gcc/rust/resolve/rust-name-resolution-context.h:671
0xffa585 tl::optional<Rust::Resolver2_0::Rib::Definition> Rust::Resolver2_0::NameResolutionContext::resolve_path<Rust::AST::SimplePathSegment>(std::vector<Rust::AST::SimplePathSegment, std::allocator<Rust::AST::SimplePathSegment> > const&, bool, Rust::Resolver2_0::Namespace)
	../../gcc/rust/resolve/rust-name-resolution-context.h:681
0xffa585 tl::optional<Rust::Resolver2_0::Rib::Definition> Rust::Resolver2_0::NameResolutionContext::resolve_path<Rust::Resolver2_0::Namespace>(Rust::AST::SimplePath const&, Rust::Resolver2_0::Namespace&&)
	../../gcc/rust/resolve/rust-name-resolution-context.h:699
0xffa585 Rust::Resolver2_0::Early::resolve_glob_import(unsigned int, Rust::Resolver2_0::TopLevel::ImportKind&&)
	../../gcc/rust/resolve/rust-early-name-resolver-2.0.cc:78
0xffc7cb Rust::Resolver2_0::Early::build_import_mapping(std::pair<unsigned int, std::vector<Rust::Resolver2_0::TopLevel::ImportKind, std::allocator<Rust::Resolver2_0::TopLevel::ImportKind> > >&&)
	../../gcc/rust/resolve/rust-early-name-resolver-2.0.cc:156
0xffcc95 Rust::Resolver2_0::Early::visit(Rust::AST::UseDeclaration&)
	../../gcc/rust/resolve/rust-early-name-resolver-2.0.cc:491
0xe864bf 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:420
0xe864bf Rust::AST::DefaultASTVisitor::visit(Rust::AST::Module&)
	../../gcc/rust/ast/rust-ast-visitor.cc:835
0xfe5f09 operator()
	../../gcc/rust/resolve/rust-default-resolver.cc:61
0xfe5f09 scope_inner<Rust::Resolver2_0::CanonicalPathCtx::scope<Rust::Resolver2_0::DefaultResolver::visit(Rust::AST::Module&)::<lambda()> >(Rust::NodeId, std::string, Rust::Resolver2_0::DefaultResolver::visit(Rust::AST::Module&)::<lambda()>&&)::<lambda()>, Rust::Resolver2_0::DefaultResolver::visit(Rust::AST::Module&)::<lambda()> >
	../../gcc/rust/resolve/rust-name-resolution-context.h:470
0xfe5f09 scope<Rust::Resolver2_0::DefaultResolver::visit(Rust::AST::Module&)::<lambda()> >
	../../gcc/rust/resolve/rust-name-resolution-context.h:413
0xfe5f09 scope<Rust::Resolver2_0::DefaultResolver::visit(Rust::AST::Module&)::<lambda()> >
	../../gcc/rust/resolve/rust-name-resolution-context.h:406
0xfe5f09 operator()
	../../gcc/rust/resolve/rust-default-resolver.cc:64
0xfe5f09 __invoke_impl<void, Rust::Resolver2_0::DefaultResolver::visit(Rust::AST::Module&)::<lambda()>&>
	/usr/include/c++/15.2.1/bits/invoke.h:63
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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions