Exit when there are unmatched delims to avoid noisy diagnostics

This commit is contained in:
yukang 2023-02-28 07:55:19 +00:00
parent f0bc76ac41
commit f01d0c02e7
99 changed files with 254 additions and 1279 deletions

View file

@ -204,16 +204,23 @@ pub fn maybe_file_to_stream(
lexer::parse_token_trees(sess, src.as_str(), source_file.start_pos, override_span);
match token_trees {
Ok(stream) => Ok((stream, unmatched_braces)),
Err(err) => {
Ok(stream) if unmatched_braces.is_empty() => Ok((stream, unmatched_braces)),
_ => {
// Return error if there are unmatched delimiters or unclosng delimiters.
// We emit delimiter mismatch errors first, then emit the unclosing delimiter mismatch
// because the delimiter mismatch is more likely to be the root cause of the
let mut buffer = Vec::with_capacity(1);
err.buffer(&mut buffer);
// Not using `emit_unclosed_delims` to use `db.buffer`
for unmatched in unmatched_braces {
if let Some(err) = make_unclosed_delims_error(unmatched, &sess) {
err.buffer(&mut buffer);
}
}
if let Err(err) = token_trees {
// Add unclosing delimiter error
err.buffer(&mut buffer);
}
Err(buffer)
}
}

View file

@ -769,8 +769,8 @@ fn check_if_attr_is_complete(source: &str, edition: Edition) -> bool {
match maybe_new_parser_from_source_str(&sess, filename, source.to_owned()) {
Ok(p) => p,
Err(_) => {
debug!("Cannot build a parser to check mod attr so skipping...");
return true;
// If there is an unclosed delimiter, an error will be returned by the tokentrees.
return false;
}
};
// If a parsing error happened, it's very likely that the attribute is incomplete.
@ -778,15 +778,7 @@ fn check_if_attr_is_complete(source: &str, edition: Edition) -> bool {
e.cancel();
return false;
}
// We now check if there is an unclosed delimiter for the attribute. To do so, we look at
// the `unclosed_delims` and see if the opening square bracket was closed.
parser
.unclosed_delims()
.get(0)
.map(|unclosed| {
unclosed.unclosed_span.map(|s| s.lo()).unwrap_or(BytePos(0)) != BytePos(2)
})
.unwrap_or(true)
true
})
})
.unwrap_or(false)

View file

