Make parse error suggestions verbose and fix spans

Go over all structured parser suggestions and make them verbose style.

When suggesting to add or remove delimiters, turn them into multiple suggestion parts.
This commit is contained in:
Esteban Küber 2024-07-06 03:07:46 +00:00
parent 5e311f933d
commit 692bc344d5
175 changed files with 3197 additions and 786 deletions

View File

@ -1,7 +1,7 @@
parse_add_paren = try adding parentheses
parse_ambiguous_range_pattern = the range pattern here has ambiguous interpretation
.suggestion = add parentheses to clarify the precedence
parse_ambiguous_range_pattern_suggestion = add parentheses to clarify the precedence
parse_array_brackets_instead_of_braces = this is a block expression, not an array
.suggestion = to make an array, use square brackets instead of curly braces
@ -644,7 +644,7 @@ parse_parentheses_with_struct_fields = invalid `struct` delimiters or `fn` call
.suggestion_no_fields_for_fn = if `{$type}` is a function, use the arguments directly
parse_parenthesized_lifetime = parenthesized lifetime bounds are not supported
.suggestion = remove the parentheses
parse_parenthesized_lifetime_suggestion = remove the parentheses
parse_path_single_colon = path separator must be a double colon
.suggestion = use a double colon instead

File diff suppressed because it is too large Load Diff

View File

