gccrs icon indicating copy to clipboard operation
gccrs copied to clipboard

parser: no error when namespace operator is used without an identifier

Open liushuyu opened this issue 2 years ago • 1 comments

Code

// http://phpsadness.com/sad/1

fn main() {
    ::; //~ ERROR expected identifier, found `;`
}

Origin: https://github.com/rust-lang/rust/blob/master/src/test/ui/parser/paamayim-nekudotayim.rs

Meta

  • 7beea479c5a1e7e415223f3fbd4e16c20c3214ec

Error output

rust1: note: Preparing to parse files. 
rust1: note: inferred crate name: paamayim_nekudotayim
rust1: note: Attempting to parse file: paamayim-nekudotayim.rs
rust1: note: null denotation is null; returning null for parse_expr
rust1: internal compiler error: Segmentation Fault
Backtrace

0x10bf52f crash_signal
      /home/liushuyu/Development/gccrs/build/../gcc/toplev.cc:322
0x9bdad8 Rust::AST::ExprStmtWithoutBlock::ExprStmtWithoutBlock(std::unique_ptr<Rust::AST::ExprWithoutBlock, std::default_delete<Rust::AST::ExprWithoutBlock> >, Location)
      /home/liushuyu/Development/gccrs/build/../gcc/rust/ast/rust-stmt.h:222
0x9bdad8 Rust::Parser<Rust::Lexer>::parse_stmt_or_expr_without_block()
      /home/liushuyu/Development/gccrs/build/../gcc/rust/parse/rust-parse-impl.h:11732
0x9bdecf Rust::Parser<Rust::Lexer>::parse_block_expr(std::vector<Rust::AST::Attribute, std::allocator<Rust::AST::Attribute> >, Location)
      /home/liushuyu/Development/gccrs/build/../gcc/rust/parse/rust-parse-impl.h:7341
0x9de650 Rust::Parser<Rust::Lexer>::parse_function(Rust::AST::Visibility, std::vector<Rust::AST::Attribute, std::allocator<Rust::AST::Attribute> >)
      /home/liushuyu/Development/gccrs/build/../gcc/rust/parse/rust-parse-impl.h:2702
0x9e3757 Rust::Parser<Rust::Lexer>::parse_vis_item(std::vector<Rust::AST::Attribute, std::allocator<Rust::AST::Attribute> >)
      /home/liushuyu/Development/gccrs/build/../gcc/rust/parse/rust-parse-impl.h:1259
0x9e4370 Rust::Parser<Rust::Lexer>::parse_item(bool)
      /home/liushuyu/Development/gccrs/build/../gcc/rust/parse/rust-parse-impl.h:1080
0x9e4568 Rust::Parser<Rust::Lexer>::parse_items()
      /home/liushuyu/Development/gccrs/build/../gcc/rust/parse/rust-parse-impl.h:405
0x9fde72 Rust::Parser<Rust::Lexer>::parse_crate()
      /home/liushuyu/Development/gccrs/build/../gcc/rust/parse/rust-parse-impl.h:434
0x9f7cbc Rust::Session::parse_file(char const*)
      /home/liushuyu/Development/gccrs/build/../gcc/rust/rust-session-manager.cc:676
0x9f88e0 Rust::Session::parse_files(int, char const**)
      /home/liushuyu/Development/gccrs/build/../gcc/rust/rust-session-manager.cc:601

liushuyu avatar Aug 08 '22 06:08 liushuyu