From c3f426ad8aa9edd2b3e86877fe8f1577fba5b4f8 Mon Sep 17 00:00:00 2001 From: Pierre-Emmanuel Patry Date: Wed, 26 Nov 2025 15:46:04 +0100 Subject: [PATCH] Remove non-leaf item in crate parsing failure error gcc/rust/ChangeLog: * parse/rust-parse-impl.h (Parser::parse_items): Remove item parsing error. gcc/testsuite/ChangeLog: * rust/compile/braced_macro_arm.rs: Remove superfluous error message matching. * rust/compile/decl_macro6.rs: Likewise. * rust/compile/decl_macro7.rs: Likewise. * rust/compile/extern_type_item_missing_semi.rs: Likewise. * rust/compile/issue-2187.rs: Likewise. * rust/compile/issue-407-2.rs: Likewise. * rust/compile/issue-407.rs: Likewise. * rust/compile/issue-4162.rs: Likewise. * rust/compile/issue-867.rs: Likewise. * rust/compile/macros/mbe/macro-issue1053-2.rs: Likewise. * rust/compile/macros/mbe/macro-issue1395-2.rs: Likewise. * rust/compile/macros/mbe/macro-issue3608.rs: Likewise. * rust/compile/macros/mbe/macro27.rs: Likewise. * rust/compile/macros/mbe/macro28.rs: Likewise. * rust/compile/macros/mbe/macro29.rs: Likewise. * rust/compile/macros/mbe/macro30.rs: Likewise. * rust/compile/macros/mbe/macro31.rs: Likewise. * rust/compile/macros/mbe/macro33.rs: Likewise. * rust/compile/macros/mbe/macro35.rs: Likewise. * rust/compile/macros/mbe/macro37.rs: Likewise. * rust/compile/macros/mbe/macro38.rs: Likewise. * rust/compile/macros/mbe/macro39.rs: Likewise. * rust/compile/macros/mbe/macro48.rs: Likewise. * rust/compile/parse_invalid_specialization.rs: Likewise. * rust/compile/parse_simple_path_fail_1.rs: Likewise. * rust/compile/parse_simple_path_fail_2.rs: Likewise. * rust/compile/raw-string-loc.rs: Likewise. * rust/compile/raw-byte-string-loc.rs: Likewise. * rust/compile/self_const_ptr.rs: Likewise. * rust/compile/self_mut_ptr.rs: Likewise. * rust/compile/static_var1.rs: Likewise. * rust/compile/self_ptr.rs: Likewise. * rust/compile/torture/identifier-missing-impl-1.rs: Likewise. Signed-off-by: Pierre-Emmanuel Patry --- gcc/rust/parse/rust-parse-impl.h | 4 ---- gcc/testsuite/rust/compile/braced_macro_arm.rs | 1 - gcc/testsuite/rust/compile/decl_macro6.rs | 1 - gcc/testsuite/rust/compile/decl_macro7.rs | 1 - gcc/testsuite/rust/compile/extern_type_item_missing_semi.rs | 1 - gcc/testsuite/rust/compile/issue-2187.rs | 1 - gcc/testsuite/rust/compile/issue-407-2.rs | 1 - gcc/testsuite/rust/compile/issue-407.rs | 1 - gcc/testsuite/rust/compile/issue-4162.rs | 1 - gcc/testsuite/rust/compile/issue-867.rs | 3 +-- gcc/testsuite/rust/compile/macros/mbe/macro-issue1053-2.rs | 1 - gcc/testsuite/rust/compile/macros/mbe/macro-issue1395-2.rs | 1 - gcc/testsuite/rust/compile/macros/mbe/macro-issue3608.rs | 5 ++--- gcc/testsuite/rust/compile/macros/mbe/macro27.rs | 1 - gcc/testsuite/rust/compile/macros/mbe/macro28.rs | 1 - gcc/testsuite/rust/compile/macros/mbe/macro29.rs | 1 - gcc/testsuite/rust/compile/macros/mbe/macro30.rs | 1 - gcc/testsuite/rust/compile/macros/mbe/macro31.rs | 1 - gcc/testsuite/rust/compile/macros/mbe/macro33.rs | 1 - gcc/testsuite/rust/compile/macros/mbe/macro35.rs | 1 - gcc/testsuite/rust/compile/macros/mbe/macro37.rs | 1 - gcc/testsuite/rust/compile/macros/mbe/macro38.rs | 1 - gcc/testsuite/rust/compile/macros/mbe/macro39.rs | 1 - gcc/testsuite/rust/compile/macros/mbe/macro48.rs | 5 ++--- gcc/testsuite/rust/compile/parse_invalid_specialization.rs | 1 - gcc/testsuite/rust/compile/parse_simple_path_fail_1.rs | 1 - gcc/testsuite/rust/compile/parse_simple_path_fail_2.rs | 2 -- gcc/testsuite/rust/compile/raw-byte-string-loc.rs | 1 - gcc/testsuite/rust/compile/raw-string-loc.rs | 1 - gcc/testsuite/rust/compile/self_const_ptr.rs | 1 - gcc/testsuite/rust/compile/self_mut_ptr.rs | 1 - gcc/testsuite/rust/compile/self_ptr.rs | 1 - gcc/testsuite/rust/compile/static_var1.rs | 2 +- .../rust/compile/torture/identifier-missing-impl-1.rs | 1 - 34 files changed, 6 insertions(+), 43 deletions(-) diff --git a/gcc/rust/parse/rust-parse-impl.h b/gcc/rust/parse/rust-parse-impl.h index afc701230951..1ffddabf74d6 100644 --- a/gcc/rust/parse/rust-parse-impl.h +++ b/gcc/rust/parse/rust-parse-impl.h @@ -431,10 +431,6 @@ Parser::parse_items () std::unique_ptr item = parse_item (false); if (item == nullptr) { - Error error (lexer.peek_token ()->get_locus (), - "failed to parse item in crate"); - add_error (std::move (error)); - // TODO: should all items be cleared? items = std::vector> (); break; diff --git a/gcc/testsuite/rust/compile/braced_macro_arm.rs b/gcc/testsuite/rust/compile/braced_macro_arm.rs index 14468786f509..9bcd1a69c9fb 100644 --- a/gcc/testsuite/rust/compile/braced_macro_arm.rs +++ b/gcc/testsuite/rust/compile/braced_macro_arm.rs @@ -12,7 +12,6 @@ fn h(c: bool) { false => () // { dg-error "exprwithoutblock requires comma after match case expression in match arm \\(if not final case\\)" "" { target *-*-* } .-1 } // { dg-error "unrecognised token .false. for start of item" "" { target *-*-* } .-2 } - // { dg-error "failed to parse item in crate" "" { target *-*-* } .-3 } }; } diff --git a/gcc/testsuite/rust/compile/decl_macro6.rs b/gcc/testsuite/rust/compile/decl_macro6.rs index 5c5e7002a980..b290b4c98204 100644 --- a/gcc/testsuite/rust/compile/decl_macro6.rs +++ b/gcc/testsuite/rust/compile/decl_macro6.rs @@ -2,4 +2,3 @@ macro m {} // { dg-error "unexpected token .\}. - expecting delimiters .for a macro matcher." "" { target *-*-* } .-1 } // { dg-error "required first macro rule in declarative macro definition could not be parsed" "" { target *-*-* } .-2 } -// { dg-error "failed to parse item in crate" "" { target *-*-* } .-3 } diff --git a/gcc/testsuite/rust/compile/decl_macro7.rs b/gcc/testsuite/rust/compile/decl_macro7.rs index 7327fb567821..800754441840 100644 --- a/gcc/testsuite/rust/compile/decl_macro7.rs +++ b/gcc/testsuite/rust/compile/decl_macro7.rs @@ -1,4 +1,3 @@ #![feature(decl_macro)] pub macro hello() [ "Hello" ] // { dg-error "only braces can be used for a macro transcriber in declarative macro definition" "" { target *-*-* } .-1 } -// { dg-error "failed to parse item in crate" } \ No newline at end of file diff --git a/gcc/testsuite/rust/compile/extern_type_item_missing_semi.rs b/gcc/testsuite/rust/compile/extern_type_item_missing_semi.rs index a42af02210fa..cd4d4e2cd540 100644 --- a/gcc/testsuite/rust/compile/extern_type_item_missing_semi.rs +++ b/gcc/testsuite/rust/compile/extern_type_item_missing_semi.rs @@ -4,4 +4,3 @@ extern "C" { type F; type E // { dg-error "failed to parse" } } // { dg-error "expecting" } -// { dg-error "failed to parse item in crate" "" { target *-*-* } .-1 } diff --git a/gcc/testsuite/rust/compile/issue-2187.rs b/gcc/testsuite/rust/compile/issue-2187.rs index deef417a668b..78d843ec8329 100644 --- a/gcc/testsuite/rust/compile/issue-2187.rs +++ b/gcc/testsuite/rust/compile/issue-2187.rs @@ -8,4 +8,3 @@ const D: &'static str = " "; ERROR_TIME // { dg-error "unrecognised token" "" { target *-*-* } .-1 } -// { dg-error "failed to parse item in crate" "" { target *-*-* } .-2 } diff --git a/gcc/testsuite/rust/compile/issue-407-2.rs b/gcc/testsuite/rust/compile/issue-407-2.rs index 2d60d6d72b89..002d998a95eb 100644 --- a/gcc/testsuite/rust/compile/issue-407-2.rs +++ b/gcc/testsuite/rust/compile/issue-407-2.rs @@ -10,7 +10,6 @@ pub fn loopy() { // { dg-error {failed to parse if body block expression in if expression} "" { target *-*-* } .-2 } // { dg-error {could not parse loop body in \(infinite\) loop expression} "" { target *-*-* } .-3 } // { dg-error {unrecognised token 'integer literal' for start of item} "" { target *-*-* } .-4 } - // { dg-error {failed to parse item in crate} "" { target *-*-* } .-5 } } else { break; } diff --git a/gcc/testsuite/rust/compile/issue-407.rs b/gcc/testsuite/rust/compile/issue-407.rs index bd0d3069b109..9188c2c6b07d 100644 --- a/gcc/testsuite/rust/compile/issue-407.rs +++ b/gcc/testsuite/rust/compile/issue-407.rs @@ -4,5 +4,4 @@ fn test() { a + = 1; // { dg-error "found unexpected token '=' in null denotation" } // { dg-error {failed to parse statement or expression in block expression} "" { target *-*-* } .-1 } // { dg-error {unrecognised token 'integer literal' for start of item} "" { target *-*-* } .-2 } - // { dg-error {failed to parse item in crate} "" { target *-*-* } .-3 } } diff --git a/gcc/testsuite/rust/compile/issue-4162.rs b/gcc/testsuite/rust/compile/issue-4162.rs index c82bac611d3e..7caf8870c05d 100644 --- a/gcc/testsuite/rust/compile/issue-4162.rs +++ b/gcc/testsuite/rust/compile/issue-4162.rs @@ -3,7 +3,6 @@ pub fn main() { // { dg-error "should be at least 1 pattern" "" { target *-*-* } .-1 } // { dg-error "failed to parse statement or expression in block expression" "" { target *-*-* } .-2 } // { dg-error "unrecognised token .=. for start of item" "" { target *-*-* } .-3 } - // { dg-error "failed to parse item in crate" "" { target *-*-* } .-4 } {} } diff --git a/gcc/testsuite/rust/compile/issue-867.rs b/gcc/testsuite/rust/compile/issue-867.rs index e5f9b29bd595..c61de09d8abb 100644 --- a/gcc/testsuite/rust/compile/issue-867.rs +++ b/gcc/testsuite/rust/compile/issue-867.rs @@ -3,6 +3,5 @@ fn main() { let a = _ + 123; // { dg-error "use of '_' is not allowed on the right-side of an assignment" } // { dg-error {failed to parse expression in let statement} "" { target *-*-* } .-1 } // { dg-error {failed to parse statement or expression in block expression} "" { target *-*-* } .-2 } - // { dg-error {unrecognised token '\}' for start of item} "" { target *-*-* } .+2 } - // { dg-error {failed to parse item in crate} "" { target *-*-* } .+1 } + // { dg-error {unrecognised token '\}' for start of item} "" { target *-*-* } .+1 } } diff --git a/gcc/testsuite/rust/compile/macros/mbe/macro-issue1053-2.rs b/gcc/testsuite/rust/compile/macros/mbe/macro-issue1053-2.rs index 31459907c08f..fc96caa1b4ea 100644 --- a/gcc/testsuite/rust/compile/macros/mbe/macro-issue1053-2.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro-issue1053-2.rs @@ -1,5 +1,4 @@ macro_rules! m { ($e:expr $(forbidden)*) => {{}}; // { dg-error "token .identifier. is not allowed after .expr. fragment" } // { dg-error "required first macro rule in macro rules definition could not be parsed" "" { target *-*-* } .-1 } - // { dg-error "failed to parse item in crate" "" { target *-*-* } .-2 } } diff --git a/gcc/testsuite/rust/compile/macros/mbe/macro-issue1395-2.rs b/gcc/testsuite/rust/compile/macros/mbe/macro-issue1395-2.rs index 1df6a3a00384..7ff380d891df 100644 --- a/gcc/testsuite/rust/compile/macros/mbe/macro-issue1395-2.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro-issue1395-2.rs @@ -2,6 +2,5 @@ macro_rules! try { // { dg-error "expecting .identifier. but .try. found" "" { target *-*-* } .-1 } - // { dg-error "failed to parse item in crate" "" { target *-*-* } .-2 } () => {}; } diff --git a/gcc/testsuite/rust/compile/macros/mbe/macro-issue3608.rs b/gcc/testsuite/rust/compile/macros/mbe/macro-issue3608.rs index 15207992ad27..381f1210afdf 100644 --- a/gcc/testsuite/rust/compile/macros/mbe/macro-issue3608.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro-issue3608.rs @@ -7,6 +7,5 @@ impl Bar for fn main() { )// { dg-error "unexpected closing delimiter .\\). - token tree requires either paired delimiters or non-delimiter tokens" } // { dg-error "failed to parse token tree in delimited token tree - found .\\)." "" { target *-*-* } .-1 } - // { dg-error "unexpected token .end of file. - expecting closing delimiter .\}. .for a delimited token tree." "" { target *-*-* } .+3 } - // { dg-error "unexpected token .end of file. - expecting closing delimiter .\\). .for a macro invocation semi." "" { target *-*-* } .+2 } - // { dg-error "failed to parse item in crate" "" { target *-*-* } .+1 } + // { dg-error "unexpected token .end of file. - expecting closing delimiter .\}. .for a delimited token tree." "" { target *-*-* } .+2 } + // { dg-error "unexpected token .end of file. - expecting closing delimiter .\\). .for a macro invocation semi." "" { target *-*-* } .+1 } diff --git a/gcc/testsuite/rust/compile/macros/mbe/macro27.rs b/gcc/testsuite/rust/compile/macros/mbe/macro27.rs index ee7833be0a6e..b9f392f64023 100644 --- a/gcc/testsuite/rust/compile/macros/mbe/macro27.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro27.rs @@ -2,7 +2,6 @@ macro_rules! m { ($a:expr tok) => { // { dg-error "token .identifier. is not allowed after .expr. fragment" "" { target *-*-* } .-1 } // { dg-error "required first macro rule in macro rules definition could not be parsed" "" { target *-*-* } .-2 } - // { dg-error "failed to parse item in crate" "" { target *-*-* } .-3 } $a }; } diff --git a/gcc/testsuite/rust/compile/macros/mbe/macro28.rs b/gcc/testsuite/rust/compile/macros/mbe/macro28.rs index 8002f284ecff..bbe55a76c29d 100644 --- a/gcc/testsuite/rust/compile/macros/mbe/macro28.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro28.rs @@ -2,7 +2,6 @@ macro_rules! m { ($a:expr $(tok $es:expr)*) => { // { dg-error "token .identifier. is not allowed after .expr. fragment" "" { target *-*-* } .-1 } // { dg-error "required first macro rule in macro rules definition could not be parsed" "" { target *-*-* } .-2 } - // { dg-error "failed to parse item in crate" "" { target *-*-* } .-3 } $a }; } diff --git a/gcc/testsuite/rust/compile/macros/mbe/macro29.rs b/gcc/testsuite/rust/compile/macros/mbe/macro29.rs index 39f5021b74f7..a6c9eb5271d3 100644 --- a/gcc/testsuite/rust/compile/macros/mbe/macro29.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro29.rs @@ -2,7 +2,6 @@ macro_rules! m { ($($es:expr)* tok) => { // { dg-error "token .identifier. is not allowed after .expr. fragment" "" { target *-*-* } .-1 } // { dg-error "required first macro rule in macro rules definition could not be parsed" "" { target *-*-* } .-2 } - // { dg-error "failed to parse item in crate" "" { target *-*-* } .-3 } $a }; } diff --git a/gcc/testsuite/rust/compile/macros/mbe/macro30.rs b/gcc/testsuite/rust/compile/macros/mbe/macro30.rs index 35064bc0ee58..097272edcb78 100644 --- a/gcc/testsuite/rust/compile/macros/mbe/macro30.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro30.rs @@ -2,7 +2,6 @@ macro_rules! m { ($e:expr $f:expr) => { // { dg-error "fragment is not allowed after .expr. fragment" "" { target *-*-* } .-1 } // { dg-error "required first macro rule in macro rules definition could not be parsed" "" { target *-*-* } .-2 } - // { dg-error "failed to parse item in crate" "" { target *-*-* } .-3 } $e }; } diff --git a/gcc/testsuite/rust/compile/macros/mbe/macro31.rs b/gcc/testsuite/rust/compile/macros/mbe/macro31.rs index 6674a5fe554b..30fae48f91f3 100644 --- a/gcc/testsuite/rust/compile/macros/mbe/macro31.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro31.rs @@ -2,7 +2,6 @@ macro_rules! m { ($($e:expr)* $($f:expr)*) => { // { dg-error "fragment is not allowed after .expr. fragment" "" { target *-*-* } .-1 } // { dg-error "required first macro rule in macro rules definition could not be parsed" "" { target *-*-* } .-2 } - // { dg-error "failed to parse item in crate" "" { target *-*-* } .-3 } $e }; } diff --git a/gcc/testsuite/rust/compile/macros/mbe/macro33.rs b/gcc/testsuite/rust/compile/macros/mbe/macro33.rs index 2ccd33e50d3a..a73d245a5426 100644 --- a/gcc/testsuite/rust/compile/macros/mbe/macro33.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro33.rs @@ -1,5 +1,4 @@ macro_rules! forbidden_frag { ($t:ty $not_block:ident) => {{}}; // { dg-error "fragment specifier .ident. is not allowed after .ty. fragments" } // { dg-error "required first macro rule in macro rules definition could not be parsed" "" { target *-*-* } .-1 } - // { dg-error "failed to parse item in crate" "" { target *-*-* } .-2 } } diff --git a/gcc/testsuite/rust/compile/macros/mbe/macro35.rs b/gcc/testsuite/rust/compile/macros/mbe/macro35.rs index 07b157b53c2f..8c295d4ffeb0 100644 --- a/gcc/testsuite/rust/compile/macros/mbe/macro35.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro35.rs @@ -3,5 +3,4 @@ macro_rules! inside_matcher { // { dg-error "failed to parse macro matcher" "" { target *-*-* } .-1 } // { dg-error "failed to parse macro match" "" { target *-*-* } .-2 } // { dg-error "required first macro rule" "" { target *-*-* } .-3 } - // { dg-error "failed to parse item in crate" "" { target *-*-* } .-4 } } diff --git a/gcc/testsuite/rust/compile/macros/mbe/macro37.rs b/gcc/testsuite/rust/compile/macros/mbe/macro37.rs index 5713d90130aa..26f79d88ef18 100644 --- a/gcc/testsuite/rust/compile/macros/mbe/macro37.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro37.rs @@ -1,5 +1,4 @@ macro_rules! invalid_after_zeroable { ($e:expr $(,)* forbidden) => {{}}; // { dg-error "token .identifier. is not allowed after .expr. fragment" } // { dg-error "required first macro rule" "" { target *-*-* } .-1 } - // { dg-error "failed to parse item in crate" "" { target *-*-* } .-2 } } diff --git a/gcc/testsuite/rust/compile/macros/mbe/macro38.rs b/gcc/testsuite/rust/compile/macros/mbe/macro38.rs index eb294aec83bb..e297492721e0 100644 --- a/gcc/testsuite/rust/compile/macros/mbe/macro38.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro38.rs @@ -1,5 +1,4 @@ macro_rules! invalid_after_zeroable_multi { ($e:expr $(,)? $(;)* $(=>)? forbidden) => {{}}; // { dg-error "token .identifier. is not allowed after .expr. fragment" } // { dg-error "required first macro rule" "" { target *-*-* } .-1 } - // { dg-error "failed to parse item in crate" "" { target *-*-* } .-2 } } diff --git a/gcc/testsuite/rust/compile/macros/mbe/macro39.rs b/gcc/testsuite/rust/compile/macros/mbe/macro39.rs index f5c498cc8ef3..867ec21c3837 100644 --- a/gcc/testsuite/rust/compile/macros/mbe/macro39.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro39.rs @@ -1,5 +1,4 @@ macro_rules! m { ($e:expr (, parenthesis_forbidden)) => {{}}; // { dg-error "token .\\(. at start of matcher is not allowed after .expr. fragment" } // { dg-error "required first macro rule" "" { target *-*-* } .-1 } - // { dg-error "failed to parse item in crate" "" { target *-*-* } .-2 } } diff --git a/gcc/testsuite/rust/compile/macros/mbe/macro48.rs b/gcc/testsuite/rust/compile/macros/mbe/macro48.rs index 6b3b369bc3a0..aff5d199c473 100644 --- a/gcc/testsuite/rust/compile/macros/mbe/macro48.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro48.rs @@ -1,8 +1,7 @@ // Check that "priv" is not in the follow set of :vis. -// { dg-error "token .priv. is not allowed after .vis. fragment" "#359" { target *-*-* } .+4 } -// { dg-error "required first macro rule in macro rules definition could not be parsed" "" { target *-*-* } .+3 } -// { dg-error "failed to parse item in crate" "" { target *-*-* } .+2 } +// { dg-error "token .priv. is not allowed after .vis. fragment" "#359" { target *-*-* } .+3 } +// { dg-error "required first macro rule in macro rules definition could not be parsed" "" { target *-*-* } .+2 } macro_rules! my_mac { ($v:vis priv) => { $v struct Foo(i32); diff --git a/gcc/testsuite/rust/compile/parse_invalid_specialization.rs b/gcc/testsuite/rust/compile/parse_invalid_specialization.rs index 1ce73848d0a3..68e2120a2f9b 100644 --- a/gcc/testsuite/rust/compile/parse_invalid_specialization.rs +++ b/gcc/testsuite/rust/compile/parse_invalid_specialization.rs @@ -1,4 +1,3 @@ default fn f() { // { dg-error ".default. is only allowed on items within .impl. blocks" "" { target *-*-* } .-1 } - // { dg-error "failed to parse item in crate" "" { target *-*-* } .-2 } } diff --git a/gcc/testsuite/rust/compile/parse_simple_path_fail_1.rs b/gcc/testsuite/rust/compile/parse_simple_path_fail_1.rs index c112e4048ed0..1d52abbd6488 100644 --- a/gcc/testsuite/rust/compile/parse_simple_path_fail_1.rs +++ b/gcc/testsuite/rust/compile/parse_simple_path_fail_1.rs @@ -1,3 +1,2 @@ pub(in crate::) struct S; // { dg-error "expecting ... but .::. found" "" { target *-*-* } .-1 } -// { dg-error "failed to parse item in crate" "" { target *-*-* } .-2 } diff --git a/gcc/testsuite/rust/compile/parse_simple_path_fail_2.rs b/gcc/testsuite/rust/compile/parse_simple_path_fail_2.rs index 94c49c381b25..1205f1936a5e 100644 --- a/gcc/testsuite/rust/compile/parse_simple_path_fail_2.rs +++ b/gcc/testsuite/rust/compile/parse_simple_path_fail_2.rs @@ -5,5 +5,3 @@ mod A { use A{B}; // { dg-error "unexpected token" "" { target *-*-* } .-1 } // { dg-error "could not parse use tree" "" { target *-*-* } .-2 } -// { dg-error "failed to parse item in crate" "" { target *-*-* } 10 } -// ^^^ TODO: should the above error happen at line 10? diff --git a/gcc/testsuite/rust/compile/raw-byte-string-loc.rs b/gcc/testsuite/rust/compile/raw-byte-string-loc.rs index b71b6e5adedc..6082118d4e42 100644 --- a/gcc/testsuite/rust/compile/raw-byte-string-loc.rs +++ b/gcc/testsuite/rust/compile/raw-byte-string-loc.rs @@ -3,4 +3,3 @@ const X: &'static u8 = br#"12 BREAK // { dg-error "unrecognised token" "" { target *-*-* } .-1 } -// { dg-error "failed to parse item" "" { target *-*-* } .-2 } diff --git a/gcc/testsuite/rust/compile/raw-string-loc.rs b/gcc/testsuite/rust/compile/raw-string-loc.rs index 26331eafa44a..9e32790427db 100644 --- a/gcc/testsuite/rust/compile/raw-string-loc.rs +++ b/gcc/testsuite/rust/compile/raw-string-loc.rs @@ -3,4 +3,3 @@ const X: &'static str = r#"12 BREAK // { dg-error "unrecognised token" "" { target *-*-* } .-1 } -// { dg-error "failed to parse item" "" { target *-*-* } .-2 } diff --git a/gcc/testsuite/rust/compile/self_const_ptr.rs b/gcc/testsuite/rust/compile/self_const_ptr.rs index 014fe1b63d84..51e339eaa5e2 100644 --- a/gcc/testsuite/rust/compile/self_const_ptr.rs +++ b/gcc/testsuite/rust/compile/self_const_ptr.rs @@ -4,5 +4,4 @@ impl MyStruct { pub fn do_something(*const self) {} // { dg-error "cannot pass .self. by raw pointer" "" { target *-*-* } .-1 } // { dg-error "failed to parse inherent impl item in inherent impl" "" { target *-*-* } .-2 } - // { dg-error "failed to parse item in crate" "" { target *-*-* } .-3 } } diff --git a/gcc/testsuite/rust/compile/self_mut_ptr.rs b/gcc/testsuite/rust/compile/self_mut_ptr.rs index 2a127b7dcb2c..c986ef6e5118 100644 --- a/gcc/testsuite/rust/compile/self_mut_ptr.rs +++ b/gcc/testsuite/rust/compile/self_mut_ptr.rs @@ -4,5 +4,4 @@ impl MyStruct { pub fn do_something(*mut self) {} // { dg-error "cannot pass .self. by raw pointer" "" { target *-*-* } .-1 } // { dg-error "failed to parse inherent impl item in inherent impl" "" { target *-*-* } .-2 } - // { dg-error "failed to parse item in crate" "" { target *-*-* } .-3 } } diff --git a/gcc/testsuite/rust/compile/self_ptr.rs b/gcc/testsuite/rust/compile/self_ptr.rs index fd7ff6ce5d2f..2b3128cd853b 100644 --- a/gcc/testsuite/rust/compile/self_ptr.rs +++ b/gcc/testsuite/rust/compile/self_ptr.rs @@ -4,5 +4,4 @@ impl MyStruct { pub fn do_something(*self) {} // { dg-error "cannot pass .self. by raw pointer" "" { target *-*-* } .-1 } // { dg-error "failed to parse inherent impl item in inherent impl" "" { target *-*-* } .-2 } - // { dg-error "failed to parse item in crate" "" { target *-*-* } .-3 } } diff --git a/gcc/testsuite/rust/compile/static_var1.rs b/gcc/testsuite/rust/compile/static_var1.rs index b3b5751c9322..fdd287679d18 100644 --- a/gcc/testsuite/rust/compile/static_var1.rs +++ b/gcc/testsuite/rust/compile/static_var1.rs @@ -1,5 +1,5 @@ static x = 3; // { dg-error "expecting ':' but '=' found" } -fn main() {// { dg-error "failed to parse item in crate" } +fn main() { let y = x +1; } diff --git a/gcc/testsuite/rust/compile/torture/identifier-missing-impl-1.rs b/gcc/testsuite/rust/compile/torture/identifier-missing-impl-1.rs index 2389fa52bfd1..8a9b03163efd 100644 --- a/gcc/testsuite/rust/compile/torture/identifier-missing-impl-1.rs +++ b/gcc/testsuite/rust/compile/torture/identifier-missing-impl-1.rs @@ -4,7 +4,6 @@ impl I { fn () { // { dg-error {expecting 'identifier' but '\(' found} "" { target *-*-* } .-1 } // { dg-error {failed to parse inherent impl item in inherent impl} "" { target *-*-* } .-2 } - // { dg-error {failed to parse item in crate} "" { target *-*-* } .-3 } } }