@ -3,8 +3,8 @@ use super::{
BlockMode, CommaRecoveryMode, Parser, PathStyle, Restrictions, SemiColonMode, SeqSep, TokenType,
};
use crate::errors::{
AmbiguousPlus, AsyncMoveBlockIn2015, AttributeOnParamType, BadQPathStage2, BadTypePlus,
BadTypePlusSub, ColonAsSemi, ComparisonOperatorsCannotBeChained,
AddParen, AmbiguousPlus, AsyncMoveBlockIn2015, AttributeOnParamType, BadQPathStage2,
BadTypePlus, BadTypePlusSub, ColonAsSemi, ComparisonOperatorsCannotBeChained,
ComparisonOperatorsCannotBeChainedSugg, ConstGenericWithoutBraces,
ConstGenericWithoutBracesSugg, DocCommentDoesNotDocumentAnything, DocCommentOnParamType,
DoubleColonInBound, ExpectedIdentifier, ExpectedSemi, ExpectedSemiSugg,
@ -566,7 +566,10 @@ impl<'a> Parser<'a> {
&& expected.iter().any(|tok| matches!(tok, TokenType::Token(TokenKind::Eq)))
{
// Likely typo: `=` → `==` in let expr or enum item
return Err(self.dcx().create_err(UseEqInstead { span: self.token.span }));
return Err(self.dcx().create_err(UseEqInstead {
span: self.token.span,
suggestion: self.token.span.with_lo(self.token.span.lo() + BytePos(1)),
}));
}
if self.token.is_keyword(kw::Move) && self.prev_token.is_keyword(kw::Async) {
@ -1151,7 +1154,7 @@ impl<'a> Parser<'a> {
// Eat from where we started until the end token so that parsing can continue
// as if we didn't have those extra angle brackets.
self.eat_to_tokens(end);
let span = lo.until(self.token.span);
let span = lo.to(self.prev_token.span);
let num_extra_brackets = number_of_gt + number_of_shr * 2;
return Some(self.dcx().emit_err(UnmatchedAngleBrackets { span, num_extra_brackets }));
@ -1539,7 +1542,10 @@ impl<'a> Parser<'a> {
pub(super) fn maybe_report_ambiguous_plus(&mut self, impl_dyn_multi: bool, ty: &Ty) {
if impl_dyn_multi {
self.dcx().emit_err(AmbiguousPlus { sum_ty: pprust::ty_to_string(ty), span: ty.span });
self.dcx().emit_err(AmbiguousPlus {
span: ty.span,
suggestion: AddParen { lo: ty.span.shrink_to_lo(), hi: ty.span.shrink_to_hi() },
});
}
}
@ -1608,21 +1614,10 @@ impl<'a> Parser<'a> {
let sum_span = ty.span.to(self.prev_token.span);
let sub = match &ty.kind {
TyKind::Ref(lifetime, mut_ty) => {
let sum_with_parens = pprust::to_string(|s| {
s.s.word("&");
s.print_opt_lifetime(lifetime);
s.print_mutability(mut_ty.mutbl, false);
s.popen();
s.print_type(&mut_ty.ty);
if !bounds.is_empty() {
s.word(" + ");
s.print_type_bounds(&bounds);
}
s.pclose()
});
BadTypePlusSub::AddParen { sum_with_parens, span: sum_span }
TyKind::Ref(_lifetime, mut_ty) => {
let lo = mut_ty.ty.span.shrink_to_lo();
let hi = self.prev_token.span.shrink_to_hi();
BadTypePlusSub::AddParen { suggestion: AddParen { lo, hi } }
}
TyKind::Ptr(..) | TyKind::BareFn(..) => BadTypePlusSub::ForgotParen { span: sum_span },
_ => BadTypePlusSub::ExpectPath { span: sum_span },

View File

@ -714,7 +714,7 @@ impl<'a> Parser<'a> {
type_err.cancel();
self.dcx().emit_err(errors::MalformedLoopLabel {
span: label.ident.span,
correct_label: label.ident,
suggestion: label.ident.span.shrink_to_lo(),
});
return Ok(expr);
}
@ -856,7 +856,7 @@ impl<'a> Parser<'a> {
let hi = self.interpolated_or_expr_span(&expr);
let span = lo.to(hi);
if let Some(lt) = lifetime {
self.error_remove_borrow_lifetime(span, lt.ident.span);
self.error_remove_borrow_lifetime(span, lt.ident.span.until(expr.span));
}
Ok((span, ExprKind::AddrOf(borrow_kind, mutbl, expr)))
}
@ -1653,6 +1653,7 @@ impl<'a> Parser<'a> {
let lo = label_.ident.span;
let label = Some(label_);
let ate_colon = self.eat(&token::Colon);
let tok_sp = self.token.span;
let expr = if self.eat_keyword(kw::While) {
self.parse_expr_while(label, lo)
} else if self.eat_keyword(kw::For) {
@ -1747,7 +1748,7 @@ impl<'a> Parser<'a> {
self.dcx().emit_err(errors::RequireColonAfterLabeledExpression {
span: expr.span,
label: lo,
label_end: lo.shrink_to_hi(),
label_end: lo.between(tok_sp),
});
}
@ -2106,7 +2107,7 @@ impl<'a> Parser<'a> {
self.bump();
self.dcx().emit_err(errors::FloatLiteralRequiresIntegerPart {
span: token.span,
correct: pprust::token_to_string(token).into_owned(),
suggestion: token.span.shrink_to_lo(),
});
}
}
@ -2741,7 +2742,7 @@ impl<'a> Parser<'a> {
if !attrs.is_empty()
&& let [x0 @ xn] | [x0, .., xn] = &*attrs.take_for_recovery(self.psess)
{
let attributes = x0.span.to(xn.span);
let attributes = x0.span.until(branch_span);
let last = xn.span;
let ctx = if is_ctx_else { "else" } else { "if" };
self.dcx().emit_err(errors::OuterAttributeNotAllowedOnIfElse {

View File

@ -2241,9 +2241,13 @@ impl<'a> Parser<'a> {
let kw_token = self.token.clone();
let kw_str = pprust::token_to_string(&kw_token);
let item = self.parse_item(ForceCollect::No)?;
let mut item = item.unwrap().span;
if self.token == token::Comma {
item = item.to(self.token.span);
}
self.dcx().emit_err(errors::NestedAdt {
span: kw_token.span,
item: item.unwrap().span,
item,
kw_str,
keyword: keyword.as_str(),
});

View File

@ -4,11 +4,11 @@ use crate::errors::{
DotDotDotRestPattern, EnumPatternInsteadOfIdentifier, ExpectedBindingLeftOfAt,
ExpectedCommaAfterPatternField, GenericArgsInPatRequireTurbofishSyntax,
InclusiveRangeExtraEquals, InclusiveRangeMatchArrow, InclusiveRangeNoEnd, InvalidMutInPattern,
PatternOnWrongSideOfAt, RemoveLet, RepeatedMutInPattern, SwitchRefBoxOrder,
TopLevelOrPatternNotAllowed, TopLevelOrPatternNotAllowedSugg, TrailingVertNotAllowed,
UnexpectedExpressionInPattern, UnexpectedLifetimeInPattern, UnexpectedParenInRangePat,
UnexpectedParenInRangePatSugg, UnexpectedVertVertBeforeFunctionParam,
UnexpectedVertVertInPattern,
ParenRangeSuggestion, PatternOnWrongSideOfAt, RemoveLet, RepeatedMutInPattern,
SwitchRefBoxOrder, TopLevelOrPatternNotAllowed, TopLevelOrPatternNotAllowedSugg,
TrailingVertNotAllowed, UnexpectedExpressionInPattern, UnexpectedLifetimeInPattern,
UnexpectedParenInRangePat, UnexpectedParenInRangePatSugg,
UnexpectedVertVertBeforeFunctionParam, UnexpectedVertVertInPattern, WrapInParens,
};
use crate::parser::expr::{could_be_unclosed_char_literal, LhsExpr};
use crate::{maybe_recover_from_interpolated_ty_qpath, maybe_whole};
@ -24,7 +24,7 @@ use rustc_errors::{Applicability, Diag, PResult};
use rustc_session::errors::ExprParenthesesNeeded;
use rustc_span::source_map::{respan, Spanned};
use rustc_span::symbol::{kw, sym, Ident};
use rustc_span::{ErrorGuaranteed, Span};
use rustc_span::{BytePos, ErrorGuaranteed, Span};
use thin_vec::{thin_vec, ThinVec};
#[derive(PartialEq, Copy, Clone)]
@ -236,11 +236,15 @@ impl<'a> Parser<'a> {
if let PatKind::Or(pats) = &pat.kind {
let span = pat.span;
let pat = pprust::pat_to_string(&pat);
let sub = if pats.len() == 1 {
Some(TopLevelOrPatternNotAllowedSugg::RemoveLeadingVert { span, pat })
Some(TopLevelOrPatternNotAllowedSugg::RemoveLeadingVert {
span: span.with_hi(span.lo() + BytePos(1)),
})
} else {
Some(TopLevelOrPatternNotAllowedSugg::WrapInParens { span, pat })
Some(TopLevelOrPatternNotAllowedSugg::WrapInParens {
span,
suggestion: WrapInParens { lo: span.shrink_to_lo(), hi: span.shrink_to_hi() },
})
};
let err = self.dcx().create_err(match syntax_loc {
@ -599,7 +603,10 @@ impl<'a> Parser<'a> {
self.bump(); // `...`
// The user probably mistook `...` for a rest pattern `..`.
self.dcx().emit_err(DotDotDotRestPattern { span: lo });
self.dcx().emit_err(DotDotDotRestPattern {
span: lo,
suggestion: lo.with_lo(lo.hi() - BytePos(1)),
});
PatKind::Rest
}
@ -664,8 +671,13 @@ impl<'a> Parser<'a> {
_ => return,
}
self.dcx()
.emit_err(AmbiguousRangePattern { span: pat.span, pat: pprust::pat_to_string(pat) });
self.dcx().emit_err(AmbiguousRangePattern {
span: pat.span,
suggestion: ParenRangeSuggestion {
lo: pat.span.shrink_to_lo(),
hi: pat.span.shrink_to_hi(),
},
});
}
/// Parse `&pat` / `&mut pat`.
@ -674,8 +686,11 @@ impl<'a> Parser<'a> {
if let token::Lifetime(name) = self.token.kind {
self.bump(); // `'a`
self.dcx()
.emit_err(UnexpectedLifetimeInPattern { span: self.prev_token.span, symbol: name });
self.dcx().emit_err(UnexpectedLifetimeInPattern {
span: self.prev_token.span,
symbol: name,
suggestion: self.prev_token.span.until(self.token.span),
});
}
let mutbl = self.parse_mutability();
@ -913,10 +928,13 @@ impl<'a> Parser<'a> {
self.dcx().emit_err(InclusiveRangeExtraEquals { span: span_with_eq })
}
token::Gt if no_space => {
let after_pat = span.with_hi(span.hi() - rustc_span::BytePos(1)).shrink_to_hi();
let after_pat = span.with_hi(span.hi() - BytePos(1)).shrink_to_hi();
self.dcx().emit_err(InclusiveRangeMatchArrow { span, arrow: tok.span, after_pat })
}
_ => self.dcx().emit_err(InclusiveRangeNoEnd { span }),
_ => self.dcx().emit_err(InclusiveRangeNoEnd {
span,
suggestion: span.with_lo(span.hi() - BytePos(1)),
}),
}
}

View File

@ -430,8 +430,10 @@ impl<'a> Parser<'a> {
let eq_consumed = match self.token.kind {
token::BinOpEq(..) => {
// Recover `let x <op>= 1` as `let x = 1`
self.dcx()
.emit_err(errors::CompoundAssignmentExpressionInLet { span: self.token.span });
self.dcx().emit_err(errors::CompoundAssignmentExpressionInLet {
span: self.token.span,
suggestion: self.token.span.with_hi(self.token.span.lo() + BytePos(1)),
});
self.bump();
true
}
@ -717,7 +719,7 @@ impl<'a> Parser<'a> {
e.cancel();
self.dcx().emit_err(MalformedLoopLabel {
span: label.ident.span,
correct_label: label.ident,
suggestion: label.ident.span.shrink_to_lo(),
});
*expr = labeled_expr;
break 'break_recover None;

View File

@ -209,6 +209,7 @@ impl<'a> Parser<'a> {
recover_qpath: RecoverQPath,
recover_return_sign: RecoverReturnSign,
) -> PResult<'a, FnRetTy> {
let lo = self.prev_token.span;
Ok(if self.eat(&token::RArrow) {
// FIXME(Centril): Can we unconditionally `allow_plus`?
let ty = self.parse_ty_common(
@ -224,7 +225,10 @@ impl<'a> Parser<'a> {
// Don't `eat` to prevent `=>` from being added as an expected token which isn't
// actually expected and could only confuse users
self.bump();
self.dcx().emit_err(ReturnTypesUseThinArrow { span: self.prev_token.span });
self.dcx().emit_err(ReturnTypesUseThinArrow {
span: self.prev_token.span,
suggestion: lo.between(self.token.span),
});
let ty = self.parse_ty_common(
allow_plus,
AllowCVariadic::No,
@ -794,8 +798,11 @@ impl<'a> Parser<'a> {
{
if self.token.is_keyword(kw::Dyn) {
// Account for `&dyn Trait + dyn Other`.
self.dcx().emit_err(InvalidDynKeyword { span: self.token.span });
self.bump();
self.dcx().emit_err(InvalidDynKeyword {
span: self.prev_token.span,
suggestion: self.prev_token.span.until(self.token.span),
});
}
bounds.push(self.parse_generic_bound()?);
if allow_plus == AllowPlus::No || !self.eat_plus() {
@ -861,7 +868,7 @@ impl<'a> Parser<'a> {
if has_parens {
// FIXME(Centril): Consider not erroring here and accepting `('lt)` instead,
// possibly introducing `GenericBound::Paren(P<GenericBound>)`?
self.recover_paren_lifetime(lo, lt.ident.span)?;
self.recover_paren_lifetime(lo)?;
}
Ok(bound)
}
@ -909,16 +916,12 @@ impl<'a> Parser<'a> {
}
/// Recover on `('lifetime)` with `(` already eaten.
fn recover_paren_lifetime(&mut self, lo: Span, lt_span: Span) -> PResult<'a, ()> {
fn recover_paren_lifetime(&mut self, lo: Span) -> PResult<'a, ()> {
self.expect(&token::CloseDelim(Delimiter::Parenthesis))?;
let span = lo.to(self.prev_token.span);
let (sugg, snippet) = if let Ok(snippet) = self.span_to_snippet(lt_span) {
(Some(span), snippet)
} else {
(None, String::new())
};
let sugg = errors::RemoveParens { lo, hi: self.prev_token.span };
self.dcx().emit_err(errors::ParenthesizedLifetime { span, sugg, snippet });
self.dcx().emit_err(errors::ParenthesizedLifetime { span, sugg });
Ok(())
}

View File

@ -9,9 +9,14 @@ error: expected item, found `;`
--> $DIR/failed-doctest-extra-semicolon-on-item.rs:12:12
|
LL | struct S {}; // unexpected semicolon after struct def
| ^ help: remove this semicolon
| ^
|
= help: braced struct declarations are not followed by a semicolon
help: remove this semicolon
|
LL - struct S {}; // unexpected semicolon after struct def
LL + struct S {} // unexpected semicolon after struct def
|
error: aborting due to 1 previous error

View File

@ -2,115 +2,214 @@ error: incorrect use of `await`
--> $DIR/incorrect-syntax-suggestions.rs:8:13
|
LL | let _ = await bar();
| ^^^^^^^^^^^ help: `await` is a postfix operation: `bar().await`
| ^^^^^^^^^^^
|
help: `await` is a postfix operation
|
LL | let _ = bar().await;
| ~~~~~~~~~~~
error: incorrect use of `await`
--> $DIR/incorrect-syntax-suggestions.rs:12:13
|
LL | let _ = await? bar();
| ^^^^^^^^^^^^ help: `await` is a postfix operation: `bar().await?`
| ^^^^^^^^^^^^
|
help: `await` is a postfix operation
|
LL | let _ = bar().await?;
| ~~~~~~~~~~~~
error: incorrect use of `await`
--> $DIR/incorrect-syntax-suggestions.rs:16:13
|
LL | let _ = await bar()?;
| ^^^^^^^^^^^^ help: `await` is a postfix operation: `bar()?.await`
| ^^^^^^^^^^^^
|
help: `await` is a postfix operation
|
LL | let _ = bar()?.await;
| ~~~~~~~~~~~~
error: incorrect use of `await`
--> $DIR/incorrect-syntax-suggestions.rs:20:13
|
LL | let _ = await { bar() };
| ^^^^^^^^^^^^^^^ help: `await` is a postfix operation: `{ bar() }.await`
| ^^^^^^^^^^^^^^^
|
help: `await` is a postfix operation
|
LL | let _ = { bar() }.await;
| ~~~~~~~~~~~~~~~
error: incorrect use of `await`
--> $DIR/incorrect-syntax-suggestions.rs:24:13
|
LL | let _ = await(bar());
| ^^^^^^^^^^^^ help: `await` is a postfix operation: `(bar()).await`
| ^^^^^^^^^^^^
|
help: `await` is a postfix operation
|
LL | let _ = (bar()).await;
| ~~~~~~~~~~~~~
error: incorrect use of `await`
--> $DIR/incorrect-syntax-suggestions.rs:28:13
|
LL | let _ = await { bar() }?;
| ^^^^^^^^^^^^^^^ help: `await` is a postfix operation: `{ bar() }.await`
| ^^^^^^^^^^^^^^^
|
help: `await` is a postfix operation
|
LL | let _ = { bar() }.await?;
| ~~~~~~~~~~~~~~~
error: incorrect use of `await`
--> $DIR/incorrect-syntax-suggestions.rs:32:14
|
LL | let _ = (await bar())?;
| ^^^^^^^^^^^ help: `await` is a postfix operation: `bar().await`
| ^^^^^^^^^^^
|
help: `await` is a postfix operation
|
LL | let _ = (bar().await)?;
| ~~~~~~~~~~~
error: incorrect use of `await`
--> $DIR/incorrect-syntax-suggestions.rs:36:24
|
LL | let _ = bar().await();
| ^^ help: `await` is not a method call, remove the parentheses
| ^^
|
help: `await` is not a method call, remove the parentheses
|
LL - let _ = bar().await();
LL + let _ = bar().await;
|
error: incorrect use of `await`
--> $DIR/incorrect-syntax-suggestions.rs:40:24
|
LL | let _ = bar().await()?;
| ^^ help: `await` is not a method call, remove the parentheses
| ^^
|
help: `await` is not a method call, remove the parentheses
|
LL - let _ = bar().await()?;
LL + let _ = bar().await?;
|
error: incorrect use of `await`
--> $DIR/incorrect-syntax-suggestions.rs:52:13
|
LL | let _ = await bar();
| ^^^^^^^^^^^ help: `await` is a postfix operation: `bar().await`
| ^^^^^^^^^^^
|
help: `await` is a postfix operation
|
LL | let _ = bar().await;
| ~~~~~~~~~~~
error: incorrect use of `await`
--> $DIR/incorrect-syntax-suggestions.rs:56:13
|
LL | let _ = await? bar();
| ^^^^^^^^^^^^ help: `await` is a postfix operation: `bar().await?`
| ^^^^^^^^^^^^
|
help: `await` is a postfix operation
|
LL | let _ = bar().await?;
| ~~~~~~~~~~~~
error: incorrect use of `await`
--> $DIR/incorrect-syntax-suggestions.rs:60:13
|
LL | let _ = await bar()?;
| ^^^^^^^^^^^^ help: `await` is a postfix operation: `bar()?.await`
| ^^^^^^^^^^^^
|
help: `await` is a postfix operation
|
LL | let _ = bar()?.await;
| ~~~~~~~~~~~~
error: incorrect use of `await`
--> $DIR/incorrect-syntax-suggestions.rs:64:14
|
LL | let _ = (await bar())?;
| ^^^^^^^^^^^ help: `await` is a postfix operation: `bar().await`
| ^^^^^^^^^^^
|
help: `await` is a postfix operation
|
LL | let _ = (bar().await)?;
| ~~~~~~~~~~~
error: incorrect use of `await`
--> $DIR/incorrect-syntax-suggestions.rs:68:24
|
LL | let _ = bar().await();
| ^^ help: `await` is not a method call, remove the parentheses
| ^^
|
help: `await` is not a method call, remove the parentheses
|
LL - let _ = bar().await();
LL + let _ = bar().await;
|
error: incorrect use of `await`
--> $DIR/incorrect-syntax-suggestions.rs:73:24
|
LL | let _ = bar().await()?;
| ^^ help: `await` is not a method call, remove the parentheses
| ^^
|
help: `await` is not a method call, remove the parentheses
|
LL - let _ = bar().await()?;
LL + let _ = bar().await?;
|
error: incorrect use of `await`
--> $DIR/incorrect-syntax-suggestions.rs:101:13
|
LL | let _ = await!(bar());
| ^^^^^^^^^^^^^ help: `await` is a postfix operation: `bar().await`
| ^^^^^^^^^^^^^
|
help: `await` is a postfix operation
|
LL | let _ = bar().await;
| ~~~~~~~~~~~
error: incorrect use of `await`
--> $DIR/incorrect-syntax-suggestions.rs:105:13
|
LL | let _ = await!(bar())?;
| ^^^^^^^^^^^^^ help: `await` is a postfix operation: `bar().await`
| ^^^^^^^^^^^^^
|
help: `await` is a postfix operation
|
LL | let _ = bar().await?;
| ~~~~~~~~~~~
error: incorrect use of `await`
--> $DIR/incorrect-syntax-suggestions.rs:110:17
|
LL | let _ = await!(bar())?;
| ^^^^^^^^^^^^^ help: `await` is a postfix operation: `bar().await`
| ^^^^^^^^^^^^^
|
help: `await` is a postfix operation
|
LL | let _ = bar().await?;
| ~~~~~~~~~~~
error: incorrect use of `await`
--> $DIR/incorrect-syntax-suggestions.rs:117:17
|
LL | let _ = await!(bar())?;
| ^^^^^^^^^^^^^ help: `await` is a postfix operation: `bar().await`
| ^^^^^^^^^^^^^
|
help: `await` is a postfix operation
|
LL | let _ = bar().await?;
| ~~~~~~~~~~~
error: expected expression, found `=>`
--> $DIR/incorrect-syntax-suggestions.rs:124:25
@ -124,7 +223,12 @@ error: incorrect use of `await`
--> $DIR/incorrect-syntax-suggestions.rs:124:11
|
LL | match await { await => () }
| ^^^^^^^^^^^^^^^^^^^^^ help: `await` is a postfix operation: `{ await => () }.await`
| ^^^^^^^^^^^^^^^^^^^^^
|
help: `await` is a postfix operation
|
LL | match { await => () }.await
| ~~~~~~~~~~~~~~~~~~~~~
error: expected one of `.`, `?`, `{`, or an operator, found `}`
--> $DIR/incorrect-syntax-suggestions.rs:127:1

View File

@ -32,7 +32,12 @@ error: missing type for `static` item
--> $DIR/issue-90873.rs:1:17
|
LL | #![u=||{static d=||1;}]
| ^ help: provide a type for the item: `: <type>`
| ^
|
help: provide a type for the item
|
LL | #![u=||{static d: <type>=||1;}]
| ++++++++
error: aborting due to 6 previous errors

View File

@ -2,9 +2,13 @@ error: malformed `cfg_attr` attribute input
--> $DIR/cfg-attr-parse.rs:4:1
|
LL | #[cfg_attr()]
| ^^^^^^^^^^^^^ help: missing condition and attribute: `#[cfg_attr(condition, attribute, other_attribute, ...)]`
| ^^^^^^^^^^^^^
|
= note: for more information, visit <https://doc.rust-lang.org/reference/conditional-compilation.html#the-cfg_attr-attribute>
help: missing condition and attribute
|
LL | #[cfg_attr(condition, attribute, other_attribute, ...)]
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: expected `,`, found end of `cfg_attr` input
--> $DIR/cfg-attr-parse.rs:8:17

View File

@ -38,28 +38,43 @@ error: borrow expressions cannot be annotated with lifetimes
--> $DIR/issue-104390.rs:3:25
|
LL | fn f3() -> impl Sized { &'a 2E }
| ^--^^^
| ^---^^
| |
| annotated with lifetime here
| help: remove the lifetime annotation
|
help: remove the lifetime annotation
|
LL - fn f3() -> impl Sized { &'a 2E }
LL + fn f3() -> impl Sized { &2E }
|
error: borrow expressions cannot be annotated with lifetimes
--> $DIR/issue-104390.rs:5:25
|
LL | fn f4() -> impl Sized { &'static 2E }
| ^-------^^^
| ^--------^^
| |
| annotated with lifetime here
| help: remove the lifetime annotation
|
help: remove the lifetime annotation
|
LL - fn f4() -> impl Sized { &'static 2E }
LL + fn f4() -> impl Sized { &2E }
|
error: borrow expressions cannot be annotated with lifetimes
--> $DIR/issue-104390.rs:8:25
|
LL | fn f6() -> impl Sized { &'_ 2E }
| ^--^^^
| ^---^^
| |
| annotated with lifetime here
| help: remove the lifetime annotation
|
help: remove the lifetime annotation
|
LL - fn f6() -> impl Sized { &'_ 2E }
LL + fn f6() -> impl Sized { &2E }
|
error: aborting due to 9 previous errors

View File

@ -106,10 +106,13 @@ error: expected identifier, found `,`
--> $DIR/bad-syntax.rs:42:12
|
LL | #[coverage(,off)]
| ^
| |
| expected identifier
| help: remove this comma
| ^ expected identifier
|
help: remove this comma
|
LL - #[coverage(,off)]
LL + #[coverage(off)]
|
error: multiple `coverage` attributes
--> $DIR/bad-syntax.rs:7:1

View File

@ -2,19 +2,34 @@ error[E0178]: expected a path on the left-hand side of `+`, not `&'a Foo`
--> $DIR/E0178.rs:6:8
|
LL | w: &'a Foo + Copy,
| ^^^^^^^^^^^^^^ help: try adding parentheses: `&'a (Foo + Copy)`
| ^^^^^^^^^^^^^^
|
help: try adding parentheses
|
LL | w: &'a (Foo + Copy),
| + +
error[E0178]: expected a path on the left-hand side of `+`, not `&'a Foo`
--> $DIR/E0178.rs:7:8
|
LL | x: &'a Foo + 'a,
| ^^^^^^^^^^^^ help: try adding parentheses: `&'a (Foo + 'a)`
| ^^^^^^^^^^^^
|
help: try adding parentheses
|
LL | x: &'a (Foo + 'a),
| + +
error[E0178]: expected a path on the left-hand side of `+`, not `&'a mut Foo`
--> $DIR/E0178.rs:8:8
|
LL | y: &'a mut Foo + 'a,
| ^^^^^^^^^^^^^^^^ help: try adding parentheses: `&'a mut (Foo + 'a)`
| ^^^^^^^^^^^^^^^^
|
help: try adding parentheses
|
LL | y: &'a mut (Foo + 'a),
| + +
error[E0178]: expected a path on the left-hand side of `+`, not `fn() -> Foo`
--> $DIR/E0178.rs:9:8

View File

@ -2,39 +2,56 @@ error: `~` cannot be used as a unary operator
--> $DIR/issue-41679-tilde-bitwise-negation-attempt.rs:4:14
|
LL | let _x = ~1;
| ^ help: use `!` to perform bitwise not
| ^
|
help: use `!` to perform bitwise not
|
LL | let _x = !1;
| ~
error: unexpected `1` after identifier
--> $DIR/issue-41679-tilde-bitwise-negation-attempt.rs:5:18
|
LL | let _y = not 1;
| ----^
| |
| help: use `!` to perform bitwise not
| ^
|
help: use `!` to perform bitwise not
|
LL | let _y = !1;
| ~
error: unexpected keyword `false` after identifier
--> $DIR/issue-41679-tilde-bitwise-negation-attempt.rs:6:18
|
LL | let _z = not false;
| ----^^^^^
| |
| help: use `!` to perform logical negation
| ^^^^^
|
help: use `!` to perform logical negation
|
LL | let _z = !false;
| ~
error: unexpected keyword `true` after identifier
--> $DIR/issue-41679-tilde-bitwise-negation-attempt.rs:7:18
|
LL | let _a = not true;
| ----^^^^
| |
| help: use `!` to perform logical negation
| ^^^^
|
help: use `!` to perform logical negation
|
LL | let _a = !true;
| ~
error: unexpected `v` after identifier
--> $DIR/issue-41679-tilde-bitwise-negation-attempt.rs:9:18
|
LL | let _v = not v;
| ----^
| |
| help: use `!` to perform logical negation or bitwise not
| ^
|
help: use `!` to perform logical negation or bitwise not
|
LL | let _v = !v;
| ~
error: aborting due to 5 previous errors

View File

@ -2,25 +2,34 @@ error: unexpected `for_you` after identifier
--> $DIR/issue-46836-identifier-not-instead-of-negation.rs:3:12
|
LL | if not for_you {
| ----^^^^^^^
| |
| help: use `!` to perform logical negation or bitwise not
| ^^^^^^^
|
help: use `!` to perform logical negation or bitwise not
|
LL | if !for_you {
| ~
error: unexpected `the_worst` after identifier
--> $DIR/issue-46836-identifier-not-instead-of-negation.rs:11:15
|
LL | while not the_worst {
| ----^^^^^^^^^
| |
| help: use `!` to perform logical negation or bitwise not
| ^^^^^^^^^
|
help: use `!` to perform logical negation or bitwise not
|
LL | while !the_worst {
| ~
error: unexpected `println` after identifier
--> $DIR/issue-46836-identifier-not-instead-of-negation.rs:20:9
|
LL | if not // lack of braces is [sic]
| ----- help: use `!` to perform logical negation or bitwise not
LL | println!("Then when?");
| ^^^^^^^
|
help: use `!` to perform logical negation or bitwise not
|
LL | if !// lack of braces is [sic]
| ~
error: expected `{`, found `;`
--> $DIR/issue-46836-identifier-not-instead-of-negation.rs:20:31
@ -40,17 +49,23 @@ error: unexpected `2` after identifier
--> $DIR/issue-46836-identifier-not-instead-of-negation.rs:26:24
|
LL | let resource = not 2;
| ----^
| |
| help: use `!` to perform bitwise not
| ^
|
help: use `!` to perform bitwise not
|
LL | let resource = !2;
| ~
error: unexpected `be_smothered_out_before` after identifier
--> $DIR/issue-46836-identifier-not-instead-of-negation.rs:32:27
|
LL | let young_souls = not be_smothered_out_before;
| ----^^^^^^^^^^^^^^^^^^^^^^^
| |
| help: use `!` to perform logical negation or bitwise not
| ^^^^^^^^^^^^^^^^^^^^^^^
|
help: use `!` to perform logical negation or bitwise not
|
LL | let young_souls = !be_smothered_out_before;
| ~
error: aborting due to 6 previous errors

View File

@ -2,65 +2,97 @@ error: `and` is not a logical operator
--> $DIR/issue-54109-and_instead_of_ampersands.rs:7:15
|
LL | let _ = a and b;
| ^^^ help: use `&&` to perform logical conjunction
| ^^^
|
= note: unlike in e.g., Python and PHP, `&&` and `||` are used for logical operators
help: use `&&` to perform logical conjunction
|
LL | let _ = a && b;
| ~~
error: `and` is not a logical operator
--> $DIR/issue-54109-and_instead_of_ampersands.rs:9:10
|
LL | if a and b {
| ^^^ help: use `&&` to perform logical conjunction
| ^^^
|
= note: unlike in e.g., Python and PHP, `&&` and `||` are used for logical operators
help: use `&&` to perform logical conjunction
|
LL | if a && b {
| ~~
error: `or` is not a logical operator
--> $DIR/issue-54109-and_instead_of_ampersands.rs:20:15
|
LL | let _ = a or b;
| ^^ help: use `||` to perform logical disjunction
| ^^
|
= note: unlike in e.g., Python and PHP, `&&` and `||` are used for logical operators
help: use `||` to perform logical disjunction
|
LL | let _ = a || b;
| ~~
error: `or` is not a logical operator
--> $DIR/issue-54109-and_instead_of_ampersands.rs:22:10
|
LL | if a or b {
| ^^ help: use `||` to perform logical disjunction
| ^^
|
= note: unlike in e.g., Python and PHP, `&&` and `||` are used for logical operators
help: use `||` to perform logical disjunction
|
LL | if a || b {
| ~~
error: `and` is not a logical operator
--> $DIR/issue-54109-and_instead_of_ampersands.rs:30:11
|
LL | if (a and b) {
| ^^^ help: use `&&` to perform logical conjunction
| ^^^
|
= note: unlike in e.g., Python and PHP, `&&` and `||` are used for logical operators
help: use `&&` to perform logical conjunction
|
LL | if (a && b) {
| ~~
error: `or` is not a logical operator
--> $DIR/issue-54109-and_instead_of_ampersands.rs:38:11
|
LL | if (a or b) {
| ^^ help: use `||` to perform logical disjunction
| ^^
|
= note: unlike in e.g., Python and PHP, `&&` and `||` are used for logical operators
help: use `||` to perform logical disjunction
|
LL | if (a || b) {
| ~~
error: `and` is not a logical operator
--> $DIR/issue-54109-and_instead_of_ampersands.rs:46:13
|
LL | while a and b {
| ^^^ help: use `&&` to perform logical conjunction
| ^^^
|
= note: unlike in e.g., Python and PHP, `&&` and `||` are used for logical operators
help: use `&&` to perform logical conjunction
|
LL | while a && b {
| ~~
error: `or` is not a logical operator
--> $DIR/issue-54109-and_instead_of_ampersands.rs:54:13
|
LL | while a or b {
| ^^ help: use `||` to perform logical disjunction
| ^^
|
= note: unlike in e.g., Python and PHP, `&&` and `||` are used for logical operators
help: use `||` to perform logical disjunction
|
LL | while a || b {
| ~~
error[E0308]: mismatched types
--> $DIR/issue-54109-and_instead_of_ampersands.rs:13:33

View File

@ -2,65 +2,97 @@ error: `and` is not a logical operator
--> $DIR/issue-54109-without-witness.rs:13:15
|
LL | let _ = a and b;
| ^^^ help: use `&&` to perform logical conjunction
| ^^^
|
= note: unlike in e.g., Python and PHP, `&&` and `||` are used for logical operators
help: use `&&` to perform logical conjunction
|
LL | let _ = a && b;
| ~~
error: `and` is not a logical operator
--> $DIR/issue-54109-without-witness.rs:15:10
|
LL | if a and b {
| ^^^ help: use `&&` to perform logical conjunction
| ^^^
|
= note: unlike in e.g., Python and PHP, `&&` and `||` are used for logical operators
help: use `&&` to perform logical conjunction
|
LL | if a && b {
| ~~
error: `or` is not a logical operator
--> $DIR/issue-54109-without-witness.rs:24:15
|
LL | let _ = a or b;
| ^^ help: use `||` to perform logical disjunction
| ^^
|
= note: unlike in e.g., Python and PHP, `&&` and `||` are used for logical operators
help: use `||` to perform logical disjunction
|
LL | let _ = a || b;
| ~~
error: `or` is not a logical operator
--> $DIR/issue-54109-without-witness.rs:26:10
|
LL | if a or b {
| ^^ help: use `||` to perform logical disjunction
| ^^
|
= note: unlike in e.g., Python and PHP, `&&` and `||` are used for logical operators
help: use `||` to perform logical disjunction
|
LL | if a || b {
| ~~
error: `and` is not a logical operator
--> $DIR/issue-54109-without-witness.rs:34:11
|
LL | if (a and b) {
| ^^^ help: use `&&` to perform logical conjunction
| ^^^
|
= note: unlike in e.g., Python and PHP, `&&` and `||` are used for logical operators
help: use `&&` to perform logical conjunction
|
LL | if (a && b) {
| ~~
error: `or` is not a logical operator
--> $DIR/issue-54109-without-witness.rs:42:11
|
LL | if (a or b) {
| ^^ help: use `||` to perform logical disjunction
| ^^
|
= note: unlike in e.g., Python and PHP, `&&` and `||` are used for logical operators
help: use `||` to perform logical disjunction
|
LL | if (a || b) {
| ~~
error: `and` is not a logical operator
--> $DIR/issue-54109-without-witness.rs:50:13
|
LL | while a and b {
| ^^^ help: use `&&` to perform logical conjunction
| ^^^
|
= note: unlike in e.g., Python and PHP, `&&` and `||` are used for logical operators
help: use `&&` to perform logical conjunction
|
LL | while a && b {
| ~~
error: `or` is not a logical operator
--> $DIR/issue-54109-without-witness.rs:58:13
|
LL | while a or b {
| ^^ help: use `||` to perform logical disjunction
| ^^
|
= note: unlike in e.g., Python and PHP, `&&` and `||` are used for logical operators
help: use `||` to perform logical disjunction
|
LL | while a || b {
| ~~
error: aborting due to 8 previous errors

View File

@ -2,7 +2,12 @@ error: can't qualify macro_rules invocation with `pub`
--> $DIR/pub-macro-rules.rs:2:5
|
LL | pub macro_rules! foo {
| ^^^ help: try exporting the macro: `#[macro_export]`
| ^^^
|
help: try exporting the macro
|
LL | #[macro_export] macro_rules! foo {
| ~~~~~~~~~~~~~~~
error: aborting due to 1 previous error

View File

@ -2,13 +2,23 @@ error[E0178]: expected a path on the left-hand side of `+`, not `&Copy`
--> $DIR/trait-object-reference-without-parens-suggestion.rs:4:12
|
LL | let _: &Copy + 'static;
| ^^^^^^^^^^^^^^^ help: try adding parentheses: `&(Copy + 'static)`
| ^^^^^^^^^^^^^^^
|
help: try adding parentheses
|
LL | let _: &(Copy + 'static);
| + +
error[E0178]: expected a path on the left-hand side of `+`, not `&'static Copy`
--> $DIR/trait-object-reference-without-parens-suggestion.rs:6:12
|
LL | let _: &'static Copy + 'static;
| ^^^^^^^^^^^^^^^^^^^^^^^ help: try adding parentheses: `&'static (Copy + 'static)`
| ^^^^^^^^^^^^^^^^^^^^^^^
|
help: try adding parentheses
|
LL | let _: &'static (Copy + 'static);
| + +
error[E0038]: the trait `Copy` cannot be made into an object
--> $DIR/trait-object-reference-without-parens-suggestion.rs:4:12

View File

@ -2,25 +2,45 @@ error: expected item, found `import`
--> $DIR/use_instead_of_import.rs:3:1
|
LL | import std::{
| ^^^^^^ help: items are imported using the `use` keyword
| ^^^^^^
|
help: items are imported using the `use` keyword
|
LL | use std::{
| ~~~
error: expected item, found `require`
--> $DIR/use_instead_of_import.rs:9:1
|
LL | require std::time::Duration;
| ^^^^^^^ help: items are imported using the `use` keyword
| ^^^^^^^
|
help: items are imported using the `use` keyword
|
LL | use std::time::Duration;
| ~~~
error: expected item, found `include`
--> $DIR/use_instead_of_import.rs:12:1
|
LL | include std::time::Instant;
| ^^^^^^^ help: items are imported using the `use` keyword
| ^^^^^^^
|
help: items are imported using the `use` keyword
|
LL | use std::time::Instant;
| ~~~
error: expected item, found `using`
--> $DIR/use_instead_of_import.rs:15:5
|
LL | pub using std::io;
| ^^^^^ help: items are imported using the `use` keyword
| ^^^^^
|
help: items are imported using the `use` keyword
|
LL | pub use std::io;
| ~~~
error: aborting due to 4 previous errors

View File

@ -2,25 +2,37 @@ error: `enum` definition cannot be nested inside `enum`
--> $DIR/nested-enum.rs:2:5
|
LL | enum Bar { Baz },
| ^^^^------------
| |
| help: consider creating a new `enum` definition instead of nesting
| ^^^^
|
help: consider creating a new `enum` definition instead of nesting
|
LL - enum Bar { Baz },
LL +
|
error: `struct` definition cannot be nested inside `enum`
--> $DIR/nested-enum.rs:3:5
|
LL | struct Quux { field: u8 },
| ^^^^^^-------------------
| |
| help: consider creating a new `struct` definition instead of nesting
| ^^^^^^
|
help: consider creating a new `struct` definition instead of nesting
|
LL - struct Quux { field: u8 },
LL +
|
error: `union` definition cannot be nested inside `enum`
--> $DIR/nested-enum.rs:4:5
|
LL | union Wibble { field: u8 },
| ^^^^^---------------------
| |
| help: consider creating a new `union` definition instead of nesting
| ^^^^^
|
help: consider creating a new `union` definition instead of nesting
|
LL - union Wibble { field: u8 },
LL +
|
error: aborting due to 3 previous errors

View File

@ -2,9 +2,14 @@ error[E0586]: inclusive range with no end
--> $DIR/E0586.rs:3:19
|
LL | let x = &tmp[1..=];
| ^^^ help: use `..` instead
| ^^^
|
= note: inclusive ranges must be bounded at the end (`..=b` or `a..=b`)
help: use `..` instead
|
LL - let x = &tmp[1..=];
LL + let x = &tmp[1..];
|
error: aborting due to 1 previous error

View File

@ -9,12 +9,17 @@ error: outer attributes are not allowed on `if` and `else` branches
|
LL | } else #[attr] if false {
| _______----_^^^^^^^_-
| | | |
| | | help: remove the attributes
| | |
| | the branch belongs to this `else`
LL | | } else {
LL | | }
| |_____- the attributes are attached to this branch
|
help: remove the attributes
|
LL - } else #[attr] if false {
LL + } else if false {
|
error: expected expression, found keyword `else`
--> $DIR/else-attrs.rs:20:15

View File

@ -2,11 +2,13 @@ error: extern items cannot be `const`
--> $DIR/extern-const.rs:14:11
|
LL | const rust_dbg_static_mut: c_int;
| ------^^^^^^^^^^^^^^^^^^^
| |
| help: try using a static value: `static`
| ^^^^^^^^^^^^^^^^^^^
|
= note: for more information, visit https://doc.rust-lang.org/std/keyword.extern.html
help: try using a static value
|
LL | static rust_dbg_static_mut: c_int;
| ~~~~~~
error: aborting due to 1 previous error

View File

@ -2,7 +2,12 @@ error: incorrect unicode escape sequence
--> $DIR/format-string-error-2.rs:77:20
|
LL | println!("\x7B}\u8 {", 1);
| ^^^ help: format of unicode escape sequences uses braces: `\u{8}`
| ^^^
|
help: format of unicode escape sequences uses braces
|
LL | println!("\x7B}\u{8} {", 1);
| ~~~~~
error: invalid format string: expected `'}'`, found `'a'`
--> $DIR/format-string-error-2.rs:5:5

View File

@ -3,7 +3,7 @@
fn a() -> usize { 0 }
//~^ ERROR return types are denoted using `->`
fn b()-> usize { 0 }
fn b() -> usize { 0 }
//~^ ERROR return types are denoted using `->`
fn bar(_: u32) {}
@ -22,7 +22,7 @@ fn main() {
//~^ ERROR return types are denoted using `->`
dbg!(foo(false));
let bar = |a: bool|-> bool { a };
let bar = |a: bool| -> bool { a };
//~^ ERROR return types are denoted using `->`
dbg!(bar(false));
}

View File

@ -2,25 +2,45 @@ error: return types are denoted using `->`
--> $DIR/fn-recover-return-sign.rs:3:8
|
LL | fn a() => usize { 0 }
| ^^ help: use `->` instead
| ^^
|
help: use `->` instead
|
LL | fn a() -> usize { 0 }
| ~~
error: return types are denoted using `->`
--> $DIR/fn-recover-return-sign.rs:6:7
|
LL | fn b(): usize { 0 }
| ^ help: use `->` instead
| ^
|
help: use `->` instead
|
LL | fn b() -> usize { 0 }
| ~~
error: return types are denoted using `->`
--> $DIR/fn-recover-return-sign.rs:21:25
|
LL | let foo = |a: bool| => bool { a };
| ^^ help: use `->` instead
| ^^
|
help: use `->` instead
|
LL | let foo = |a: bool| -> bool { a };
| ~~
error: return types are denoted using `->`
--> $DIR/fn-recover-return-sign.rs:25:24
|
LL | let bar = |a: bool|: bool { a };
| ^ help: use `->` instead
| ^
|
help: use `->` instead
|
LL | let bar = |a: bool| -> bool { a };
| ~~
error: aborting due to 4 previous errors

View File

@ -2,7 +2,12 @@ error: return types are denoted using `->`
--> $DIR/fn-recover-return-sign2.rs:4:10
|
LL | fn foo() => impl Fn() => bool {
| ^^ help: use `->` instead
| ^^
|
help: use `->` instead
|
LL | fn foo() -> impl Fn() => bool {
| ~~
error: expected one of `+`, `->`, `::`, `where`, or `{`, found `=>`
--> $DIR/fn-recover-return-sign2.rs:4:23

View File

@ -2,9 +2,12 @@ error: expected `:` followed by trait or lifetime
--> $DIR/issue-95208-ignore-qself.rs:6:88
|
LL | impl<T: Iterator> Struct<T> where <T as std:: iter::Iterator>::Item:: std::fmt::Display {
| --- ^
| |
| help: use single colon: `:`
| ^
|
help: use single colon
|
LL | impl<T: Iterator> Struct<T> where <T as std:: iter::Iterator>::Item: std::fmt::Display {
| ~
error: aborting due to 1 previous error

View File

@ -2,9 +2,12 @@ error: expected `:` followed by trait or lifetime
--> $DIR/issue-95208.rs:6:46
|
LL | impl<T> Struct<T> where T:: std::fmt::Display {
| --- ^
| |
| help: use single colon: `:`
| ^
|
help: use single colon
|
LL | impl<T> Struct<T> where T: std::fmt::Display {
| ~
error: aborting due to 1 previous error

View File

@ -4,9 +4,13 @@ error: path separator must be a double colon
LL | pub struct Foo {
| --- while parsing this struct
LL | a: Vec<foo::bar:A>,
| ^ help: use a double colon instead: `::`
| ^
|
= note: if you meant to annotate an expression with a type, the type ascription syntax has been removed, see issue #101728 <https://github.com/rust-lang/rust/issues/101728>
help: use a double colon instead
|
LL | a: Vec<foo::bar::A>,
| ~~
error: aborting due to 1 previous error

View File

@ -2,36 +2,60 @@ error: range-to patterns with `...` are not allowed
--> $DIR/half-open-range-pats-inclusive-dotdotdot-bad-syntax.rs:15:9
|
LL | ...X => {}
| ^^^ help: use `..=` instead
| ^^^
|
help: use `..=` instead
|
LL | ..=X => {}
| ~~~
error: range-to patterns with `...` are not allowed
--> $DIR/half-open-range-pats-inclusive-dotdotdot-bad-syntax.rs:16:9
|
LL | ...0 => {}
| ^^^ help: use `..=` instead
| ^^^
|
help: use `..=` instead
|
LL | ..=0 => {}
| ~~~
error: range-to patterns with `...` are not allowed
--> $DIR/half-open-range-pats-inclusive-dotdotdot-bad-syntax.rs:17:9
|
LL | ...'a' => {}
| ^^^ help: use `..=` instead
| ^^^
|
help: use `..=` instead
|
LL | ..='a' => {}
| ~~~
error: range-to patterns with `...` are not allowed
--> $DIR/half-open-range-pats-inclusive-dotdotdot-bad-syntax.rs:18:9
|
LL | ...0.0f32 => {}
| ^^^ help: use `..=` instead
| ^^^
|
help: use `..=` instead
|
LL | ..=0.0f32 => {}
| ~~~
error: range-to patterns with `...` are not allowed
--> $DIR/half-open-range-pats-inclusive-dotdotdot-bad-syntax.rs:25:17
|
LL | let ...$e;
| ^^^ help: use `..=` instead
| ^^^
...
LL | mac!(0);
| ------- in this macro invocation
|
= note: this error originates in the macro `mac` (in Nightly builds, run with -Z macro-backtrace for more info)
help: use `..=` instead
|
LL | let ..=$e;
| ~~~
error[E0005]: refutable pattern in local binding
--> $DIR/half-open-range-pats-inclusive-dotdotdot-bad-syntax.rs:25:17

View File

@ -2,57 +2,87 @@ error[E0586]: inclusive range with no end
--> $DIR/half-open-range-pats-inclusive-no-end.rs:8:13
|
LL | if let 0... = 1 {}
| ^^^ help: use `..` instead
| ^^^
|
= note: inclusive ranges must be bounded at the end (`..=b` or `a..=b`)
help: use `..` instead
|
LL - if let 0... = 1 {}
LL + if let 0.. = 1 {}
|
error[E0586]: inclusive range with no end
--> $DIR/half-open-range-pats-inclusive-no-end.rs:9:13
|
LL | if let 0..= = 1 {}
| ^^^ help: use `..` instead
| ^^^
|
= note: inclusive ranges must be bounded at the end (`..=b` or `a..=b`)
help: use `..` instead
|
LL - if let 0..= = 1 {}
LL + if let 0.. = 1 {}
|
error[E0586]: inclusive range with no end
--> $DIR/half-open-range-pats-inclusive-no-end.rs:11:13
|
LL | if let X... = 1 {}
| ^^^ help: use `..` instead
| ^^^
|
= note: inclusive ranges must be bounded at the end (`..=b` or `a..=b`)
help: use `..` instead
|
LL - if let X... = 1 {}
LL + if let X.. = 1 {}
|
error[E0586]: inclusive range with no end
--> $DIR/half-open-range-pats-inclusive-no-end.rs:12:13
|
LL | if let X..= = 1 {}
| ^^^ help: use `..` instead
| ^^^
|
= note: inclusive ranges must be bounded at the end (`..=b` or `a..=b`)
help: use `..` instead
|
LL - if let X..= = 1 {}
LL + if let X.. = 1 {}
|
error[E0586]: inclusive range with no end
--> $DIR/half-open-range-pats-inclusive-no-end.rs:18:19
|
LL | let $e...;
| ^^^ help: use `..` instead
| ^^^
...
LL | mac!(0);
| ------- in this macro invocation
|
= note: inclusive ranges must be bounded at the end (`..=b` or `a..=b`)
= note: this error originates in the macro `mac` (in Nightly builds, run with -Z macro-backtrace for more info)
help: use `..` instead
|
LL - let $e...;
LL + let $e..;
|
error[E0586]: inclusive range with no end
--> $DIR/half-open-range-pats-inclusive-no-end.rs:20:19
|
LL | let $e..=;
| ^^^ help: use `..` instead
| ^^^
...
LL | mac!(0);
| ------- in this macro invocation
|
= note: inclusive ranges must be bounded at the end (`..=b` or `a..=b`)
= note: this error originates in the macro `mac` (in Nightly builds, run with -Z macro-backtrace for more info)
help: use `..` instead
|
LL - let $e..=;
LL + let $e..;
|
error[E0005]: refutable pattern in local binding
--> $DIR/half-open-range-pats-inclusive-no-end.rs:18:17

View File

@ -2,53 +2,93 @@ error: the range pattern here has ambiguous interpretation
--> $DIR/half-open-range-pats-ref-ambiguous-interp.rs:6:10
|
LL | &0.. | _ => {}
| ^^^ help: add parentheses to clarify the precedence: `(0..)`
| ^^^
|
help: add parentheses to clarify the precedence
|
LL | &(0..) | _ => {}
| + +
error[E0586]: inclusive range with no end
--> $DIR/half-open-range-pats-ref-ambiguous-interp.rs:8:11
|
LL | &0..= | _ => {}
| ^^^ help: use `..` instead
| ^^^
|
= note: inclusive ranges must be bounded at the end (`..=b` or `a..=b`)
help: use `..` instead
|
LL - &0..= | _ => {}
LL + &0.. | _ => {}
|
error: the range pattern here has ambiguous interpretation
--> $DIR/half-open-range-pats-ref-ambiguous-interp.rs:8:10
|
LL | &0..= | _ => {}
| ^^^^ help: add parentheses to clarify the precedence: `(0..=)`
| ^^^^
|
help: add parentheses to clarify the precedence
|
LL | &(0..=) | _ => {}
| + +
error[E0586]: inclusive range with no end
--> $DIR/half-open-range-pats-ref-ambiguous-interp.rs:11:11
|
LL | &0... | _ => {}
| ^^^ help: use `..` instead
| ^^^
|
= note: inclusive ranges must be bounded at the end (`..=b` or `a..=b`)
help: use `..` instead
|
LL - &0... | _ => {}
LL + &0.. | _ => {}
|
error: the range pattern here has ambiguous interpretation
--> $DIR/half-open-range-pats-ref-ambiguous-interp.rs:16:10
|
LL | &..0 | _ => {}
| ^^^ help: add parentheses to clarify the precedence: `(..0)`
| ^^^
|
help: add parentheses to clarify the precedence
|
LL | &(..0) | _ => {}
| + +
error: the range pattern here has ambiguous interpretation
--> $DIR/half-open-range-pats-ref-ambiguous-interp.rs:18:10
|
LL | &..=0 | _ => {}
| ^^^^ help: add parentheses to clarify the precedence: `(..=0)`
| ^^^^
|
help: add parentheses to clarify the precedence
|
LL | &(..=0) | _ => {}
| + +
error: range-to patterns with `...` are not allowed
--> $DIR/half-open-range-pats-ref-ambiguous-interp.rs:20:10
|
LL | &...0 | _ => {}
| ^^^ help: use `..=` instead
| ^^^
|
help: use `..=` instead
|
LL | &..=0 | _ => {}
| ~~~
error: the range pattern here has ambiguous interpretation
--> $DIR/half-open-range-pats-ref-ambiguous-interp.rs:20:10
|
LL | &...0 | _ => {}
| ^^^^ help: add parentheses to clarify the precedence: `(..=0)`
| ^^^^
|
help: add parentheses to clarify the precedence
|
LL | &(...0) | _ => {}
| + +
error: aborting due to 8 previous errors

View File

@ -2,25 +2,35 @@ error: unexpected `impl` keyword
--> $DIR/extra-impl-in-trait-impl.rs:8:18
|
LL | impl<T: Default> impl Default for S<T> {
| ^^^^^ help: remove the extra `impl`
| ^^^^^
|
note: this is parsed as an `impl Trait` type, but a trait is expected at this position
--> $DIR/extra-impl-in-trait-impl.rs:8:18
|
LL | impl<T: Default> impl Default for S<T> {
| ^^^^^^^^^^^^
help: remove the extra `impl`
|
LL - impl<T: Default> impl Default for S<T> {
LL + impl<T: Default> Default for S<T> {
|
error: unexpected `impl` keyword
--> $DIR/extra-impl-in-trait-impl.rs:14:6
|
LL | impl impl Default for S2 {
| ^^^^^ help: remove the extra `impl`
| ^^^^^
|
note: this is parsed as an `impl Trait` type, but a trait is expected at this position
--> $DIR/extra-impl-in-trait-impl.rs:14:6
|
LL | impl impl Default for S2 {
| ^^^^^^^^^^^^
help: remove the extra `impl`
|
LL - impl impl Default for S2 {
LL + impl Default for S2 {
|
error: aborting due to 2 previous errors

View File

@ -2,13 +2,23 @@ error: ambiguous `+` in a type
--> $DIR/impl-fn-parsing-ambiguities.rs:4:27
|
LL | fn a() -> impl Fn(&u8) -> impl Debug + '_ {
| ^^^^^^^^^^^^^^^ help: use parentheses to disambiguate: `(impl Debug + '_)`
| ^^^^^^^^^^^^^^^
|
help: try adding parentheses
|
LL | fn a() -> impl Fn(&u8) -> (impl Debug + '_) {
| + +
error: ambiguous `+` in a type
--> $DIR/impl-fn-parsing-ambiguities.rs:10:24
|
LL | fn b() -> impl Fn() -> impl Debug + Send {
| ^^^^^^^^^^^^^^^^^ help: use parentheses to disambiguate: `(impl Debug + Send)`
| ^^^^^^^^^^^^^^^^^
|
help: try adding parentheses
|
LL | fn b() -> impl Fn() -> (impl Debug + Send) {
| + +
error[E0657]: `impl Trait` cannot capture higher-ranked lifetime from outer `impl Trait`
--> $DIR/impl-fn-parsing-ambiguities.rs:4:40

View File

@ -2,19 +2,34 @@ error: ambiguous `+` in a type
--> $DIR/impl-trait-plus-priority.rs:23:18
|
LL | type A = fn() -> impl A +;
| ^^^^^^^^ help: use parentheses to disambiguate: `(impl A)`
| ^^^^^^^^
|
help: try adding parentheses
|
LL | type A = fn() -> (impl A +);
| + +
error: ambiguous `+` in a type
--> $DIR/impl-trait-plus-priority.rs:25:18
|
LL | type A = fn() -> impl A + B;
| ^^^^^^^^^^ help: use parentheses to disambiguate: `(impl A + B)`
| ^^^^^^^^^^
|
help: try adding parentheses
|
LL | type A = fn() -> (impl A + B);
| + +
error: ambiguous `+` in a type
--> $DIR/impl-trait-plus-priority.rs:27:18
|
LL | type A = fn() -> dyn A + B;
| ^^^^^^^^^ help: use parentheses to disambiguate: `(dyn A + B)`
| ^^^^^^^^^
|
help: try adding parentheses
|
LL | type A = fn() -> (dyn A + B);
| + +
error[E0178]: expected a path on the left-hand side of `+`, not `fn() -> A`
--> $DIR/impl-trait-plus-priority.rs:29:10
@ -26,43 +41,78 @@ error: ambiguous `+` in a type
--> $DIR/impl-trait-plus-priority.rs:32:18
|
LL | type A = Fn() -> impl A +;
| ^^^^^^^^ help: use parentheses to disambiguate: `(impl A)`
| ^^^^^^^^
|
help: try adding parentheses
|
LL | type A = Fn() -> (impl A +);
| + +
error: ambiguous `+` in a type
--> $DIR/impl-trait-plus-priority.rs:34:18
|
LL | type A = Fn() -> impl A + B;
| ^^^^^^^^^^ help: use parentheses to disambiguate: `(impl A + B)`
| ^^^^^^^^^^
|
help: try adding parentheses
|
LL | type A = Fn() -> (impl A + B);
| + +
error: ambiguous `+` in a type
--> $DIR/impl-trait-plus-priority.rs:36:18
|
LL | type A = Fn() -> dyn A + B;
| ^^^^^^^^^ help: use parentheses to disambiguate: `(dyn A + B)`
| ^^^^^^^^^
|
help: try adding parentheses
|
LL | type A = Fn() -> (dyn A + B);
| + +
error: ambiguous `+` in a type
--> $DIR/impl-trait-plus-priority.rs:40:11
|
LL | type A = &impl A +;
| ^^^^^^^^ help: use parentheses to disambiguate: `(impl A)`
| ^^^^^^^^
|
help: try adding parentheses
|
LL | type A = &(impl A +);
| + +
error: ambiguous `+` in a type
--> $DIR/impl-trait-plus-priority.rs:42:11
|
LL | type A = &impl A + B;
| ^^^^^^^^^^ help: use parentheses to disambiguate: `(impl A + B)`
| ^^^^^^^^^^
|
help: try adding parentheses
|
LL | type A = &(impl A + B);
| + +
error: ambiguous `+` in a type
--> $DIR/impl-trait-plus-priority.rs:44:11
|
LL | type A = &dyn A + B;
| ^^^^^^^^^ help: use parentheses to disambiguate: `(dyn A + B)`
| ^^^^^^^^^
|
help: try adding parentheses
|
LL | type A = &(dyn A + B);
| + +
error[E0178]: expected a path on the left-hand side of `+`, not `&A`
--> $DIR/impl-trait-plus-priority.rs:46:10
|
LL | type A = &A + B;
| ^^^^^^ help: try adding parentheses: `&(A + B)`
| ^^^^^^
|
help: try adding parentheses
|
LL | type A = &(A + B);
| + +
error: aborting due to 11 previous errors

View File

@ -2,13 +2,23 @@ error: missing `in` in `for` loop
--> $DIR/issue-40782.rs:4:11
|
LL | for _i 0..2 {
| ^ help: try adding `in` here
| ^
|
help: try adding `in` here
|
LL | for _i in 0..2 {
| ++
error: missing `in` in `for` loop
--> $DIR/issue-40782.rs:6:12
|
LL | for _i of 0..2 {
| ^^ help: try using `in` here instead
| ^^
|
help: try using `in` here instead
|
LL | for _i in 0..2 {
| ~~
error: aborting due to 2 previous errors

View File

@ -2,13 +2,23 @@ error: malformed loop label
--> $DIR/label_misspelled_2.rs:10:5
|
LL | c: for _ in 0..1 {
| ^ help: use the correct loop label format: `'c`
| ^
|
help: use the correct loop label format
|
LL | 'c: for _ in 0..1 {
| +
error: malformed loop label
--> $DIR/label_misspelled_2.rs:13:5
|
LL | d: for _ in 0..1 {
| ^ help: use the correct loop label format: `'d`
| ^
|
help: use the correct loop label format
|
LL | 'd: for _ in 0..1 {
| +
error[E0425]: cannot find value `b` in this scope
--> $DIR/label_misspelled_2.rs:8:15

View File

@ -2,17 +2,27 @@ error: expected `;`, found keyword `let`
--> $DIR/let-else-missing-semicolon.rs:4:6
|
LL | }
| ^ help: add `;` here
| ^
LL | let _ = "";
| --- unexpected token
|
help: add `;` here
|
LL | };
| +
error: expected `;`, found `}`
--> $DIR/let-else-missing-semicolon.rs:8:6
|
LL | }
| ^ help: add `;` here
| ^
LL | }
| - unexpected token
|
help: add `;` here
|
LL | };
| +
error: aborting due to 2 previous errors

View File

@ -26,7 +26,12 @@ error: bare CR not allowed in string, use `\r` instead
--> $DIR/lex-bare-cr-string-literal-doc-comment.rs:19:18
|
LL | let _s = "foo bar";
| ^ help: escape the character: `\r`
| ^
|
help: escape the character
|
LL | let _s = "foo\rbar";
| ++
error: bare CR not allowed in raw string
--> $DIR/lex-bare-cr-string-literal-doc-comment.rs:22:19

View File

@ -2,7 +2,13 @@ error: macro names aren't followed by a `!`
--> $DIR/bang-after-name.rs:4:17
|
LL | macro_rules! foo! {
| ^ help: remove the `!`
| ^
|
help: remove the `!`
|
LL - macro_rules! foo! {
LL + macro_rules! foo {
|
error: aborting due to 1 previous error

View File

@ -24,7 +24,13 @@ error: macro names aren't followed by a `!`
--> $DIR/missing-bang-in-decl.rs:10:16
|
LL | macro_rules bar! {
| ^ help: remove the `!`
| ^
|
help: remove the `!`
|
LL - macro_rules bar! {
LL + macro_rules bar {
|
error: aborting due to 3 previous errors

View File

@ -2,9 +2,12 @@ error: unexpected `1` after identifier
--> $DIR/recovery-allowed.rs:5:23
|
LL | please_recover! { not 1 }
| ----^
| |
| help: use `!` to perform bitwise not
| ^
|
help: use `!` to perform bitwise not
|
LL | please_recover! { !1 }
| ~
error: aborting due to 1 previous error

View File

@ -2,17 +2,25 @@ error: malformed `cfg_attr` attribute input
--> $DIR/malformed-special-attrs.rs:1:1
|
LL | #[cfg_attr]
| ^^^^^^^^^^^ help: missing condition and attribute: `#[cfg_attr(condition, attribute, other_attribute, ...)]`
| ^^^^^^^^^^^
|
= note: for more information, visit <https://doc.rust-lang.org/reference/conditional-compilation.html#the-cfg_attr-attribute>
help: missing condition and attribute
|
LL | #[cfg_attr(condition, attribute, other_attribute, ...)]
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: malformed `cfg_attr` attribute input
--> $DIR/malformed-special-attrs.rs:4:1
|
LL | #[cfg_attr = ""]
| ^^^^^^^^^^^^^^^^ help: missing condition and attribute: `#[cfg_attr(condition, attribute, other_attribute, ...)]`
| ^^^^^^^^^^^^^^^^
|
= note: for more information, visit <https://doc.rust-lang.org/reference/conditional-compilation.html#the-cfg_attr-attribute>
help: missing condition and attribute
|
LL | #[cfg_attr(condition, attribute, other_attribute, ...)]
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: malformed `derive` attribute input
--> $DIR/malformed-special-attrs.rs:7:1

View File

@ -2,7 +2,12 @@ error: return types are denoted using `->`
--> $DIR/avoid-ice-on-warning.rs:4:23
|
LL | fn call_this<F>(f: F) : Fn(&str) + call_that {}
| ^ help: use `->` instead
| ^
|
help: use `->` instead
|
LL | fn call_this<F>(f: F) -> Fn(&str) + call_that {}
| ~~
error[E0405]: cannot find trait `call_that` in this scope
--> $DIR/avoid-ice-on-warning.rs:4:36

View File

@ -2,7 +2,12 @@ error: return types are denoted using `->`
--> $DIR/avoid-ice-on-warning.rs:4:23
|
LL | fn call_this<F>(f: F) : Fn(&str) + call_that {}
| ^ help: use `->` instead
| ^
|
help: use `->` instead
|
LL | fn call_this<F>(f: F) -> Fn(&str) + call_that {}
| ~~
error[E0405]: cannot find trait `call_that` in this scope
--> $DIR/avoid-ice-on-warning.rs:4:36

View File

@ -2,7 +2,12 @@ error: invalid comparison operator `<>`
--> $DIR/less-than-greater-than.rs:2:22
|
LL | println!("{}", 1 <> 2);
| ^^ help: `<>` is not a valid comparison operator, use `!=`
| ^^
|
help: `<>` is not a valid comparison operator, use `!=`
|
LL | println!("{}", 1 != 2);
| ~~
error: aborting due to 1 previous error

View File

@ -2,7 +2,12 @@ error: top-level or-patterns are not allowed in function parameters
--> $DIR/fn-param-wrap-parens.rs:13:9
|
LL | fn fun1(A | B: E) {}
| ^^^^^ help: wrap the pattern in parentheses: `(A | B)`
| ^^^^^
|
help: wrap the pattern in parentheses
|
LL | fn fun1((A | B): E) {}
| + +
error: aborting due to 1 previous error

View File

@ -4,7 +4,13 @@ error: a trailing `|` is not allowed in an or-pattern
LL | E::A |
| ---- while parsing this or-pattern starting here
LL | E::B |
| ^ help: remove the `|`
| ^
|
help: remove the `|`
|
LL - E::B |
LL + E::B
|
error[E0308]: mismatched types
--> $DIR/issue-64879-trailing-before-guard.rs:12:42

View File

@ -2,55 +2,90 @@ error: unexpected token `||` in pattern
--> $DIR/multiple-pattern-typo.rs:7:15
|
LL | 1 | 2 || 3 => (),
| - ^^ help: use a single `|` to separate multiple alternative patterns: `|`
| - ^^
| |
| while parsing this or-pattern starting here
|
help: use a single `|` to separate multiple alternative patterns
|
LL | 1 | 2 | 3 => (),
| ~
error: unexpected token `||` in pattern
--> $DIR/multiple-pattern-typo.rs:12:16
|
LL | (1 | 2 || 3) => (),
| - ^^ help: use a single `|` to separate multiple alternative patterns: `|`
| - ^^
| |
| while parsing this or-pattern starting here
|
help: use a single `|` to separate multiple alternative patterns
|
LL | (1 | 2 | 3) => (),
| ~
error: unexpected token `||` in pattern
--> $DIR/multiple-pattern-typo.rs:17:16
|
LL | (1 | 2 || 3,) => (),
| - ^^ help: use a single `|` to separate multiple alternative patterns: `|`
| - ^^
| |
| while parsing this or-pattern starting here
|
help: use a single `|` to separate multiple alternative patterns
|
LL | (1 | 2 | 3,) => (),
| ~
error: unexpected token `||` in pattern
--> $DIR/multiple-pattern-typo.rs:24:18
|
LL | TS(1 | 2 || 3) => (),
| - ^^ help: use a single `|` to separate multiple alternative patterns: `|`
| - ^^
| |
| while parsing this or-pattern starting here
|
help: use a single `|` to separate multiple alternative patterns
|
LL | TS(1 | 2 | 3) => (),
| ~
error: unexpected token `||` in pattern
--> $DIR/multiple-pattern-typo.rs:31:23
|
LL | NS { f: 1 | 2 || 3 } => (),
| - ^^ help: use a single `|` to separate multiple alternative patterns: `|`
| - ^^
| |
| while parsing this or-pattern starting here
|
help: use a single `|` to separate multiple alternative patterns
|
LL | NS { f: 1 | 2 | 3 } => (),
| ~
error: unexpected token `||` in pattern
--> $DIR/multiple-pattern-typo.rs:36:16
|
LL | [1 | 2 || 3] => (),
| - ^^ help: use a single `|` to separate multiple alternative patterns: `|`
| - ^^
| |
| while parsing this or-pattern starting here
|
help: use a single `|` to separate multiple alternative patterns
|
LL | [1 | 2 | 3] => (),
| ~
error: unexpected token `||` in pattern
--> $DIR/multiple-pattern-typo.rs:41:9
|
LL | || 1 | 2 | 3 => (),
| ^^ help: use a single `|` to separate multiple alternative patterns: `|`
| ^^
|
help: use a single `|` to separate multiple alternative patterns
|
LL | | 1 | 2 | 3 => (),
| ~
error: aborting due to 7 previous errors

View File

@ -2,31 +2,56 @@ error: top-level or-patterns are not allowed in `let` bindings
--> $DIR/nested-undelimited-precedence.rs:19:9
|
LL | let b @ A | B: E = A;
| ^^^^^^^^^ help: wrap the pattern in parentheses: `(b @ A | B)`
| ^^^^^^^^^
|
help: wrap the pattern in parentheses
|
LL | let (b @ A | B): E = A;
| + +
error: top-level or-patterns are not allowed in `let` bindings
--> $DIR/nested-undelimited-precedence.rs:34:9
|
LL | let &A(_) | B(_): F = A(3);
| ^^^^^^^^^^^^ help: wrap the pattern in parentheses: `(&A(_) | B(_))`
| ^^^^^^^^^^^^
|
help: wrap the pattern in parentheses
|
LL | let (&A(_) | B(_)): F = A(3);
| + +
error: top-level or-patterns are not allowed in `let` bindings
--> $DIR/nested-undelimited-precedence.rs:36:9
|
LL | let &&A(_) | B(_): F = A(3);
| ^^^^^^^^^^^^^ help: wrap the pattern in parentheses: `(&&A(_) | B(_))`
| ^^^^^^^^^^^^^
|
help: wrap the pattern in parentheses
|
LL | let (&&A(_) | B(_)): F = A(3);
| + +
error: top-level or-patterns are not allowed in `let` bindings
--> $DIR/nested-undelimited-precedence.rs:38:9
|
LL | let &mut A(_) | B(_): F = A(3);
| ^^^^^^^^^^^^^^^^ help: wrap the pattern in parentheses: `(&mut A(_) | B(_))`
| ^^^^^^^^^^^^^^^^
|
help: wrap the pattern in parentheses
|
LL | let (&mut A(_) | B(_)): F = A(3);
| + +
error: top-level or-patterns are not allowed in `let` bindings
--> $DIR/nested-undelimited-precedence.rs:40:9
|
LL | let &&mut A(_) | B(_): F = A(3);
| ^^^^^^^^^^^^^^^^^ help: wrap the pattern in parentheses: `(&&mut A(_) | B(_))`
| ^^^^^^^^^^^^^^^^^
|
help: wrap the pattern in parentheses
|
LL | let (&&mut A(_) | B(_)): F = A(3);
| + +
error[E0408]: variable `b` is not bound in all patterns
--> $DIR/nested-undelimited-precedence.rs:19:17

View File

@ -16,25 +16,45 @@ error: top-level or-patterns are not allowed in function parameters
--> $DIR/or-patterns-syntactic-fail.rs:18:13
|
LL | fn fun1(A | B: E) {}
| ^^^^^ help: wrap the pattern in parentheses: `(A | B)`
| ^^^^^
|
help: wrap the pattern in parentheses
|
LL | fn fun1((A | B): E) {}
| + +
error: top-level or-patterns are not allowed in function parameters
--> $DIR/or-patterns-syntactic-fail.rs:21:13
|
LL | fn fun2(| A | B: E) {}
| ^^^^^^^ help: wrap the pattern in parentheses: `(A | B)`
| ^^^^^^^
|
help: wrap the pattern in parentheses
|
LL | fn fun2((| A | B): E) {}
| + +
error: top-level or-patterns are not allowed in `let` bindings
--> $DIR/or-patterns-syntactic-fail.rs:26:9
|
LL | let A | B: E = A;
| ^^^^^ help: wrap the pattern in parentheses: `(A | B)`
| ^^^^^
|
help: wrap the pattern in parentheses
|
LL | let (A | B): E = A;
| + +
error: top-level or-patterns are not allowed in `let` bindings
--> $DIR/or-patterns-syntactic-fail.rs:29:9
|
LL | let | A | B: E = A;
| ^^^^^^^ help: wrap the pattern in parentheses: `(A | B)`
| ^^^^^^^
|
help: wrap the pattern in parentheses
|
LL | let (| A | B): E = A;
| + +
error: aborting due to 5 previous errors

View File

@ -8,7 +8,7 @@ fn main() {}
#[cfg(FALSE)]
fn leading() {
fn fun1( A: E) {} //~ ERROR top-level or-patterns are not allowed
fn fun1( A: E) {} //~ ERROR top-level or-patterns are not allowed
fn fun2( A: E) {} //~ ERROR unexpected `||` before function parameter
let ( | A): E;
let ( | A): (E); //~ ERROR unexpected token `||` in pattern

View File

@ -2,161 +2,279 @@ error: top-level or-patterns are not allowed in function parameters
--> $DIR/remove-leading-vert.rs:11:14
|
LL | fn fun1( | A: E) {}
| ^^^ help: remove the `|`: `A`
| ^^^
|
help: remove the `|`
|
LL - fn fun1( | A: E) {}
LL + fn fun1( A: E) {}
|
error: unexpected `||` before function parameter
--> $DIR/remove-leading-vert.rs:12:14
|
LL | fn fun2( || A: E) {}
| ^^ help: remove the `||`
| ^^
|
= note: alternatives in or-patterns are separated with `|`, not `||`
help: remove the `||`
|
LL - fn fun2( || A: E) {}
LL + fn fun2( A: E) {}
|
error: unexpected token `||` in pattern
--> $DIR/remove-leading-vert.rs:14:11
|
LL | let ( || A): (E);
| ^^ help: use a single `|` to separate multiple alternative patterns: `|`
| ^^
|
help: use a single `|` to separate multiple alternative patterns
|
LL | let ( | A): (E);
| ~
error: unexpected token `||` in pattern
--> $DIR/remove-leading-vert.rs:17:11
|
LL | let [ || A ]: [E; 1];
| ^^ help: use a single `|` to separate multiple alternative patterns: `|`
| ^^
|
help: use a single `|` to separate multiple alternative patterns
|
LL | let [ | A ]: [E; 1];
| ~
error: unexpected token `||` in pattern
--> $DIR/remove-leading-vert.rs:19:13
|
LL | let TS( || A ): TS;
| ^^ help: use a single `|` to separate multiple alternative patterns: `|`
| ^^
|
help: use a single `|` to separate multiple alternative patterns
|
LL | let TS( | A ): TS;
| ~
error: unexpected token `||` in pattern
--> $DIR/remove-leading-vert.rs:21:17
|
LL | let NS { f: || A }: NS;
| ^^ help: use a single `|` to separate multiple alternative patterns: `|`
| ^^
|
help: use a single `|` to separate multiple alternative patterns
|
LL | let NS { f: | A }: NS;
| ~
error: a trailing `|` is not allowed in an or-pattern
--> $DIR/remove-leading-vert.rs:26:13
|
LL | let ( A | ): E;
| - ^ help: remove the `|`
| - ^
| |
| while parsing this or-pattern starting here
|
help: remove the `|`
|
LL - let ( A | ): E;
LL + let ( A ): E;
|
error: a trailing `|` is not allowed in an or-pattern
--> $DIR/remove-leading-vert.rs:27:12
|
LL | let (a |,): (E,);
| - ^ help: remove the `|`
| - ^
| |
| while parsing this or-pattern starting here
|
help: remove the `|`
|
LL - let (a |,): (E,);
LL + let (a ,): (E,);
|
error: a trailing `|` is not allowed in an or-pattern
--> $DIR/remove-leading-vert.rs:28:17
|
LL | let ( A | B | ): E;
| - ^ help: remove the `|`
| - ^
| |
| while parsing this or-pattern starting here
|
help: remove the `|`
|
LL - let ( A | B | ): E;
LL + let ( A | B ): E;
|
error: a trailing `|` is not allowed in an or-pattern
--> $DIR/remove-leading-vert.rs:29:17
|
LL | let [ A | B | ]: [E; 1];
| - ^ help: remove the `|`
| - ^
| |
| while parsing this or-pattern starting here
|
help: remove the `|`
|
LL - let [ A | B | ]: [E; 1];
LL + let [ A | B ]: [E; 1];
|
error: a trailing `|` is not allowed in an or-pattern
--> $DIR/remove-leading-vert.rs:30:18
|
LL | let S { f: B | };
| - ^ help: remove the `|`
| - ^
| |
| while parsing this or-pattern starting here
|
help: remove the `|`
|
LL - let S { f: B | };
LL + let S { f: B };
|
error: unexpected token `||` in pattern
--> $DIR/remove-leading-vert.rs:31:13
|
LL | let ( A || B | ): E;
| - ^^ help: use a single `|` to separate multiple alternative patterns: `|`
| - ^^
| |
| while parsing this or-pattern starting here
|
help: use a single `|` to separate multiple alternative patterns
|
LL | let ( A | B | ): E;
| ~
error: a trailing `|` is not allowed in an or-pattern
--> $DIR/remove-leading-vert.rs:31:18
|
LL | let ( A || B | ): E;
| - ^ help: remove the `|`
| - ^
| |
| while parsing this or-pattern starting here
|
help: remove the `|`
|
LL - let ( A || B | ): E;
LL + let ( A || B ): E;
|
error: a trailing `|` is not allowed in an or-pattern
--> $DIR/remove-leading-vert.rs:34:11
|
LL | A | => {}
| - ^ help: remove the `|`
| - ^
| |
| while parsing this or-pattern starting here
|
help: remove the `|`
|
LL - A | => {}
LL + A => {}
|
error: a trailing `|` is not allowed in an or-pattern
--> $DIR/remove-leading-vert.rs:35:11
|
LL | A || => {}
| - ^^ help: remove the `||`
| - ^^
| |
| while parsing this or-pattern starting here
|
= note: alternatives in or-patterns are separated with `|`, not `||`
help: remove the `||`
|
LL - A || => {}
LL + A => {}
|
error: unexpected token `||` in pattern
--> $DIR/remove-leading-vert.rs:36:11
|
LL | A || B | => {}
| - ^^ help: use a single `|` to separate multiple alternative patterns: `|`
| - ^^
| |
| while parsing this or-pattern starting here
|
help: use a single `|` to separate multiple alternative patterns
|
LL | A | B | => {}
| ~
error: a trailing `|` is not allowed in an or-pattern
--> $DIR/remove-leading-vert.rs:36:16
|
LL | A || B | => {}
| - ^ help: remove the `|`
| - ^
| |
| while parsing this or-pattern starting here
|
help: remove the `|`
|
LL - A || B | => {}
LL + A || B => {}
|
error: a trailing `|` is not allowed in an or-pattern
--> $DIR/remove-leading-vert.rs:38:17
|
LL | | A | B | => {}
| - ^ help: remove the `|`
| - ^
| |
| while parsing this or-pattern starting here
|
help: remove the `|`
|
LL - | A | B | => {}
LL + | A | B => {}
|
error: a trailing `|` is not allowed in an or-pattern
--> $DIR/remove-leading-vert.rs:45:11
|
LL | let a | : u8 = 0;
| - ^ help: remove the `|`
| - ^
| |
| while parsing this or-pattern starting here
|
help: remove the `|`
|
LL - let a | : u8 = 0;
LL + let a : u8 = 0;
|
error: a trailing `|` is not allowed in an or-pattern
--> $DIR/remove-leading-vert.rs:46:11
|
LL | let a | = 0;
| - ^ help: remove the `|`
| - ^
| |
| while parsing this or-pattern starting here
|
help: remove the `|`
|
LL - let a | = 0;
LL + let a = 0;
|
error: a trailing `|` is not allowed in an or-pattern
--> $DIR/remove-leading-vert.rs:47:11
|
LL | let a | ;
| - ^ help: remove the `|`
| - ^
| |
| while parsing this or-pattern starting here
|
help: remove the `|`
|
LL - let a | ;
LL + let a ;
|
error: aborting due to 21 previous errors

View File

@ -154,9 +154,14 @@ error: outer attributes are not allowed on `if` and `else` branches
|
LL | #[cfg(FALSE)] fn e() { let _ = if 0 #[attr] {}; }
| -- ^^^^^^^ -- the attributes are attached to this branch
| | |
| | help: remove the attributes
| |
| the branch belongs to this `if`
|
help: remove the attributes
|
LL - #[cfg(FALSE)] fn e() { let _ = if 0 #[attr] {}; }
LL + #[cfg(FALSE)] fn e() { let _ = if 0 {}; }
|
error: an inner attribute is not permitted in this context
--> $DIR/attr-stmt-expr-attr-bad.rs:40:38
@ -178,9 +183,14 @@ error: outer attributes are not allowed on `if` and `else` branches
|
LL | #[cfg(FALSE)] fn e() { let _ = if 0 {} else #[attr] {}; }
| ---- ^^^^^^^ -- the attributes are attached to this branch
| | |
| | help: remove the attributes
| |
| the branch belongs to this `else`
|
help: remove the attributes
|
LL - #[cfg(FALSE)] fn e() { let _ = if 0 {} else #[attr] {}; }
LL + #[cfg(FALSE)] fn e() { let _ = if 0 {} else {}; }
|
error: an inner attribute is not permitted in this context
--> $DIR/attr-stmt-expr-attr-bad.rs:46:46
@ -196,18 +206,28 @@ error: outer attributes are not allowed on `if` and `else` branches
|
LL | #[cfg(FALSE)] fn e() { let _ = if 0 {} else #[attr] if 0 {}; }
| ---- ^^^^^^^ ------- the attributes are attached to this branch
| | |
| | help: remove the attributes
| |
| the branch belongs to this `else`
|
help: remove the attributes
|
LL - #[cfg(FALSE)] fn e() { let _ = if 0 {} else #[attr] if 0 {}; }
LL + #[cfg(FALSE)] fn e() { let _ = if 0 {} else if 0 {}; }
|
error: outer attributes are not allowed on `if` and `else` branches
--> $DIR/attr-stmt-expr-attr-bad.rs:50:50
|
LL | #[cfg(FALSE)] fn e() { let _ = if 0 {} else if 0 #[attr] {}; }
| -- ^^^^^^^ -- the attributes are attached to this branch
| | |
| | help: remove the attributes
| |
| the branch belongs to this `if`
|
help: remove the attributes
|
LL - #[cfg(FALSE)] fn e() { let _ = if 0 {} else if 0 #[attr] {}; }
LL + #[cfg(FALSE)] fn e() { let _ = if 0 {} else if 0 {}; }
|
error: an inner attribute is not permitted in this context
--> $DIR/attr-stmt-expr-attr-bad.rs:52:51
@ -223,9 +243,14 @@ error: outer attributes are not allowed on `if` and `else` branches
|
LL | #[cfg(FALSE)] fn e() { let _ = if let _ = 0 #[attr] {}; }
| -- ^^^^^^^ -- the attributes are attached to this branch
| | |
| | help: remove the attributes
| |
| the branch belongs to this `if`
|
help: remove the attributes
|
LL - #[cfg(FALSE)] fn e() { let _ = if let _ = 0 #[attr] {}; }
LL + #[cfg(FALSE)] fn e() { let _ = if let _ = 0 {}; }
|
error: an inner attribute is not permitted in this context
--> $DIR/attr-stmt-expr-attr-bad.rs:56:46
@ -247,9 +272,14 @@ error: outer attributes are not allowed on `if` and `else` branches
|
LL | #[cfg(FALSE)] fn e() { let _ = if let _ = 0 {} else #[attr] {}; }
| ---- ^^^^^^^ -- the attributes are attached to this branch
| | |
| | help: remove the attributes
| |
| the branch belongs to this `else`
|
help: remove the attributes
|
LL - #[cfg(FALSE)] fn e() { let _ = if let _ = 0 {} else #[attr] {}; }
LL + #[cfg(FALSE)] fn e() { let _ = if let _ = 0 {} else {}; }
|
error: an inner attribute is not permitted in this context
--> $DIR/attr-stmt-expr-attr-bad.rs:62:54
@ -265,18 +295,28 @@ error: outer attributes are not allowed on `if` and `else` branches
|
LL | #[cfg(FALSE)] fn e() { let _ = if let _ = 0 {} else #[attr] if let _ = 0 {}; }
| ---- ^^^^^^^ --------------- the attributes are attached to this branch
| | |
| | help: remove the attributes
| |
| the branch belongs to this `else`
|
help: remove the attributes
|
LL - #[cfg(FALSE)] fn e() { let _ = if let _ = 0 {} else #[attr] if let _ = 0 {}; }
LL + #[cfg(FALSE)] fn e() { let _ = if let _ = 0 {} else if let _ = 0 {}; }
|
error: outer attributes are not allowed on `if` and `else` branches
--> $DIR/attr-stmt-expr-attr-bad.rs:66:66
|
LL | #[cfg(FALSE)] fn e() { let _ = if let _ = 0 {} else if let _ = 0 #[attr] {}; }
| -- ^^^^^^^ -- the attributes are attached to this branch
| | |
| | help: remove the attributes
| |
| the branch belongs to this `if`
|
help: remove the attributes
|
LL - #[cfg(FALSE)] fn e() { let _ = if let _ = 0 {} else if let _ = 0 #[attr] {}; }
LL + #[cfg(FALSE)] fn e() { let _ = if let _ = 0 {} else if let _ = 0 {}; }
|
error: an inner attribute is not permitted in this context
--> $DIR/attr-stmt-expr-attr-bad.rs:68:67
@ -361,9 +401,14 @@ error[E0586]: inclusive range with no end
--> $DIR/attr-stmt-expr-attr-bad.rs:85:35
|
LL | #[cfg(FALSE)] fn e() { match 0 { 0..=#[attr] 10 => () } }
| ^^^ help: use `..` instead
| ^^^
|
= note: inclusive ranges must be bounded at the end (`..=b` or `a..=b`)
help: use `..` instead
|
LL - #[cfg(FALSE)] fn e() { match 0 { 0..=#[attr] 10 => () } }
LL + #[cfg(FALSE)] fn e() { match 0 { 0..#[attr] 10 => () } }
|
error: expected one of `=>`, `if`, or `|`, found `#`
--> $DIR/attr-stmt-expr-attr-bad.rs:85:38
@ -375,9 +420,14 @@ error[E0586]: inclusive range with no end
--> $DIR/attr-stmt-expr-attr-bad.rs:88:35
|
LL | #[cfg(FALSE)] fn e() { match 0 { 0..=#[attr] -10 => () } }
| ^^^ help: use `..` instead
| ^^^
|
= note: inclusive ranges must be bounded at the end (`..=b` or `a..=b`)
help: use `..` instead
|
LL - #[cfg(FALSE)] fn e() { match 0 { 0..=#[attr] -10 => () } }
LL + #[cfg(FALSE)] fn e() { match 0 { 0..#[attr] -10 => () } }
|
error: expected one of `=>`, `if`, or `|`, found `#`
--> $DIR/attr-stmt-expr-attr-bad.rs:88:38
@ -395,9 +445,14 @@ error[E0586]: inclusive range with no end
--> $DIR/attr-stmt-expr-attr-bad.rs:93:35
|
LL | #[cfg(FALSE)] fn e() { match 0 { 0..=#[attr] FOO => () } }
| ^^^ help: use `..` instead
| ^^^
|
= note: inclusive ranges must be bounded at the end (`..=b` or `a..=b`)
help: use `..` instead
|
LL - #[cfg(FALSE)] fn e() { match 0 { 0..=#[attr] FOO => () } }
LL + #[cfg(FALSE)] fn e() { match 0 { 0..#[attr] FOO => () } }
|
error: expected one of `=>`, `if`, or `|`, found `#`
--> $DIR/attr-stmt-expr-attr-bad.rs:93:38

View File

@ -2,7 +2,12 @@ error: character constant must be escaped: `'`
--> $DIR/bad-char-literals.rs:6:6
|
LL | ''';
| ^ help: escape the character: `\'`
| ^
|
help: escape the character
|
LL | '\'';
| ~~
error: character constant must be escaped: `\n`
--> $DIR/bad-char-literals.rs:10:6
@ -10,19 +15,34 @@ error: character constant must be escaped: `\n`
LL | '
| ______^
LL | | ';
| |_ help: escape the character: `\n`
| |_
|
help: escape the character
|
LL | '\n';
| ++
error: character constant must be escaped: `\r`
--> $DIR/bad-char-literals.rs:15:6
|
LL | ' ';
| ^ help: escape the character: `\r`
| ^
|
help: escape the character
|
LL | '\r';
| ++
error: character constant must be escaped: `\t`
--> $DIR/bad-char-literals.rs:18:6
|
LL | ' ';
| ^^^^ help: escape the character: `\t`
| ^^^^
|
help: escape the character
|
LL | '\t';
| ++
error: aborting due to 4 previous errors

View File

@ -5,7 +5,12 @@ LL | pub type T0 = const fn();
| -----^^^^^
| |
| `const` because of this
| help: remove the `const` qualifier
|
help: remove the `const` qualifier
|
LL - pub type T0 = const fn();
LL + pub type T0 = fn();
|
error: an `fn` pointer type cannot be `const`
--> $DIR/bad-fn-ptr-qualifier.rs:6:15
@ -14,7 +19,12 @@ LL | pub type T1 = const extern "C" fn();
| -----^^^^^^^^^^^^^^^^
| |
| `const` because of this
| help: remove the `const` qualifier
|
help: remove the `const` qualifier
|
LL - pub type T1 = const extern "C" fn();
LL + pub type T1 = extern "C" fn();
|
error: an `fn` pointer type cannot be `const`
--> $DIR/bad-fn-ptr-qualifier.rs:7:15
@ -23,7 +33,12 @@ LL | pub type T2 = const unsafe extern fn();
| -----^^^^^^^^^^^^^^^^^^^
| |
| `const` because of this
| help: remove the `const` qualifier
|
help: remove the `const` qualifier
|
LL - pub type T2 = const unsafe extern fn();
LL + pub type T2 = unsafe extern fn();
|
error: an `fn` pointer type cannot be `async`
--> $DIR/bad-fn-ptr-qualifier.rs:8:15
@ -32,7 +47,12 @@ LL | pub type T3 = async fn();
| -----^^^^^
| |
| `async` because of this
| help: remove the `async` qualifier
|
help: remove the `async` qualifier
|
LL - pub type T3 = async fn();
LL + pub type T3 = fn();
|
error: an `fn` pointer type cannot be `async`
--> $DIR/bad-fn-ptr-qualifier.rs:9:15
@ -41,7 +61,12 @@ LL | pub type T4 = async extern fn();
| -----^^^^^^^^^^^^
| |
| `async` because of this
| help: remove the `async` qualifier
|
help: remove the `async` qualifier
|
LL - pub type T4 = async extern fn();
LL + pub type T4 = extern fn();
|
error: an `fn` pointer type cannot be `async`
--> $DIR/bad-fn-ptr-qualifier.rs:10:15
@ -50,7 +75,12 @@ LL | pub type T5 = async unsafe extern "C" fn();
| -----^^^^^^^^^^^^^^^^^^^^^^^
| |
| `async` because of this
| help: remove the `async` qualifier
|
help: remove the `async` qualifier
|
LL - pub type T5 = async unsafe extern "C" fn();
LL + pub type T5 = unsafe extern "C" fn();
|
error: an `fn` pointer type cannot be `const`
--> $DIR/bad-fn-ptr-qualifier.rs:11:15
@ -59,7 +89,12 @@ LL | pub type T6 = const async unsafe extern "C" fn();
| -----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
| `const` because of this
| help: remove the `const` qualifier
|
help: remove the `const` qualifier
|
LL - pub type T6 = const async unsafe extern "C" fn();
LL + pub type T6 = async unsafe extern "C" fn();
|
error: an `fn` pointer type cannot be `async`
--> $DIR/bad-fn-ptr-qualifier.rs:11:15
@ -68,7 +103,12 @@ LL | pub type T6 = const async unsafe extern "C" fn();
| ^^^^^^-----^^^^^^^^^^^^^^^^^^^^^^^
| |
| `async` because of this
| help: remove the `async` qualifier
|
help: remove the `async` qualifier
|
LL - pub type T6 = const async unsafe extern "C" fn();
LL + pub type T6 = const unsafe extern "C" fn();
|
error: an `fn` pointer type cannot be `const`
--> $DIR/bad-fn-ptr-qualifier.rs:15:17
@ -77,7 +117,12 @@ LL | pub type FTT0 = for<'a> const fn();
| ^^^^^^^^-----^^^^^
| |
| `const` because of this
| help: remove the `const` qualifier
|
help: remove the `const` qualifier
|
LL - pub type FTT0 = for<'a> const fn();
LL + pub type FTT0 = for<'a> fn();
|
error: an `fn` pointer type cannot be `const`
--> $DIR/bad-fn-ptr-qualifier.rs:16:17
@ -86,7 +131,12 @@ LL | pub type FTT1 = for<'a> const extern "C" fn();
| ^^^^^^^^-----^^^^^^^^^^^^^^^^
| |
| `const` because of this
| help: remove the `const` qualifier
|
help: remove the `const` qualifier
|
LL - pub type FTT1 = for<'a> const extern "C" fn();
LL + pub type FTT1 = for<'a> extern "C" fn();
|
error: an `fn` pointer type cannot be `const`
--> $DIR/bad-fn-ptr-qualifier.rs:17:17
@ -95,7 +145,12 @@ LL | pub type FTT2 = for<'a> const unsafe extern fn();
| ^^^^^^^^-----^^^^^^^^^^^^^^^^^^^
| |
| `const` because of this
| help: remove the `const` qualifier
|
help: remove the `const` qualifier
|
LL - pub type FTT2 = for<'a> const unsafe extern fn();
LL + pub type FTT2 = for<'a> unsafe extern fn();
|
error: an `fn` pointer type cannot be `async`
--> $DIR/bad-fn-ptr-qualifier.rs:18:17
@ -104,7 +159,12 @@ LL | pub type FTT3 = for<'a> async fn();
| ^^^^^^^^-----^^^^^
| |
| `async` because of this
| help: remove the `async` qualifier
|
help: remove the `async` qualifier
|
LL - pub type FTT3 = for<'a> async fn();
LL + pub type FTT3 = for<'a> fn();
|
error: an `fn` pointer type cannot be `async`
--> $DIR/bad-fn-ptr-qualifier.rs:19:17
@ -113,7 +173,12 @@ LL | pub type FTT4 = for<'a> async extern fn();
| ^^^^^^^^-----^^^^^^^^^^^^
| |
| `async` because of this
| help: remove the `async` qualifier
|
help: remove the `async` qualifier
|
LL - pub type FTT4 = for<'a> async extern fn();
LL + pub type FTT4 = for<'a> extern fn();
|
error: an `fn` pointer type cannot be `async`
--> $DIR/bad-fn-ptr-qualifier.rs:20:17
@ -122,7 +187,12 @@ LL | pub type FTT5 = for<'a> async unsafe extern "C" fn();
| ^^^^^^^^-----^^^^^^^^^^^^^^^^^^^^^^^
| |
| `async` because of this
| help: remove the `async` qualifier
|
help: remove the `async` qualifier
|
LL - pub type FTT5 = for<'a> async unsafe extern "C" fn();
LL + pub type FTT5 = for<'a> unsafe extern "C" fn();
|
error: an `fn` pointer type cannot be `const`
--> $DIR/bad-fn-ptr-qualifier.rs:22:17
@ -131,7 +201,12 @@ LL | pub type FTT6 = for<'a> const async unsafe extern "C" fn();
| ^^^^^^^^-----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
| `const` because of this
| help: remove the `const` qualifier
|
help: remove the `const` qualifier
|
LL - pub type FTT6 = for<'a> const async unsafe extern "C" fn();
LL + pub type FTT6 = for<'a> async unsafe extern "C" fn();
|
error: an `fn` pointer type cannot be `async`
--> $DIR/bad-fn-ptr-qualifier.rs:22:17
@ -140,7 +215,12 @@ LL | pub type FTT6 = for<'a> const async unsafe extern "C" fn();
| ^^^^^^^^^^^^^^-----^^^^^^^^^^^^^^^^^^^^^^^
| |
| `async` because of this
| help: remove the `async` qualifier
|
help: remove the `async` qualifier
|
LL - pub type FTT6 = for<'a> const async unsafe extern "C" fn();
LL + pub type FTT6 = for<'a> const unsafe extern "C" fn();
|
error: aborting due to 16 previous errors

View File

@ -24,13 +24,23 @@ error: byte constant must be escaped: `\t`
--> $DIR/byte-literals.rs:8:7
|
LL | b' ';
| ^^^^ help: escape the character: `\t`
| ^^^^
|
help: escape the character
|
LL | b'\t';
| ++
error: byte constant must be escaped: `'`
--> $DIR/byte-literals.rs:9:7
|
LL | b''';
| ^ help: escape the character: `\'`
| ^
|
help: escape the character
|
LL | b'\'';
| ~~
error: non-ASCII character in byte literal
--> $DIR/byte-literals.rs:10:7

View File

@ -2,15 +2,17 @@ error: character literal may only contain one codepoint
--> $DIR/whitespace-character-literal.rs:5:30
|
LL | let _hair_space_around = 'x';
| ^--^
| |
| help: consider removing the non-printing characters: `x`
| ^^^^
|
note: there are non-printing characters, the full sequence is `\u{200a}x\u{200b}`
--> $DIR/whitespace-character-literal.rs:5:31
|
LL | let _hair_space_around = 'x';
| ^^
help: consider removing the non-printing characters
|
LL | let _hair_space_around = 'x';
| ~
error: aborting due to 1 previous error

View File

@ -154,11 +154,13 @@ error: extern items cannot be `const`
--> $DIR/default-on-wrong-item-kind.rs:38:19
|
LL | default const foo: u8;
| --------------^^^
| |
| help: try using a static value: `static`
| ^^^
|
= note: for more information, visit https://doc.rust-lang.org/std/keyword.extern.html
help: try using a static value
|
LL | static foo: u8;
| ~~~~~~
error: a module cannot be `default`
--> $DIR/default-on-wrong-item-kind.rs:41:5

View File

@ -2,9 +2,13 @@ error: found removed `do catch` syntax
--> $DIR/do-catch-suggests-try.rs:4:25
|
LL | let _: Option<()> = do catch {};
| ^^^^^^^^ help: replace with the new syntax: `try`
| ^^^^^^^^
|
= note: following RFC #2388, the new non-placeholder syntax is `try`
help: replace with the new syntax
|
LL | let _: Option<()> = try {};
| ~~~
error[E0308]: mismatched types
--> $DIR/do-catch-suggests-try.rs:9:33

View File

@ -16,9 +16,14 @@ error: outer attributes are not allowed on `if` and `else` branches
|
LL | if true /*!*/ {}
| -- ^^^^^ -- the attributes are attached to this branch
| | |
| | help: remove the attributes
| |
| the branch belongs to this `if`
|
help: remove the attributes
|
LL - if true /*!*/ {}
LL + if true {}
|
error: aborting due to 2 previous errors

View File

@ -2,41 +2,61 @@ error: `->` used for field access or method call
--> $DIR/expr-rarrow-call.rs:14:10
|
LL | named->foo;
| ^^ help: try using `.` instead
| ^^
|
= help: the `.` operator will dereference the value if needed
help: try using `.` instead
|
LL | named.foo;
| ~
error: `->` used for field access or method call
--> $DIR/expr-rarrow-call.rs:18:12
|
LL | unnamed->0;
| ^^ help: try using `.` instead
| ^^
|
= help: the `.` operator will dereference the value if needed
help: try using `.` instead
|
LL | unnamed.0;
| ~
error: `->` used for field access or method call
--> $DIR/expr-rarrow-call.rs:22:6
|
LL | t->0;
| ^^ help: try using `.` instead
| ^^
|
= help: the `.` operator will dereference the value if needed
help: try using `.` instead
|
LL | t.0;
| ~
error: `->` used for field access or method call
--> $DIR/expr-rarrow-call.rs:23:6
|
LL | t->1;
| ^^ help: try using `.` instead
| ^^
|
= help: the `.` operator will dereference the value if needed
help: try using `.` instead
|
LL | t.1;
| ~
error: `->` used for field access or method call
--> $DIR/expr-rarrow-call.rs:30:8
|
LL | foo->clone();
| ^^ help: try using `.` instead
| ^^
|
= help: the `.` operator will dereference the value if needed
help: try using `.` instead
|
LL | foo.clone();
| ~
error: aborting due to 5 previous errors

View File

@ -2,7 +2,12 @@ error: return types are denoted using `->`
--> $DIR/fn-colon-return-type.rs:1:15
|
LL | fn foo(x: i32): i32 {
| ^ help: use `->` instead
| ^
|
help: use `->` instead
|
LL | fn foo(x: i32) -> i32 {
| ~~
error: aborting due to 1 previous error

View File

@ -2,21 +2,25 @@ error: extern items cannot be `const`
--> $DIR/foreign-const-semantic-fail.rs:4:11
|
LL | const A: isize;
| ------^
| |
| help: try using a static value: `static`
| ^
|
= note: for more information, visit https://doc.rust-lang.org/std/keyword.extern.html
help: try using a static value
|
LL | static A: isize;
| ~~~~~~
error: extern items cannot be `const`
--> $DIR/foreign-const-semantic-fail.rs:6:11
|
LL | const B: isize = 42;
| ------^
| |
| help: try using a static value: `static`
| ^
|
= note: for more information, visit https://doc.rust-lang.org/std/keyword.extern.html
help: try using a static value
|
LL | static B: isize = 42;
| ~~~~~~
error: incorrect `static` inside `extern` block
--> $DIR/foreign-const-semantic-fail.rs:6:11

View File

@ -2,21 +2,25 @@ error: extern items cannot be `const`
--> $DIR/foreign-const-syntactic-fail.rs:7:11
|
LL | const A: isize;
| ------^
| |
| help: try using a static value: `static`
| ^
|
= note: for more information, visit https://doc.rust-lang.org/std/keyword.extern.html
help: try using a static value
|
LL | static A: isize;
| ~~~~~~
error: extern items cannot be `const`
--> $DIR/foreign-const-syntactic-fail.rs:8:11
|
LL | const B: isize = 42;
| ------^
| |
| help: try using a static value: `static`
| ^
|
= note: for more information, visit https://doc.rust-lang.org/std/keyword.extern.html
help: try using a static value
|
LL | static B: isize = 42;
| ~~~~~~
error: aborting due to 2 previous errors

View File

@ -2,19 +2,25 @@ error: expected identifier, found `,`
--> $DIR/ident-recovery.rs:1:4
|
LL | fn ,comma() {
| ^
| |
| expected identifier
| help: remove this comma
| ^ expected identifier
|
help: remove this comma
|
LL - fn ,comma() {
LL + fn comma() {
|
error: expected identifier, found `,`
--> $DIR/ident-recovery.rs:4:16
|
LL | x: i32,,
| ^
| |
| expected identifier
| help: remove this comma
| ^ expected identifier
|
help: remove this comma
|
LL - x: i32,,
LL + x: i32,
|
error: expected identifier, found keyword `break`
--> $DIR/ident-recovery.rs:10:4

View File

@ -2,9 +2,13 @@ error: expected iterable, found keyword `in`
--> $DIR/if-in-in.rs:4:14
|
LL | for i in in 1..2 {
| ---^^
| |
| help: remove the duplicated `in`
| ^^
|
help: remove the duplicated `in`
|
LL - for i in in 1..2 {
LL + for i in 1..2 {
|
error: aborting due to 1 previous error

View File

@ -2,13 +2,23 @@ error: missing `for` in a trait impl
--> $DIR/impl-parsing.rs:4:11
|
LL | impl Trait Type {}
| ^ help: add `for` here
| ^
|
help: add `for` here
|
LL | impl Trait for Type {}
| +++
error: missing `for` in a trait impl
--> $DIR/impl-parsing.rs:5:11
|
LL | impl Trait .. {}
| ^ help: add `for` here
| ^
|
help: add `for` here
|
LL | impl Trait for .. {}
| +++
error: expected a trait, found type
--> $DIR/impl-parsing.rs:6:6

View File

@ -6,7 +6,11 @@ LL | Some(x) @ y => {}
| | |
| | binding on the right, should be on the left
| pattern on the left, should be on the right
| help: switch the order: `y @ Some(x)`
|
help: switch the order
|
LL | y @ Some(x) => {}
| ~~~~~~~~~~~
error: pattern on wrong side of `@`
--> $DIR/intersection-patterns-1.rs:27:9
@ -16,7 +20,11 @@ LL | 1 ..= 5 @ e => {}
| | |
| | binding on the right, should be on the left
| pattern on the left, should be on the right
| help: switch the order: `e @ 1..=5`
|
help: switch the order
|
LL | e @ 1..=5 => {}
| ~~~~~~~~~
error: aborting due to 2 previous errors

View File

@ -2,7 +2,13 @@ error: expected item, found `;`
--> $DIR/fn-no-semicolon-issue-124935-semi-after-item.rs:5:1
|
LL | ;
| ^ help: remove this semicolon
| ^
|
help: remove this semicolon
|
LL - ;
LL +
|
error: aborting due to 1 previous error

View File

@ -2,7 +2,12 @@ error: invalid variable declaration
--> $DIR/issue-100197-mut-let.rs:4:5
|
LL | mut let _x = 123;
| ^^^^^^^ help: switch the order of `mut` and `let`: `let mut`
| ^^^^^^^
|
help: switch the order of `mut` and `let`
|
LL | let mut _x = 123;
| ~~~~~~~
error: aborting due to 1 previous error

View File

@ -2,9 +2,14 @@ error: unexpected `==`
--> $DIR/issue-101477-enum.rs:6:7
|
LL | B == 2
| ^^ help: try using `=` instead
| ^^
|
= help: enum variants can be `Variant`, `Variant = <integer>`, `Variant(Type, ..., TypeN)` or `Variant { fields: Types }`
help: try using `=` instead
|
LL - B == 2
LL + B = 2
|
error: expected item, found `==`
--> $DIR/issue-101477-enum.rs:6:7

View File

@ -2,7 +2,13 @@ error: unexpected `==`
--> $DIR/issue-101477-let.rs:4:11
|
LL | let x == 2;
| ^^ help: try using `=` instead
| ^^
|
help: try using `=` instead
|
LL - let x == 2;
LL + let x = 2;
|
error: aborting due to 1 previous error

View File

@ -2,28 +2,43 @@ error: expected `;`, found `5.0`
--> $DIR/issue-103425.rs:2:6
|
LL | 3
| ^ help: add `;` here
| ^
LL |
LL | 5.0
| --- unexpected token
|
help: add `;` here
|
LL | 3;
| +
error: expected `;`, found `3_i8`
--> $DIR/issue-103425.rs:8:10
|
LL | 2_u32
| ^ help: add `;` here
| ^
LL |
LL | 3_i8
| ---- unexpected token
|
help: add `;` here
|
LL | 2_u32;
| +
error: expected `;`, found `5.0`
--> $DIR/issue-103425.rs:10:9
|
LL | 3_i8
| ^ help: add `;` here
| ^
LL |
LL | 5.0
| --- unexpected token
|
help: add `;` here
|
LL | 3_i8;
| +
error: aborting due to 3 previous errors

View File

@ -2,13 +2,23 @@ error: missing parameters for function definition
--> $DIR/issue-108109-fn-missing-params.rs:3:15
|
LL | pub fn missing -> () {}
| ^ help: add a parameter list
| ^
|
help: add a parameter list
|
LL | pub fn missing() -> () {}
| ++
error: missing parameters for function definition
--> $DIR/issue-108109-fn-missing-params.rs:6:16
|
LL | pub fn missing2 {}
| ^ help: add a parameter list
| ^
|
help: add a parameter list
|
LL | pub fn missing2() {}
| ++
error: aborting due to 2 previous errors

View File

@ -2,7 +2,12 @@ error: incorrect use of `await`
--> $DIR/issue-113203.rs:5:5
|
LL | await {}()
| ^^^^^^^^ help: `await` is a postfix operation: `{}.await`
| ^^^^^^^^
|
help: `await` is a postfix operation
|
LL | {}.await()
| ~~~~~~~~
error: aborting due to 1 previous error

View File

@ -30,16 +30,23 @@ LL | #[feature]
| ---------- only `;` terminated statements or tail expressions are allowed after this attribute
LL | attr::fn bar() -> String {
| ^--- unexpected token
| |
| help: add `;` here
|
help: add `;` here
|
LL | attr::fn; bar() -> String {
| +
error: `->` used for field access or method call
--> $DIR/issue-118530-ice.rs:5:20
|
LL | attr::fn bar() -> String {
| ^^ help: try using `.` instead
| ^^
|
= help: the `.` operator will dereference the value if needed
help: try using `.` instead
|
LL | attr::fn bar() . String {
| ~
error: expected one of `(`, `.`, `::`, `;`, `?`, `}`, or an operator, found `{`
--> $DIR/issue-118530-ice.rs:5:30

View File

@ -1,10 +1,13 @@
error: const globals cannot be mutable
--> $DIR/issue-17718-const-mut.rs:2:1
|
LL | const
| ----- help: you might want to declare a static instead: `static`
LL | mut
| ^^^ cannot be mutable
|
help: you might want to declare a static instead
|
LL | static
|
error: aborting due to 1 previous error

View File

@ -86,9 +86,12 @@ error: incorrect unicode escape sequence
--> $DIR/issue-23620-invalid-escapes.rs:32:14
|
LL | let _ = "\u8f";
| ^^^-
| |
| help: format of unicode escape sequences uses braces: `\u{8f}`
| ^^^
|
help: format of unicode escape sequences uses braces
|
LL | let _ = "\u{8f}";
| ~~~~~~
error: aborting due to 13 previous errors

View File

@ -2,13 +2,23 @@ error: missing `for` in a trait impl
--> $DIR/issue-27255.rs:3:7
|
LL | impl A .. {}
| ^ help: add `for` here
| ^
|
help: add `for` here
|
LL | impl A for .. {}
| +++
error: missing `for` in a trait impl
--> $DIR/issue-27255.rs:7:7
|
LL | impl A usize {}
| ^^^^^^ help: add `for` here
| ^^^^^^
|
help: add `for` here
|
LL | impl A for usize {}
| +++
error: `impl Trait for .. {}` is an obsolete syntax
--> $DIR/issue-27255.rs:3:1

View File

@ -2,9 +2,14 @@ error: expected `;`, found `}`
--> $DIR/issue-3036.rs:6:15
|
LL | let _x = 3
| ^ help: add `;` here
| ^
LL | }
| - unexpected token
|
help: add `;` here
|
LL | let _x = 3;
| +
error: aborting due to 1 previous error

View File

@ -2,9 +2,14 @@ error: `mut` must be followed by a named binding
--> $DIR/issue-32501.rs:7:9
|
LL | let mut _ = 0;
| ^^^^ help: remove the `mut` prefix
| ^^^^
|
= note: `mut` may be followed by `variable` and `variable @ pattern`
help: remove the `mut` prefix
|
LL - let mut _ = 0;
LL + let _ = 0;
|
error: aborting due to 1 previous error

View File

@ -2,9 +2,14 @@ error: expected item, found `;`
--> $DIR/issue-46186.rs:5:2
|
LL | };
| ^ help: remove this semicolon
| ^
|
= help: braced struct declarations are not followed by a semicolon
help: remove this semicolon
|
LL - };
LL + }
|
error: aborting due to 1 previous error

View File

@ -4,11 +4,14 @@ error[E0585]: found a documentation comment that doesn't document anything
LL | struct S {
| - while parsing this struct
LL | x: u8
| - help: missing comma here: `,`
LL | /// The ID of the parent core
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: doc comments must come before what they document, if a comment was intended use `//`
help: missing comma here
|
LL | x: u8,
| +
error: aborting due to 1 previous error

View File

@ -2,7 +2,13 @@ error: expected item, found `;`
--> $DIR/issue-49040.rs:1:28
|
LL | #![allow(unused_variables)];
| ^ help: remove this semicolon
| ^
|
help: remove this semicolon
|
LL - #![allow(unused_variables)];
LL + #![allow(unused_variables)]
|
error[E0601]: `main` function not found in crate `issue_49040`
--> $DIR/issue-49040.rs:2:12

View File

@ -2,7 +2,12 @@ error: float literals must have an integer part
--> $DIR/issue-52496.rs:4:24
|
LL | let _ = Foo { bar: .5, baz: 42 };
| ^^ help: must have an integer part: `0.5`
| ^^
|
help: must have an integer part
|
LL | let _ = Foo { bar: 0.5, baz: 42 };
| +
error: expected one of `,`, `:`, or `}`, found `.`
--> $DIR/issue-52496.rs:8:22

View File

@ -2,25 +2,49 @@ error: unmatched angle brackets
--> $DIR/issue-54521-2.rs:11:25
|
LL | let _ = Vec::<usize>>>>>::new();
| ^^^^ help: remove extra angle brackets
| ^^^^
|
help: remove extra angle brackets
|
LL - let _ = Vec::<usize>>>>>::new();
LL + let _ = Vec::<usize>::new();
|
error: unmatched angle brackets
--> $DIR/issue-54521-2.rs:14:25
|
LL | let _ = Vec::<usize>>>>::new();
| ^^^ help: remove extra angle brackets
| ^^^
|
help: remove extra angle brackets
|
LL - let _ = Vec::<usize>>>>::new();
LL + let _ = Vec::<usize>::new();
|
error: unmatched angle brackets
--> $DIR/issue-54521-2.rs:17:25
|
LL | let _ = Vec::<usize>>>::new();
| ^^ help: remove extra angle brackets
| ^^
|
help: remove extra angle brackets
|
LL - let _ = Vec::<usize>>>::new();
LL + let _ = Vec::<usize>::new();
|
error: unmatched angle bracket
--> $DIR/issue-54521-2.rs:20:25
|
LL | let _ = Vec::<usize>>::new();
| ^ help: remove extra angle bracket
| ^
|
help: remove extra angle bracket
|
LL - let _ = Vec::<usize>>::new();
LL + let _ = Vec::<usize>::new();
|
error: aborting due to 4 previous errors

View File

@ -2,25 +2,49 @@ error: unmatched angle brackets
--> $DIR/issue-54521-3.rs:11:60
|
LL | let _ = vec![1, 2, 3].into_iter().collect::<Vec<usize>>>>>>();
| ^^^^ help: remove extra angle brackets
| ^^^^
|
help: remove extra angle brackets
|
LL - let _ = vec![1, 2, 3].into_iter().collect::<Vec<usize>>>>>>();
LL + let _ = vec![1, 2, 3].into_iter().collect::<Vec<usize>>();
|
error: unmatched angle brackets
--> $DIR/issue-54521-3.rs:14:60
|
LL | let _ = vec![1, 2, 3].into_iter().collect::<Vec<usize>>>>>();
| ^^^ help: remove extra angle brackets
| ^^^
|
help: remove extra angle brackets
|
LL - let _ = vec![1, 2, 3].into_iter().collect::<Vec<usize>>>>>();
LL + let _ = vec![1, 2, 3].into_iter().collect::<Vec<usize>>();
|
error: unmatched angle brackets
--> $DIR/issue-54521-3.rs:17:60
|
LL | let _ = vec![1, 2, 3].into_iter().collect::<Vec<usize>>>>();
| ^^ help: remove extra angle brackets
| ^^
|
help: remove extra angle brackets
|
LL - let _ = vec![1, 2, 3].into_iter().collect::<Vec<usize>>>>();
LL + let _ = vec![1, 2, 3].into_iter().collect::<Vec<usize>>();
|
error: unmatched angle bracket
--> $DIR/issue-54521-3.rs:20:60
|
LL | let _ = vec![1, 2, 3].into_iter().collect::<Vec<usize>>>();
| ^ help: remove extra angle bracket
| ^
|
help: remove extra angle bracket
|
LL - let _ = vec![1, 2, 3].into_iter().collect::<Vec<usize>>>();
LL + let _ = vec![1, 2, 3].into_iter().collect::<Vec<usize>>();
|
error: aborting due to 4 previous errors

View File

@ -2,17 +2,23 @@ error: expected `:`, found `=`
--> $DIR/issue-57684.rs:27:20
|
LL | let _ = X { f1 = 5 };
| -^
| |
| help: replace equals symbol with a colon: `:`
| ^
|
help: replace equals symbol with a colon
|
LL | let _ = X { f1: 5 };
| ~
error: expected `:`, found `=`
--> $DIR/issue-57684.rs:32:12
|
LL | f1 = 5,
| -^
| |
| help: replace equals symbol with a colon: `:`
| ^
|
help: replace equals symbol with a colon
|
LL | f1: 5,
| ~
error: aborting due to 2 previous errors

View File

@ -2,43 +2,85 @@ error: unmatched angle brackets
--> $DIR/issue-57819.rs:19:10
|
LL | bar::<<<<<T as Foo>::Output>();
| ^^^ help: remove extra angle brackets
| ^^^
|
help: remove extra angle brackets
|
LL - bar::<<<<<T as Foo>::Output>();
LL + bar::<<T as Foo>::Output>();
|
error: unmatched angle brackets
--> $DIR/issue-57819.rs:22:10
|
LL | bar::<<<<T as Foo>::Output>();
| ^^ help: remove extra angle brackets
| ^^
|
help: remove extra angle brackets
|
LL - bar::<<<<T as Foo>::Output>();
LL + bar::<<T as Foo>::Output>();
|
error: unmatched angle bracket
--> $DIR/issue-57819.rs:25:10
|
LL | bar::<<<T as Foo>::Output>();
| ^ help: remove extra angle bracket
| ^
|
help: remove extra angle bracket
|
LL - bar::<<<T as Foo>::Output>();
LL + bar::<<T as Foo>::Output>();
|
error: unmatched angle brackets
--> $DIR/issue-57819.rs:34:48
|
LL | let _ = vec![1, 2, 3].into_iter().collect::<<<<<Vec<usize>>();
| ^^^^ help: remove extra angle brackets
| ^^^^
|
help: remove extra angle brackets
|
LL - let _ = vec![1, 2, 3].into_iter().collect::<<<<<Vec<usize>>();
LL + let _ = vec![1, 2, 3].into_iter().collect::<Vec<usize>>();
|
error: unmatched angle brackets
--> $DIR/issue-57819.rs:37:48
|
LL | let _ = vec![1, 2, 3].into_iter().collect::<<<<Vec<usize>>();
| ^^^ help: remove extra angle brackets
| ^^^
|
help: remove extra angle brackets
|
LL - let _ = vec![1, 2, 3].into_iter().collect::<<<<Vec<usize>>();
LL + let _ = vec![1, 2, 3].into_iter().collect::<Vec<usize>>();
|
error: unmatched angle brackets
--> $DIR/issue-57819.rs:40:48
|
LL | let _ = vec![1, 2, 3].into_iter().collect::<<<Vec<usize>>();
| ^^ help: remove extra angle brackets
| ^^
|
help: remove extra angle brackets
|
LL - let _ = vec![1, 2, 3].into_iter().collect::<<<Vec<usize>>();
LL + let _ = vec![1, 2, 3].into_iter().collect::<Vec<usize>>();
|
error: unmatched angle bracket
--> $DIR/issue-57819.rs:43:48
|
LL | let _ = vec![1, 2, 3].into_iter().collect::<<Vec<usize>>();
| ^ help: remove extra angle bracket
| ^
|
help: remove extra angle bracket
|
LL - let _ = vec![1, 2, 3].into_iter().collect::<<Vec<usize>>();
LL + let _ = vec![1, 2, 3].into_iter().collect::<Vec<usize>>();
|
error: aborting due to 7 previous errors

View File

@ -2,13 +2,18 @@ error: `mut` must be followed by a named binding
--> $DIR/issue-65122-mac-invoc-in-mut-patterns.rs:6:13
|
LL | let mut $eval = ();
| ^^^^ help: remove the `mut` prefix
| ^^^^
...
LL | mac1! { does_not_exist!() }
| --------------------------- in this macro invocation
|
= note: `mut` may be followed by `variable` and `variable @ pattern`
= note: this error originates in the macro `mac1` (in Nightly builds, run with -Z macro-backtrace for more info)
help: remove the `mut` prefix
|
LL - let mut $eval = ();
LL + let $eval = ();
|
error: expected identifier, found `does_not_exist!()`
--> $DIR/issue-65122-mac-invoc-in-mut-patterns.rs:13:17
@ -25,13 +30,18 @@ error: `mut` must be followed by a named binding
--> $DIR/issue-65122-mac-invoc-in-mut-patterns.rs:13:13
|
LL | let mut $eval = ();
| ^^^ help: remove the `mut` prefix
| ^^^
...
LL | mac2! { does_not_exist!() }
| --------------------------- in this macro invocation
|
= note: `mut` may be followed by `variable` and `variable @ pattern`
= note: this error originates in the macro `mac2` (in Nightly builds, run with -Z macro-backtrace for more info)
help: remove the `mut` prefix
|
LL - let mut $eval = ();
LL + let $eval = ();
|
error: cannot find macro `does_not_exist` in this scope
--> $DIR/issue-65122-mac-invoc-in-mut-patterns.rs:22:13

View File

@ -46,13 +46,23 @@ error: invalid variable declaration
--> $DIR/issue-65257-invalid-var-decl-recovery.rs:14:5
|
LL | mut n = 0;
| ^^^ help: missing keyword: `let mut`
| ^^^
|
help: missing keyword
|
LL | let mut n = 0;
| ~~~~~~~
error: invalid variable declaration
--> $DIR/issue-65257-invalid-var-decl-recovery.rs:16:5
|
LL | mut var;
| ^^^ help: missing keyword: `let mut`
| ^^^
|
help: missing keyword
|
LL | let mut var;
| ~~~~~~~
error[E0308]: mismatched types
--> $DIR/issue-65257-invalid-var-decl-recovery.rs:20:33

View File

@ -2,19 +2,25 @@ error: unexpected `...`
--> $DIR/issue-70388-recover-dotdotdot-rest-pat.rs:4:13
|
LL | let Foo(...) = Foo(0);
| ^^^
| |
| not a valid pattern
| help: for a rest pattern, use `..` instead of `...`
| ^^^ not a valid pattern
|
help: for a rest pattern, use `..` instead of `...`
|
LL - let Foo(...) = Foo(0);
LL + let Foo(..) = Foo(0);
|
error: unexpected `...`
--> $DIR/issue-70388-recover-dotdotdot-rest-pat.rs:5:13
|
LL | let [_, ..., _] = [0, 1];
| ^^^
| |
| not a valid pattern
| help: for a rest pattern, use `..` instead of `...`
| ^^^ not a valid pattern
|
help: for a rest pattern, use `..` instead of `...`
|
LL - let [_, ..., _] = [0, 1];
LL + let [_, .., _] = [0, 1];
|
error[E0308]: mismatched types
--> $DIR/issue-70388-recover-dotdotdot-rest-pat.rs:6:33

View File

@ -2,19 +2,25 @@ error: unexpected `...`
--> $DIR/issue-70388-without-witness.rs:7:13
|
LL | let Foo(...) = Foo(0);
| ^^^
| |
| not a valid pattern
| help: for a rest pattern, use `..` instead of `...`
| ^^^ not a valid pattern
|
help: for a rest pattern, use `..` instead of `...`
|
LL - let Foo(...) = Foo(0);
LL + let Foo(..) = Foo(0);
|
error: unexpected `...`
--> $DIR/issue-70388-without-witness.rs:8:13
|
LL | let [_, ..., _] = [0, 1];
| ^^^
| |
| not a valid pattern
| help: for a rest pattern, use `..` instead of `...`
| ^^^ not a valid pattern
|
help: for a rest pattern, use `..` instead of `...`
|
LL - let [_, ..., _] = [0, 1];
LL + let [_, .., _] = [0, 1];
|
error: aborting due to 2 previous errors

View File

@ -17,7 +17,13 @@ error: unexpected lifetime `'static` in pattern
--> $DIR/issue-70549-resolve-after-recovered-self-ctor.rs:8:13
|
LL | fn bar(&'static mur Self) {}
| ^^^^^^^ help: remove the lifetime
| ^^^^^^^
|
help: remove the lifetime
|
LL - fn bar(&'static mur Self) {}
LL + fn bar(&mur Self) {}
|
error: expected identifier, found keyword `Self`
--> $DIR/issue-70549-resolve-after-recovered-self-ctor.rs:8:25

View File

@ -2,24 +2,38 @@ error: lifetime must precede `mut`
--> $DIR/issue-73568-lifetime-after-mut.rs:2:13
|
LL | fn x<'a>(x: &mut 'a i32){}
| ^^^^^^^ help: place the lifetime before `mut`: `&'a mut`
| ^^^^^^^
|
help: place the lifetime before `mut`
|
LL | fn x<'a>(x: &'a mut i32){}
| ~~~~~~~
error[E0178]: expected a path on the left-hand side of `+`, not `&mut 'a`
--> $DIR/issue-73568-lifetime-after-mut.rs:14:13
|
LL | fn y<'a>(y: &mut 'a + Send) {
| ^^^^^^^^^^^^^^ help: try adding parentheses: `&mut ('a + Send)`
| ^^^^^^^^^^^^^^
|
help: try adding parentheses
|
LL | fn y<'a>(y: &mut ('a + Send)) {
| + +
error: lifetime must precede `mut`
--> $DIR/issue-73568-lifetime-after-mut.rs:6:22
|
LL | fn w<$lt>(w: &mut $lt i32) {}
| ^^^^^^^^ help: place the lifetime before `mut`: `&$lt mut`
| ^^^^^^^^
...
LL | mac!('a);
| -------- in this macro invocation
|
= note: this error originates in the macro `mac` (in Nightly builds, run with -Z macro-backtrace for more info)
help: place the lifetime before `mut`
|
LL | fn w<$lt>(w: &$lt mut i32) {}
| ~~~~~~~~
error[E0423]: expected value, found trait `Send`
--> $DIR/issue-73568-lifetime-after-mut.rs:17:28

Some files were not shown because too many files have changed in this diff Show More