@ -1,6 +1,5 @@
// error-pattern: this file contains an unclosed delimiter
// error-pattern: this file contains an unclosed delimiter
// error-pattern: this file contains an unclosed delimiter
// error-pattern: format argument must be a string literal
fn f(){(print!(á

View file

@ -1,5 +1,5 @@
error: this file contains an unclosed delimiter
--> $DIR/issue-104897.rs:6:18
--> $DIR/issue-104897.rs:5:18
|
LL | fn f(){(print!(á
| -- - ^
@ -9,7 +9,7 @@ LL | fn f(){(print!(á
| unclosed delimiter
error: this file contains an unclosed delimiter
--> $DIR/issue-104897.rs:6:18
--> $DIR/issue-104897.rs:5:18
|
LL | fn f(){(print!(á
| -- - ^
@ -19,7 +19,7 @@ LL | fn f(){(print!(á
| unclosed delimiter
error: this file contains an unclosed delimiter
--> $DIR/issue-104897.rs:6:18
--> $DIR/issue-104897.rs:5:18
|
LL | fn f(){(print!(á
| -- - ^
@ -28,16 +28,5 @@ LL | fn f(){(print!(á
| |unclosed delimiter
| unclosed delimiter
error: format argument must be a string literal
--> $DIR/issue-104897.rs:6:16
|
LL | fn f(){(print!(á
| ^
|
help: you might be missing a string literal to format with
|
LL | fn f(){(print!("{}", á
| +++++
error: aborting due to 4 previous errors
error: aborting due to 3 previous errors

View file

@ -3,7 +3,6 @@
// error-pattern: this file contains an unclosed delimiter
// error-pattern: this file contains an unclosed delimiter
// error-pattern: this file contains an unclosed delimiter
// error-pattern: format argument must be a string literal
//
// Verify that unused parens lint does not try to create a span
// which points in the middle of a multibyte character.

View file

@ -1,5 +1,5 @@
error: this file contains an unclosed delimiter
--> $DIR/unused_parens_multibyte_recovery.rs:11:17
--> $DIR/unused_parens_multibyte_recovery.rs:10:17
|
LL | fn f(){(print!(á
| -- - ^
@ -9,7 +9,7 @@ LL | fn f(){(print!(á
| unclosed delimiter
error: this file contains an unclosed delimiter
--> $DIR/unused_parens_multibyte_recovery.rs:11:17
--> $DIR/unused_parens_multibyte_recovery.rs:10:17
|
LL | fn f(){(print!(á
| -- - ^
@ -19,7 +19,7 @@ LL | fn f(){(print!(á
| unclosed delimiter
error: this file contains an unclosed delimiter
--> $DIR/unused_parens_multibyte_recovery.rs:11:17
--> $DIR/unused_parens_multibyte_recovery.rs:10:17
|
LL | fn f(){(print!(á
| -- - ^
@ -28,16 +28,5 @@ LL | fn f(){(print!(á
| |unclosed delimiter
| unclosed delimiter
error: format argument must be a string literal
--> $DIR/unused_parens_multibyte_recovery.rs:11:16
|
LL | fn f(){(print!(á
| ^
|
help: you might be missing a string literal to format with
|
LL | fn f(){(print!("{}", á
| +++++
error: aborting due to 4 previous errors
error: aborting due to 3 previous errors

View file

@ -1,9 +1,5 @@
macro_rules!test{($l:expr,$_:r)=>({const:y y)}
//~^ ERROR mismatched closing delimiter: `)`
//~| ERROR invalid fragment specifier `r`
//~| ERROR expected identifier, found keyword `const`
//~| ERROR expected identifier, found keyword `const`
//~| ERROR expected identifier, found `:`
fn s(){test!(1,i)}

View file

@ -7,54 +7,5 @@ LL | macro_rules!test{($l:expr,$_:r)=>({const:y y)}
| |unclosed delimiter
| closing delimiter possibly meant for this
error: invalid fragment specifier `r`
--> $DIR/issue-102878.rs:1:27
|
LL | macro_rules!test{($l:expr,$_:r)=>({const:y y)}
| ^^^^
|
= help: valid fragment specifiers are `ident`, `block`, `stmt`, `expr`, `pat`, `ty`, `lifetime`, `literal`, `path`, `meta`, `tt`, `item` and `vis`
error: expected identifier, found keyword `const`
--> $DIR/issue-102878.rs:1:36
|
LL | macro_rules!test{($l:expr,$_:r)=>({const:y y)}
| ^^^^^ expected identifier, found keyword
...
LL | fn s(){test!(1,i)}
| ---------- in this macro invocation
|
= note: this error originates in the macro `test` (in Nightly builds, run with -Z macro-backtrace for more info)
help: escape `const` to use it as an identifier
|
LL | macro_rules!test{($l:expr,$_:r)=>({r#const:y y)}
| ++
error: expected identifier, found keyword `const`
--> $DIR/issue-102878.rs:1:36
|
LL | macro_rules!test{($l:expr,$_:r)=>({const:y y)}
| ^^^^^ expected identifier, found keyword
...
LL | fn s(){test!(1,i)}
| ---------- in this macro invocation
|
= note: this error originates in the macro `test` (in Nightly builds, run with -Z macro-backtrace for more info)
help: escape `const` to use it as an identifier
|
LL | macro_rules!test{($l:expr,$_:r)=>({r#const:y y)}
| ++
error: expected identifier, found `:`
--> $DIR/issue-102878.rs:1:41
|
LL | macro_rules!test{($l:expr,$_:r)=>({const:y y)}
| ^ expected identifier
...
LL | fn s(){test!(1,i)}
| ---------- in this macro invocation
|
= note: this error originates in the macro `test` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to 5 previous errors
error: aborting due to previous error

View file

@ -15,8 +15,6 @@ impl dyn Demo {
if let Some(b) = val
&& let Some(c) = num {
&& b == c {
//~^ ERROR expected struct
//~| ERROR mismatched types
}
}
}

View file

@ -1,5 +1,5 @@
error: this file contains an unclosed delimiter
--> $DIR/deli-ident-issue-1.rs:24:66
--> $DIR/deli-ident-issue-1.rs:22:66
|
LL | impl dyn Demo {
| - unclosed delimiter
@ -13,25 +13,5 @@ LL | }
LL | fn main() { }
| ^
error[E0574]: expected struct, variant or union type, found local variable `c`
--> $DIR/deli-ident-issue-1.rs:17:17
|
LL | && b == c {
| ^ not a struct, variant or union type
error: aborting due to previous error
error[E0308]: mismatched types
--> $DIR/deli-ident-issue-1.rs:17:9
|
LL | fn check(&self, val: Option<u32>, num: Option<u32>) {
| - expected `()` because of default return type
...
LL | / && b == c {
LL | |
LL | |
LL | | }
| |_________^ expected `()`, found `bool`
error: aborting due to 3 previous errors
Some errors have detailed explanations: E0308, E0574.
For more information about an error, try `rustc --explain E0308`.

View file

@ -1,3 +1,11 @@
error: mismatched closing delimiter: `]`
--> $DIR/deli-ident-issue-2.rs:2:14
|
LL | if 1 < 2 {
| ^ unclosed delimiter
LL | let _a = vec!];
| ^ mismatched closing delimiter
error: unexpected closing delimiter: `}`
--> $DIR/deli-ident-issue-2.rs:5:1
|
@ -7,13 +15,5 @@ LL | }
LL | }
| ^ unexpected closing delimiter
error: mismatched closing delimiter: `]`
--> $DIR/deli-ident-issue-2.rs:2:14
|
LL | if 1 < 2 {
| ^ unclosed delimiter
LL | let _a = vec!];
| ^ mismatched closing delimiter
error: aborting due to 2 previous errors

View file

@ -2,7 +2,7 @@ fn foo() {}
fn bar() -> [u8; 2] {
foo()
[1, 3) //~ ERROR expected one of `.`, `?`, `]`, or an operator, found `,`
[1, 3) //~ ERROR mismatched closing delimiter
}
fn main() {}

View file

@ -1,8 +1,8 @@
error: expected one of `.`, `?`, `]`, or an operator, found `,`
error: mismatched closing delimiter: `)`
--> $DIR/do-not-suggest-semicolon-before-array.rs:5:5
|
LL | [1, 3)
| ^ ^ help: `]` may belong here
| ^ ^ mismatched closing delimiter
| |
| unclosed delimiter

View file

@ -1,5 +1,4 @@
// error-pattern: this file contains an unclosed delimiter
// error-pattern: expected value, found struct `R`
struct R { }
struct S {
x: [u8; R

View file

@ -1,5 +1,5 @@
error: this file contains an unclosed delimiter
--> $DIR/issue-103451.rs:5:15
--> $DIR/issue-103451.rs:4:15
|
LL | struct S {
| - unclosed delimiter
@ -9,7 +9,7 @@ LL | x: [u8; R
| unclosed delimiter
error: this file contains an unclosed delimiter
--> $DIR/issue-103451.rs:5:15
--> $DIR/issue-103451.rs:4:15
|
LL | struct S {
| - unclosed delimiter
@ -18,15 +18,5 @@ LL | x: [u8; R
| |
| unclosed delimiter
error[E0423]: expected value, found struct `R`
--> $DIR/issue-103451.rs:5:13
|
LL | struct R { }
| ------------ `R` defined here
LL | struct S {
LL | x: [u8; R
| ^ help: use struct literal syntax instead: `R {}`
error: aborting due to 2 previous errors
error: aborting due to 3 previous errors
For more information about this error, try `rustc --explain E0423`.

View file

@ -1,3 +1,11 @@
error: mismatched closing delimiter: `)`
--> $DIR/issue-68987-unmatch-issue-2.rs:3:32
|
LL | async fn obstest() -> Result<> {
| ^ unclosed delimiter
LL | let obs_connect = || -> Result<(), MyError) {
| ^ mismatched closing delimiter
error: unexpected closing delimiter: `}`
--> $DIR/issue-68987-unmatch-issue-2.rs:14:1
|
@ -7,13 +15,5 @@ LL | let obs_connect = || -> Result<(), MyError) {
LL | }
| ^ unexpected closing delimiter
error: mismatched closing delimiter: `)`
--> $DIR/issue-68987-unmatch-issue-2.rs:3:32
|
LL | async fn obstest() -> Result<> {
| ^ unclosed delimiter
LL | let obs_connect = || -> Result<(), MyError) {
| ^ mismatched closing delimiter
error: aborting due to 2 previous errors

View file

@ -1,3 +1,11 @@
error: mismatched closing delimiter: `)`
--> $DIR/issue-68987-unmatch-issue-3.rs:5:19
|
LL | while cnt < j {
| ^ unclosed delimiter
LL | write!&mut res, " ");
| ^ mismatched closing delimiter
error: unexpected closing delimiter: `}`
--> $DIR/issue-68987-unmatch-issue-3.rs:8:1
|
@ -7,13 +15,5 @@ LL | }
LL | }
| ^ unexpected closing delimiter
error: mismatched closing delimiter: `)`
--> $DIR/issue-68987-unmatch-issue-3.rs:5:19
|
LL | while cnt < j {
| ^ unclosed delimiter
LL | write!&mut res, " ");
| ^ mismatched closing delimiter
error: aborting due to 2 previous errors

View file

@ -1,8 +1,5 @@
// error-pattern: this file contains an unclosed delimiter
// error-pattern: this file contains an unclosed delimiter
// error-pattern: expected pattern, found `=`
// error-pattern: expected one of `)`, `,`, `->`, `where`, or `{`, found `]`
// error-pattern: expected item, found `]`
fn main() {}

View file

@ -1,5 +1,5 @@
error: this file contains an unclosed delimiter
--> $DIR/issue-81804.rs:9:11
--> $DIR/issue-81804.rs:6:11
|
LL | fn p([=(}
| -- ^
@ -8,7 +8,7 @@ LL | fn p([=(}
| unclosed delimiter
error: this file contains an unclosed delimiter
--> $DIR/issue-81804.rs:9:11
--> $DIR/issue-81804.rs:6:11
|
LL | fn p([=(}
| -- ^
@ -16,26 +16,13 @@ LL | fn p([=(}
| |unclosed delimiter
| unclosed delimiter
error: expected pattern, found `=`
--> $DIR/issue-81804.rs:9:7
error: mismatched closing delimiter: `}`
--> $DIR/issue-81804.rs:6:8
|
LL | fn p([=(}
| ^ expected pattern
error: expected one of `)`, `,`, `->`, `where`, or `{`, found `]`
--> $DIR/issue-81804.rs:9:8
|
LL | fn p([=(}
| ^ -^
| | |
| | help: `)` may belong here
| ^^ mismatched closing delimiter
| |
| unclosed delimiter
error: expected item, found `]`
--> $DIR/issue-81804.rs:9:11
|
LL | fn p([=(}
| ^ expected item
error: aborting due to 5 previous errors
error: aborting due to 3 previous errors

View file

@ -1,6 +1,5 @@
// error-pattern: this file contains an unclosed delimiter
// error-pattern: mismatched closing delimiter: `]`
// error-pattern: expected one of `)` or `,`, found `{`
#![crate_name="0"]

View file

@ -1,5 +1,5 @@
error: this file contains an unclosed delimiter
--> $DIR/issue-81827.rs:11:27
--> $DIR/issue-81827.rs:10:27
|
LL | fn r()->i{0|{#[cfg(r(0{]0
| - - - ^
@ -9,7 +9,7 @@ LL | fn r()->i{0|{#[cfg(r(0{]0
| unclosed delimiter
error: this file contains an unclosed delimiter
--> $DIR/issue-81827.rs:11:27
--> $DIR/issue-81827.rs:10:27
|
LL | fn r()->i{0|{#[cfg(r(0{]0
| - - - ^
@ -19,7 +19,7 @@ LL | fn r()->i{0|{#[cfg(r(0{]0
| unclosed delimiter
error: mismatched closing delimiter: `]`
--> $DIR/issue-81827.rs:11:23
--> $DIR/issue-81827.rs:10:23
|
LL | fn r()->i{0|{#[cfg(r(0{]0
| - ^^ mismatched closing delimiter
@ -27,11 +27,5 @@ LL | fn r()->i{0|{#[cfg(r(0{]0
| | unclosed delimiter
| closing delimiter possibly meant for this
error: expected one of `)` or `,`, found `{`
--> $DIR/issue-81827.rs:11:23
|
LL | fn r()->i{0|{#[cfg(r(0{]0
| ^ expected one of `)` or `,`
error: aborting due to 4 previous errors
error: aborting due to 3 previous errors

View file

@ -1,11 +1,11 @@
// error-pattern: mismatched closing delimiter: `}`
// FIXME(31528) we emit a bunch of silly errors here due to continuing past the
// first one. This would be easy-ish to address by better recovery in tokenisation.
pub fn trace_option(option: Option<isize>) {
option.map(|some| 42;
//~^ ERROR: expected one of
}
//~^ ERROR: expected expression, found `)`
fn main() {}

View file

@ -1,16 +1,13 @@
error: expected one of `)`, `,`, `.`, `?`, or an operator, found `;`
--> $DIR/issue-10636-2.rs:5:15
error: mismatched closing delimiter: `}`
--> $DIR/issue-10636-2.rs:6:15
|
LL | pub fn trace_option(option: Option<isize>) {
| - closing delimiter possibly meant for this
LL | option.map(|some| 42;
| ^ ^ help: `)` may belong here
| |
| unclosed delimiter
error: expected expression, found `)`
--> $DIR/issue-10636-2.rs:8:1
|
| ^ unclosed delimiter
...
LL | }
| ^ expected expression
| ^ mismatched closing delimiter
error: aborting due to 2 previous errors
error: aborting due to previous error

View file

@ -1,4 +1,5 @@
// Fixed in #66054.
// ignore-tidy-trailing-newlines
// error-pattern: aborting due to 2 previous errors
// error-pattern: this file contains an unclosed delimiter
// error-pattern: aborting due to previous error
#[Ѕ

View file

@ -1,16 +1,10 @@
error: this file contains an unclosed delimiter
--> $DIR/issue-58094-missing-right-square-bracket.rs:4:4
--> $DIR/issue-58094-missing-right-square-bracket.rs:5:4
|
LL | #[Ѕ
| - ^
| |
| unclosed delimiter
error: expected item after attributes
--> $DIR/issue-58094-missing-right-square-bracket.rs:4:1
|
LL | #[Ѕ
| ^^^
error: aborting due to 2 previous errors
error: aborting due to previous error

View file

@ -1,8 +1,5 @@
impl A {
//~^ ERROR cannot find type `A` in this scope
fn b(self>
//~^ ERROR expected one of `)`, `,`, or `:`, found `>`
//~| ERROR expected one of `->`, `where`, or `{`, found `>`
}
} //~ ERROR mismatched closing delimiter
fn main() {}

View file

@ -1,29 +1,12 @@
error: expected one of `)`, `,`, or `:`, found `>`
--> $DIR/issue-58856-1.rs:3:9
|
LL | fn b(self>
| ^ ^ help: `)` may belong here
| |
| unclosed delimiter
error: expected one of `->`, `where`, or `{`, found `>`
--> $DIR/issue-58856-1.rs:3:14
error: mismatched closing delimiter: `}`
--> $DIR/issue-58856-1.rs:2:9
|
LL | impl A {
| - while parsing this item list starting here
LL |
| - closing delimiter possibly meant for this
LL | fn b(self>
| ^ expected one of `->`, `where`, or `{`
...
| ^ unclosed delimiter
LL | }
| - the item list ends here
| ^ mismatched closing delimiter
error[E0412]: cannot find type `A` in this scope
--> $DIR/issue-58856-1.rs:1:6
|
LL | impl A {
| ^ not found in this scope
error: aborting due to previous error
error: aborting due to 3 previous errors
For more information about this error, try `rustc --explain E0412`.

View file

@ -4,11 +4,8 @@ trait Howness {}
impl Howness for () {
fn how_are_you(&self -> Empty {
//~^ ERROR expected one of `)` or `,`, found `->`
//~| ERROR method `how_are_you` is not a member of trait `Howness`
Empty
}
}
//~^ ERROR non-item in item list
} //~ ERROR mismatched closing delimiter
fn main() {}

View file

@ -1,34 +1,13 @@
error: expected one of `)` or `,`, found `->`
error: mismatched closing delimiter: `}`
--> $DIR/issue-58856-2.rs:6:19
|
LL | fn how_are_you(&self -> Empty {
| ^ -^^
| | |
| | help: `)` may belong here
| unclosed delimiter
error: non-item in item list
--> $DIR/issue-58856-2.rs:11:1
|
LL | impl Howness for () {
| - item list starts here
| - closing delimiter possibly meant for this
LL | fn how_are_you(&self -> Empty {
| ^ unclosed delimiter
...
LL | }
| ^
| |
| non-item starts here
| item list ends here
| ^ mismatched closing delimiter
error[E0407]: method `how_are_you` is not a member of trait `Howness`
--> $DIR/issue-58856-2.rs:6:5
|
LL | / fn how_are_you(&self -> Empty {
LL | |
LL | |
LL | | Empty
LL | | }
| |_____^ not a member of trait `Howness`
error: aborting due to previous error
error: aborting due to 3 previous errors
For more information about this error, try `rustc --explain E0407`.

View file

@ -3,9 +3,6 @@ fn main() {}
trait T {
fn qux() -> Option<usize> {
let _ = if true {
});
//~^ ERROR non-item in item list
//~| ERROR mismatched closing delimiter: `)`
//~| ERROR expected one of `.`, `;`
}); //~ ERROR mismatched closing delimiter
Some(4)
}

View file

@ -1,21 +1,3 @@
error: expected one of `.`, `;`, `?`, `else`, or an operator, found `}`
--> $DIR/issue-60075.rs:6:10
|
LL | });
| ^ expected one of `.`, `;`, `?`, `else`, or an operator
error: non-item in item list
--> $DIR/issue-60075.rs:6:11
|
LL | trait T {
| - item list starts here
...
LL | });
| ^ non-item starts here
...
LL | }
| - item list ends here
error: mismatched closing delimiter: `)`
--> $DIR/issue-60075.rs:4:31
|
@ -25,5 +7,5 @@ LL | let _ = if true {
LL | });
| ^ mismatched closing delimiter
error: aborting due to 3 previous errors
error: aborting due to previous error

View file

@ -1,5 +1,5 @@
// ignore-tidy-trailing-newlines
// error-pattern: aborting due to 3 previous errors
// error-pattern: aborting due to previous error
#![allow(uncommon_codepoints)]
y![

View file

@ -6,28 +6,5 @@ LL | y![
LL | Ϥ,
| ^
error: macros that expand to items must be delimited with braces or followed by a semicolon
--> $DIR/issue-62524.rs:5:3
|
LL | y![
| ___^
LL | | Ϥ,
| |__^
|
help: change the delimiters to curly braces
|
LL | y! { /* items */ }
| ~~~~~~~~~~~~~~~
help: add a semicolon
|
LL | Ϥ,;
| +
error: cannot find macro `y` in this scope
--> $DIR/issue-62524.rs:5:1
|
LL | y![
| ^
error: aborting due to 3 previous errors
error: aborting due to previous error

View file

@ -1,3 +1 @@
pub t(#
//~^ ERROR missing `fn` or `struct` for function or struct definition
//~ ERROR this file contains an unclosed delimiter
pub t(# //~ ERROR this file contains an unclosed delimiter

View file

@ -1,17 +1,8 @@
error: this file contains an unclosed delimiter
--> $DIR/issue-62546.rs:3:52
--> $DIR/issue-62546.rs:1:60
|
LL | pub t(#
| - unclosed delimiter
LL |
LL |
| ^
| - unclosed delimiter ^
error: missing `fn` or `struct` for function or struct definition
--> $DIR/issue-62546.rs:1:4
|
LL | pub t(#
| ---^- help: if you meant to call a macro, try: `t!`
error: aborting due to 2 previous errors
error: aborting due to previous error

View file

@ -1,5 +1,4 @@
// error-pattern:this file contains an unclosed delimiter
// error-pattern:xpected `{`, found `macro_rules`
fn main() {}

View file

@ -1,5 +1,5 @@
error: this file contains an unclosed delimiter
--> $DIR/issue-62554.rs:6:89
--> $DIR/issue-62554.rs:5:89
|
LL | fn foo(u: u8) { if u8 macro_rules! u8 { (u6) => { fn uuuuuuuuuuu() { use s loo mod u8 {
| - - - - - ^
@ -10,7 +10,7 @@ LL | fn foo(u: u8) { if u8 macro_rules! u8 { (u6) => { fn uuuuuuuuuuu() { use s
| unclosed delimiter unclosed delimiter
error: this file contains an unclosed delimiter
--> $DIR/issue-62554.rs:6:89
--> $DIR/issue-62554.rs:5:89
|
LL | fn foo(u: u8) { if u8 macro_rules! u8 { (u6) => { fn uuuuuuuuuuu() { use s loo mod u8 {
| - - - - - ^
@ -21,7 +21,7 @@ LL | fn foo(u: u8) { if u8 macro_rules! u8 { (u6) => { fn uuuuuuuuuuu() { use s
| unclosed delimiter unclosed delimiter
error: this file contains an unclosed delimiter
--> $DIR/issue-62554.rs:6:89
--> $DIR/issue-62554.rs:5:89
|
LL | fn foo(u: u8) { if u8 macro_rules! u8 { (u6) => { fn uuuuuuuuuuu() { use s loo mod u8 {
| - - - - - ^
@ -32,7 +32,7 @@ LL | fn foo(u: u8) { if u8 macro_rules! u8 { (u6) => { fn uuuuuuuuuuu() { use s
| unclosed delimiter unclosed delimiter
error: this file contains an unclosed delimiter
--> $DIR/issue-62554.rs:6:89
--> $DIR/issue-62554.rs:5:89
|
LL | fn foo(u: u8) { if u8 macro_rules! u8 { (u6) => { fn uuuuuuuuuuu() { use s loo mod u8 {
| - - - - - ^
@ -43,7 +43,7 @@ LL | fn foo(u: u8) { if u8 macro_rules! u8 { (u6) => { fn uuuuuuuuuuu() { use s
| unclosed delimiter unclosed delimiter
error: this file contains an unclosed delimiter
--> $DIR/issue-62554.rs:6:89
--> $DIR/issue-62554.rs:5:89
|
LL | fn foo(u: u8) { if u8 macro_rules! u8 { (u6) => { fn uuuuuuuuuuu() { use s loo mod u8 {
| - - - - - ^
@ -53,21 +53,5 @@ LL | fn foo(u: u8) { if u8 macro_rules! u8 { (u6) => { fn uuuuuuuuuuu() { use s
| | | unclosed delimiter
| unclosed delimiter unclosed delimiter
error: expected `{`, found `macro_rules`
--> $DIR/issue-62554.rs:6:23
|
LL | fn foo(u: u8) { if u8 macro_rules! u8 { (u6) => { fn uuuuuuuuuuu() { use s loo mod u8 {
| ^^^^^^^^^^^ expected `{`
|
note: the `if` expression is missing a block after this condition
--> $DIR/issue-62554.rs:6:20
|
LL | fn foo(u: u8) { if u8 macro_rules! u8 { (u6) => { fn uuuuuuuuuuu() { use s loo mod u8 {
| ^^
help: try placing this code inside a block
|
LL | fn foo(u: u8) { if u8 { macro_rules! u8 { (u6) => { fn uuuuuuuuuuu() { use s loo mod u8 { }
| + +
error: aborting due to 6 previous errors
error: aborting due to 5 previous errors

View file

@ -1,6 +1,3 @@
fn main() {}
fn f() -> isize { fn f() -> isize {} pub f<
//~^ ERROR missing `fn` or `struct` for function or struct definition
//~| ERROR mismatched types
//~ ERROR this file contains an unclosed delimiter
fn f() -> isize { fn f() -> isize {} pub f< //~ ERROR this file contains an unclosed delimiter

View file

@ -1,26 +1,8 @@
error: this file contains an unclosed delimiter
--> $DIR/issue-62881.rs:6:52
--> $DIR/issue-62881.rs:3:96
|
LL | fn f() -> isize { fn f() -> isize {} pub f<
| - unclosed delimiter
...
LL |
| ^
| - unclosed delimiter ^
error: missing `fn` or `struct` for function or struct definition
--> $DIR/issue-62881.rs:3:41
|
LL | fn f() -> isize { fn f() -> isize {} pub f<
| ^
error: aborting due to previous error
error[E0308]: mismatched types
--> $DIR/issue-62881.rs:3:29
|
LL | fn f() -> isize { fn f() -> isize {} pub f<
| - ^^^^^ expected `isize`, found `()`
| |
| implicitly returns `()` as its body has no tail or `return` expression
error: aborting due to 3 previous errors
For more information about this error, try `rustc --explain E0308`.

View file

@ -1,6 +1,5 @@
// Regression test for #62894, shouldn't crash.
// error-pattern: this file contains an unclosed delimiter
// error-pattern: expected one of `(`, `[`, or `{`, found keyword `fn`
fn f() { assert_eq!(f(), (), assert_eq!(assert_eq!

View file

@ -1,5 +1,5 @@
error: this file contains an unclosed delimiter
--> $DIR/issue-62894.rs:7:14
--> $DIR/issue-62894.rs:6:14
|
LL | fn f() { assert_eq!(f(), (), assert_eq!(assert_eq!
| - - - unclosed delimiter
@ -11,7 +11,7 @@ LL | fn main() {}
| ^
error: this file contains an unclosed delimiter
--> $DIR/issue-62894.rs:7:14
--> $DIR/issue-62894.rs:6:14
|
LL | fn f() { assert_eq!(f(), (), assert_eq!(assert_eq!
| - - - unclosed delimiter
@ -23,7 +23,7 @@ LL | fn main() {}
| ^
error: this file contains an unclosed delimiter
--> $DIR/issue-62894.rs:7:14
--> $DIR/issue-62894.rs:6:14
|
LL | fn f() { assert_eq!(f(), (), assert_eq!(assert_eq!
| - - - unclosed delimiter
@ -34,17 +34,5 @@ LL |
LL | fn main() {}
| ^
error: expected one of `(`, `[`, or `{`, found keyword `fn`
--> $DIR/issue-62894.rs:7:1
|
LL | fn f() { assert_eq!(f(), (), assert_eq!(assert_eq!
| - expected one of `(`, `[`, or `{`
LL |
LL | fn main() {}
| ^^ unexpected token
--> $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
= note: while parsing argument for this `expr` macro fragment
error: aborting due to 4 previous errors
error: aborting due to 3 previous errors

View file

@ -1,11 +1,11 @@
fn main() {}
fn v() -> isize { //~ ERROR mismatched types
mod _ { //~ ERROR expected identifier
pub fn g() -> isizee { //~ ERROR cannot find type `isizee` in this scope
mod _ { //~ ERROR expected identifier
pub g() -> is //~ ERROR missing `fn` for function definition
(), w20);
fn v() -> isize {
mod _ {
pub fn g() -> isizee {
mod _ {
pub g() -> is
(), w20); //~ ERROR mismatched closing delimiter
}
(), w20); //~ ERROR expected item, found `;`
(), w20); //~ ERROR mismatched closing delimiter
}

View file

@ -1,47 +1,20 @@
error: expected identifier, found reserved identifier `_`
--> $DIR/issue-62895.rs:4:5
error: mismatched closing delimiter: `)`
--> $DIR/issue-62895.rs:6:7
|
LL | mod _ {
| ^ expected identifier, found reserved identifier
error: expected identifier, found reserved identifier `_`
--> $DIR/issue-62895.rs:6:5
|
LL | mod _ {
| ^ expected identifier, found reserved identifier
error: missing `fn` for function definition
--> $DIR/issue-62895.rs:7:4
|
| ^ unclosed delimiter
LL | pub g() -> is
| ^^^^
|
help: add `fn` here to parse `g` as a public function
|
LL | pub fn g() -> is
| ++
error: expected item, found `;`
--> $DIR/issue-62895.rs:10:9
|
LL | (), w20);
| ^ help: remove this semicolon
| ^ mismatched closing delimiter
error[E0412]: cannot find type `isizee` in this scope
--> $DIR/issue-62895.rs:5:15
error: mismatched closing delimiter: `)`
--> $DIR/issue-62895.rs:4:7
|
LL | pub fn g() -> isizee {
| ^^^^^^ help: a builtin type with a similar name exists: `isize`
LL | mod _ {
| ^ unclosed delimiter
...
LL | (), w20);
| ^ mismatched closing delimiter
error[E0308]: mismatched types
--> $DIR/issue-62895.rs:3:11
|
LL | fn v() -> isize {
| - ^^^^^ expected `isize`, found `()`
| |
| implicitly returns `()` as its body has no tail or `return` expression
error: aborting due to 2 previous errors
error: aborting due to 6 previous errors
Some errors have detailed explanations: E0308, E0412.
For more information about an error, try `rustc --explain E0308`.

View file

@ -1,5 +1,5 @@
// ignore-tidy-trailing-newlines
// error-pattern: aborting due to 7 previous errors
// error-pattern: aborting due to 4 previous errors
fn main() {}

View file

@ -24,49 +24,6 @@ LL |
LL |
| ^
error: expected one of `,`, `:`, or `}`, found `{`
--> $DIR/issue-62973.rs:6:8
|
LL | fn p() { match s { v, E { [) {) }
| ^ - ^ expected one of `,`, `:`, or `}`
| | |
| | while parsing this struct
| unclosed delimiter
|
help: `}` may belong here
|
LL | fn p() { match s { v, E} { [) {) }
| +
help: try naming a field
|
LL | fn p() { match s { v, E: E { [) {) }
| ++
error: struct literals are not allowed here
--> $DIR/issue-62973.rs:6:16
|
LL | fn p() { match s { v, E { [) {) }
| ________________^
LL | |
LL | |
| |_^
|
help: surround the struct literal with parentheses
|
LL ~ fn p() { match (s { v, E { [) {) }
LL |
LL ~ )
|
error: expected one of `.`, `?`, `{`, or an operator, found `}`
--> $DIR/issue-62973.rs:8:2
|
LL | fn p() { match s { v, E { [) {) }
| ----- while parsing this `match` expression
LL |
LL |
| ^ expected one of `.`, `?`, `{`, or an operator
error: mismatched closing delimiter: `)`
--> $DIR/issue-62973.rs:6:27
|
@ -83,5 +40,5 @@ LL | fn p() { match s { v, E { [) {) }
| |
| unclosed delimiter
error: aborting due to 7 previous errors
error: aborting due to 4 previous errors

View file

@ -1,3 +1,3 @@
// fixed by #66361
// error-pattern: aborting due to 3 previous errors
// error-pattern: aborting due to 2 previous errors
impl W <s(f;Y(;]

View file

@ -7,12 +7,6 @@ LL | impl W <s(f;Y(;]
| | missing open `[` for this delimiter
| unclosed delimiter
error: expected one of `!`, `(`, `)`, `+`, `,`, `::`, or `<`, found `;`
--> $DIR/issue-63116.rs:3:12
|
LL | impl W <s(f;Y(;]
| ^ expected one of 7 possible tokens
error: mismatched closing delimiter: `]`
--> $DIR/issue-63116.rs:3:14
|
@ -21,5 +15,5 @@ LL | impl W <s(f;Y(;]
| |
| unclosed delimiter
error: aborting due to 3 previous errors
error: aborting due to 2 previous errors

View file

@ -1,3 +1,3 @@
// error-pattern: aborting due to 5 previous errors
// error-pattern: this file contains an unclosed delimiter
// error-pattern: aborting due to 2 previous errors
fn i(n{...,f #

View file

@ -16,33 +16,5 @@ LL | fn i(n{...,f #
| | unclosed delimiter
| unclosed delimiter
error: expected field pattern, found `...`
--> $DIR/issue-63135.rs:3:8
|
LL | fn i(n{...,f #
| ^^^
|
help: to omit remaining fields, use `..`
|
LL | fn i(n{..,f #
| ~~
error: expected `}`, found `,`
--> $DIR/issue-63135.rs:3:11
|
LL | fn i(n{...,f #
| ---^
| | |
| | expected `}`
| `..` must be at the end and cannot have a trailing comma
error: expected one of `!` or `[`, found `}`
--> $DIR/issue-63135.rs:3:16
|
LL | fn i(n{...,f #
| - ^ expected one of `!` or `[`
| |
| while parsing the fields for this pattern
error: aborting due to 5 previous errors
error: aborting due to 2 previous errors

View file

@ -9,6 +9,4 @@
//
// ended up bubbling up `Ok(true)` to `unexpected` which then used `unreachable!()`.
fn f() { |[](* }
//~^ ERROR expected one of `,` or `:`, found `(`
//~| ERROR expected one of `&`, `(`, `)`, `-`, `...`, `..=`, `..`, `[`, `_`, `box`, `mut`, `ref`, `|`, identifier, or path, found `*`
fn f() { |[](* } //~ ERROR mismatched closing delimiter

View file

@ -1,16 +1,11 @@
error: expected one of `,` or `:`, found `(`
error: mismatched closing delimiter: `}`
--> $DIR/issue-66357-unexpected-unreachable.rs:12:13
|
LL | fn f() { |[](* }
| ^ expected one of `,` or `:`
| - ^ ^ mismatched closing delimiter
| | |
| | unclosed delimiter
| closing delimiter possibly meant for this
error: expected one of `&`, `(`, `)`, `-`, `...`, `..=`, `..`, `[`, `_`, `box`, `mut`, `ref`, `|`, identifier, or path, found `*`
--> $DIR/issue-66357-unexpected-unreachable.rs:12:13
|
LL | fn f() { |[](* }
| ^^ help: `)` may belong here
| |
| unclosed delimiter
error: aborting due to 2 previous errors
error: aborting due to previous error

View file

@ -4,9 +4,6 @@ mod a {
enum Bug {
V = [PhantomData; { [ () ].len() ].len() as isize,
//~^ ERROR mismatched closing delimiter: `]`
//~| ERROR mismatched closing delimiter: `]`
//~| ERROR mismatched closing delimiter: `]`
//~| ERROR mismatched closing delimiter: `]`
}
}
@ -14,10 +11,6 @@ mod b {
enum Bug {
V = [Vec::new; { [].len() ].len() as isize,
//~^ ERROR mismatched closing delimiter: `]`
//~| ERROR mismatched closing delimiter: `]`
//~| ERROR mismatched closing delimiter: `]`
//~| ERROR mismatched closing delimiter: `]`
//~| ERROR type annotations needed
}
}
@ -25,11 +18,6 @@ mod c {
enum Bug {
V = [Vec::new; { [0].len() ].len() as isize,
//~^ ERROR mismatched closing delimiter: `]`
//~| ERROR mismatched closing delimiter: `]`
//~| ERROR mismatched closing delimiter: `]`
//~| ERROR mismatched closing delimiter: `]`
//~| ERROR type annotations needed
}
}
fn main() {}
fn main() {} //~ ERROR this file contains an unclosed delimiter

View file

@ -1,29 +1,20 @@
error: mismatched closing delimiter: `]`
--> $DIR/issue-67377-invalid-syntax-in-enum-discriminant.rs:5:27
error: this file contains an unclosed delimiter
--> $DIR/issue-67377-invalid-syntax-in-enum-discriminant.rs:23:65
|
LL | V = [PhantomData; { [ () ].len() ].len() as isize,
| - ^ ^ mismatched closing delimiter
| | |
| | unclosed delimiter
| closing delimiter possibly meant for this
error: mismatched closing delimiter: `]`
--> $DIR/issue-67377-invalid-syntax-in-enum-discriminant.rs:15:24
|
| - missing open `[` for this delimiter
...
LL | V = [Vec::new; { [].len() ].len() as isize,
| - ^ ^ mismatched closing delimiter
| | |
| | unclosed delimiter
| closing delimiter possibly meant for this
error: mismatched closing delimiter: `]`
--> $DIR/issue-67377-invalid-syntax-in-enum-discriminant.rs:26:24
|
| - missing open `[` for this delimiter
...
LL | mod c {
| - unclosed delimiter
LL | enum Bug {
LL | V = [Vec::new; { [0].len() ].len() as isize,
| - ^ ^ mismatched closing delimiter
| | |
| | unclosed delimiter
| closing delimiter possibly meant for this
| - missing open `[` for this delimiter
...
LL | fn main() {}
| ^
error: mismatched closing delimiter: `]`
--> $DIR/issue-67377-invalid-syntax-in-enum-discriminant.rs:5:27
@ -35,7 +26,7 @@ LL | V = [PhantomData; { [ () ].len() ].len() as isize,
| closing delimiter possibly meant for this
error: mismatched closing delimiter: `]`
--> $DIR/issue-67377-invalid-syntax-in-enum-discriminant.rs:15:24
--> $DIR/issue-67377-invalid-syntax-in-enum-discriminant.rs:12:24
|
LL | V = [Vec::new; { [].len() ].len() as isize,
| - ^ ^ mismatched closing delimiter
@ -44,7 +35,7 @@ LL | V = [Vec::new; { [].len() ].len() as isize,
| closing delimiter possibly meant for this
error: mismatched closing delimiter: `]`
--> $DIR/issue-67377-invalid-syntax-in-enum-discriminant.rs:26:24
--> $DIR/issue-67377-invalid-syntax-in-enum-discriminant.rs:19:24
|
LL | V = [Vec::new; { [0].len() ].len() as isize,
| - ^ ^ mismatched closing delimiter
@ -52,77 +43,5 @@ LL | V = [Vec::new; { [0].len() ].len() as isize,
| | unclosed delimiter
| closing delimiter possibly meant for this
error: mismatched closing delimiter: `]`
--> $DIR/issue-67377-invalid-syntax-in-enum-discriminant.rs:5:27
|
LL | V = [PhantomData; { [ () ].len() ].len() as isize,
| - ^ ^ mismatched closing delimiter
| | |
| | unclosed delimiter
| closing delimiter possibly meant for this
error: aborting due to 4 previous errors
error: mismatched closing delimiter: `]`
--> $DIR/issue-67377-invalid-syntax-in-enum-discriminant.rs:15:24
|
LL | V = [Vec::new; { [].len() ].len() as isize,
| - ^ ^ mismatched closing delimiter
| | |
| | unclosed delimiter
| closing delimiter possibly meant for this
error: mismatched closing delimiter: `]`
--> $DIR/issue-67377-invalid-syntax-in-enum-discriminant.rs:26:24
|
LL | V = [Vec::new; { [0].len() ].len() as isize,
| - ^ ^ mismatched closing delimiter
| | |
| | unclosed delimiter
| closing delimiter possibly meant for this
error: mismatched closing delimiter: `]`
--> $DIR/issue-67377-invalid-syntax-in-enum-discriminant.rs:5:27
|
LL | V = [PhantomData; { [ () ].len() ].len() as isize,
| - ^ ^ mismatched closing delimiter
| | |
| | unclosed delimiter
| closing delimiter possibly meant for this
error: mismatched closing delimiter: `]`
--> $DIR/issue-67377-invalid-syntax-in-enum-discriminant.rs:15:24
|
LL | V = [Vec::new; { [].len() ].len() as isize,
| - ^ ^ mismatched closing delimiter
| | |
| | unclosed delimiter
| closing delimiter possibly meant for this
error: mismatched closing delimiter: `]`
--> $DIR/issue-67377-invalid-syntax-in-enum-discriminant.rs:26:24
|
LL | V = [Vec::new; { [0].len() ].len() as isize,
| - ^ ^ mismatched closing delimiter
| | |
| | unclosed delimiter
| closing delimiter possibly meant for this
error[E0282]: type annotations needed
--> $DIR/issue-67377-invalid-syntax-in-enum-discriminant.rs:15:26
|
LL | V = [Vec::new; { [].len() ].len() as isize,
| ^^ cannot infer type for type parameter `T`
error[E0282]: type annotations needed
--> $DIR/issue-67377-invalid-syntax-in-enum-discriminant.rs:26:14
|
LL | V = [Vec::new; { [0].len() ].len() as isize,
| ^^^^^^^^ cannot infer type of the type parameter `T` declared on the struct `Vec`
|
help: consider specifying the generic argument
|
LL | V = [Vec::<T>::new; { [0].len() ].len() as isize,
| +++++
error: aborting due to 14 previous errors
For more information about this error, try `rustc --explain E0282`.

View file

@ -1,3 +1,2 @@
// error-pattern: this file contains an unclosed delimiter
// error-pattern: expected one of
#[i=i::<ښܖ<

View file

@ -1,16 +1,10 @@
error: this file contains an unclosed delimiter
--> $DIR/issue-84104.rs:3:13
--> $DIR/issue-84104.rs:2:13
|
LL | #[i=i::<ښܖ<
| - ^
| |
| unclosed delimiter
error: expected one of `>`, a const expression, lifetime, or type, found `]`
--> $DIR/issue-84104.rs:3:13
|
LL | #[i=i::<ښܖ<
| ^ expected one of `>`, a const expression, lifetime, or type
error: aborting due to 2 previous errors
error: aborting due to previous error

View file

@ -1,3 +1,2 @@
// error-pattern: this file contains an unclosed delimiter
// error-pattern: invalid `?` in type
fn f(t:for<>t?

View file

@ -1,27 +1,10 @@
error: this file contains an unclosed delimiter
--> $DIR/issue-84148-2.rs:3:16
--> $DIR/issue-84148-2.rs:2:16
|
LL | fn f(t:for<>t?
| - ^
| |
| unclosed delimiter
error: invalid `?` in type
--> $DIR/issue-84148-2.rs:3:14
|
LL | fn f(t:for<>t?
| ^ `?` is only allowed on expressions, not types
|
help: if you meant to express that the type might not contain a value, use the `Option` wrapper type
|
LL | fn f(t:Option<for<>t>
| +++++++ ~
error: expected one of `->`, `where`, or `{`, found `<eof>`
--> $DIR/issue-84148-2.rs:3:16
|
LL | fn f(t:for<>t?
| ^ expected one of `->`, `where`, or `{`
error: aborting due to 3 previous errors
error: aborting due to previous error

View file

@ -1,9 +1,6 @@
// Regression test for the ICE described in #88770.
// error-pattern:this file contains an unclosed delimiter
// error-pattern:expected one of
// error-pattern:missing `in` in `for` loop
// error-pattern:expected one of `!`, `)`, `,`, `.`, `::`, `;`, `?`, `{`, or an operator, found `e`
fn m(){print!("",(c for&g
u

View file

@ -1,5 +1,5 @@
error: this file contains an unclosed delimiter
--> $DIR/issue-88770.rs:11:3
--> $DIR/issue-88770.rs:8:3
|
LL | fn m(){print!("",(c for&g
| - - - unclosed delimiter
@ -11,7 +11,7 @@ LL | e
| ^
error: this file contains an unclosed delimiter
--> $DIR/issue-88770.rs:11:3
--> $DIR/issue-88770.rs:8:3
|
LL | fn m(){print!("",(c for&g
| - - - unclosed delimiter
@ -23,7 +23,7 @@ LL | e
| ^
error: this file contains an unclosed delimiter
--> $DIR/issue-88770.rs:11:3
--> $DIR/issue-88770.rs:8:3
|
LL | fn m(){print!("",(c for&g
| - - - unclosed delimiter
@ -34,27 +34,5 @@ LL | fn m(){print!("",(c for&g
LL | e
| ^
error: missing `in` in `for` loop
--> $DIR/issue-88770.rs:8:26
|
LL | fn m(){print!("",(c for&g
| __________________________^
LL | | u
| |_ help: try adding `in` here
error: expected one of `!`, `)`, `,`, `.`, `::`, `?`, `{`, or an operator, found keyword `for`
--> $DIR/issue-88770.rs:8:21
|
LL | fn m(){print!("",(c for&g
| ^^^ expected one of 8 possible tokens
error: expected one of `!`, `)`, `,`, `.`, `::`, `;`, `?`, `{`, or an operator, found `e`
--> $DIR/issue-88770.rs:11:1
|
LL | e
| - expected one of 9 possible tokens
LL | e
| ^ unexpected token
error: aborting due to 6 previous errors
error: aborting due to 3 previous errors

View file

@ -1,3 +1,12 @@
error: mismatched closing delimiter: `}`
--> $DIR/macro-mismatched-delim-paren-brace.rs:2:10
|
LL | foo! (
| ^ unclosed delimiter
LL | bar, "baz", 1, 2.0
LL | }
| ^ mismatched closing delimiter
error: unexpected closing delimiter: `}`
--> $DIR/macro-mismatched-delim-paren-brace.rs:5:1
|
@ -9,14 +18,5 @@ LL | }
LL | }
| ^ unexpected closing delimiter
error: mismatched closing delimiter: `}`
--> $DIR/macro-mismatched-delim-paren-brace.rs:2:10
|
LL | foo! (
| ^ unclosed delimiter
LL | bar, "baz", 1, 2.0
LL | }
| ^ mismatched closing delimiter
error: aborting due to 2 previous errors

View file

@ -1,3 +1,3 @@
// ignore-tidy-trailing-newlines
// error-pattern: aborting due to 3 previous errors
// error-pattern: this file contains an unclosed delimiter
macro_rules! abc(ؼ

View file

@ -6,26 +6,5 @@ LL | macro_rules! abc(ؼ
| |
| unclosed delimiter
error: macros that expand to items must be delimited with braces or followed by a semicolon
--> $DIR/mbe_missing_right_paren.rs:3:17
|
LL | macro_rules! abc(ؼ
| ^^
|
help: change the delimiters to curly braces
|
LL | macro_rules! abc { /* items */ }
| ~~~~~~~~~~~~~~~
help: add a semicolon
|
LL | macro_rules! abc(ؼ;
| +
error: unexpected end of macro invocation
--> $DIR/mbe_missing_right_paren.rs:3:19
|
LL | macro_rules! abc(ؼ
| ^ missing tokens in macro arguments
error: aborting due to 3 previous errors
error: aborting due to previous error

View file

@ -1,13 +1,13 @@
fn main() {}
impl T for () { //~ ERROR cannot find trait `T` in this scope
impl T for () {
fn foo(&self) {}
trait T { //~ ERROR trait is not supported in `trait`s or `impl`s
trait T {
fn foo(&self);
}
pub(crate) struct Bar<T>(); //~ ERROR struct is not supported in `trait`s or `impl`s
pub(crate) struct Bar<T>();
//~ ERROR this file contains an unclosed delimiter

View file

@ -7,28 +7,5 @@ LL | impl T for () {
LL |
| ^
error: trait is not supported in `trait`s or `impl`s
--> $DIR/missing-close-brace-in-impl-trait.rs:7:1
|
LL | trait T {
| ^^^^^^^
|
= help: consider moving the trait out to a nearby module scope
error: aborting due to previous error
error: struct is not supported in `trait`s or `impl`s
--> $DIR/missing-close-brace-in-impl-trait.rs:11:1
|
LL | pub(crate) struct Bar<T>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: consider moving the struct out to a nearby module scope
error[E0405]: cannot find trait `T` in this scope
--> $DIR/missing-close-brace-in-impl-trait.rs:3:6
|
LL | impl T for () {
| ^ not found in this scope
error: aborting due to 4 previous errors
For more information about this error, try `rustc --explain E0405`.

View file

@ -1,7 +1,7 @@
pub(crate) struct Bar<T> {
foo: T,
trait T { //~ ERROR expected identifier, found keyword `trait`
trait T {
fn foo(&self);
}

View file

@ -7,14 +7,5 @@ LL | pub(crate) struct Bar<T> {
LL | fn main() {}
| ^
error: expected identifier, found keyword `trait`
--> $DIR/missing-close-brace-in-struct.rs:4:1
|
LL | pub(crate) struct Bar<T> {
| --- while parsing this struct
...
LL | trait T {
| ^^^^^ expected identifier, found keyword
error: aborting due to 2 previous errors
error: aborting due to previous error

View file

@ -2,10 +2,9 @@ trait T {
fn foo(&self);
pub(crate) struct Bar<T>();
//~^ ERROR struct is not supported in `trait`s or `impl`s
impl T for Bar<usize> {
//~^ ERROR implementation is not supported in `trait`s or `impl`s
fn foo(&self) {}
}

View file

@ -1,5 +1,5 @@
error: this file contains an unclosed delimiter
--> $DIR/missing-close-brace-in-trait.rs:12:65
--> $DIR/missing-close-brace-in-trait.rs:11:65
|
LL | trait T {
| - unclosed delimiter
@ -7,21 +7,5 @@ LL | trait T {
LL | fn main() {}
| ^
error: struct is not supported in `trait`s or `impl`s
--> $DIR/missing-close-brace-in-trait.rs:4:1
|
LL | pub(crate) struct Bar<T>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: consider moving the struct out to a nearby module scope
error: implementation is not supported in `trait`s or `impl`s
--> $DIR/missing-close-brace-in-trait.rs:7:1
|
LL | impl T for Bar<usize> {
| ^^^^^^^^^^^^^^^^^^^^^
|
= help: consider moving the implementation out to a nearby module scope
error: aborting due to 3 previous errors
error: aborting due to previous error

View file

@ -1,3 +1,4 @@
// ignore-tidy-trailing-newlines
// error-pattern: aborting due to 4 previous errors
// error-pattern: this file contains an unclosed delimiter
// error-pattern: aborting due to 2 previous errors
fn main((ؼ

View file

@ -1,5 +1,5 @@
error: this file contains an unclosed delimiter
--> $DIR/missing_right_paren.rs:3:11
--> $DIR/missing_right_paren.rs:4:11
|
LL | fn main((ؼ
| -- ^
@ -8,7 +8,7 @@ LL | fn main((ؼ
| unclosed delimiter
error: this file contains an unclosed delimiter
--> $DIR/missing_right_paren.rs:3:11
--> $DIR/missing_right_paren.rs:4:11
|
LL | fn main((ؼ
| -- ^
@ -16,17 +16,5 @@ LL | fn main((ؼ
| |unclosed delimiter
| unclosed delimiter
error: expected one of `:` or `|`, found `)`
--> $DIR/missing_right_paren.rs:3:11
|
LL | fn main((ؼ
| ^ expected one of `:` or `|`
error: expected one of `->`, `where`, or `{`, found `<eof>`
--> $DIR/missing_right_paren.rs:3:11
|
LL | fn main((ؼ
| ^ expected one of `->`, `where`, or `{`
error: aborting due to 4 previous errors
error: aborting due to 2 previous errors

View file

@ -3,11 +3,8 @@
trait Foo {
fn bar() {
let x = foo();
//~^ ERROR cannot find function `foo` in this scope
}
fn main() {
let x = y.;
//~^ ERROR unexpected token
//~| ERROR cannot find value `y` in this scope
} //~ ERROR this file contains an unclosed delimiter

View file

@ -1,35 +1,16 @@
error: this file contains an unclosed delimiter
--> $DIR/parser-recovery-1.rs:13:54
--> $DIR/parser-recovery-1.rs:10:54
|
LL | trait Foo {
| - unclosed delimiter
LL | fn bar() {
| - this delimiter might not be properly closed...
...
LL | let x = foo();
LL | }
| - ...as it matches this but it has different indentation
...
LL | }
| ^
error: unexpected token: `;`
--> $DIR/parser-recovery-1.rs:10:15
|
LL | let x = y.;
| ^
error: aborting due to previous error
error[E0425]: cannot find value `y` in this scope
--> $DIR/parser-recovery-1.rs:10:13
|
LL | let x = y.;
| ^ not found in this scope
error[E0425]: cannot find function `foo` in this scope
--> $DIR/parser-recovery-1.rs:5:17
|
LL | let x = foo();
| ^^^ not found in this scope
error: aborting due to 4 previous errors
For more information about this error, try `rustc --explain E0425`.

View file

@ -2,11 +2,10 @@
trait Foo {
fn bar() {
let x = foo(); //~ ERROR cannot find function `foo` in this scope
let x = foo();
) //~ ERROR mismatched closing delimiter: `)`
}
fn main() {
let x = y.; //~ ERROR unexpected token
//~^ ERROR cannot find value `y` in this scope
let x = y.;
}

View file

@ -1,9 +1,3 @@
error: unexpected token: `;`
--> $DIR/parser-recovery-2.rs:10:15
|
LL | let x = y.;
| ^
error: mismatched closing delimiter: `)`
--> $DIR/parser-recovery-2.rs:4:14
|
@ -13,18 +7,5 @@ LL | let x = foo();
LL | )
| ^ mismatched closing delimiter
error[E0425]: cannot find value `y` in this scope
--> $DIR/parser-recovery-2.rs:10:13
|
LL | let x = y.;
| ^ not found in this scope
error: aborting due to previous error
error[E0425]: cannot find function `foo` in this scope
--> $DIR/parser-recovery-2.rs:5:17
|
LL | let x = foo();
| ^^^ not found in this scope
error: aborting due to 4 previous errors
For more information about this error, try `rustc --explain E0425`.

View file

@ -2,5 +2,4 @@ mod unclosed_delim_mod;
fn main() {
let _: usize = unclosed_delim_mod::new();
//~^ ERROR mismatched types
}

View file

@ -9,17 +9,5 @@ LL | }
LL | }
| ^ mismatched closing delimiter
error[E0308]: mismatched types
--> $DIR/unclosed-delimiter-in-dep.rs:4:20
|
LL | let _: usize = unclosed_delim_mod::new();
| ----- ^^^^^^^^^^^^^^^^^^^^^^^^^ expected `usize`, found `Result<Value, ()>`
| |
| expected due to this
|
= note: expected type `usize`
found enum `Result<Value, ()>`
error: aborting due to previous error
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0308`.

View file

@ -1,6 +1,4 @@
// error-pattern: expected one of `,`, `::`, `as`, or `}`, found `;`
// error-pattern: this file contains an unclosed delimiter
// error-pattern: expected item, found `}`
use foo::{bar, baz;
use std::fmt::Display;

View file

@ -1,5 +1,5 @@
error: this file contains an unclosed delimiter
--> $DIR/use-unclosed-brace.rs:12:14
--> $DIR/use-unclosed-brace.rs:10:14
|
LL | use foo::{bar, baz;
| - unclosed delimiter
@ -7,21 +7,5 @@ LL | use foo::{bar, baz;
LL | fn main() {}
| ^
error: expected one of `,`, `::`, `as`, or `}`, found `;`
--> $DIR/use-unclosed-brace.rs:4:10
|
LL | use foo::{bar, baz;
| ^ ^
| | |
| | expected one of `,`, `::`, `as`, or `}`
| | help: `}` may belong here
| unclosed delimiter
error: expected item, found `}`
--> $DIR/use-unclosed-brace.rs:12:14
|
LL | fn main() {}
| ^ expected item
error: aborting due to 3 previous errors
error: aborting due to previous error

View file

@ -2,6 +2,5 @@
fn main() {
if foo {
//~^ ERROR: cannot find value `foo`
) //~ ERROR: mismatched closing delimiter: `)`
}

View file

@ -3,16 +3,8 @@ error: mismatched closing delimiter: `)`
|
LL | if foo {
| ^ unclosed delimiter
LL |
LL | )
| ^ mismatched closing delimiter
error[E0425]: cannot find value `foo` in this scope
--> $DIR/token-error-correct-2.rs:4:8
|
LL | if foo {
| ^^^ not found in this scope
error: aborting due to previous error
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0425`.

View file

@ -9,12 +9,9 @@ pub mod raw {
callback: F)
-> io::Result<bool> {
if !is_directory(path.as_ref()) {
//~^ ERROR cannot find function `is_directory`
callback(path.as_ref();
//~^ ERROR expected one of
fs::create_dir_all(path.as_ref()).map(|()| true)
} else {
//~^ ERROR expected one of `.`, `;`, `?`, `}`, or an operator, found `)`
} else { //~ ERROR mismatched closing delimiter
Ok(false);
}

View file

@ -1,25 +1,13 @@
error: expected one of `)`, `,`, `.`, `?`, or an operator, found `;`
--> $DIR/token-error-correct-3.rs:13:21
|
LL | callback(path.as_ref();
| ^ ^ help: `)` may belong here
| |
| unclosed delimiter
error: expected one of `.`, `;`, `?`, `}`, or an operator, found `)`
--> $DIR/token-error-correct-3.rs:16:9
|
LL | fs::create_dir_all(path.as_ref()).map(|()| true)
| - expected one of `.`, `;`, `?`, `}`, or an operator
LL | } else {
| ^ unexpected token
error[E0425]: cannot find function `is_directory` in this scope
--> $DIR/token-error-correct-3.rs:11:13
error: mismatched closing delimiter: `}`
--> $DIR/token-error-correct-3.rs:12:21
|
LL | if !is_directory(path.as_ref()) {
| ^^^^^^^^^^^^ not found in this scope
| - closing delimiter possibly meant for this
LL | callback(path.as_ref();
| ^ unclosed delimiter
LL | fs::create_dir_all(path.as_ref()).map(|()| true)
LL | } else {
| ^ mismatched closing delimiter
error: aborting due to 3 previous errors
error: aborting due to previous error
For more information about this error, try `rustc --explain E0425`.

View file

@ -1,10 +0,0 @@
// run-rustfix
// Test that we do some basic error correction in the tokeniser and apply suggestions.
fn setsuna(_: ()) {}
fn kazusa() {}
fn main() {
setsuna(kazusa()); //~ ERROR: expected one of
} //~ ERROR: expected expression

View file

@ -1,4 +1,3 @@
// run-rustfix
// Test that we do some basic error correction in the tokeniser and apply suggestions.
fn setsuna(_: ()) {}
@ -6,5 +5,5 @@ fn setsuna(_: ()) {}
fn kazusa() {}
fn main() {
setsuna(kazusa(); //~ ERROR: expected one of
} //~ ERROR: expected expression
setsuna(kazusa();
} //~ ERROR mismatched closing delimiter

View file

@ -1,16 +1,12 @@
error: expected one of `)`, `,`, `.`, `?`, or an operator, found `;`
--> $DIR/token-error-correct-4.rs:9:12
error: mismatched closing delimiter: `}`
--> $DIR/token-error-correct-4.rs:8:12
|
LL | fn main() {
| - closing delimiter possibly meant for this
LL | setsuna(kazusa();
| ^ ^ help: `)` may belong here
| |
| unclosed delimiter
error: expected expression, found `)`
--> $DIR/token-error-correct-4.rs:10:1
|
| ^ unclosed delimiter
LL | }
| ^ expected expression
| ^ mismatched closing delimiter
error: aborting due to 2 previous errors
error: aborting due to previous error

View file

@ -2,7 +2,6 @@
fn main() {
foo(bar(;
//~^ ERROR cannot find function `bar` in this scope
}
//~^ ERROR: mismatched closing delimiter: `}`

View file

@ -5,16 +5,8 @@ LL | fn main() {
| - closing delimiter possibly meant for this
LL | foo(bar(;
| ^ unclosed delimiter
LL |
LL | }
| ^ mismatched closing delimiter
error[E0425]: cannot find function `bar` in this scope
--> $DIR/token-error-correct.rs:4:9
|
LL | foo(bar(;
| ^^^ not found in this scope
error: aborting due to previous error
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0425`.

View file

@ -3,16 +3,10 @@
pub struct A {}
impl A {
async fn create(path: impl AsRef<std::path::Path>) { //~ ERROR `async fn` is not permitted in Rust 2015
//~^ WARN changes to closure capture in Rust 2021 will affect drop order [rust_2021_incompatible_closure_captures]
async fn create(path: impl AsRef<std::path::Path>) {
;
crate(move || {} ).await //~ ERROR expected function, found module `crate`
crate(move || {} ).await
}
}
trait C{async fn new(val: T) {} //~ ERROR `async fn` is not permitted in Rust 2015
//~^ ERROR functions in traits cannot be declared `async`
//~| ERROR cannot find type `T` in this scope
//~| WARN changes to closure capture in Rust 2021 will affect drop order [rust_2021_incompatible_closure_captures]
//~ ERROR this file contains an unclosed delimiter
trait C{async fn new(val: T) {} //~ ERROR this file contains an unclosed delimiter

View file

@ -1,95 +1,8 @@
error: this file contains an unclosed delimiter
--> $DIR/drop-location-span-error-rust-2021-incompatible-closure-captures-93117.rs:18:53
--> $DIR/drop-location-span-error-rust-2021-incompatible-closure-captures-93117.rs:12:85
|
LL | trait C{async fn new(val: T) {}
| - unclosed delimiter
...
LL |
| ^
| - unclosed delimiter ^
error[E0670]: `async fn` is not permitted in Rust 2015
--> $DIR/drop-location-span-error-rust-2021-incompatible-closure-captures-93117.rs:6:5
|
LL | async fn create(path: impl AsRef<std::path::Path>) {
| ^^^^^ to use `async fn`, switch to Rust 2018 or later
|
= help: pass `--edition 2021` to `rustc`
= note: for more on editions, read https://doc.rust-lang.org/edition-guide
error: aborting due to previous error
error[E0670]: `async fn` is not permitted in Rust 2015
--> $DIR/drop-location-span-error-rust-2021-incompatible-closure-captures-93117.rs:13:9
|
LL | trait C{async fn new(val: T) {}
| ^^^^^ to use `async fn`, switch to Rust 2018 or later
|
= help: pass `--edition 2021` to `rustc`
= note: for more on editions, read https://doc.rust-lang.org/edition-guide
error[E0412]: cannot find type `T` in this scope
--> $DIR/drop-location-span-error-rust-2021-incompatible-closure-captures-93117.rs:13:27
|
LL | pub struct A {}
| ------------ similarly named struct `A` defined here
...
LL | trait C{async fn new(val: T) {}
| ^ help: a struct with a similar name exists: `A`
error[E0706]: functions in traits cannot be declared `async`
--> $DIR/drop-location-span-error-rust-2021-incompatible-closure-captures-93117.rs:13:9
|
LL | trait C{async fn new(val: T) {}
| -----^^^^^^^^^^^^^^^
| |
| `async` because of this
|
= note: `async` trait functions are not currently supported
= note: consider using the `async-trait` crate: https://crates.io/crates/async-trait
= note: see issue #91611 <https://github.com/rust-lang/rust/issues/91611> for more information
= help: add `#![feature(async_fn_in_trait)]` to the crate attributes to enable
error[E0423]: expected function, found module `crate`
--> $DIR/drop-location-span-error-rust-2021-incompatible-closure-captures-93117.rs:9:5
|
LL | crate(move || {} ).await
| ^^^^^ not a function
warning: changes to closure capture in Rust 2021 will affect drop order
--> $DIR/drop-location-span-error-rust-2021-incompatible-closure-captures-93117.rs:6:57
|
LL | async fn create(path: impl AsRef<std::path::Path>) {
| _____________________----_____________________________-__^
| | | |
| | | in Rust 2018, `path` is dropped here along with the closure, but in Rust 2021 `path` is not part of the closure
| | in Rust 2018, this causes the closure to capture `path`, but in Rust 2021, it has no effect
LL | |
LL | | ;
LL | | crate(move || {} ).await
LL | | }
| |_____^
|
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
= note: requested on the command line with `-W rust-2021-incompatible-closure-captures`
help: add a dummy let to cause `path` to be fully captured
|
LL | async fn create(path: impl AsRef<std::path::Path>) { let _ = &path;
| ++++++++++++++
warning: changes to closure capture in Rust 2021 will affect drop order
--> $DIR/drop-location-span-error-rust-2021-incompatible-closure-captures-93117.rs:13:30
|
LL | trait C{async fn new(val: T) {}
| --- - ^^
| | |
| | in Rust 2018, `val` is dropped here along with the closure, but in Rust 2021 `val` is not part of the closure
| in Rust 2018, this causes the closure to capture `val`, but in Rust 2021, it has no effect
|
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
help: add a dummy let to cause `val` to be fully captured
|
LL | trait C{async fn new(val: T) { let _ = &val;}
| +++++++++++++
error: aborting due to 6 previous errors; 2 warnings emitted
Some errors have detailed explanations: E0412, E0423, E0670, E0706.
For more information about an error, try `rustc --explain E0412`.

View file

@ -1,11 +1,9 @@
struct Bug<S>{ //~ ERROR parameter `S` is never used [E0392]
struct Bug<S>{
A: [(); {
let x: [u8; Self::W] = [0; Self::W]; //~ ERROR generic `Self` types are currently not permitted in anonymous constants
//~^ ERROR generic `Self` types are currently not permitted in anonymous constants
//~^^ ERROR the size for values of type `S` cannot be known at compilation time [E0277]
F //~ ERROR cannot find value `F` in this scope [E0425]
let x: [u8; Self::W] = [0; Self::W];
F
}
} //~ ERROR mismatched closing delimiter: `}`
}
//~^ ERROR mismatched closing delimiter: `}`
fn main() {}

View file

@ -9,64 +9,5 @@ LL | A: [(); {
LL | }
| ^ mismatched closing delimiter
error: mismatched closing delimiter: `}`
--> $DIR/constrain-suggest-ice.rs:2:8
|
LL | struct Bug<S>{
| - closing delimiter possibly meant for this
LL | A: [(); {
| ^ unclosed delimiter
...
LL | }
| ^ mismatched closing delimiter
error: aborting due to previous error
error[E0425]: cannot find value `F` in this scope
--> $DIR/constrain-suggest-ice.rs:6:9
|
LL | F
| ^ help: a local variable with a similar name exists: `x`
error: generic `Self` types are currently not permitted in anonymous constants
--> $DIR/constrain-suggest-ice.rs:3:21
|
LL | let x: [u8; Self::W] = [0; Self::W];
| ^^^^
error: generic `Self` types are currently not permitted in anonymous constants
--> $DIR/constrain-suggest-ice.rs:3:36
|
LL | let x: [u8; Self::W] = [0; Self::W];
| ^^^^
error[E0277]: the size for values of type `S` cannot be known at compilation time
--> $DIR/constrain-suggest-ice.rs:3:36
|
LL | struct Bug<S>{
| - this type parameter needs to be `std::marker::Sized`
LL | A: [(); {
LL | let x: [u8; Self::W] = [0; Self::W];
| ^^^^^^^ doesn't have a size known at compile-time
|
note: required by a bound in `Bug`
--> $DIR/constrain-suggest-ice.rs:1:12
|
LL | struct Bug<S>{
| ^ required by this bound in `Bug`
help: consider relaxing the implicit `Sized` restriction
|
LL | struct Bug<S: ?Sized>{
| ++++++++
error[E0392]: parameter `S` is never used
--> $DIR/constrain-suggest-ice.rs:1:12
|
LL | struct Bug<S>{
| ^ unused parameter
|
= help: consider removing `S`, referring to it in a field, or using a marker such as `PhantomData`
= help: if you intended `S` to be a const parameter, use `const S: usize` instead
error: aborting due to 7 previous errors
Some errors have detailed explanations: E0277, E0392, E0425.
For more information about an error, try `rustc --explain E0277`.

View file

@ -1,8 +1,4 @@
// error-pattern: this file contains an unclosed delimiter
// error-pattern: cannot find type `ţ` in this scope
// error-pattern: parenthesized type parameters may only be used with a `Fn` trait
// error-pattern: type arguments are not allowed on builtin type `u8`
// error-pattern: mismatched types
// ignore-tidy-trailing-newlines
// `ţ` must be the last character in this file, it cannot be followed by a newline
fn main() {

View file

@ -1,5 +1,5 @@
error: this file contains an unclosed delimiter
--> $DIR/issue-91268.rs:9:12
--> $DIR/issue-91268.rs:5:12
|
LL | fn main() {
| - unclosed delimiter
@ -9,7 +9,7 @@ LL | 0: u8(ţ
| unclosed delimiter
error: this file contains an unclosed delimiter
--> $DIR/issue-91268.rs:9:12
--> $DIR/issue-91268.rs:5:12
|
LL | fn main() {
| - unclosed delimiter
@ -18,46 +18,5 @@ LL | 0: u8(ţ
| |
| unclosed delimiter
error[E0412]: cannot find type `ţ` in this scope
--> $DIR/issue-91268.rs:9:11
|
LL | 0: u8(ţ
| ^ expecting a type here because of type ascription
error: aborting due to 2 previous errors
error[E0214]: parenthesized type parameters may only be used with a `Fn` trait
--> $DIR/issue-91268.rs:9:8
|
LL | 0: u8(ţ
| ^^^^ only `Fn` traits may use parentheses
|
help: use angle brackets instead
|
LL | 0: u8<ţ>
| ~ +
error[E0109]: type arguments are not allowed on builtin type `u8`
--> $DIR/issue-91268.rs:9:11
|
LL | 0: u8(ţ
| -- ^ type argument not allowed
| |
| not allowed on builtin type `u8`
|
help: primitive type `u8` doesn't have generic parameters
|
LL - 0: u8(ţ
LL + 0: u8
|
error[E0308]: mismatched types
--> $DIR/issue-91268.rs:9:5
|
LL | fn main() {
| - expected `()` because of default return type
LL | 0: u8(ţ
| ^^^^^^^ expected `()`, found `u8`
error: aborting due to 6 previous errors
Some errors have detailed explanations: E0109, E0214, E0308, E0412.
For more information about an error, try `rustc --explain E0109`.

View file

@ -1,9 +1,6 @@
// Regression test for the ICE described in issue #91334.
// error-pattern: this file contains an unclosed delimiter
// error-pattern: expected one of
// error-pattern: mismatched closing delimiter
// error-pattern: mismatched types
#![feature(generators)]

View file

@ -1,5 +1,5 @@
error: this file contains an unclosed delimiter
--> $DIR/issue-91334.rs:10:23
--> $DIR/issue-91334.rs:7:23
|
LL | fn f(){||yield(((){),
| - - - ^
@ -9,7 +9,7 @@ LL | fn f(){||yield(((){),
| unclosed delimiter
error: this file contains an unclosed delimiter
--> $DIR/issue-91334.rs:10:23
--> $DIR/issue-91334.rs:7:23
|
LL | fn f(){||yield(((){),
| - - - ^
@ -18,17 +18,8 @@ LL | fn f(){||yield(((){),
| | unclosed delimiter
| unclosed delimiter
error: expected one of `)`, `,`, `.`, `?`, or an operator, found `{`
--> $DIR/issue-91334.rs:10:19
|
LL | fn f(){||yield(((){),
| ^
| |
| expected one of `)`, `,`, `.`, `?`, or an operator
| help: missing `,`
error: mismatched closing delimiter: `)`
--> $DIR/issue-91334.rs:10:19
--> $DIR/issue-91334.rs:7:19
|
LL | fn f(){||yield(((){),
| - ^^ mismatched closing delimiter
@ -36,17 +27,5 @@ LL | fn f(){||yield(((){),
| | unclosed delimiter
| closing delimiter possibly meant for this
error[E0308]: mismatched types
--> $DIR/issue-91334.rs:10:8
|
LL | fn f(){||yield(((){),
| -^^^^^^^^^^^^^^^ expected `()`, found generator
| |
| help: a return type might be missing here: `-> _`
|
= note: expected unit type `()`
found generator `[generator@$DIR/issue-91334.rs:10:8: 10:10]`
error: aborting due to 3 previous errors
error: aborting due to 5 previous errors
For more information about this error, try `rustc --explain E0308`.

View file

@ -2,13 +2,8 @@
#![crate_type="lib"]
fn r({) {
Ok { //~ ERROR mismatched types [E0308]
fn r({) { //~ ERROR mismatched closing delimiter
Ok {
d..||_=m
}
}
//~^^^^^ ERROR expected parameter name, found `{`
//~| ERROR expected one of `,`, `:`, or `}`, found `..`
//~^^^^^ ERROR cannot find value `d` in this scope [E0425]
//~| ERROR cannot find value `m` in this scope [E0425]
//~| ERROR variant `Result<_, _>::Ok` has no field named `d` [E0559]

View file

@ -1,60 +1,11 @@
error: expected parameter name, found `{`
error: mismatched closing delimiter: `)`
--> $DIR/issue-92481.rs:5:6
|
LL | fn r({) {
| ^ expected parameter name
| -^^ mismatched closing delimiter
| ||
| |unclosed delimiter
| closing delimiter possibly meant for this
error: expected one of `,`, `:`, or `}`, found `..`
--> $DIR/issue-92481.rs:5:6
|
LL | fn r({) {
| ^ unclosed delimiter
LL | Ok {
LL | d..||_=m
| -^
| |
| help: `}` may belong here
error: aborting due to previous error
error[E0425]: cannot find value `d` in this scope
--> $DIR/issue-92481.rs:7:9
|
LL | d..||_=m
| ^ not found in this scope
error[E0425]: cannot find value `m` in this scope
--> $DIR/issue-92481.rs:7:16
|
LL | d..||_=m
| ^ not found in this scope
error[E0559]: variant `Result<_, _>::Ok` has no field named `d`
--> $DIR/issue-92481.rs:7:9
|
LL | d..||_=m
| ^ field does not exist
--> $SRC_DIR/core/src/result.rs:LL:COL
|
= note: `Result<_, _>::Ok` defined here
|
help: `Result<_, _>::Ok` is a tuple variant, use the appropriate syntax
|
LL | Result<_, _>::Ok(/* fields */)
|
error[E0308]: mismatched types
--> $DIR/issue-92481.rs:6:5
|
LL | fn r({) {
| - help: a return type might be missing here: `-> _`
LL | / Ok {
LL | | d..||_=m
LL | | }
| |_____^ expected `()`, found `Result<_, _>`
|
= note: expected unit type `()`
found enum `Result<_, _>`
error: aborting due to 6 previous errors
Some errors have detailed explanations: E0308, E0425, E0559.
For more information about an error, try `rustc --explain E0308`.