Skip to content

segfault clone_type_no_bounds_impl() #4478

@matthiaskrgr

Description

@matthiaskrgr

auto-reduced (treereduce-rust):

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

fn id<'c, 'b>(c: &'b &'x dyn Fn(&&dyn Fn(&'c))) -> &'c &'b dyn  Fn() {
    &f
}

original:

#![feature(no_core)]
#![no_core]
// run-pass
#![allow(unused_variables)]
fn Y() {
    let f: &dyn Fn(&&'b dyn Fn(&&'b dyn  Fn(&&dyn Fn(&&dyn Fn(&&'b dyn Fn(&&'b dyn Fn(dyn Fn(&&'b dyn Fn(&&'b dyn Fn(&i32)))))))))) = unused_variables&|x| &|x| {}(&i33);
    {
    let f: &dyn Fn(&&'b dyn Fn(&&'b dyn  Fn(&&dyn Fn(&&dyn Fn(&&'b dyn Fn(&&'b dyn Fn(dyn Fn(&&'b dyn Fn(&&'b dyn Fn(&i32)))))))))) = Y&|x| &|x| {}(&i33);
    {};
};
}

fn id<'c, 'b>(c: &'b &'x dyn Fn(&&dyn Fn(&'c))) -> &'c &'b dyn  Fn(&&dyn Fn(&&dyn Fn(f: &'b &'Fn(&&dyn Fn(&&dyn Fn(f: &'b &'b dyn Fn(&&dyn Fn(&&'b dyn Fn(&&'b dyn Fn(&&'b dyn Fn(&i32)))))))) dyn Fn(&&'b dyn  Fn(&&dyn Fn(&&dyn Fn(f: &'b &'b dyn Fn(&&dyn Fn(&&'b dyn Fn(&&'b dyn Fn(&&'b dyn Fn(&i32)))))))))))) {
    &f
}

Version information:

1a91028

Command:
/home/matthias/vcs/github/gccrs/gccrs-build/gcc/crab1 -frust-incomplete-and-experimental-compiler-do-not-use

Program output

crab1: internal compiler error: Segmentation fault
0x3097ef9 internal_error(char const*, ...)
	../../gcc/diagnostic-global-context.cc:787
0x19c085f crash_signal
	../../gcc/toplev.cc:325
0xde1769 Rust::AST::TypeNoBounds::clone_type_no_bounds() const
	../../gcc/rust/ast/rust-ast.h:1529
0xde1769 Rust::AST::ReferenceType::ReferenceType(Rust::AST::ReferenceType const&)
	../../gcc/rust/ast/rust-type.h:646
0xde1769 Rust::AST::ReferenceType::clone_type_no_bounds_impl() const
	../../gcc/rust/ast/rust-type.h:698
0xdedd91 Rust::AST::Type::clone_type() const
	../../gcc/rust/ast/rust-ast.h:1484
0xdedd91 Rust::AST::TypePathFunction::TypePathFunction(Rust::AST::TypePathFunction const&)
	../../gcc/rust/ast/rust-path.h:1135
0xdedd91 Rust::AST::TypePathSegmentFunction::TypePathSegmentFunction(Rust::AST::TypePathSegmentFunction const&)
	../../gcc/rust/ast/rust-path.h:1203
0xdedd91 Rust::AST::TypePathSegmentFunction::clone_type_path_segment_impl() const
	../../gcc/rust/ast/rust-path.h:1244
0xcea6cc Rust::AST::TypePathSegment::clone_type_path_segment() const
	../../gcc/rust/ast/rust-path.h:867
0xcea6cc Rust::AST::TypePath::TypePath(Rust::AST::TypePath const&)
	../../gcc/rust/ast/rust-path.h:1317
0xcea6cc Rust::AST::TraitBound::TraitBound(Rust::AST::TraitBound const&)
	../../gcc/rust/ast/rust-type.h:81
0xd7af1c Rust::Parser<Rust::Lexer>::parse_type_no_bounds()
	../../gcc/rust/parse/rust-parse-impl.hxx:6711
0xd7bfa7 Rust::Parser<Rust::Lexer>::parse_reference_type_inner(unsigned long)
	../../gcc/rust/parse/rust-parse-impl.hxx:6333
0xd7c9ba Rust::Parser<Rust::Lexer>::parse_reference_type()
	../../gcc/rust/parse/rust-parse-impl.hxx:6360
0xd7afff Rust::Parser<Rust::Lexer>::parse_type_no_bounds()
	../../gcc/rust/parse/rust-parse-impl.hxx:6526
0xd7bfa7 Rust::Parser<Rust::Lexer>::parse_reference_type_inner(unsigned long)
	../../gcc/rust/parse/rust-parse-impl.hxx:6333
0xd7c9ba Rust::Parser<Rust::Lexer>::parse_reference_type()
	../../gcc/rust/parse/rust-parse-impl.hxx:6360
0xd7d19f Rust::Parser<Rust::Lexer>::parse_type(bool)
	../../gcc/rust/parse/rust-parse-impl.hxx:5652
0xd906c3 Rust::Parser<Rust::Lexer>::parse_function_param()
	../../gcc/rust/parse/rust-parse-impl.hxx:2399
/home/matthias/vcs/github/gccrs/gccrs-build/gcc/crab1 /tmp/icemaker_global_tempdir.OypEAej2sZax/rustc_testrunner_tmpdir_reporting.XVGSGMxM5rH9/mvce.rs -o/tmp/icemaker_global_tempdir.OypEAej2sZax/rustc_testrunner_tmpdir_reporting.XVGSGMxM5rH9/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.

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