Skip to content

segfault Rust::Parser<Rust::Lexer>::left_denotations macro missing body #4413

@matthiaskrgr

Description

@matthiaskrgr

auto-reduced (treereduce-rust):

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





					fn main() {
						
						match money {
							 
							
							
							v => println!
						}
					}

original:

// Test for #78438: ensure underline alignment with many tabs on the left, long line on the right
//@ compile-flags: --diagnostic-width=145
// ignore-tidy-linelength
// ignore-tidy-tab

					fn main() {
						let money = 2;
						match money {
							v @ 3 | 2 | 3 => panic!("You gave me too little money {}", v), // Long text here: TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT
							//~^ ERROR variable `v` is not bound in all patterns
							//~| ERROR possibly-uninitialized
							v => println!("Enough money {}", v"You gave me too little money {}",
						}
					}

Version information:

145e66e

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
0x30d80b9 internal_error(char const*, ...)
	../../gcc/diagnostic-global-context.cc:787
0x1a0b21f crash_signal
	../../gcc/toplev.cc:325
0xdcf980 Rust::Parser<Rust::Lexer>::left_denotations(tl::expected<std::unique_ptr<Rust::AST::Expr, std::default_delete<Rust::AST::Expr> >, Rust::Parse::Error::Expr>, int, std::vector<Rust::AST::Attribute, std::allocator<Rust::AST::Attribute> >, Rust::ParseRestrictions)
	../../gcc/rust/parse/rust-parse-impl-expr.hxx:1828
0xdc1bc5 Rust::Parser<Rust::Lexer>::parse_expr(int, std::vector<Rust::AST::Attribute, std::allocator<Rust::AST::Attribute> >, Rust::ParseRestrictions)
	../../gcc/rust/parse/rust-parse-impl-expr.hxx:1799
0xdc1cb1 Rust::Parser<Rust::Lexer>::parse_expr(std::vector<Rust::AST::Attribute, std::allocator<Rust::AST::Attribute> >, Rust::ParseRestrictions)
	../../gcc/rust/parse/rust-parse-impl-expr.hxx:1808
0xded108 Rust::Parser<Rust::Lexer>::parse_match_expr(std::vector<Rust::AST::Attribute, std::allocator<Rust::AST::Attribute> >, unsigned long)
	../../gcc/rust/parse/rust-parse-impl-expr.hxx:1284
0xe0ee79 Rust::Parser<Rust::Lexer>::null_denotation_not_path(std::shared_ptr<Rust::Token const>, std::vector<Rust::AST::Attribute, std::allocator<Rust::AST::Attribute> >, Rust::ParseRestrictions)
	../../gcc/rust/parse/rust-parse-impl-expr.hxx:2463
0xdc157f Rust::Parser<Rust::Lexer>::null_denotation(std::vector<Rust::AST::Attribute, std::allocator<Rust::AST::Attribute> >, Rust::ParseRestrictions)
	../../gcc/rust/parse/rust-parse-impl-expr.hxx:1933
0xdc1a07 Rust::Parser<Rust::Lexer>::parse_expr(int, std::vector<Rust::AST::Attribute, std::allocator<Rust::AST::Attribute> >, Rust::ParseRestrictions)
	../../gcc/rust/parse/rust-parse-impl-expr.hxx:1793
0xdc1cb1 Rust::Parser<Rust::Lexer>::parse_expr(std::vector<Rust::AST::Attribute, std::allocator<Rust::AST::Attribute> >, Rust::ParseRestrictions)
	../../gcc/rust/parse/rust-parse-impl-expr.hxx:1808
0xdcfc0d Rust::Parser<Rust::Lexer>::parse_stmt_or_expr()
	../../gcc/rust/parse/rust-parse-impl.hxx:7170
0xdd0dcf Rust::Parser<Rust::Lexer>::parse_block_expr(std::vector<Rust::AST::Attribute, std::allocator<Rust::AST::Attribute> >, tl::optional<Rust::AST::LoopLabel>, unsigned long)
	../../gcc/rust/parse/rust-parse-impl-expr.hxx:55
0xdfa5f3 Rust::Parser<Rust::Lexer>::parse_function(Rust::AST::Visibility, std::vector<Rust::AST::Attribute, std::allocator<Rust::AST::Attribute> >, bool)
	../../gcc/rust/parse/rust-parse-impl.hxx:1630
0xe02f9b Rust::Parser<Rust::Lexer>::parse_vis_item(std::vector<Rust::AST::Attribute, std::allocator<Rust::AST::Attribute> >)
	../../gcc/rust/parse/rust-parse-impl.hxx:509
0xe0433a Rust::Parser<Rust::Lexer>::parse_item(bool)
	../../gcc/rust/parse/rust-parse-impl.hxx:402
0xe0580c Rust::Parser<Rust::Lexer>::parse_items()
	../../gcc/rust/parse/rust-parse-impl.hxx:278
0xe05a36 Rust::Parser<Rust::Lexer>::parse_crate()
	../../gcc/rust/parse/rust-parse-impl.hxx:305
0xec8ff8 Rust::Session::compile_crate(char const*)
	../../gcc/rust/rust-session-manager.cc:601
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