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:
parent
5e311f933d
commit
692bc344d5
175 changed files with 3197 additions and 786 deletions
|
@ -1,7 +1,7 @@
|
||||||
parse_add_paren = try adding parentheses
|
parse_add_paren = try adding parentheses
|
||||||
|
|
||||||
parse_ambiguous_range_pattern = the range pattern here has ambiguous interpretation
|
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
|
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
|
.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
|
.suggestion_no_fields_for_fn = if `{$type}` is a function, use the arguments directly
|
||||||
|
|
||||||
parse_parenthesized_lifetime = parenthesized lifetime bounds are not supported
|
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
|
parse_path_single_colon = path separator must be a double colon
|
||||||
.suggestion = use a double colon instead
|
.suggestion = use a double colon instead
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -3,8 +3,8 @@ use super::{
|
||||||
BlockMode, CommaRecoveryMode, Parser, PathStyle, Restrictions, SemiColonMode, SeqSep, TokenType,
|
BlockMode, CommaRecoveryMode, Parser, PathStyle, Restrictions, SemiColonMode, SeqSep, TokenType,
|
||||||
};
|
};
|
||||||
use crate::errors::{
|
use crate::errors::{
|
||||||
AmbiguousPlus, AsyncMoveBlockIn2015, AttributeOnParamType, BadQPathStage2, BadTypePlus,
|
AddParen, AmbiguousPlus, AsyncMoveBlockIn2015, AttributeOnParamType, BadQPathStage2,
|
||||||
BadTypePlusSub, ColonAsSemi, ComparisonOperatorsCannotBeChained,
|
BadTypePlus, BadTypePlusSub, ColonAsSemi, ComparisonOperatorsCannotBeChained,
|
||||||
ComparisonOperatorsCannotBeChainedSugg, ConstGenericWithoutBraces,
|
ComparisonOperatorsCannotBeChainedSugg, ConstGenericWithoutBraces,
|
||||||
ConstGenericWithoutBracesSugg, DocCommentDoesNotDocumentAnything, DocCommentOnParamType,
|
ConstGenericWithoutBracesSugg, DocCommentDoesNotDocumentAnything, DocCommentOnParamType,
|
||||||
DoubleColonInBound, ExpectedIdentifier, ExpectedSemi, ExpectedSemiSugg,
|
DoubleColonInBound, ExpectedIdentifier, ExpectedSemi, ExpectedSemiSugg,
|
||||||
|
@ -566,7 +566,10 @@ impl<'a> Parser<'a> {
|
||||||
&& expected.iter().any(|tok| matches!(tok, TokenType::Token(TokenKind::Eq)))
|
&& expected.iter().any(|tok| matches!(tok, TokenType::Token(TokenKind::Eq)))
|
||||||
{
|
{
|
||||||
// Likely typo: `=` → `==` in let expr or enum item
|
// 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) {
|
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
|
// Eat from where we started until the end token so that parsing can continue
|
||||||
// as if we didn't have those extra angle brackets.
|
// as if we didn't have those extra angle brackets.
|
||||||
self.eat_to_tokens(end);
|
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;
|
let num_extra_brackets = number_of_gt + number_of_shr * 2;
|
||||||
return Some(self.dcx().emit_err(UnmatchedAngleBrackets { span, num_extra_brackets }));
|
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) {
|
pub(super) fn maybe_report_ambiguous_plus(&mut self, impl_dyn_multi: bool, ty: &Ty) {
|
||||||
if impl_dyn_multi {
|
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 sum_span = ty.span.to(self.prev_token.span);
|
||||||
|
|
||||||
let sub = match &ty.kind {
|
let sub = match &ty.kind {
|
||||||
TyKind::Ref(lifetime, mut_ty) => {
|
TyKind::Ref(_lifetime, mut_ty) => {
|
||||||
let sum_with_parens = pprust::to_string(|s| {
|
let lo = mut_ty.ty.span.shrink_to_lo();
|
||||||
s.s.word("&");
|
let hi = self.prev_token.span.shrink_to_hi();
|
||||||
s.print_opt_lifetime(lifetime);
|
BadTypePlusSub::AddParen { suggestion: AddParen { lo, hi } }
|
||||||
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::Ptr(..) | TyKind::BareFn(..) => BadTypePlusSub::ForgotParen { span: sum_span },
|
TyKind::Ptr(..) | TyKind::BareFn(..) => BadTypePlusSub::ForgotParen { span: sum_span },
|
||||||
_ => BadTypePlusSub::ExpectPath { span: sum_span },
|
_ => BadTypePlusSub::ExpectPath { span: sum_span },
|
||||||
|
|
|
@ -714,7 +714,7 @@ impl<'a> Parser<'a> {
|
||||||
type_err.cancel();
|
type_err.cancel();
|
||||||
self.dcx().emit_err(errors::MalformedLoopLabel {
|
self.dcx().emit_err(errors::MalformedLoopLabel {
|
||||||
span: label.ident.span,
|
span: label.ident.span,
|
||||||
correct_label: label.ident,
|
suggestion: label.ident.span.shrink_to_lo(),
|
||||||
});
|
});
|
||||||
return Ok(expr);
|
return Ok(expr);
|
||||||
}
|
}
|
||||||
|
@ -856,7 +856,7 @@ impl<'a> Parser<'a> {
|
||||||
let hi = self.interpolated_or_expr_span(&expr);
|
let hi = self.interpolated_or_expr_span(&expr);
|
||||||
let span = lo.to(hi);
|
let span = lo.to(hi);
|
||||||
if let Some(lt) = lifetime {
|
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)))
|
Ok((span, ExprKind::AddrOf(borrow_kind, mutbl, expr)))
|
||||||
}
|
}
|
||||||
|
@ -1653,6 +1653,7 @@ impl<'a> Parser<'a> {
|
||||||
let lo = label_.ident.span;
|
let lo = label_.ident.span;
|
||||||
let label = Some(label_);
|
let label = Some(label_);
|
||||||
let ate_colon = self.eat(&token::Colon);
|
let ate_colon = self.eat(&token::Colon);
|
||||||
|
let tok_sp = self.token.span;
|
||||||
let expr = if self.eat_keyword(kw::While) {
|
let expr = if self.eat_keyword(kw::While) {
|
||||||
self.parse_expr_while(label, lo)
|
self.parse_expr_while(label, lo)
|
||||||
} else if self.eat_keyword(kw::For) {
|
} else if self.eat_keyword(kw::For) {
|
||||||
|
@ -1747,7 +1748,7 @@ impl<'a> Parser<'a> {
|
||||||
self.dcx().emit_err(errors::RequireColonAfterLabeledExpression {
|
self.dcx().emit_err(errors::RequireColonAfterLabeledExpression {
|
||||||
span: expr.span,
|
span: expr.span,
|
||||||
label: lo,
|
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.bump();
|
||||||
self.dcx().emit_err(errors::FloatLiteralRequiresIntegerPart {
|
self.dcx().emit_err(errors::FloatLiteralRequiresIntegerPart {
|
||||||
span: token.span,
|
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()
|
if !attrs.is_empty()
|
||||||
&& let [x0 @ xn] | [x0, .., xn] = &*attrs.take_for_recovery(self.psess)
|
&& 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 last = xn.span;
|
||||||
let ctx = if is_ctx_else { "else" } else { "if" };
|
let ctx = if is_ctx_else { "else" } else { "if" };
|
||||||
self.dcx().emit_err(errors::OuterAttributeNotAllowedOnIfElse {
|
self.dcx().emit_err(errors::OuterAttributeNotAllowedOnIfElse {
|
||||||
|
|
|
@ -2241,9 +2241,13 @@ impl<'a> Parser<'a> {
|
||||||
let kw_token = self.token.clone();
|
let kw_token = self.token.clone();
|
||||||
let kw_str = pprust::token_to_string(&kw_token);
|
let kw_str = pprust::token_to_string(&kw_token);
|
||||||
let item = self.parse_item(ForceCollect::No)?;
|
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 {
|
self.dcx().emit_err(errors::NestedAdt {
|
||||||
span: kw_token.span,
|
span: kw_token.span,
|
||||||
item: item.unwrap().span,
|
item,
|
||||||
kw_str,
|
kw_str,
|
||||||
keyword: keyword.as_str(),
|
keyword: keyword.as_str(),
|
||||||
});
|
});
|
||||||
|
|
|
@ -4,11 +4,11 @@ use crate::errors::{
|
||||||
DotDotDotRestPattern, EnumPatternInsteadOfIdentifier, ExpectedBindingLeftOfAt,
|
DotDotDotRestPattern, EnumPatternInsteadOfIdentifier, ExpectedBindingLeftOfAt,
|
||||||
ExpectedCommaAfterPatternField, GenericArgsInPatRequireTurbofishSyntax,
|
ExpectedCommaAfterPatternField, GenericArgsInPatRequireTurbofishSyntax,
|
||||||
InclusiveRangeExtraEquals, InclusiveRangeMatchArrow, InclusiveRangeNoEnd, InvalidMutInPattern,
|
InclusiveRangeExtraEquals, InclusiveRangeMatchArrow, InclusiveRangeNoEnd, InvalidMutInPattern,
|
||||||
PatternOnWrongSideOfAt, RemoveLet, RepeatedMutInPattern, SwitchRefBoxOrder,
|
ParenRangeSuggestion, PatternOnWrongSideOfAt, RemoveLet, RepeatedMutInPattern,
|
||||||
TopLevelOrPatternNotAllowed, TopLevelOrPatternNotAllowedSugg, TrailingVertNotAllowed,
|
SwitchRefBoxOrder, TopLevelOrPatternNotAllowed, TopLevelOrPatternNotAllowedSugg,
|
||||||
UnexpectedExpressionInPattern, UnexpectedLifetimeInPattern, UnexpectedParenInRangePat,
|
TrailingVertNotAllowed, UnexpectedExpressionInPattern, UnexpectedLifetimeInPattern,
|
||||||
UnexpectedParenInRangePatSugg, UnexpectedVertVertBeforeFunctionParam,
|
UnexpectedParenInRangePat, UnexpectedParenInRangePatSugg,
|
||||||
UnexpectedVertVertInPattern,
|
UnexpectedVertVertBeforeFunctionParam, UnexpectedVertVertInPattern, WrapInParens,
|
||||||
};
|
};
|
||||||
use crate::parser::expr::{could_be_unclosed_char_literal, LhsExpr};
|
use crate::parser::expr::{could_be_unclosed_char_literal, LhsExpr};
|
||||||
use crate::{maybe_recover_from_interpolated_ty_qpath, maybe_whole};
|
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_session::errors::ExprParenthesesNeeded;
|
||||||
use rustc_span::source_map::{respan, Spanned};
|
use rustc_span::source_map::{respan, Spanned};
|
||||||
use rustc_span::symbol::{kw, sym, Ident};
|
use rustc_span::symbol::{kw, sym, Ident};
|
||||||
use rustc_span::{ErrorGuaranteed, Span};
|
use rustc_span::{BytePos, ErrorGuaranteed, Span};
|
||||||
use thin_vec::{thin_vec, ThinVec};
|
use thin_vec::{thin_vec, ThinVec};
|
||||||
|
|
||||||
#[derive(PartialEq, Copy, Clone)]
|
#[derive(PartialEq, Copy, Clone)]
|
||||||
|
@ -236,11 +236,15 @@ impl<'a> Parser<'a> {
|
||||||
|
|
||||||
if let PatKind::Or(pats) = &pat.kind {
|
if let PatKind::Or(pats) = &pat.kind {
|
||||||
let span = pat.span;
|
let span = pat.span;
|
||||||
let pat = pprust::pat_to_string(&pat);
|
|
||||||
let sub = if pats.len() == 1 {
|
let sub = if pats.len() == 1 {
|
||||||
Some(TopLevelOrPatternNotAllowedSugg::RemoveLeadingVert { span, pat })
|
Some(TopLevelOrPatternNotAllowedSugg::RemoveLeadingVert {
|
||||||
|
span: span.with_hi(span.lo() + BytePos(1)),
|
||||||
|
})
|
||||||
} else {
|
} 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 {
|
let err = self.dcx().create_err(match syntax_loc {
|
||||||
|
@ -599,7 +603,10 @@ impl<'a> Parser<'a> {
|
||||||
self.bump(); // `...`
|
self.bump(); // `...`
|
||||||
|
|
||||||
// The user probably mistook `...` for a rest pattern `..`.
|
// 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
|
PatKind::Rest
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -664,8 +671,13 @@ impl<'a> Parser<'a> {
|
||||||
_ => return,
|
_ => return,
|
||||||
}
|
}
|
||||||
|
|
||||||
self.dcx()
|
self.dcx().emit_err(AmbiguousRangePattern {
|
||||||
.emit_err(AmbiguousRangePattern { span: pat.span, pat: pprust::pat_to_string(pat) });
|
span: pat.span,
|
||||||
|
suggestion: ParenRangeSuggestion {
|
||||||
|
lo: pat.span.shrink_to_lo(),
|
||||||
|
hi: pat.span.shrink_to_hi(),
|
||||||
|
},
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Parse `&pat` / `&mut pat`.
|
/// Parse `&pat` / `&mut pat`.
|
||||||
|
@ -674,8 +686,11 @@ impl<'a> Parser<'a> {
|
||||||
if let token::Lifetime(name) = self.token.kind {
|
if let token::Lifetime(name) = self.token.kind {
|
||||||
self.bump(); // `'a`
|
self.bump(); // `'a`
|
||||||
|
|
||||||
self.dcx()
|
self.dcx().emit_err(UnexpectedLifetimeInPattern {
|
||||||
.emit_err(UnexpectedLifetimeInPattern { span: self.prev_token.span, symbol: name });
|
span: self.prev_token.span,
|
||||||
|
symbol: name,
|
||||||
|
suggestion: self.prev_token.span.until(self.token.span),
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
let mutbl = self.parse_mutability();
|
let mutbl = self.parse_mutability();
|
||||||
|
@ -913,10 +928,13 @@ impl<'a> Parser<'a> {
|
||||||
self.dcx().emit_err(InclusiveRangeExtraEquals { span: span_with_eq })
|
self.dcx().emit_err(InclusiveRangeExtraEquals { span: span_with_eq })
|
||||||
}
|
}
|
||||||
token::Gt if no_space => {
|
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(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)),
|
||||||
|
}),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -430,8 +430,10 @@ impl<'a> Parser<'a> {
|
||||||
let eq_consumed = match self.token.kind {
|
let eq_consumed = match self.token.kind {
|
||||||
token::BinOpEq(..) => {
|
token::BinOpEq(..) => {
|
||||||
// Recover `let x <op>= 1` as `let x = 1`
|
// Recover `let x <op>= 1` as `let x = 1`
|
||||||
self.dcx()
|
self.dcx().emit_err(errors::CompoundAssignmentExpressionInLet {
|
||||||
.emit_err(errors::CompoundAssignmentExpressionInLet { span: self.token.span });
|
span: self.token.span,
|
||||||
|
suggestion: self.token.span.with_hi(self.token.span.lo() + BytePos(1)),
|
||||||
|
});
|
||||||
self.bump();
|
self.bump();
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
|
@ -717,7 +719,7 @@ impl<'a> Parser<'a> {
|
||||||
e.cancel();
|
e.cancel();
|
||||||
self.dcx().emit_err(MalformedLoopLabel {
|
self.dcx().emit_err(MalformedLoopLabel {
|
||||||
span: label.ident.span,
|
span: label.ident.span,
|
||||||
correct_label: label.ident,
|
suggestion: label.ident.span.shrink_to_lo(),
|
||||||
});
|
});
|
||||||
*expr = labeled_expr;
|
*expr = labeled_expr;
|
||||||
break 'break_recover None;
|
break 'break_recover None;
|
||||||
|
|
|
@ -209,6 +209,7 @@ impl<'a> Parser<'a> {
|
||||||
recover_qpath: RecoverQPath,
|
recover_qpath: RecoverQPath,
|
||||||
recover_return_sign: RecoverReturnSign,
|
recover_return_sign: RecoverReturnSign,
|
||||||
) -> PResult<'a, FnRetTy> {
|
) -> PResult<'a, FnRetTy> {
|
||||||
|
let lo = self.prev_token.span;
|
||||||
Ok(if self.eat(&token::RArrow) {
|
Ok(if self.eat(&token::RArrow) {
|
||||||
// FIXME(Centril): Can we unconditionally `allow_plus`?
|
// FIXME(Centril): Can we unconditionally `allow_plus`?
|
||||||
let ty = self.parse_ty_common(
|
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
|
// Don't `eat` to prevent `=>` from being added as an expected token which isn't
|
||||||
// actually expected and could only confuse users
|
// actually expected and could only confuse users
|
||||||
self.bump();
|
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(
|
let ty = self.parse_ty_common(
|
||||||
allow_plus,
|
allow_plus,
|
||||||
AllowCVariadic::No,
|
AllowCVariadic::No,
|
||||||
|
@ -794,8 +798,11 @@ impl<'a> Parser<'a> {
|
||||||
{
|
{
|
||||||
if self.token.is_keyword(kw::Dyn) {
|
if self.token.is_keyword(kw::Dyn) {
|
||||||
// Account for `&dyn Trait + dyn Other`.
|
// Account for `&dyn Trait + dyn Other`.
|
||||||
self.dcx().emit_err(InvalidDynKeyword { span: self.token.span });
|
|
||||||
self.bump();
|
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()?);
|
bounds.push(self.parse_generic_bound()?);
|
||||||
if allow_plus == AllowPlus::No || !self.eat_plus() {
|
if allow_plus == AllowPlus::No || !self.eat_plus() {
|
||||||
|
@ -861,7 +868,7 @@ impl<'a> Parser<'a> {
|
||||||
if has_parens {
|
if has_parens {
|
||||||
// FIXME(Centril): Consider not erroring here and accepting `('lt)` instead,
|
// FIXME(Centril): Consider not erroring here and accepting `('lt)` instead,
|
||||||
// possibly introducing `GenericBound::Paren(P<GenericBound>)`?
|
// possibly introducing `GenericBound::Paren(P<GenericBound>)`?
|
||||||
self.recover_paren_lifetime(lo, lt.ident.span)?;
|
self.recover_paren_lifetime(lo)?;
|
||||||
}
|
}
|
||||||
Ok(bound)
|
Ok(bound)
|
||||||
}
|
}
|
||||||
|
@ -909,16 +916,12 @@ impl<'a> Parser<'a> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Recover on `('lifetime)` with `(` already eaten.
|
/// 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))?;
|
self.expect(&token::CloseDelim(Delimiter::Parenthesis))?;
|
||||||
let span = lo.to(self.prev_token.span);
|
let span = lo.to(self.prev_token.span);
|
||||||
let (sugg, snippet) = if let Ok(snippet) = self.span_to_snippet(lt_span) {
|
let sugg = errors::RemoveParens { lo, hi: self.prev_token.span };
|
||||||
(Some(span), snippet)
|
|
||||||
} else {
|
|
||||||
(None, String::new())
|
|
||||||
};
|
|
||||||
|
|
||||||
self.dcx().emit_err(errors::ParenthesizedLifetime { span, sugg, snippet });
|
self.dcx().emit_err(errors::ParenthesizedLifetime { span, sugg });
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9,9 +9,14 @@ error: expected item, found `;`
|
||||||
--> $DIR/failed-doctest-extra-semicolon-on-item.rs:12:12
|
--> $DIR/failed-doctest-extra-semicolon-on-item.rs:12:12
|
||||||
|
|
|
|
||||||
LL | struct S {}; // unexpected semicolon after struct def
|
LL | struct S {}; // unexpected semicolon after struct def
|
||||||
| ^ help: remove this semicolon
|
| ^
|
||||||
|
|
|
|
||||||
= help: braced struct declarations are not followed by a 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
|
error: aborting due to 1 previous error
|
||||||
|
|
||||||
|
|
|
@ -2,115 +2,214 @@ error: incorrect use of `await`
|
||||||
--> $DIR/incorrect-syntax-suggestions.rs:8:13
|
--> $DIR/incorrect-syntax-suggestions.rs:8:13
|
||||||
|
|
|
|
||||||
LL | let _ = await bar();
|
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`
|
error: incorrect use of `await`
|
||||||
--> $DIR/incorrect-syntax-suggestions.rs:12:13
|
--> $DIR/incorrect-syntax-suggestions.rs:12:13
|
||||||
|
|
|
|
||||||
LL | let _ = await? bar();
|
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`
|
error: incorrect use of `await`
|
||||||
--> $DIR/incorrect-syntax-suggestions.rs:16:13
|
--> $DIR/incorrect-syntax-suggestions.rs:16:13
|
||||||
|
|
|
|
||||||
LL | let _ = await bar()?;
|
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`
|
error: incorrect use of `await`
|
||||||
--> $DIR/incorrect-syntax-suggestions.rs:20:13
|
--> $DIR/incorrect-syntax-suggestions.rs:20:13
|
||||||
|
|
|
|
||||||
LL | let _ = await { bar() };
|
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`
|
error: incorrect use of `await`
|
||||||
--> $DIR/incorrect-syntax-suggestions.rs:24:13
|
--> $DIR/incorrect-syntax-suggestions.rs:24:13
|
||||||
|
|
|
|
||||||
LL | let _ = await(bar());
|
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`
|
error: incorrect use of `await`
|
||||||
--> $DIR/incorrect-syntax-suggestions.rs:28:13
|
--> $DIR/incorrect-syntax-suggestions.rs:28:13
|
||||||
|
|
|
|
||||||
LL | let _ = await { bar() }?;
|
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`
|
error: incorrect use of `await`
|
||||||
--> $DIR/incorrect-syntax-suggestions.rs:32:14
|
--> $DIR/incorrect-syntax-suggestions.rs:32:14
|
||||||
|
|
|
|
||||||
LL | let _ = (await bar())?;
|
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`
|
error: incorrect use of `await`
|
||||||
--> $DIR/incorrect-syntax-suggestions.rs:36:24
|
--> $DIR/incorrect-syntax-suggestions.rs:36:24
|
||||||
|
|
|
|
||||||
LL | let _ = bar().await();
|
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`
|
error: incorrect use of `await`
|
||||||
--> $DIR/incorrect-syntax-suggestions.rs:40:24
|
--> $DIR/incorrect-syntax-suggestions.rs:40:24
|
||||||
|
|
|
|
||||||
LL | let _ = bar().await()?;
|
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`
|
error: incorrect use of `await`
|
||||||
--> $DIR/incorrect-syntax-suggestions.rs:52:13
|
--> $DIR/incorrect-syntax-suggestions.rs:52:13
|
||||||
|
|
|
|
||||||
LL | let _ = await bar();
|
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`
|
error: incorrect use of `await`
|
||||||
--> $DIR/incorrect-syntax-suggestions.rs:56:13
|
--> $DIR/incorrect-syntax-suggestions.rs:56:13
|
||||||
|
|
|
|
||||||
LL | let _ = await? bar();
|
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`
|
error: incorrect use of `await`
|
||||||
--> $DIR/incorrect-syntax-suggestions.rs:60:13
|
--> $DIR/incorrect-syntax-suggestions.rs:60:13
|
||||||
|
|
|
|
||||||
LL | let _ = await bar()?;
|
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`
|
error: incorrect use of `await`
|
||||||
--> $DIR/incorrect-syntax-suggestions.rs:64:14
|
--> $DIR/incorrect-syntax-suggestions.rs:64:14
|
||||||
|
|
|
|
||||||
LL | let _ = (await bar())?;
|
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`
|
error: incorrect use of `await`
|
||||||
--> $DIR/incorrect-syntax-suggestions.rs:68:24
|
--> $DIR/incorrect-syntax-suggestions.rs:68:24
|
||||||
|
|
|
|
||||||
LL | let _ = bar().await();
|
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`
|
error: incorrect use of `await`
|
||||||
--> $DIR/incorrect-syntax-suggestions.rs:73:24
|
--> $DIR/incorrect-syntax-suggestions.rs:73:24
|
||||||
|
|
|
|
||||||
LL | let _ = bar().await()?;
|
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`
|
error: incorrect use of `await`
|
||||||
--> $DIR/incorrect-syntax-suggestions.rs:101:13
|
--> $DIR/incorrect-syntax-suggestions.rs:101:13
|
||||||
|
|
|
|
||||||
LL | let _ = await!(bar());
|
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`
|
error: incorrect use of `await`
|
||||||
--> $DIR/incorrect-syntax-suggestions.rs:105:13
|
--> $DIR/incorrect-syntax-suggestions.rs:105:13
|
||||||
|
|
|
|
||||||
LL | let _ = await!(bar())?;
|
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`
|
error: incorrect use of `await`
|
||||||
--> $DIR/incorrect-syntax-suggestions.rs:110:17
|
--> $DIR/incorrect-syntax-suggestions.rs:110:17
|
||||||
|
|
|
|
||||||
LL | let _ = await!(bar())?;
|
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`
|
error: incorrect use of `await`
|
||||||
--> $DIR/incorrect-syntax-suggestions.rs:117:17
|
--> $DIR/incorrect-syntax-suggestions.rs:117:17
|
||||||
|
|
|
|
||||||
LL | let _ = await!(bar())?;
|
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 `=>`
|
error: expected expression, found `=>`
|
||||||
--> $DIR/incorrect-syntax-suggestions.rs:124:25
|
--> $DIR/incorrect-syntax-suggestions.rs:124:25
|
||||||
|
@ -124,7 +223,12 @@ error: incorrect use of `await`
|
||||||
--> $DIR/incorrect-syntax-suggestions.rs:124:11
|
--> $DIR/incorrect-syntax-suggestions.rs:124:11
|
||||||
|
|
|
|
||||||
LL | match await { await => () }
|
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 `}`
|
error: expected one of `.`, `?`, `{`, or an operator, found `}`
|
||||||
--> $DIR/incorrect-syntax-suggestions.rs:127:1
|
--> $DIR/incorrect-syntax-suggestions.rs:127:1
|
||||||
|
|
|
@ -32,7 +32,12 @@ error: missing type for `static` item
|
||||||
--> $DIR/issue-90873.rs:1:17
|
--> $DIR/issue-90873.rs:1:17
|
||||||
|
|
|
|
||||||
LL | #![u=||{static d=||1;}]
|
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
|
error: aborting due to 6 previous errors
|
||||||
|
|
||||||
|
|
|
@ -2,9 +2,13 @@ error: malformed `cfg_attr` attribute input
|
||||||
--> $DIR/cfg-attr-parse.rs:4:1
|
--> $DIR/cfg-attr-parse.rs:4:1
|
||||||
|
|
|
|
||||||
LL | #[cfg_attr()]
|
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>
|
= 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
|
error: expected `,`, found end of `cfg_attr` input
|
||||||
--> $DIR/cfg-attr-parse.rs:8:17
|
--> $DIR/cfg-attr-parse.rs:8:17
|
||||||
|
|
|
@ -38,28 +38,43 @@ error: borrow expressions cannot be annotated with lifetimes
|
||||||
--> $DIR/issue-104390.rs:3:25
|
--> $DIR/issue-104390.rs:3:25
|
||||||
|
|
|
|
||||||
LL | fn f3() -> impl Sized { &'a 2E }
|
LL | fn f3() -> impl Sized { &'a 2E }
|
||||||
| ^--^^^
|
| ^---^^
|
||||||
| |
|
| |
|
||||||
| annotated with lifetime here
|
| 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
|
error: borrow expressions cannot be annotated with lifetimes
|
||||||
--> $DIR/issue-104390.rs:5:25
|
--> $DIR/issue-104390.rs:5:25
|
||||||
|
|
|
|
||||||
LL | fn f4() -> impl Sized { &'static 2E }
|
LL | fn f4() -> impl Sized { &'static 2E }
|
||||||
| ^-------^^^
|
| ^--------^^
|
||||||
| |
|
| |
|
||||||
| annotated with lifetime here
|
| 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
|
error: borrow expressions cannot be annotated with lifetimes
|
||||||
--> $DIR/issue-104390.rs:8:25
|
--> $DIR/issue-104390.rs:8:25
|
||||||
|
|
|
|
||||||
LL | fn f6() -> impl Sized { &'_ 2E }
|
LL | fn f6() -> impl Sized { &'_ 2E }
|
||||||
| ^--^^^
|
| ^---^^
|
||||||
| |
|
| |
|
||||||
| annotated with lifetime here
|
| 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
|
error: aborting due to 9 previous errors
|
||||||
|
|
||||||
|
|
|
@ -106,10 +106,13 @@ error: expected identifier, found `,`
|
||||||
--> $DIR/bad-syntax.rs:42:12
|
--> $DIR/bad-syntax.rs:42:12
|
||||||
|
|
|
|
||||||
LL | #[coverage(,off)]
|
LL | #[coverage(,off)]
|
||||||
| ^
|
| ^ expected identifier
|
||||||
| |
|
|
|
||||||
| expected identifier
|
help: remove this comma
|
||||||
| help: remove this comma
|
|
|
||||||
|
LL - #[coverage(,off)]
|
||||||
|
LL + #[coverage(off)]
|
||||||
|
|
|
||||||
|
|
||||||
error: multiple `coverage` attributes
|
error: multiple `coverage` attributes
|
||||||
--> $DIR/bad-syntax.rs:7:1
|
--> $DIR/bad-syntax.rs:7:1
|
||||||
|
|
|
@ -2,19 +2,34 @@ error[E0178]: expected a path on the left-hand side of `+`, not `&'a Foo`
|
||||||
--> $DIR/E0178.rs:6:8
|
--> $DIR/E0178.rs:6:8
|
||||||
|
|
|
|
||||||
LL | w: &'a Foo + Copy,
|
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`
|
error[E0178]: expected a path on the left-hand side of `+`, not `&'a Foo`
|
||||||
--> $DIR/E0178.rs:7:8
|
--> $DIR/E0178.rs:7:8
|
||||||
|
|
|
|
||||||
LL | x: &'a Foo + 'a,
|
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`
|
error[E0178]: expected a path on the left-hand side of `+`, not `&'a mut Foo`
|
||||||
--> $DIR/E0178.rs:8:8
|
--> $DIR/E0178.rs:8:8
|
||||||
|
|
|
|
||||||
LL | y: &'a mut Foo + 'a,
|
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`
|
error[E0178]: expected a path on the left-hand side of `+`, not `fn() -> Foo`
|
||||||
--> $DIR/E0178.rs:9:8
|
--> $DIR/E0178.rs:9:8
|
||||||
|
|
|
@ -2,39 +2,56 @@ error: `~` cannot be used as a unary operator
|
||||||
--> $DIR/issue-41679-tilde-bitwise-negation-attempt.rs:4:14
|
--> $DIR/issue-41679-tilde-bitwise-negation-attempt.rs:4:14
|
||||||
|
|
|
|
||||||
LL | let _x = ~1;
|
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
|
error: unexpected `1` after identifier
|
||||||
--> $DIR/issue-41679-tilde-bitwise-negation-attempt.rs:5:18
|
--> $DIR/issue-41679-tilde-bitwise-negation-attempt.rs:5:18
|
||||||
|
|
|
|
||||||
LL | let _y = not 1;
|
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
|
error: unexpected keyword `false` after identifier
|
||||||
--> $DIR/issue-41679-tilde-bitwise-negation-attempt.rs:6:18
|
--> $DIR/issue-41679-tilde-bitwise-negation-attempt.rs:6:18
|
||||||
|
|
|
|
||||||
LL | let _z = not false;
|
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
|
error: unexpected keyword `true` after identifier
|
||||||
--> $DIR/issue-41679-tilde-bitwise-negation-attempt.rs:7:18
|
--> $DIR/issue-41679-tilde-bitwise-negation-attempt.rs:7:18
|
||||||
|
|
|
|
||||||
LL | let _a = not true;
|
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
|
error: unexpected `v` after identifier
|
||||||
--> $DIR/issue-41679-tilde-bitwise-negation-attempt.rs:9:18
|
--> $DIR/issue-41679-tilde-bitwise-negation-attempt.rs:9:18
|
||||||
|
|
|
|
||||||
LL | let _v = not v;
|
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
|
error: aborting due to 5 previous errors
|
||||||
|
|
||||||
|
|
|
@ -2,25 +2,34 @@ error: unexpected `for_you` after identifier
|
||||||
--> $DIR/issue-46836-identifier-not-instead-of-negation.rs:3:12
|
--> $DIR/issue-46836-identifier-not-instead-of-negation.rs:3:12
|
||||||
|
|
|
|
||||||
LL | if not for_you {
|
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
|
error: unexpected `the_worst` after identifier
|
||||||
--> $DIR/issue-46836-identifier-not-instead-of-negation.rs:11:15
|
--> $DIR/issue-46836-identifier-not-instead-of-negation.rs:11:15
|
||||||
|
|
|
|
||||||
LL | while not the_worst {
|
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
|
error: unexpected `println` after identifier
|
||||||
--> $DIR/issue-46836-identifier-not-instead-of-negation.rs:20:9
|
--> $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?");
|
LL | println!("Then when?");
|
||||||
| ^^^^^^^
|
| ^^^^^^^
|
||||||
|
|
|
||||||
|
help: use `!` to perform logical negation or bitwise not
|
||||||
|
|
|
||||||
|
LL | if !// lack of braces is [sic]
|
||||||
|
| ~
|
||||||
|
|
||||||
error: expected `{`, found `;`
|
error: expected `{`, found `;`
|
||||||
--> $DIR/issue-46836-identifier-not-instead-of-negation.rs:20:31
|
--> $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
|
--> $DIR/issue-46836-identifier-not-instead-of-negation.rs:26:24
|
||||||
|
|
|
|
||||||
LL | let resource = not 2;
|
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
|
error: unexpected `be_smothered_out_before` after identifier
|
||||||
--> $DIR/issue-46836-identifier-not-instead-of-negation.rs:32:27
|
--> $DIR/issue-46836-identifier-not-instead-of-negation.rs:32:27
|
||||||
|
|
|
|
||||||
LL | let young_souls = not be_smothered_out_before;
|
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
|
error: aborting due to 6 previous errors
|
||||||
|
|
||||||
|
|
|
@ -2,65 +2,97 @@ error: `and` is not a logical operator
|
||||||
--> $DIR/issue-54109-and_instead_of_ampersands.rs:7:15
|
--> $DIR/issue-54109-and_instead_of_ampersands.rs:7:15
|
||||||
|
|
|
|
||||||
LL | let _ = a and b;
|
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
|
= 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
|
error: `and` is not a logical operator
|
||||||
--> $DIR/issue-54109-and_instead_of_ampersands.rs:9:10
|
--> $DIR/issue-54109-and_instead_of_ampersands.rs:9:10
|
||||||
|
|
|
|
||||||
LL | if a and b {
|
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
|
= 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
|
error: `or` is not a logical operator
|
||||||
--> $DIR/issue-54109-and_instead_of_ampersands.rs:20:15
|
--> $DIR/issue-54109-and_instead_of_ampersands.rs:20:15
|
||||||
|
|
|
|
||||||
LL | let _ = a or b;
|
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
|
= 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
|
error: `or` is not a logical operator
|
||||||
--> $DIR/issue-54109-and_instead_of_ampersands.rs:22:10
|
--> $DIR/issue-54109-and_instead_of_ampersands.rs:22:10
|
||||||
|
|
|
|
||||||
LL | if a or b {
|
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
|
= 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
|
error: `and` is not a logical operator
|
||||||
--> $DIR/issue-54109-and_instead_of_ampersands.rs:30:11
|
--> $DIR/issue-54109-and_instead_of_ampersands.rs:30:11
|
||||||
|
|
|
|
||||||
LL | if (a and b) {
|
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
|
= 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
|
error: `or` is not a logical operator
|
||||||
--> $DIR/issue-54109-and_instead_of_ampersands.rs:38:11
|
--> $DIR/issue-54109-and_instead_of_ampersands.rs:38:11
|
||||||
|
|
|
|
||||||
LL | if (a or b) {
|
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
|
= 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
|
error: `and` is not a logical operator
|
||||||
--> $DIR/issue-54109-and_instead_of_ampersands.rs:46:13
|
--> $DIR/issue-54109-and_instead_of_ampersands.rs:46:13
|
||||||
|
|
|
|
||||||
LL | while a and b {
|
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
|
= 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
|
error: `or` is not a logical operator
|
||||||
--> $DIR/issue-54109-and_instead_of_ampersands.rs:54:13
|
--> $DIR/issue-54109-and_instead_of_ampersands.rs:54:13
|
||||||
|
|
|
|
||||||
LL | while a or b {
|
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
|
= 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
|
error[E0308]: mismatched types
|
||||||
--> $DIR/issue-54109-and_instead_of_ampersands.rs:13:33
|
--> $DIR/issue-54109-and_instead_of_ampersands.rs:13:33
|
||||||
|
|
|
@ -2,65 +2,97 @@ error: `and` is not a logical operator
|
||||||
--> $DIR/issue-54109-without-witness.rs:13:15
|
--> $DIR/issue-54109-without-witness.rs:13:15
|
||||||
|
|
|
|
||||||
LL | let _ = a and b;
|
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
|
= 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
|
error: `and` is not a logical operator
|
||||||
--> $DIR/issue-54109-without-witness.rs:15:10
|
--> $DIR/issue-54109-without-witness.rs:15:10
|
||||||
|
|
|
|
||||||
LL | if a and b {
|
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
|
= 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
|
error: `or` is not a logical operator
|
||||||
--> $DIR/issue-54109-without-witness.rs:24:15
|
--> $DIR/issue-54109-without-witness.rs:24:15
|
||||||
|
|
|
|
||||||
LL | let _ = a or b;
|
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
|
= 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
|
error: `or` is not a logical operator
|
||||||
--> $DIR/issue-54109-without-witness.rs:26:10
|
--> $DIR/issue-54109-without-witness.rs:26:10
|
||||||
|
|
|
|
||||||
LL | if a or b {
|
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
|
= 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
|
error: `and` is not a logical operator
|
||||||
--> $DIR/issue-54109-without-witness.rs:34:11
|
--> $DIR/issue-54109-without-witness.rs:34:11
|
||||||
|
|
|
|
||||||
LL | if (a and b) {
|
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
|
= 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
|
error: `or` is not a logical operator
|
||||||
--> $DIR/issue-54109-without-witness.rs:42:11
|
--> $DIR/issue-54109-without-witness.rs:42:11
|
||||||
|
|
|
|
||||||
LL | if (a or b) {
|
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
|
= 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
|
error: `and` is not a logical operator
|
||||||
--> $DIR/issue-54109-without-witness.rs:50:13
|
--> $DIR/issue-54109-without-witness.rs:50:13
|
||||||
|
|
|
|
||||||
LL | while a and b {
|
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
|
= 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
|
error: `or` is not a logical operator
|
||||||
--> $DIR/issue-54109-without-witness.rs:58:13
|
--> $DIR/issue-54109-without-witness.rs:58:13
|
||||||
|
|
|
|
||||||
LL | while a or b {
|
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
|
= 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
|
error: aborting due to 8 previous errors
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,12 @@ error: can't qualify macro_rules invocation with `pub`
|
||||||
--> $DIR/pub-macro-rules.rs:2:5
|
--> $DIR/pub-macro-rules.rs:2:5
|
||||||
|
|
|
|
||||||
LL | pub macro_rules! foo {
|
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
|
error: aborting due to 1 previous error
|
||||||
|
|
||||||
|
|
|
@ -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
|
--> $DIR/trait-object-reference-without-parens-suggestion.rs:4:12
|
||||||
|
|
|
|
||||||
LL | let _: &Copy + 'static;
|
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`
|
error[E0178]: expected a path on the left-hand side of `+`, not `&'static Copy`
|
||||||
--> $DIR/trait-object-reference-without-parens-suggestion.rs:6:12
|
--> $DIR/trait-object-reference-without-parens-suggestion.rs:6:12
|
||||||
|
|
|
|
||||||
LL | let _: &'static Copy + 'static;
|
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
|
error[E0038]: the trait `Copy` cannot be made into an object
|
||||||
--> $DIR/trait-object-reference-without-parens-suggestion.rs:4:12
|
--> $DIR/trait-object-reference-without-parens-suggestion.rs:4:12
|
||||||
|
|
|
@ -2,25 +2,45 @@ error: expected item, found `import`
|
||||||
--> $DIR/use_instead_of_import.rs:3:1
|
--> $DIR/use_instead_of_import.rs:3:1
|
||||||
|
|
|
|
||||||
LL | import std::{
|
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`
|
error: expected item, found `require`
|
||||||
--> $DIR/use_instead_of_import.rs:9:1
|
--> $DIR/use_instead_of_import.rs:9:1
|
||||||
|
|
|
|
||||||
LL | require std::time::Duration;
|
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`
|
error: expected item, found `include`
|
||||||
--> $DIR/use_instead_of_import.rs:12:1
|
--> $DIR/use_instead_of_import.rs:12:1
|
||||||
|
|
|
|
||||||
LL | include std::time::Instant;
|
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`
|
error: expected item, found `using`
|
||||||
--> $DIR/use_instead_of_import.rs:15:5
|
--> $DIR/use_instead_of_import.rs:15:5
|
||||||
|
|
|
|
||||||
LL | pub using std::io;
|
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
|
error: aborting due to 4 previous errors
|
||||||
|
|
||||||
|
|
|
@ -2,25 +2,37 @@ error: `enum` definition cannot be nested inside `enum`
|
||||||
--> $DIR/nested-enum.rs:2:5
|
--> $DIR/nested-enum.rs:2:5
|
||||||
|
|
|
|
||||||
LL | enum Bar { Baz },
|
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`
|
error: `struct` definition cannot be nested inside `enum`
|
||||||
--> $DIR/nested-enum.rs:3:5
|
--> $DIR/nested-enum.rs:3:5
|
||||||
|
|
|
|
||||||
LL | struct Quux { field: u8 },
|
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`
|
error: `union` definition cannot be nested inside `enum`
|
||||||
--> $DIR/nested-enum.rs:4:5
|
--> $DIR/nested-enum.rs:4:5
|
||||||
|
|
|
|
||||||
LL | union Wibble { field: u8 },
|
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
|
error: aborting due to 3 previous errors
|
||||||
|
|
||||||
|
|
|
@ -2,9 +2,14 @@ error[E0586]: inclusive range with no end
|
||||||
--> $DIR/E0586.rs:3:19
|
--> $DIR/E0586.rs:3:19
|
||||||
|
|
|
|
||||||
LL | let x = &tmp[1..=];
|
LL | let x = &tmp[1..=];
|
||||||
| ^^^ help: use `..` instead
|
| ^^^
|
||||||
|
|
|
|
||||||
= note: inclusive ranges must be bounded at the end (`..=b` or `a..=b`)
|
= 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
|
error: aborting due to 1 previous error
|
||||||
|
|
||||||
|
|
|
@ -9,12 +9,17 @@ error: outer attributes are not allowed on `if` and `else` branches
|
||||||
|
|
|
|
||||||
LL | } else #[attr] if false {
|
LL | } else #[attr] if false {
|
||||||
| _______----_^^^^^^^_-
|
| _______----_^^^^^^^_-
|
||||||
| | | |
|
| | |
|
||||||
| | | help: remove the attributes
|
|
||||||
| | the branch belongs to this `else`
|
| | the branch belongs to this `else`
|
||||||
LL | | } else {
|
LL | | } else {
|
||||||
LL | | }
|
LL | | }
|
||||||
| |_____- the attributes are attached to this branch
|
| |_____- 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`
|
error: expected expression, found keyword `else`
|
||||||
--> $DIR/else-attrs.rs:20:15
|
--> $DIR/else-attrs.rs:20:15
|
||||||
|
|
8
tests/ui/extern/extern-const.stderr
vendored
8
tests/ui/extern/extern-const.stderr
vendored
|
@ -2,11 +2,13 @@ error: extern items cannot be `const`
|
||||||
--> $DIR/extern-const.rs:14:11
|
--> $DIR/extern-const.rs:14:11
|
||||||
|
|
|
|
||||||
LL | const rust_dbg_static_mut: c_int;
|
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
|
= 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
|
error: aborting due to 1 previous error
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,12 @@ error: incorrect unicode escape sequence
|
||||||
--> $DIR/format-string-error-2.rs:77:20
|
--> $DIR/format-string-error-2.rs:77:20
|
||||||
|
|
|
|
||||||
LL | println!("\x7B}\u8 {", 1);
|
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'`
|
error: invalid format string: expected `'}'`, found `'a'`
|
||||||
--> $DIR/format-string-error-2.rs:5:5
|
--> $DIR/format-string-error-2.rs:5:5
|
||||||
|
|
|
@ -2,25 +2,45 @@ error: return types are denoted using `->`
|
||||||
--> $DIR/fn-recover-return-sign.rs:3:8
|
--> $DIR/fn-recover-return-sign.rs:3:8
|
||||||
|
|
|
|
||||||
LL | fn a() => usize { 0 }
|
LL | fn a() => usize { 0 }
|
||||||
| ^^ help: use `->` instead
|
| ^^
|
||||||
|
|
|
||||||
|
help: use `->` instead
|
||||||
|
|
|
||||||
|
LL | fn a() -> usize { 0 }
|
||||||
|
| ~~
|
||||||
|
|
||||||
error: return types are denoted using `->`
|
error: return types are denoted using `->`
|
||||||
--> $DIR/fn-recover-return-sign.rs:6:7
|
--> $DIR/fn-recover-return-sign.rs:6:7
|
||||||
|
|
|
|
||||||
LL | fn b(): usize { 0 }
|
LL | fn b(): usize { 0 }
|
||||||
| ^ help: use `->` instead
|
| ^
|
||||||
|
|
|
||||||
|
help: use `->` instead
|
||||||
|
|
|
||||||
|
LL | fn b() -> usize { 0 }
|
||||||
|
| ~~
|
||||||
|
|
||||||
error: return types are denoted using `->`
|
error: return types are denoted using `->`
|
||||||
--> $DIR/fn-recover-return-sign.rs:21:25
|
--> $DIR/fn-recover-return-sign.rs:21:25
|
||||||
|
|
|
|
||||||
LL | let foo = |a: bool| => bool { a };
|
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 `->`
|
error: return types are denoted using `->`
|
||||||
--> $DIR/fn-recover-return-sign.rs:25:24
|
--> $DIR/fn-recover-return-sign.rs:25:24
|
||||||
|
|
|
|
||||||
LL | let bar = |a: bool|: bool { a };
|
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
|
error: aborting due to 4 previous errors
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,12 @@ error: return types are denoted using `->`
|
||||||
--> $DIR/fn-recover-return-sign2.rs:4:10
|
--> $DIR/fn-recover-return-sign2.rs:4:10
|
||||||
|
|
|
|
||||||
LL | fn foo() => impl Fn() => bool {
|
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 `=>`
|
error: expected one of `+`, `->`, `::`, `where`, or `{`, found `=>`
|
||||||
--> $DIR/fn-recover-return-sign2.rs:4:23
|
--> $DIR/fn-recover-return-sign2.rs:4:23
|
||||||
|
|
|
@ -2,9 +2,12 @@ error: expected `:` followed by trait or lifetime
|
||||||
--> $DIR/issue-95208-ignore-qself.rs:6:88
|
--> $DIR/issue-95208-ignore-qself.rs:6:88
|
||||||
|
|
|
|
||||||
LL | impl<T: Iterator> Struct<T> where <T as std:: iter::Iterator>::Item:: std::fmt::Display {
|
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
|
error: aborting due to 1 previous error
|
||||||
|
|
||||||
|
|
|
@ -2,9 +2,12 @@ error: expected `:` followed by trait or lifetime
|
||||||
--> $DIR/issue-95208.rs:6:46
|
--> $DIR/issue-95208.rs:6:46
|
||||||
|
|
|
|
||||||
LL | impl<T> Struct<T> where T:: std::fmt::Display {
|
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
|
error: aborting due to 1 previous error
|
||||||
|
|
||||||
|
|
|
@ -4,9 +4,13 @@ error: path separator must be a double colon
|
||||||
LL | pub struct Foo {
|
LL | pub struct Foo {
|
||||||
| --- while parsing this struct
|
| --- while parsing this struct
|
||||||
LL | a: Vec<foo::bar:A>,
|
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>
|
= 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
|
error: aborting due to 1 previous error
|
||||||
|
|
||||||
|
|
|
@ -2,36 +2,60 @@ error: range-to patterns with `...` are not allowed
|
||||||
--> $DIR/half-open-range-pats-inclusive-dotdotdot-bad-syntax.rs:15:9
|
--> $DIR/half-open-range-pats-inclusive-dotdotdot-bad-syntax.rs:15:9
|
||||||
|
|
|
|
||||||
LL | ...X => {}
|
LL | ...X => {}
|
||||||
| ^^^ help: use `..=` instead
|
| ^^^
|
||||||
|
|
|
||||||
|
help: use `..=` instead
|
||||||
|
|
|
||||||
|
LL | ..=X => {}
|
||||||
|
| ~~~
|
||||||
|
|
||||||
error: range-to patterns with `...` are not allowed
|
error: range-to patterns with `...` are not allowed
|
||||||
--> $DIR/half-open-range-pats-inclusive-dotdotdot-bad-syntax.rs:16:9
|
--> $DIR/half-open-range-pats-inclusive-dotdotdot-bad-syntax.rs:16:9
|
||||||
|
|
|
|
||||||
LL | ...0 => {}
|
LL | ...0 => {}
|
||||||
| ^^^ help: use `..=` instead
|
| ^^^
|
||||||
|
|
|
||||||
|
help: use `..=` instead
|
||||||
|
|
|
||||||
|
LL | ..=0 => {}
|
||||||
|
| ~~~
|
||||||
|
|
||||||
error: range-to patterns with `...` are not allowed
|
error: range-to patterns with `...` are not allowed
|
||||||
--> $DIR/half-open-range-pats-inclusive-dotdotdot-bad-syntax.rs:17:9
|
--> $DIR/half-open-range-pats-inclusive-dotdotdot-bad-syntax.rs:17:9
|
||||||
|
|
|
|
||||||
LL | ...'a' => {}
|
LL | ...'a' => {}
|
||||||
| ^^^ help: use `..=` instead
|
| ^^^
|
||||||
|
|
|
||||||
|
help: use `..=` instead
|
||||||
|
|
|
||||||
|
LL | ..='a' => {}
|
||||||
|
| ~~~
|
||||||
|
|
||||||
error: range-to patterns with `...` are not allowed
|
error: range-to patterns with `...` are not allowed
|
||||||
--> $DIR/half-open-range-pats-inclusive-dotdotdot-bad-syntax.rs:18:9
|
--> $DIR/half-open-range-pats-inclusive-dotdotdot-bad-syntax.rs:18:9
|
||||||
|
|
|
|
||||||
LL | ...0.0f32 => {}
|
LL | ...0.0f32 => {}
|
||||||
| ^^^ help: use `..=` instead
|
| ^^^
|
||||||
|
|
|
||||||
|
help: use `..=` instead
|
||||||
|
|
|
||||||
|
LL | ..=0.0f32 => {}
|
||||||
|
| ~~~
|
||||||
|
|
||||||
error: range-to patterns with `...` are not allowed
|
error: range-to patterns with `...` are not allowed
|
||||||
--> $DIR/half-open-range-pats-inclusive-dotdotdot-bad-syntax.rs:25:17
|
--> $DIR/half-open-range-pats-inclusive-dotdotdot-bad-syntax.rs:25:17
|
||||||
|
|
|
|
||||||
LL | let ...$e;
|
LL | let ...$e;
|
||||||
| ^^^ help: use `..=` instead
|
| ^^^
|
||||||
...
|
...
|
||||||
LL | mac!(0);
|
LL | mac!(0);
|
||||||
| ------- in this macro invocation
|
| ------- in this macro invocation
|
||||||
|
|
|
|
||||||
= note: this error originates in the macro `mac` (in Nightly builds, run with -Z macro-backtrace for more info)
|
= 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
|
error[E0005]: refutable pattern in local binding
|
||||||
--> $DIR/half-open-range-pats-inclusive-dotdotdot-bad-syntax.rs:25:17
|
--> $DIR/half-open-range-pats-inclusive-dotdotdot-bad-syntax.rs:25:17
|
||||||
|
|
|
@ -2,57 +2,87 @@ error[E0586]: inclusive range with no end
|
||||||
--> $DIR/half-open-range-pats-inclusive-no-end.rs:8:13
|
--> $DIR/half-open-range-pats-inclusive-no-end.rs:8:13
|
||||||
|
|
|
|
||||||
LL | if let 0... = 1 {}
|
LL | if let 0... = 1 {}
|
||||||
| ^^^ help: use `..` instead
|
| ^^^
|
||||||
|
|
|
|
||||||
= note: inclusive ranges must be bounded at the end (`..=b` or `a..=b`)
|
= 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
|
error[E0586]: inclusive range with no end
|
||||||
--> $DIR/half-open-range-pats-inclusive-no-end.rs:9:13
|
--> $DIR/half-open-range-pats-inclusive-no-end.rs:9:13
|
||||||
|
|
|
|
||||||
LL | if let 0..= = 1 {}
|
LL | if let 0..= = 1 {}
|
||||||
| ^^^ help: use `..` instead
|
| ^^^
|
||||||
|
|
|
|
||||||
= note: inclusive ranges must be bounded at the end (`..=b` or `a..=b`)
|
= 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
|
error[E0586]: inclusive range with no end
|
||||||
--> $DIR/half-open-range-pats-inclusive-no-end.rs:11:13
|
--> $DIR/half-open-range-pats-inclusive-no-end.rs:11:13
|
||||||
|
|
|
|
||||||
LL | if let X... = 1 {}
|
LL | if let X... = 1 {}
|
||||||
| ^^^ help: use `..` instead
|
| ^^^
|
||||||
|
|
|
|
||||||
= note: inclusive ranges must be bounded at the end (`..=b` or `a..=b`)
|
= 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
|
error[E0586]: inclusive range with no end
|
||||||
--> $DIR/half-open-range-pats-inclusive-no-end.rs:12:13
|
--> $DIR/half-open-range-pats-inclusive-no-end.rs:12:13
|
||||||
|
|
|
|
||||||
LL | if let X..= = 1 {}
|
LL | if let X..= = 1 {}
|
||||||
| ^^^ help: use `..` instead
|
| ^^^
|
||||||
|
|
|
|
||||||
= note: inclusive ranges must be bounded at the end (`..=b` or `a..=b`)
|
= 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
|
error[E0586]: inclusive range with no end
|
||||||
--> $DIR/half-open-range-pats-inclusive-no-end.rs:18:19
|
--> $DIR/half-open-range-pats-inclusive-no-end.rs:18:19
|
||||||
|
|
|
|
||||||
LL | let $e...;
|
LL | let $e...;
|
||||||
| ^^^ help: use `..` instead
|
| ^^^
|
||||||
...
|
...
|
||||||
LL | mac!(0);
|
LL | mac!(0);
|
||||||
| ------- in this macro invocation
|
| ------- in this macro invocation
|
||||||
|
|
|
|
||||||
= note: inclusive ranges must be bounded at the end (`..=b` or `a..=b`)
|
= 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)
|
= 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
|
error[E0586]: inclusive range with no end
|
||||||
--> $DIR/half-open-range-pats-inclusive-no-end.rs:20:19
|
--> $DIR/half-open-range-pats-inclusive-no-end.rs:20:19
|
||||||
|
|
|
|
||||||
LL | let $e..=;
|
LL | let $e..=;
|
||||||
| ^^^ help: use `..` instead
|
| ^^^
|
||||||
...
|
...
|
||||||
LL | mac!(0);
|
LL | mac!(0);
|
||||||
| ------- in this macro invocation
|
| ------- in this macro invocation
|
||||||
|
|
|
|
||||||
= note: inclusive ranges must be bounded at the end (`..=b` or `a..=b`)
|
= 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)
|
= 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
|
error[E0005]: refutable pattern in local binding
|
||||||
--> $DIR/half-open-range-pats-inclusive-no-end.rs:18:17
|
--> $DIR/half-open-range-pats-inclusive-no-end.rs:18:17
|
||||||
|
|
|
@ -2,53 +2,93 @@ error: the range pattern here has ambiguous interpretation
|
||||||
--> $DIR/half-open-range-pats-ref-ambiguous-interp.rs:6:10
|
--> $DIR/half-open-range-pats-ref-ambiguous-interp.rs:6:10
|
||||||
|
|
|
|
||||||
LL | &0.. | _ => {}
|
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
|
error[E0586]: inclusive range with no end
|
||||||
--> $DIR/half-open-range-pats-ref-ambiguous-interp.rs:8:11
|
--> $DIR/half-open-range-pats-ref-ambiguous-interp.rs:8:11
|
||||||
|
|
|
|
||||||
LL | &0..= | _ => {}
|
LL | &0..= | _ => {}
|
||||||
| ^^^ help: use `..` instead
|
| ^^^
|
||||||
|
|
|
|
||||||
= note: inclusive ranges must be bounded at the end (`..=b` or `a..=b`)
|
= 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
|
error: the range pattern here has ambiguous interpretation
|
||||||
--> $DIR/half-open-range-pats-ref-ambiguous-interp.rs:8:10
|
--> $DIR/half-open-range-pats-ref-ambiguous-interp.rs:8:10
|
||||||
|
|
|
|
||||||
LL | &0..= | _ => {}
|
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
|
error[E0586]: inclusive range with no end
|
||||||
--> $DIR/half-open-range-pats-ref-ambiguous-interp.rs:11:11
|
--> $DIR/half-open-range-pats-ref-ambiguous-interp.rs:11:11
|
||||||
|
|
|
|
||||||
LL | &0... | _ => {}
|
LL | &0... | _ => {}
|
||||||
| ^^^ help: use `..` instead
|
| ^^^
|
||||||
|
|
|
|
||||||
= note: inclusive ranges must be bounded at the end (`..=b` or `a..=b`)
|
= 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
|
error: the range pattern here has ambiguous interpretation
|
||||||
--> $DIR/half-open-range-pats-ref-ambiguous-interp.rs:16:10
|
--> $DIR/half-open-range-pats-ref-ambiguous-interp.rs:16:10
|
||||||
|
|
|
|
||||||
LL | &..0 | _ => {}
|
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
|
error: the range pattern here has ambiguous interpretation
|
||||||
--> $DIR/half-open-range-pats-ref-ambiguous-interp.rs:18:10
|
--> $DIR/half-open-range-pats-ref-ambiguous-interp.rs:18:10
|
||||||
|
|
|
|
||||||
LL | &..=0 | _ => {}
|
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
|
error: range-to patterns with `...` are not allowed
|
||||||
--> $DIR/half-open-range-pats-ref-ambiguous-interp.rs:20:10
|
--> $DIR/half-open-range-pats-ref-ambiguous-interp.rs:20:10
|
||||||
|
|
|
|
||||||
LL | &...0 | _ => {}
|
LL | &...0 | _ => {}
|
||||||
| ^^^ help: use `..=` instead
|
| ^^^
|
||||||
|
|
|
||||||
|
help: use `..=` instead
|
||||||
|
|
|
||||||
|
LL | &..=0 | _ => {}
|
||||||
|
| ~~~
|
||||||
|
|
||||||
error: the range pattern here has ambiguous interpretation
|
error: the range pattern here has ambiguous interpretation
|
||||||
--> $DIR/half-open-range-pats-ref-ambiguous-interp.rs:20:10
|
--> $DIR/half-open-range-pats-ref-ambiguous-interp.rs:20:10
|
||||||
|
|
|
|
||||||
LL | &...0 | _ => {}
|
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
|
error: aborting due to 8 previous errors
|
||||||
|
|
||||||
|
|
|
@ -2,25 +2,35 @@ error: unexpected `impl` keyword
|
||||||
--> $DIR/extra-impl-in-trait-impl.rs:8:18
|
--> $DIR/extra-impl-in-trait-impl.rs:8:18
|
||||||
|
|
|
|
||||||
LL | impl<T: Default> impl Default for S<T> {
|
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
|
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
|
--> $DIR/extra-impl-in-trait-impl.rs:8:18
|
||||||
|
|
|
|
||||||
LL | impl<T: Default> impl Default for S<T> {
|
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
|
error: unexpected `impl` keyword
|
||||||
--> $DIR/extra-impl-in-trait-impl.rs:14:6
|
--> $DIR/extra-impl-in-trait-impl.rs:14:6
|
||||||
|
|
|
|
||||||
LL | impl impl Default for S2 {
|
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
|
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
|
--> $DIR/extra-impl-in-trait-impl.rs:14:6
|
||||||
|
|
|
|
||||||
LL | impl impl Default for S2 {
|
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
|
error: aborting due to 2 previous errors
|
||||||
|
|
||||||
|
|
|
@ -2,13 +2,23 @@ error: ambiguous `+` in a type
|
||||||
--> $DIR/impl-fn-parsing-ambiguities.rs:4:27
|
--> $DIR/impl-fn-parsing-ambiguities.rs:4:27
|
||||||
|
|
|
|
||||||
LL | fn a() -> impl Fn(&u8) -> impl Debug + '_ {
|
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
|
error: ambiguous `+` in a type
|
||||||
--> $DIR/impl-fn-parsing-ambiguities.rs:10:24
|
--> $DIR/impl-fn-parsing-ambiguities.rs:10:24
|
||||||
|
|
|
|
||||||
LL | fn b() -> impl Fn() -> impl Debug + Send {
|
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`
|
error[E0657]: `impl Trait` cannot capture higher-ranked lifetime from outer `impl Trait`
|
||||||
--> $DIR/impl-fn-parsing-ambiguities.rs:4:40
|
--> $DIR/impl-fn-parsing-ambiguities.rs:4:40
|
||||||
|
|
|
@ -2,19 +2,34 @@ error: ambiguous `+` in a type
|
||||||
--> $DIR/impl-trait-plus-priority.rs:23:18
|
--> $DIR/impl-trait-plus-priority.rs:23:18
|
||||||
|
|
|
|
||||||
LL | type A = fn() -> impl A +;
|
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
|
error: ambiguous `+` in a type
|
||||||
--> $DIR/impl-trait-plus-priority.rs:25:18
|
--> $DIR/impl-trait-plus-priority.rs:25:18
|
||||||
|
|
|
|
||||||
LL | type A = fn() -> impl A + B;
|
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
|
error: ambiguous `+` in a type
|
||||||
--> $DIR/impl-trait-plus-priority.rs:27:18
|
--> $DIR/impl-trait-plus-priority.rs:27:18
|
||||||
|
|
|
|
||||||
LL | type A = fn() -> dyn A + B;
|
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`
|
error[E0178]: expected a path on the left-hand side of `+`, not `fn() -> A`
|
||||||
--> $DIR/impl-trait-plus-priority.rs:29:10
|
--> $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
|
--> $DIR/impl-trait-plus-priority.rs:32:18
|
||||||
|
|
|
|
||||||
LL | type A = Fn() -> impl A +;
|
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
|
error: ambiguous `+` in a type
|
||||||
--> $DIR/impl-trait-plus-priority.rs:34:18
|
--> $DIR/impl-trait-plus-priority.rs:34:18
|
||||||
|
|
|
|
||||||
LL | type A = Fn() -> impl A + B;
|
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
|
error: ambiguous `+` in a type
|
||||||
--> $DIR/impl-trait-plus-priority.rs:36:18
|
--> $DIR/impl-trait-plus-priority.rs:36:18
|
||||||
|
|
|
|
||||||
LL | type A = Fn() -> dyn A + B;
|
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
|
error: ambiguous `+` in a type
|
||||||
--> $DIR/impl-trait-plus-priority.rs:40:11
|
--> $DIR/impl-trait-plus-priority.rs:40:11
|
||||||
|
|
|
|
||||||
LL | type A = &impl A +;
|
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
|
error: ambiguous `+` in a type
|
||||||
--> $DIR/impl-trait-plus-priority.rs:42:11
|
--> $DIR/impl-trait-plus-priority.rs:42:11
|
||||||
|
|
|
|
||||||
LL | type A = &impl A + B;
|
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
|
error: ambiguous `+` in a type
|
||||||
--> $DIR/impl-trait-plus-priority.rs:44:11
|
--> $DIR/impl-trait-plus-priority.rs:44:11
|
||||||
|
|
|
|
||||||
LL | type A = &dyn A + B;
|
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`
|
error[E0178]: expected a path on the left-hand side of `+`, not `&A`
|
||||||
--> $DIR/impl-trait-plus-priority.rs:46:10
|
--> $DIR/impl-trait-plus-priority.rs:46:10
|
||||||
|
|
|
|
||||||
LL | type A = &A + B;
|
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
|
error: aborting due to 11 previous errors
|
||||||
|
|
||||||
|
|
|
@ -2,13 +2,23 @@ error: missing `in` in `for` loop
|
||||||
--> $DIR/issue-40782.rs:4:11
|
--> $DIR/issue-40782.rs:4:11
|
||||||
|
|
|
|
||||||
LL | for _i 0..2 {
|
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
|
error: missing `in` in `for` loop
|
||||||
--> $DIR/issue-40782.rs:6:12
|
--> $DIR/issue-40782.rs:6:12
|
||||||
|
|
|
|
||||||
LL | for _i of 0..2 {
|
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
|
error: aborting due to 2 previous errors
|
||||||
|
|
||||||
|
|
|
@ -2,13 +2,23 @@ error: malformed loop label
|
||||||
--> $DIR/label_misspelled_2.rs:10:5
|
--> $DIR/label_misspelled_2.rs:10:5
|
||||||
|
|
|
|
||||||
LL | c: for _ in 0..1 {
|
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
|
error: malformed loop label
|
||||||
--> $DIR/label_misspelled_2.rs:13:5
|
--> $DIR/label_misspelled_2.rs:13:5
|
||||||
|
|
|
|
||||||
LL | d: for _ in 0..1 {
|
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
|
error[E0425]: cannot find value `b` in this scope
|
||||||
--> $DIR/label_misspelled_2.rs:8:15
|
--> $DIR/label_misspelled_2.rs:8:15
|
||||||
|
|
|
@ -2,17 +2,27 @@ error: expected `;`, found keyword `let`
|
||||||
--> $DIR/let-else-missing-semicolon.rs:4:6
|
--> $DIR/let-else-missing-semicolon.rs:4:6
|
||||||
|
|
|
|
||||||
LL | }
|
LL | }
|
||||||
| ^ help: add `;` here
|
| ^
|
||||||
LL | let _ = "";
|
LL | let _ = "";
|
||||||
| --- unexpected token
|
| --- unexpected token
|
||||||
|
|
|
||||||
|
help: add `;` here
|
||||||
|
|
|
||||||
|
LL | };
|
||||||
|
| +
|
||||||
|
|
||||||
error: expected `;`, found `}`
|
error: expected `;`, found `}`
|
||||||
--> $DIR/let-else-missing-semicolon.rs:8:6
|
--> $DIR/let-else-missing-semicolon.rs:8:6
|
||||||
|
|
|
|
||||||
LL | }
|
LL | }
|
||||||
| ^ help: add `;` here
|
| ^
|
||||||
LL | }
|
LL | }
|
||||||
| - unexpected token
|
| - unexpected token
|
||||||
|
|
|
||||||
|
help: add `;` here
|
||||||
|
|
|
||||||
|
LL | };
|
||||||
|
| +
|
||||||
|
|
||||||
error: aborting due to 2 previous errors
|
error: aborting due to 2 previous errors
|
||||||
|
|
||||||
|
|
|
@ -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
|
--> $DIR/lex-bare-cr-string-literal-doc-comment.rs:19:18
|
||||||
|
|
|
|
||||||
LL | let _s = "foo
bar";
|
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
|
error: bare CR not allowed in raw string
|
||||||
--> $DIR/lex-bare-cr-string-literal-doc-comment.rs:22:19
|
--> $DIR/lex-bare-cr-string-literal-doc-comment.rs:22:19
|
||||||
|
|
|
@ -2,7 +2,13 @@ error: macro names aren't followed by a `!`
|
||||||
--> $DIR/bang-after-name.rs:4:17
|
--> $DIR/bang-after-name.rs:4:17
|
||||||
|
|
|
|
||||||
LL | macro_rules! foo! {
|
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
|
error: aborting due to 1 previous error
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,13 @@ error: macro names aren't followed by a `!`
|
||||||
--> $DIR/missing-bang-in-decl.rs:10:16
|
--> $DIR/missing-bang-in-decl.rs:10:16
|
||||||
|
|
|
|
||||||
LL | macro_rules bar! {
|
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
|
error: aborting due to 3 previous errors
|
||||||
|
|
||||||
|
|
|
@ -2,9 +2,12 @@ error: unexpected `1` after identifier
|
||||||
--> $DIR/recovery-allowed.rs:5:23
|
--> $DIR/recovery-allowed.rs:5:23
|
||||||
|
|
|
|
||||||
LL | please_recover! { not 1 }
|
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
|
error: aborting due to 1 previous error
|
||||||
|
|
||||||
|
|
|
@ -2,17 +2,25 @@ error: malformed `cfg_attr` attribute input
|
||||||
--> $DIR/malformed-special-attrs.rs:1:1
|
--> $DIR/malformed-special-attrs.rs:1:1
|
||||||
|
|
|
|
||||||
LL | #[cfg_attr]
|
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>
|
= 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
|
error: malformed `cfg_attr` attribute input
|
||||||
--> $DIR/malformed-special-attrs.rs:4:1
|
--> $DIR/malformed-special-attrs.rs:4:1
|
||||||
|
|
|
|
||||||
LL | #[cfg_attr = ""]
|
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>
|
= 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
|
error: malformed `derive` attribute input
|
||||||
--> $DIR/malformed-special-attrs.rs:7:1
|
--> $DIR/malformed-special-attrs.rs:7:1
|
||||||
|
|
|
@ -2,7 +2,12 @@ error: return types are denoted using `->`
|
||||||
--> $DIR/avoid-ice-on-warning.rs:4:23
|
--> $DIR/avoid-ice-on-warning.rs:4:23
|
||||||
|
|
|
|
||||||
LL | fn call_this<F>(f: F) : Fn(&str) + call_that {}
|
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
|
error[E0405]: cannot find trait `call_that` in this scope
|
||||||
--> $DIR/avoid-ice-on-warning.rs:4:36
|
--> $DIR/avoid-ice-on-warning.rs:4:36
|
||||||
|
|
|
@ -2,7 +2,12 @@ error: return types are denoted using `->`
|
||||||
--> $DIR/avoid-ice-on-warning.rs:4:23
|
--> $DIR/avoid-ice-on-warning.rs:4:23
|
||||||
|
|
|
|
||||||
LL | fn call_this<F>(f: F) : Fn(&str) + call_that {}
|
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
|
error[E0405]: cannot find trait `call_that` in this scope
|
||||||
--> $DIR/avoid-ice-on-warning.rs:4:36
|
--> $DIR/avoid-ice-on-warning.rs:4:36
|
||||||
|
|
|
@ -2,7 +2,12 @@ error: invalid comparison operator `<>`
|
||||||
--> $DIR/less-than-greater-than.rs:2:22
|
--> $DIR/less-than-greater-than.rs:2:22
|
||||||
|
|
|
|
||||||
LL | println!("{}", 1 <> 2);
|
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
|
error: aborting due to 1 previous error
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,12 @@ error: top-level or-patterns are not allowed in function parameters
|
||||||
--> $DIR/fn-param-wrap-parens.rs:13:9
|
--> $DIR/fn-param-wrap-parens.rs:13:9
|
||||||
|
|
|
|
||||||
LL | fn fun1(A | B: E) {}
|
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
|
error: aborting due to 1 previous error
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,13 @@ error: a trailing `|` is not allowed in an or-pattern
|
||||||
LL | E::A |
|
LL | E::A |
|
||||||
| ---- while parsing this or-pattern starting here
|
| ---- while parsing this or-pattern starting here
|
||||||
LL | E::B |
|
LL | E::B |
|
||||||
| ^ help: remove the `|`
|
| ^
|
||||||
|
|
|
||||||
|
help: remove the `|`
|
||||||
|
|
|
||||||
|
LL - E::B |
|
||||||
|
LL + E::B
|
||||||
|
|
|
||||||
|
|
||||||
error[E0308]: mismatched types
|
error[E0308]: mismatched types
|
||||||
--> $DIR/issue-64879-trailing-before-guard.rs:12:42
|
--> $DIR/issue-64879-trailing-before-guard.rs:12:42
|
||||||
|
|
|
@ -2,55 +2,90 @@ error: unexpected token `||` in pattern
|
||||||
--> $DIR/multiple-pattern-typo.rs:7:15
|
--> $DIR/multiple-pattern-typo.rs:7:15
|
||||||
|
|
|
|
||||||
LL | 1 | 2 || 3 => (),
|
LL | 1 | 2 || 3 => (),
|
||||||
| - ^^ help: use a single `|` to separate multiple alternative patterns: `|`
|
| - ^^
|
||||||
| |
|
| |
|
||||||
| while parsing this or-pattern starting here
|
| 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
|
error: unexpected token `||` in pattern
|
||||||
--> $DIR/multiple-pattern-typo.rs:12:16
|
--> $DIR/multiple-pattern-typo.rs:12:16
|
||||||
|
|
|
|
||||||
LL | (1 | 2 || 3) => (),
|
LL | (1 | 2 || 3) => (),
|
||||||
| - ^^ help: use a single `|` to separate multiple alternative patterns: `|`
|
| - ^^
|
||||||
| |
|
| |
|
||||||
| while parsing this or-pattern starting here
|
| 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
|
error: unexpected token `||` in pattern
|
||||||
--> $DIR/multiple-pattern-typo.rs:17:16
|
--> $DIR/multiple-pattern-typo.rs:17:16
|
||||||
|
|
|
|
||||||
LL | (1 | 2 || 3,) => (),
|
LL | (1 | 2 || 3,) => (),
|
||||||
| - ^^ help: use a single `|` to separate multiple alternative patterns: `|`
|
| - ^^
|
||||||
| |
|
| |
|
||||||
| while parsing this or-pattern starting here
|
| 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
|
error: unexpected token `||` in pattern
|
||||||
--> $DIR/multiple-pattern-typo.rs:24:18
|
--> $DIR/multiple-pattern-typo.rs:24:18
|
||||||
|
|
|
|
||||||
LL | TS(1 | 2 || 3) => (),
|
LL | TS(1 | 2 || 3) => (),
|
||||||
| - ^^ help: use a single `|` to separate multiple alternative patterns: `|`
|
| - ^^
|
||||||
| |
|
| |
|
||||||
| while parsing this or-pattern starting here
|
| 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
|
error: unexpected token `||` in pattern
|
||||||
--> $DIR/multiple-pattern-typo.rs:31:23
|
--> $DIR/multiple-pattern-typo.rs:31:23
|
||||||
|
|
|
|
||||||
LL | NS { f: 1 | 2 || 3 } => (),
|
LL | NS { f: 1 | 2 || 3 } => (),
|
||||||
| - ^^ help: use a single `|` to separate multiple alternative patterns: `|`
|
| - ^^
|
||||||
| |
|
| |
|
||||||
| while parsing this or-pattern starting here
|
| 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
|
error: unexpected token `||` in pattern
|
||||||
--> $DIR/multiple-pattern-typo.rs:36:16
|
--> $DIR/multiple-pattern-typo.rs:36:16
|
||||||
|
|
|
|
||||||
LL | [1 | 2 || 3] => (),
|
LL | [1 | 2 || 3] => (),
|
||||||
| - ^^ help: use a single `|` to separate multiple alternative patterns: `|`
|
| - ^^
|
||||||
| |
|
| |
|
||||||
| while parsing this or-pattern starting here
|
| 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
|
error: unexpected token `||` in pattern
|
||||||
--> $DIR/multiple-pattern-typo.rs:41:9
|
--> $DIR/multiple-pattern-typo.rs:41:9
|
||||||
|
|
|
|
||||||
LL | || 1 | 2 | 3 => (),
|
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
|
error: aborting due to 7 previous errors
|
||||||
|
|
||||||
|
|
|
@ -2,31 +2,56 @@ error: top-level or-patterns are not allowed in `let` bindings
|
||||||
--> $DIR/nested-undelimited-precedence.rs:19:9
|
--> $DIR/nested-undelimited-precedence.rs:19:9
|
||||||
|
|
|
|
||||||
LL | let b @ A | B: E = A;
|
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
|
error: top-level or-patterns are not allowed in `let` bindings
|
||||||
--> $DIR/nested-undelimited-precedence.rs:34:9
|
--> $DIR/nested-undelimited-precedence.rs:34:9
|
||||||
|
|
|
|
||||||
LL | let &A(_) | B(_): F = A(3);
|
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
|
error: top-level or-patterns are not allowed in `let` bindings
|
||||||
--> $DIR/nested-undelimited-precedence.rs:36:9
|
--> $DIR/nested-undelimited-precedence.rs:36:9
|
||||||
|
|
|
|
||||||
LL | let &&A(_) | B(_): F = A(3);
|
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
|
error: top-level or-patterns are not allowed in `let` bindings
|
||||||
--> $DIR/nested-undelimited-precedence.rs:38:9
|
--> $DIR/nested-undelimited-precedence.rs:38:9
|
||||||
|
|
|
|
||||||
LL | let &mut A(_) | B(_): F = A(3);
|
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
|
error: top-level or-patterns are not allowed in `let` bindings
|
||||||
--> $DIR/nested-undelimited-precedence.rs:40:9
|
--> $DIR/nested-undelimited-precedence.rs:40:9
|
||||||
|
|
|
|
||||||
LL | let &&mut A(_) | B(_): F = A(3);
|
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
|
error[E0408]: variable `b` is not bound in all patterns
|
||||||
--> $DIR/nested-undelimited-precedence.rs:19:17
|
--> $DIR/nested-undelimited-precedence.rs:19:17
|
||||||
|
|
|
@ -16,25 +16,45 @@ error: top-level or-patterns are not allowed in function parameters
|
||||||
--> $DIR/or-patterns-syntactic-fail.rs:18:13
|
--> $DIR/or-patterns-syntactic-fail.rs:18:13
|
||||||
|
|
|
|
||||||
LL | fn fun1(A | B: E) {}
|
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
|
error: top-level or-patterns are not allowed in function parameters
|
||||||
--> $DIR/or-patterns-syntactic-fail.rs:21:13
|
--> $DIR/or-patterns-syntactic-fail.rs:21:13
|
||||||
|
|
|
|
||||||
LL | fn fun2(| A | B: E) {}
|
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
|
error: top-level or-patterns are not allowed in `let` bindings
|
||||||
--> $DIR/or-patterns-syntactic-fail.rs:26:9
|
--> $DIR/or-patterns-syntactic-fail.rs:26:9
|
||||||
|
|
|
|
||||||
LL | let A | B: E = A;
|
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
|
error: top-level or-patterns are not allowed in `let` bindings
|
||||||
--> $DIR/or-patterns-syntactic-fail.rs:29:9
|
--> $DIR/or-patterns-syntactic-fail.rs:29:9
|
||||||
|
|
|
|
||||||
LL | let | A | B: E = A;
|
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
|
error: aborting due to 5 previous errors
|
||||||
|
|
||||||
|
|
|
@ -2,161 +2,279 @@ error: top-level or-patterns are not allowed in function parameters
|
||||||
--> $DIR/remove-leading-vert.rs:11:14
|
--> $DIR/remove-leading-vert.rs:11:14
|
||||||
|
|
|
|
||||||
LL | fn fun1( | A: E) {}
|
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
|
error: unexpected `||` before function parameter
|
||||||
--> $DIR/remove-leading-vert.rs:12:14
|
--> $DIR/remove-leading-vert.rs:12:14
|
||||||
|
|
|
|
||||||
LL | fn fun2( || A: E) {}
|
LL | fn fun2( || A: E) {}
|
||||||
| ^^ help: remove the `||`
|
| ^^
|
||||||
|
|
|
|
||||||
= note: alternatives in or-patterns are separated with `|`, not `||`
|
= 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
|
error: unexpected token `||` in pattern
|
||||||
--> $DIR/remove-leading-vert.rs:14:11
|
--> $DIR/remove-leading-vert.rs:14:11
|
||||||
|
|
|
|
||||||
LL | let ( || A): (E);
|
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
|
error: unexpected token `||` in pattern
|
||||||
--> $DIR/remove-leading-vert.rs:17:11
|
--> $DIR/remove-leading-vert.rs:17:11
|
||||||
|
|
|
|
||||||
LL | let [ || A ]: [E; 1];
|
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
|
error: unexpected token `||` in pattern
|
||||||
--> $DIR/remove-leading-vert.rs:19:13
|
--> $DIR/remove-leading-vert.rs:19:13
|
||||||
|
|
|
|
||||||
LL | let TS( || A ): TS;
|
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
|
error: unexpected token `||` in pattern
|
||||||
--> $DIR/remove-leading-vert.rs:21:17
|
--> $DIR/remove-leading-vert.rs:21:17
|
||||||
|
|
|
|
||||||
LL | let NS { f: || A }: NS;
|
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
|
error: a trailing `|` is not allowed in an or-pattern
|
||||||
--> $DIR/remove-leading-vert.rs:26:13
|
--> $DIR/remove-leading-vert.rs:26:13
|
||||||
|
|
|
|
||||||
LL | let ( A | ): E;
|
LL | let ( A | ): E;
|
||||||
| - ^ help: remove the `|`
|
| - ^
|
||||||
| |
|
| |
|
||||||
| while parsing this or-pattern starting here
|
| 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
|
error: a trailing `|` is not allowed in an or-pattern
|
||||||
--> $DIR/remove-leading-vert.rs:27:12
|
--> $DIR/remove-leading-vert.rs:27:12
|
||||||
|
|
|
|
||||||
LL | let (a |,): (E,);
|
LL | let (a |,): (E,);
|
||||||
| - ^ help: remove the `|`
|
| - ^
|
||||||
| |
|
| |
|
||||||
| while parsing this or-pattern starting here
|
| 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
|
error: a trailing `|` is not allowed in an or-pattern
|
||||||
--> $DIR/remove-leading-vert.rs:28:17
|
--> $DIR/remove-leading-vert.rs:28:17
|
||||||
|
|
|
|
||||||
LL | let ( A | B | ): E;
|
LL | let ( A | B | ): E;
|
||||||
| - ^ help: remove the `|`
|
| - ^
|
||||||
| |
|
| |
|
||||||
| while parsing this or-pattern starting here
|
| 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
|
error: a trailing `|` is not allowed in an or-pattern
|
||||||
--> $DIR/remove-leading-vert.rs:29:17
|
--> $DIR/remove-leading-vert.rs:29:17
|
||||||
|
|
|
|
||||||
LL | let [ A | B | ]: [E; 1];
|
LL | let [ A | B | ]: [E; 1];
|
||||||
| - ^ help: remove the `|`
|
| - ^
|
||||||
| |
|
| |
|
||||||
| while parsing this or-pattern starting here
|
| 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
|
error: a trailing `|` is not allowed in an or-pattern
|
||||||
--> $DIR/remove-leading-vert.rs:30:18
|
--> $DIR/remove-leading-vert.rs:30:18
|
||||||
|
|
|
|
||||||
LL | let S { f: B | };
|
LL | let S { f: B | };
|
||||||
| - ^ help: remove the `|`
|
| - ^
|
||||||
| |
|
| |
|
||||||
| while parsing this or-pattern starting here
|
| 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
|
error: unexpected token `||` in pattern
|
||||||
--> $DIR/remove-leading-vert.rs:31:13
|
--> $DIR/remove-leading-vert.rs:31:13
|
||||||
|
|
|
|
||||||
LL | let ( A || B | ): E;
|
LL | let ( A || B | ): E;
|
||||||
| - ^^ help: use a single `|` to separate multiple alternative patterns: `|`
|
| - ^^
|
||||||
| |
|
| |
|
||||||
| while parsing this or-pattern starting here
|
| 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
|
error: a trailing `|` is not allowed in an or-pattern
|
||||||
--> $DIR/remove-leading-vert.rs:31:18
|
--> $DIR/remove-leading-vert.rs:31:18
|
||||||
|
|
|
|
||||||
LL | let ( A || B | ): E;
|
LL | let ( A || B | ): E;
|
||||||
| - ^ help: remove the `|`
|
| - ^
|
||||||
| |
|
| |
|
||||||
| while parsing this or-pattern starting here
|
| 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
|
error: a trailing `|` is not allowed in an or-pattern
|
||||||
--> $DIR/remove-leading-vert.rs:34:11
|
--> $DIR/remove-leading-vert.rs:34:11
|
||||||
|
|
|
|
||||||
LL | A | => {}
|
LL | A | => {}
|
||||||
| - ^ help: remove the `|`
|
| - ^
|
||||||
| |
|
| |
|
||||||
| while parsing this or-pattern starting here
|
| while parsing this or-pattern starting here
|
||||||
|
|
|
||||||
|
help: remove the `|`
|
||||||
|
|
|
||||||
|
LL - A | => {}
|
||||||
|
LL + A => {}
|
||||||
|
|
|
||||||
|
|
||||||
error: a trailing `|` is not allowed in an or-pattern
|
error: a trailing `|` is not allowed in an or-pattern
|
||||||
--> $DIR/remove-leading-vert.rs:35:11
|
--> $DIR/remove-leading-vert.rs:35:11
|
||||||
|
|
|
|
||||||
LL | A || => {}
|
LL | A || => {}
|
||||||
| - ^^ help: remove the `||`
|
| - ^^
|
||||||
| |
|
| |
|
||||||
| while parsing this or-pattern starting here
|
| while parsing this or-pattern starting here
|
||||||
|
|
|
|
||||||
= note: alternatives in or-patterns are separated with `|`, not `||`
|
= note: alternatives in or-patterns are separated with `|`, not `||`
|
||||||
|
help: remove the `||`
|
||||||
|
|
|
||||||
|
LL - A || => {}
|
||||||
|
LL + A => {}
|
||||||
|
|
|
||||||
|
|
||||||
error: unexpected token `||` in pattern
|
error: unexpected token `||` in pattern
|
||||||
--> $DIR/remove-leading-vert.rs:36:11
|
--> $DIR/remove-leading-vert.rs:36:11
|
||||||
|
|
|
|
||||||
LL | A || B | => {}
|
LL | A || B | => {}
|
||||||
| - ^^ help: use a single `|` to separate multiple alternative patterns: `|`
|
| - ^^
|
||||||
| |
|
| |
|
||||||
| while parsing this or-pattern starting here
|
| 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
|
error: a trailing `|` is not allowed in an or-pattern
|
||||||
--> $DIR/remove-leading-vert.rs:36:16
|
--> $DIR/remove-leading-vert.rs:36:16
|
||||||
|
|
|
|
||||||
LL | A || B | => {}
|
LL | A || B | => {}
|
||||||
| - ^ help: remove the `|`
|
| - ^
|
||||||
| |
|
| |
|
||||||
| while parsing this or-pattern starting here
|
| 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
|
error: a trailing `|` is not allowed in an or-pattern
|
||||||
--> $DIR/remove-leading-vert.rs:38:17
|
--> $DIR/remove-leading-vert.rs:38:17
|
||||||
|
|
|
|
||||||
LL | | A | B | => {}
|
LL | | A | B | => {}
|
||||||
| - ^ help: remove the `|`
|
| - ^
|
||||||
| |
|
| |
|
||||||
| while parsing this or-pattern starting here
|
| 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
|
error: a trailing `|` is not allowed in an or-pattern
|
||||||
--> $DIR/remove-leading-vert.rs:45:11
|
--> $DIR/remove-leading-vert.rs:45:11
|
||||||
|
|
|
|
||||||
LL | let a | : u8 = 0;
|
LL | let a | : u8 = 0;
|
||||||
| - ^ help: remove the `|`
|
| - ^
|
||||||
| |
|
| |
|
||||||
| while parsing this or-pattern starting here
|
| 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
|
error: a trailing `|` is not allowed in an or-pattern
|
||||||
--> $DIR/remove-leading-vert.rs:46:11
|
--> $DIR/remove-leading-vert.rs:46:11
|
||||||
|
|
|
|
||||||
LL | let a | = 0;
|
LL | let a | = 0;
|
||||||
| - ^ help: remove the `|`
|
| - ^
|
||||||
| |
|
| |
|
||||||
| while parsing this or-pattern starting here
|
| 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
|
error: a trailing `|` is not allowed in an or-pattern
|
||||||
--> $DIR/remove-leading-vert.rs:47:11
|
--> $DIR/remove-leading-vert.rs:47:11
|
||||||
|
|
|
|
||||||
LL | let a | ;
|
LL | let a | ;
|
||||||
| - ^ help: remove the `|`
|
| - ^
|
||||||
| |
|
| |
|
||||||
| while parsing this or-pattern starting here
|
| while parsing this or-pattern starting here
|
||||||
|
|
|
||||||
|
help: remove the `|`
|
||||||
|
|
|
||||||
|
LL - let a | ;
|
||||||
|
LL + let a ;
|
||||||
|
|
|
||||||
|
|
||||||
error: aborting due to 21 previous errors
|
error: aborting due to 21 previous errors
|
||||||
|
|
||||||
|
|
|
@ -154,9 +154,14 @@ error: outer attributes are not allowed on `if` and `else` branches
|
||||||
|
|
|
|
||||||
LL | #[cfg(FALSE)] fn e() { let _ = if 0 #[attr] {}; }
|
LL | #[cfg(FALSE)] fn e() { let _ = if 0 #[attr] {}; }
|
||||||
| -- ^^^^^^^ -- the attributes are attached to this branch
|
| -- ^^^^^^^ -- the attributes are attached to this branch
|
||||||
| | |
|
| |
|
||||||
| | help: remove the attributes
|
|
||||||
| the branch belongs to this `if`
|
| 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
|
error: an inner attribute is not permitted in this context
|
||||||
--> $DIR/attr-stmt-expr-attr-bad.rs:40:38
|
--> $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] {}; }
|
LL | #[cfg(FALSE)] fn e() { let _ = if 0 {} else #[attr] {}; }
|
||||||
| ---- ^^^^^^^ -- the attributes are attached to this branch
|
| ---- ^^^^^^^ -- the attributes are attached to this branch
|
||||||
| | |
|
| |
|
||||||
| | help: remove the attributes
|
|
||||||
| the branch belongs to this `else`
|
| 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
|
error: an inner attribute is not permitted in this context
|
||||||
--> $DIR/attr-stmt-expr-attr-bad.rs:46:46
|
--> $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 {}; }
|
LL | #[cfg(FALSE)] fn e() { let _ = if 0 {} else #[attr] if 0 {}; }
|
||||||
| ---- ^^^^^^^ ------- the attributes are attached to this branch
|
| ---- ^^^^^^^ ------- the attributes are attached to this branch
|
||||||
| | |
|
| |
|
||||||
| | help: remove the attributes
|
|
||||||
| the branch belongs to this `else`
|
| 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
|
error: outer attributes are not allowed on `if` and `else` branches
|
||||||
--> $DIR/attr-stmt-expr-attr-bad.rs:50:50
|
--> $DIR/attr-stmt-expr-attr-bad.rs:50:50
|
||||||
|
|
|
|
||||||
LL | #[cfg(FALSE)] fn e() { let _ = if 0 {} else if 0 #[attr] {}; }
|
LL | #[cfg(FALSE)] fn e() { let _ = if 0 {} else if 0 #[attr] {}; }
|
||||||
| -- ^^^^^^^ -- the attributes are attached to this branch
|
| -- ^^^^^^^ -- the attributes are attached to this branch
|
||||||
| | |
|
| |
|
||||||
| | help: remove the attributes
|
|
||||||
| the branch belongs to this `if`
|
| 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
|
error: an inner attribute is not permitted in this context
|
||||||
--> $DIR/attr-stmt-expr-attr-bad.rs:52:51
|
--> $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] {}; }
|
LL | #[cfg(FALSE)] fn e() { let _ = if let _ = 0 #[attr] {}; }
|
||||||
| -- ^^^^^^^ -- the attributes are attached to this branch
|
| -- ^^^^^^^ -- the attributes are attached to this branch
|
||||||
| | |
|
| |
|
||||||
| | help: remove the attributes
|
|
||||||
| the branch belongs to this `if`
|
| 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
|
error: an inner attribute is not permitted in this context
|
||||||
--> $DIR/attr-stmt-expr-attr-bad.rs:56:46
|
--> $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] {}; }
|
LL | #[cfg(FALSE)] fn e() { let _ = if let _ = 0 {} else #[attr] {}; }
|
||||||
| ---- ^^^^^^^ -- the attributes are attached to this branch
|
| ---- ^^^^^^^ -- the attributes are attached to this branch
|
||||||
| | |
|
| |
|
||||||
| | help: remove the attributes
|
|
||||||
| the branch belongs to this `else`
|
| 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
|
error: an inner attribute is not permitted in this context
|
||||||
--> $DIR/attr-stmt-expr-attr-bad.rs:62:54
|
--> $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 {}; }
|
LL | #[cfg(FALSE)] fn e() { let _ = if let _ = 0 {} else #[attr] if let _ = 0 {}; }
|
||||||
| ---- ^^^^^^^ --------------- the attributes are attached to this branch
|
| ---- ^^^^^^^ --------------- the attributes are attached to this branch
|
||||||
| | |
|
| |
|
||||||
| | help: remove the attributes
|
|
||||||
| the branch belongs to this `else`
|
| 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
|
error: outer attributes are not allowed on `if` and `else` branches
|
||||||
--> $DIR/attr-stmt-expr-attr-bad.rs:66:66
|
--> $DIR/attr-stmt-expr-attr-bad.rs:66:66
|
||||||
|
|
|
|
||||||
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 #[attr] {}; }
|
||||||
| -- ^^^^^^^ -- the attributes are attached to this branch
|
| -- ^^^^^^^ -- the attributes are attached to this branch
|
||||||
| | |
|
| |
|
||||||
| | help: remove the attributes
|
|
||||||
| the branch belongs to this `if`
|
| 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
|
error: an inner attribute is not permitted in this context
|
||||||
--> $DIR/attr-stmt-expr-attr-bad.rs:68:67
|
--> $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
|
--> $DIR/attr-stmt-expr-attr-bad.rs:85:35
|
||||||
|
|
|
|
||||||
LL | #[cfg(FALSE)] fn e() { match 0 { 0..=#[attr] 10 => () } }
|
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`)
|
= 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 `#`
|
error: expected one of `=>`, `if`, or `|`, found `#`
|
||||||
--> $DIR/attr-stmt-expr-attr-bad.rs:85:38
|
--> $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
|
--> $DIR/attr-stmt-expr-attr-bad.rs:88:35
|
||||||
|
|
|
|
||||||
LL | #[cfg(FALSE)] fn e() { match 0 { 0..=#[attr] -10 => () } }
|
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`)
|
= 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 `#`
|
error: expected one of `=>`, `if`, or `|`, found `#`
|
||||||
--> $DIR/attr-stmt-expr-attr-bad.rs:88:38
|
--> $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
|
--> $DIR/attr-stmt-expr-attr-bad.rs:93:35
|
||||||
|
|
|
|
||||||
LL | #[cfg(FALSE)] fn e() { match 0 { 0..=#[attr] FOO => () } }
|
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`)
|
= 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 `#`
|
error: expected one of `=>`, `if`, or `|`, found `#`
|
||||||
--> $DIR/attr-stmt-expr-attr-bad.rs:93:38
|
--> $DIR/attr-stmt-expr-attr-bad.rs:93:38
|
||||||
|
|
|
@ -2,7 +2,12 @@ error: character constant must be escaped: `'`
|
||||||
--> $DIR/bad-char-literals.rs:6:6
|
--> $DIR/bad-char-literals.rs:6:6
|
||||||
|
|
|
|
||||||
LL | ''';
|
LL | ''';
|
||||||
| ^ help: escape the character: `\'`
|
| ^
|
||||||
|
|
|
||||||
|
help: escape the character
|
||||||
|
|
|
||||||
|
LL | '\'';
|
||||||
|
| ~~
|
||||||
|
|
||||||
error: character constant must be escaped: `\n`
|
error: character constant must be escaped: `\n`
|
||||||
--> $DIR/bad-char-literals.rs:10:6
|
--> $DIR/bad-char-literals.rs:10:6
|
||||||
|
@ -10,19 +15,34 @@ error: character constant must be escaped: `\n`
|
||||||
LL | '
|
LL | '
|
||||||
| ______^
|
| ______^
|
||||||
LL | | ';
|
LL | | ';
|
||||||
| |_ help: escape the character: `\n`
|
| |_
|
||||||
|
|
|
||||||
|
help: escape the character
|
||||||
|
|
|
||||||
|
LL | '\n';
|
||||||
|
| ++
|
||||||
|
|
||||||
error: character constant must be escaped: `\r`
|
error: character constant must be escaped: `\r`
|
||||||
--> $DIR/bad-char-literals.rs:15:6
|
--> $DIR/bad-char-literals.rs:15:6
|
||||||
|
|
|
|
||||||
LL | '
';
|
LL | '
';
|
||||||
| ^ help: escape the character: `\r`
|
| ^
|
||||||
|
|
|
||||||
|
help: escape the character
|
||||||
|
|
|
||||||
|
LL | '\r';
|
||||||
|
| ++
|
||||||
|
|
||||||
error: character constant must be escaped: `\t`
|
error: character constant must be escaped: `\t`
|
||||||
--> $DIR/bad-char-literals.rs:18:6
|
--> $DIR/bad-char-literals.rs:18:6
|
||||||
|
|
|
|
||||||
LL | ' ';
|
LL | ' ';
|
||||||
| ^^^^ help: escape the character: `\t`
|
| ^^^^
|
||||||
|
|
|
||||||
|
help: escape the character
|
||||||
|
|
|
||||||
|
LL | '\t';
|
||||||
|
| ++
|
||||||
|
|
||||||
error: aborting due to 4 previous errors
|
error: aborting due to 4 previous errors
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,12 @@ LL | pub type T0 = const fn();
|
||||||
| -----^^^^^
|
| -----^^^^^
|
||||||
| |
|
| |
|
||||||
| `const` because of this
|
| `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`
|
error: an `fn` pointer type cannot be `const`
|
||||||
--> $DIR/bad-fn-ptr-qualifier.rs:6:15
|
--> $DIR/bad-fn-ptr-qualifier.rs:6:15
|
||||||
|
@ -14,7 +19,12 @@ LL | pub type T1 = const extern "C" fn();
|
||||||
| -----^^^^^^^^^^^^^^^^
|
| -----^^^^^^^^^^^^^^^^
|
||||||
| |
|
| |
|
||||||
| `const` because of this
|
| `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`
|
error: an `fn` pointer type cannot be `const`
|
||||||
--> $DIR/bad-fn-ptr-qualifier.rs:7:15
|
--> $DIR/bad-fn-ptr-qualifier.rs:7:15
|
||||||
|
@ -23,7 +33,12 @@ LL | pub type T2 = const unsafe extern fn();
|
||||||
| -----^^^^^^^^^^^^^^^^^^^
|
| -----^^^^^^^^^^^^^^^^^^^
|
||||||
| |
|
| |
|
||||||
| `const` because of this
|
| `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`
|
error: an `fn` pointer type cannot be `async`
|
||||||
--> $DIR/bad-fn-ptr-qualifier.rs:8:15
|
--> $DIR/bad-fn-ptr-qualifier.rs:8:15
|
||||||
|
@ -32,7 +47,12 @@ LL | pub type T3 = async fn();
|
||||||
| -----^^^^^
|
| -----^^^^^
|
||||||
| |
|
| |
|
||||||
| `async` because of this
|
| `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`
|
error: an `fn` pointer type cannot be `async`
|
||||||
--> $DIR/bad-fn-ptr-qualifier.rs:9:15
|
--> $DIR/bad-fn-ptr-qualifier.rs:9:15
|
||||||
|
@ -41,7 +61,12 @@ LL | pub type T4 = async extern fn();
|
||||||
| -----^^^^^^^^^^^^
|
| -----^^^^^^^^^^^^
|
||||||
| |
|
| |
|
||||||
| `async` because of this
|
| `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`
|
error: an `fn` pointer type cannot be `async`
|
||||||
--> $DIR/bad-fn-ptr-qualifier.rs:10:15
|
--> $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
|
| `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`
|
error: an `fn` pointer type cannot be `const`
|
||||||
--> $DIR/bad-fn-ptr-qualifier.rs:11:15
|
--> $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
|
| `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`
|
error: an `fn` pointer type cannot be `async`
|
||||||
--> $DIR/bad-fn-ptr-qualifier.rs:11:15
|
--> $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
|
| `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`
|
error: an `fn` pointer type cannot be `const`
|
||||||
--> $DIR/bad-fn-ptr-qualifier.rs:15:17
|
--> $DIR/bad-fn-ptr-qualifier.rs:15:17
|
||||||
|
@ -77,7 +117,12 @@ LL | pub type FTT0 = for<'a> const fn();
|
||||||
| ^^^^^^^^-----^^^^^
|
| ^^^^^^^^-----^^^^^
|
||||||
| |
|
| |
|
||||||
| `const` because of this
|
| `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`
|
error: an `fn` pointer type cannot be `const`
|
||||||
--> $DIR/bad-fn-ptr-qualifier.rs:16:17
|
--> $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
|
| `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`
|
error: an `fn` pointer type cannot be `const`
|
||||||
--> $DIR/bad-fn-ptr-qualifier.rs:17:17
|
--> $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
|
| `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`
|
error: an `fn` pointer type cannot be `async`
|
||||||
--> $DIR/bad-fn-ptr-qualifier.rs:18:17
|
--> $DIR/bad-fn-ptr-qualifier.rs:18:17
|
||||||
|
@ -104,7 +159,12 @@ LL | pub type FTT3 = for<'a> async fn();
|
||||||
| ^^^^^^^^-----^^^^^
|
| ^^^^^^^^-----^^^^^
|
||||||
| |
|
| |
|
||||||
| `async` because of this
|
| `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`
|
error: an `fn` pointer type cannot be `async`
|
||||||
--> $DIR/bad-fn-ptr-qualifier.rs:19:17
|
--> $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
|
| `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`
|
error: an `fn` pointer type cannot be `async`
|
||||||
--> $DIR/bad-fn-ptr-qualifier.rs:20:17
|
--> $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
|
| `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`
|
error: an `fn` pointer type cannot be `const`
|
||||||
--> $DIR/bad-fn-ptr-qualifier.rs:22:17
|
--> $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
|
| `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`
|
error: an `fn` pointer type cannot be `async`
|
||||||
--> $DIR/bad-fn-ptr-qualifier.rs:22:17
|
--> $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
|
| `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
|
error: aborting due to 16 previous errors
|
||||||
|
|
||||||
|
|
|
@ -24,13 +24,23 @@ error: byte constant must be escaped: `\t`
|
||||||
--> $DIR/byte-literals.rs:8:7
|
--> $DIR/byte-literals.rs:8:7
|
||||||
|
|
|
|
||||||
LL | b' ';
|
LL | b' ';
|
||||||
| ^^^^ help: escape the character: `\t`
|
| ^^^^
|
||||||
|
|
|
||||||
|
help: escape the character
|
||||||
|
|
|
||||||
|
LL | b'\t';
|
||||||
|
| ++
|
||||||
|
|
||||||
error: byte constant must be escaped: `'`
|
error: byte constant must be escaped: `'`
|
||||||
--> $DIR/byte-literals.rs:9:7
|
--> $DIR/byte-literals.rs:9:7
|
||||||
|
|
|
|
||||||
LL | b''';
|
LL | b''';
|
||||||
| ^ help: escape the character: `\'`
|
| ^
|
||||||
|
|
|
||||||
|
help: escape the character
|
||||||
|
|
|
||||||
|
LL | b'\'';
|
||||||
|
| ~~
|
||||||
|
|
||||||
error: non-ASCII character in byte literal
|
error: non-ASCII character in byte literal
|
||||||
--> $DIR/byte-literals.rs:10:7
|
--> $DIR/byte-literals.rs:10:7
|
||||||
|
|
|
@ -2,15 +2,17 @@ error: character literal may only contain one codepoint
|
||||||
--> $DIR/whitespace-character-literal.rs:5:30
|
--> $DIR/whitespace-character-literal.rs:5:30
|
||||||
|
|
|
|
||||||
LL | let _hair_space_around = ' x';
|
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}`
|
note: there are non-printing characters, the full sequence is `\u{200a}x\u{200b}`
|
||||||
--> $DIR/whitespace-character-literal.rs:5:31
|
--> $DIR/whitespace-character-literal.rs:5:31
|
||||||
|
|
|
|
||||||
LL | let _hair_space_around = ' x';
|
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
|
error: aborting due to 1 previous error
|
||||||
|
|
||||||
|
|
|
@ -154,11 +154,13 @@ error: extern items cannot be `const`
|
||||||
--> $DIR/default-on-wrong-item-kind.rs:38:19
|
--> $DIR/default-on-wrong-item-kind.rs:38:19
|
||||||
|
|
|
|
||||||
LL | default const foo: u8;
|
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
|
= 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`
|
error: a module cannot be `default`
|
||||||
--> $DIR/default-on-wrong-item-kind.rs:41:5
|
--> $DIR/default-on-wrong-item-kind.rs:41:5
|
||||||
|
|
|
@ -2,9 +2,13 @@ error: found removed `do catch` syntax
|
||||||
--> $DIR/do-catch-suggests-try.rs:4:25
|
--> $DIR/do-catch-suggests-try.rs:4:25
|
||||||
|
|
|
|
||||||
LL | let _: Option<()> = do catch {};
|
LL | let _: Option<()> = do catch {};
|
||||||
| ^^^^^^^^ help: replace with the new syntax: `try`
|
| ^^^^^^^^
|
||||||
|
|
|
|
||||||
= note: following RFC #2388, the new non-placeholder syntax is `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
|
error[E0308]: mismatched types
|
||||||
--> $DIR/do-catch-suggests-try.rs:9:33
|
--> $DIR/do-catch-suggests-try.rs:9:33
|
||||||
|
|
|
@ -16,9 +16,14 @@ error: outer attributes are not allowed on `if` and `else` branches
|
||||||
|
|
|
|
||||||
LL | if true /*!*/ {}
|
LL | if true /*!*/ {}
|
||||||
| -- ^^^^^ -- the attributes are attached to this branch
|
| -- ^^^^^ -- the attributes are attached to this branch
|
||||||
| | |
|
| |
|
||||||
| | help: remove the attributes
|
|
||||||
| the branch belongs to this `if`
|
| the branch belongs to this `if`
|
||||||
|
|
|
||||||
|
help: remove the attributes
|
||||||
|
|
|
||||||
|
LL - if true /*!*/ {}
|
||||||
|
LL + if true {}
|
||||||
|
|
|
||||||
|
|
||||||
error: aborting due to 2 previous errors
|
error: aborting due to 2 previous errors
|
||||||
|
|
||||||
|
|
|
@ -2,41 +2,61 @@ error: `->` used for field access or method call
|
||||||
--> $DIR/expr-rarrow-call.rs:14:10
|
--> $DIR/expr-rarrow-call.rs:14:10
|
||||||
|
|
|
|
||||||
LL | named->foo;
|
LL | named->foo;
|
||||||
| ^^ help: try using `.` instead
|
| ^^
|
||||||
|
|
|
|
||||||
= help: the `.` operator will dereference the value if needed
|
= help: the `.` operator will dereference the value if needed
|
||||||
|
help: try using `.` instead
|
||||||
|
|
|
||||||
|
LL | named.foo;
|
||||||
|
| ~
|
||||||
|
|
||||||
error: `->` used for field access or method call
|
error: `->` used for field access or method call
|
||||||
--> $DIR/expr-rarrow-call.rs:18:12
|
--> $DIR/expr-rarrow-call.rs:18:12
|
||||||
|
|
|
|
||||||
LL | unnamed->0;
|
LL | unnamed->0;
|
||||||
| ^^ help: try using `.` instead
|
| ^^
|
||||||
|
|
|
|
||||||
= help: the `.` operator will dereference the value if needed
|
= help: the `.` operator will dereference the value if needed
|
||||||
|
help: try using `.` instead
|
||||||
|
|
|
||||||
|
LL | unnamed.0;
|
||||||
|
| ~
|
||||||
|
|
||||||
error: `->` used for field access or method call
|
error: `->` used for field access or method call
|
||||||
--> $DIR/expr-rarrow-call.rs:22:6
|
--> $DIR/expr-rarrow-call.rs:22:6
|
||||||
|
|
|
|
||||||
LL | t->0;
|
LL | t->0;
|
||||||
| ^^ help: try using `.` instead
|
| ^^
|
||||||
|
|
|
|
||||||
= help: the `.` operator will dereference the value if needed
|
= help: the `.` operator will dereference the value if needed
|
||||||
|
help: try using `.` instead
|
||||||
|
|
|
||||||
|
LL | t.0;
|
||||||
|
| ~
|
||||||
|
|
||||||
error: `->` used for field access or method call
|
error: `->` used for field access or method call
|
||||||
--> $DIR/expr-rarrow-call.rs:23:6
|
--> $DIR/expr-rarrow-call.rs:23:6
|
||||||
|
|
|
|
||||||
LL | t->1;
|
LL | t->1;
|
||||||
| ^^ help: try using `.` instead
|
| ^^
|
||||||
|
|
|
|
||||||
= help: the `.` operator will dereference the value if needed
|
= help: the `.` operator will dereference the value if needed
|
||||||
|
help: try using `.` instead
|
||||||
|
|
|
||||||
|
LL | t.1;
|
||||||
|
| ~
|
||||||
|
|
||||||
error: `->` used for field access or method call
|
error: `->` used for field access or method call
|
||||||
--> $DIR/expr-rarrow-call.rs:30:8
|
--> $DIR/expr-rarrow-call.rs:30:8
|
||||||
|
|
|
|
||||||
LL | foo->clone();
|
LL | foo->clone();
|
||||||
| ^^ help: try using `.` instead
|
| ^^
|
||||||
|
|
|
|
||||||
= help: the `.` operator will dereference the value if needed
|
= help: the `.` operator will dereference the value if needed
|
||||||
|
help: try using `.` instead
|
||||||
|
|
|
||||||
|
LL | foo.clone();
|
||||||
|
| ~
|
||||||
|
|
||||||
error: aborting due to 5 previous errors
|
error: aborting due to 5 previous errors
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,12 @@ error: return types are denoted using `->`
|
||||||
--> $DIR/fn-colon-return-type.rs:1:15
|
--> $DIR/fn-colon-return-type.rs:1:15
|
||||||
|
|
|
|
||||||
LL | fn foo(x: i32): i32 {
|
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
|
error: aborting due to 1 previous error
|
||||||
|
|
||||||
|
|
|
@ -2,21 +2,25 @@ error: extern items cannot be `const`
|
||||||
--> $DIR/foreign-const-semantic-fail.rs:4:11
|
--> $DIR/foreign-const-semantic-fail.rs:4:11
|
||||||
|
|
|
|
||||||
LL | const A: isize;
|
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
|
= 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`
|
error: extern items cannot be `const`
|
||||||
--> $DIR/foreign-const-semantic-fail.rs:6:11
|
--> $DIR/foreign-const-semantic-fail.rs:6:11
|
||||||
|
|
|
|
||||||
LL | const B: isize = 42;
|
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
|
= 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
|
error: incorrect `static` inside `extern` block
|
||||||
--> $DIR/foreign-const-semantic-fail.rs:6:11
|
--> $DIR/foreign-const-semantic-fail.rs:6:11
|
||||||
|
|
|
@ -2,21 +2,25 @@ error: extern items cannot be `const`
|
||||||
--> $DIR/foreign-const-syntactic-fail.rs:7:11
|
--> $DIR/foreign-const-syntactic-fail.rs:7:11
|
||||||
|
|
|
|
||||||
LL | const A: isize;
|
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
|
= 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`
|
error: extern items cannot be `const`
|
||||||
--> $DIR/foreign-const-syntactic-fail.rs:8:11
|
--> $DIR/foreign-const-syntactic-fail.rs:8:11
|
||||||
|
|
|
|
||||||
LL | const B: isize = 42;
|
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
|
= 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
|
error: aborting due to 2 previous errors
|
||||||
|
|
||||||
|
|
|
@ -2,19 +2,25 @@ error: expected identifier, found `,`
|
||||||
--> $DIR/ident-recovery.rs:1:4
|
--> $DIR/ident-recovery.rs:1:4
|
||||||
|
|
|
|
||||||
LL | fn ,comma() {
|
LL | fn ,comma() {
|
||||||
| ^
|
| ^ expected identifier
|
||||||
| |
|
|
|
||||||
| expected identifier
|
help: remove this comma
|
||||||
| help: remove this comma
|
|
|
||||||
|
LL - fn ,comma() {
|
||||||
|
LL + fn comma() {
|
||||||
|
|
|
||||||
|
|
||||||
error: expected identifier, found `,`
|
error: expected identifier, found `,`
|
||||||
--> $DIR/ident-recovery.rs:4:16
|
--> $DIR/ident-recovery.rs:4:16
|
||||||
|
|
|
|
||||||
LL | x: i32,,
|
LL | x: i32,,
|
||||||
| ^
|
| ^ expected identifier
|
||||||
| |
|
|
|
||||||
| expected identifier
|
help: remove this comma
|
||||||
| help: remove this comma
|
|
|
||||||
|
LL - x: i32,,
|
||||||
|
LL + x: i32,
|
||||||
|
|
|
||||||
|
|
||||||
error: expected identifier, found keyword `break`
|
error: expected identifier, found keyword `break`
|
||||||
--> $DIR/ident-recovery.rs:10:4
|
--> $DIR/ident-recovery.rs:10:4
|
||||||
|
|
|
@ -2,9 +2,13 @@ error: expected iterable, found keyword `in`
|
||||||
--> $DIR/if-in-in.rs:4:14
|
--> $DIR/if-in-in.rs:4:14
|
||||||
|
|
|
|
||||||
LL | for i in in 1..2 {
|
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
|
error: aborting due to 1 previous error
|
||||||
|
|
||||||
|
|
|
@ -2,13 +2,23 @@ error: missing `for` in a trait impl
|
||||||
--> $DIR/impl-parsing.rs:4:11
|
--> $DIR/impl-parsing.rs:4:11
|
||||||
|
|
|
|
||||||
LL | impl Trait Type {}
|
LL | impl Trait Type {}
|
||||||
| ^ help: add `for` here
|
| ^
|
||||||
|
|
|
||||||
|
help: add `for` here
|
||||||
|
|
|
||||||
|
LL | impl Trait for Type {}
|
||||||
|
| +++
|
||||||
|
|
||||||
error: missing `for` in a trait impl
|
error: missing `for` in a trait impl
|
||||||
--> $DIR/impl-parsing.rs:5:11
|
--> $DIR/impl-parsing.rs:5:11
|
||||||
|
|
|
|
||||||
LL | impl Trait .. {}
|
LL | impl Trait .. {}
|
||||||
| ^ help: add `for` here
|
| ^
|
||||||
|
|
|
||||||
|
help: add `for` here
|
||||||
|
|
|
||||||
|
LL | impl Trait for .. {}
|
||||||
|
| +++
|
||||||
|
|
||||||
error: expected a trait, found type
|
error: expected a trait, found type
|
||||||
--> $DIR/impl-parsing.rs:6:6
|
--> $DIR/impl-parsing.rs:6:6
|
||||||
|
|
|
@ -6,7 +6,11 @@ LL | Some(x) @ y => {}
|
||||||
| | |
|
| | |
|
||||||
| | binding on the right, should be on the left
|
| | binding on the right, should be on the left
|
||||||
| pattern on the left, should be on the right
|
| 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 `@`
|
error: pattern on wrong side of `@`
|
||||||
--> $DIR/intersection-patterns-1.rs:27:9
|
--> $DIR/intersection-patterns-1.rs:27:9
|
||||||
|
@ -16,7 +20,11 @@ LL | 1 ..= 5 @ e => {}
|
||||||
| | |
|
| | |
|
||||||
| | binding on the right, should be on the left
|
| | binding on the right, should be on the left
|
||||||
| pattern on the left, should be on the right
|
| 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
|
error: aborting due to 2 previous errors
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,13 @@ error: expected item, found `;`
|
||||||
--> $DIR/fn-no-semicolon-issue-124935-semi-after-item.rs:5:1
|
--> $DIR/fn-no-semicolon-issue-124935-semi-after-item.rs:5:1
|
||||||
|
|
|
|
||||||
LL | ;
|
LL | ;
|
||||||
| ^ help: remove this semicolon
|
| ^
|
||||||
|
|
|
||||||
|
help: remove this semicolon
|
||||||
|
|
|
||||||
|
LL - ;
|
||||||
|
LL +
|
||||||
|
|
|
||||||
|
|
||||||
error: aborting due to 1 previous error
|
error: aborting due to 1 previous error
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,12 @@ error: invalid variable declaration
|
||||||
--> $DIR/issue-100197-mut-let.rs:4:5
|
--> $DIR/issue-100197-mut-let.rs:4:5
|
||||||
|
|
|
|
||||||
LL | mut let _x = 123;
|
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
|
error: aborting due to 1 previous error
|
||||||
|
|
||||||
|
|
|
@ -2,9 +2,14 @@ error: unexpected `==`
|
||||||
--> $DIR/issue-101477-enum.rs:6:7
|
--> $DIR/issue-101477-enum.rs:6:7
|
||||||
|
|
|
|
||||||
LL | B == 2
|
LL | B == 2
|
||||||
| ^^ help: try using `=` instead
|
| ^^
|
||||||
|
|
|
|
||||||
= help: enum variants can be `Variant`, `Variant = <integer>`, `Variant(Type, ..., TypeN)` or `Variant { fields: Types }`
|
= 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 `==`
|
error: expected item, found `==`
|
||||||
--> $DIR/issue-101477-enum.rs:6:7
|
--> $DIR/issue-101477-enum.rs:6:7
|
||||||
|
|
|
@ -2,7 +2,13 @@ error: unexpected `==`
|
||||||
--> $DIR/issue-101477-let.rs:4:11
|
--> $DIR/issue-101477-let.rs:4:11
|
||||||
|
|
|
|
||||||
LL | let x == 2;
|
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
|
error: aborting due to 1 previous error
|
||||||
|
|
||||||
|
|
|
@ -2,28 +2,43 @@ error: expected `;`, found `5.0`
|
||||||
--> $DIR/issue-103425.rs:2:6
|
--> $DIR/issue-103425.rs:2:6
|
||||||
|
|
|
|
||||||
LL | 3
|
LL | 3
|
||||||
| ^ help: add `;` here
|
| ^
|
||||||
LL |
|
LL |
|
||||||
LL | 5.0
|
LL | 5.0
|
||||||
| --- unexpected token
|
| --- unexpected token
|
||||||
|
|
|
||||||
|
help: add `;` here
|
||||||
|
|
|
||||||
|
LL | 3;
|
||||||
|
| +
|
||||||
|
|
||||||
error: expected `;`, found `3_i8`
|
error: expected `;`, found `3_i8`
|
||||||
--> $DIR/issue-103425.rs:8:10
|
--> $DIR/issue-103425.rs:8:10
|
||||||
|
|
|
|
||||||
LL | 2_u32
|
LL | 2_u32
|
||||||
| ^ help: add `;` here
|
| ^
|
||||||
LL |
|
LL |
|
||||||
LL | 3_i8
|
LL | 3_i8
|
||||||
| ---- unexpected token
|
| ---- unexpected token
|
||||||
|
|
|
||||||
|
help: add `;` here
|
||||||
|
|
|
||||||
|
LL | 2_u32;
|
||||||
|
| +
|
||||||
|
|
||||||
error: expected `;`, found `5.0`
|
error: expected `;`, found `5.0`
|
||||||
--> $DIR/issue-103425.rs:10:9
|
--> $DIR/issue-103425.rs:10:9
|
||||||
|
|
|
|
||||||
LL | 3_i8
|
LL | 3_i8
|
||||||
| ^ help: add `;` here
|
| ^
|
||||||
LL |
|
LL |
|
||||||
LL | 5.0
|
LL | 5.0
|
||||||
| --- unexpected token
|
| --- unexpected token
|
||||||
|
|
|
||||||
|
help: add `;` here
|
||||||
|
|
|
||||||
|
LL | 3_i8;
|
||||||
|
| +
|
||||||
|
|
||||||
error: aborting due to 3 previous errors
|
error: aborting due to 3 previous errors
|
||||||
|
|
||||||
|
|
|
@ -2,13 +2,23 @@ error: missing parameters for function definition
|
||||||
--> $DIR/issue-108109-fn-missing-params.rs:3:15
|
--> $DIR/issue-108109-fn-missing-params.rs:3:15
|
||||||
|
|
|
|
||||||
LL | pub fn missing -> () {}
|
LL | pub fn missing -> () {}
|
||||||
| ^ help: add a parameter list
|
| ^
|
||||||
|
|
|
||||||
|
help: add a parameter list
|
||||||
|
|
|
||||||
|
LL | pub fn missing() -> () {}
|
||||||
|
| ++
|
||||||
|
|
||||||
error: missing parameters for function definition
|
error: missing parameters for function definition
|
||||||
--> $DIR/issue-108109-fn-missing-params.rs:6:16
|
--> $DIR/issue-108109-fn-missing-params.rs:6:16
|
||||||
|
|
|
|
||||||
LL | pub fn missing2 {}
|
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
|
error: aborting due to 2 previous errors
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,12 @@ error: incorrect use of `await`
|
||||||
--> $DIR/issue-113203.rs:5:5
|
--> $DIR/issue-113203.rs:5:5
|
||||||
|
|
|
|
||||||
LL | await {}()
|
LL | await {}()
|
||||||
| ^^^^^^^^ help: `await` is a postfix operation: `{}.await`
|
| ^^^^^^^^
|
||||||
|
|
|
||||||
|
help: `await` is a postfix operation
|
||||||
|
|
|
||||||
|
LL | {}.await()
|
||||||
|
| ~~~~~~~~
|
||||||
|
|
||||||
error: aborting due to 1 previous error
|
error: aborting due to 1 previous error
|
||||||
|
|
||||||
|
|
|
@ -30,16 +30,23 @@ LL | #[feature]
|
||||||
| ---------- only `;` terminated statements or tail expressions are allowed after this attribute
|
| ---------- only `;` terminated statements or tail expressions are allowed after this attribute
|
||||||
LL | attr::fn bar() -> String {
|
LL | attr::fn bar() -> String {
|
||||||
| ^--- unexpected token
|
| ^--- unexpected token
|
||||||
| |
|
|
|
||||||
| help: add `;` here
|
help: add `;` here
|
||||||
|
|
|
||||||
|
LL | attr::fn; bar() -> String {
|
||||||
|
| +
|
||||||
|
|
||||||
error: `->` used for field access or method call
|
error: `->` used for field access or method call
|
||||||
--> $DIR/issue-118530-ice.rs:5:20
|
--> $DIR/issue-118530-ice.rs:5:20
|
||||||
|
|
|
|
||||||
LL | attr::fn bar() -> String {
|
LL | attr::fn bar() -> String {
|
||||||
| ^^ help: try using `.` instead
|
| ^^
|
||||||
|
|
|
|
||||||
= help: the `.` operator will dereference the value if needed
|
= 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 `{`
|
error: expected one of `(`, `.`, `::`, `;`, `?`, `}`, or an operator, found `{`
|
||||||
--> $DIR/issue-118530-ice.rs:5:30
|
--> $DIR/issue-118530-ice.rs:5:30
|
||||||
|
|
|
@ -1,10 +1,13 @@
|
||||||
error: const globals cannot be mutable
|
error: const globals cannot be mutable
|
||||||
--> $DIR/issue-17718-const-mut.rs:2:1
|
--> $DIR/issue-17718-const-mut.rs:2:1
|
||||||
|
|
|
|
||||||
LL | const
|
|
||||||
| ----- help: you might want to declare a static instead: `static`
|
|
||||||
LL | mut
|
LL | mut
|
||||||
| ^^^ cannot be mutable
|
| ^^^ cannot be mutable
|
||||||
|
|
|
||||||
|
help: you might want to declare a static instead
|
||||||
|
|
|
||||||
|
LL | static
|
||||||
|
|
|
||||||
|
|
||||||
error: aborting due to 1 previous error
|
error: aborting due to 1 previous error
|
||||||
|
|
||||||
|
|
|
@ -86,9 +86,12 @@ error: incorrect unicode escape sequence
|
||||||
--> $DIR/issue-23620-invalid-escapes.rs:32:14
|
--> $DIR/issue-23620-invalid-escapes.rs:32:14
|
||||||
|
|
|
|
||||||
LL | let _ = "\u8f";
|
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
|
error: aborting due to 13 previous errors
|
||||||
|
|
||||||
|
|
|
@ -2,13 +2,23 @@ error: missing `for` in a trait impl
|
||||||
--> $DIR/issue-27255.rs:3:7
|
--> $DIR/issue-27255.rs:3:7
|
||||||
|
|
|
|
||||||
LL | impl A .. {}
|
LL | impl A .. {}
|
||||||
| ^ help: add `for` here
|
| ^
|
||||||
|
|
|
||||||
|
help: add `for` here
|
||||||
|
|
|
||||||
|
LL | impl A for .. {}
|
||||||
|
| +++
|
||||||
|
|
||||||
error: missing `for` in a trait impl
|
error: missing `for` in a trait impl
|
||||||
--> $DIR/issue-27255.rs:7:7
|
--> $DIR/issue-27255.rs:7:7
|
||||||
|
|
|
|
||||||
LL | impl A usize {}
|
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
|
error: `impl Trait for .. {}` is an obsolete syntax
|
||||||
--> $DIR/issue-27255.rs:3:1
|
--> $DIR/issue-27255.rs:3:1
|
||||||
|
|
|
@ -2,9 +2,14 @@ error: expected `;`, found `}`
|
||||||
--> $DIR/issue-3036.rs:6:15
|
--> $DIR/issue-3036.rs:6:15
|
||||||
|
|
|
|
||||||
LL | let _x = 3
|
LL | let _x = 3
|
||||||
| ^ help: add `;` here
|
| ^
|
||||||
LL | }
|
LL | }
|
||||||
| - unexpected token
|
| - unexpected token
|
||||||
|
|
|
||||||
|
help: add `;` here
|
||||||
|
|
|
||||||
|
LL | let _x = 3;
|
||||||
|
| +
|
||||||
|
|
||||||
error: aborting due to 1 previous error
|
error: aborting due to 1 previous error
|
||||||
|
|
||||||
|
|
|
@ -2,9 +2,14 @@ error: `mut` must be followed by a named binding
|
||||||
--> $DIR/issue-32501.rs:7:9
|
--> $DIR/issue-32501.rs:7:9
|
||||||
|
|
|
|
||||||
LL | let mut _ = 0;
|
LL | let mut _ = 0;
|
||||||
| ^^^^ help: remove the `mut` prefix
|
| ^^^^
|
||||||
|
|
|
|
||||||
= note: `mut` may be followed by `variable` and `variable @ pattern`
|
= 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
|
error: aborting due to 1 previous error
|
||||||
|
|
||||||
|
|
|
@ -2,9 +2,14 @@ error: expected item, found `;`
|
||||||
--> $DIR/issue-46186.rs:5:2
|
--> $DIR/issue-46186.rs:5:2
|
||||||
|
|
|
|
||||||
LL | };
|
LL | };
|
||||||
| ^ help: remove this semicolon
|
| ^
|
||||||
|
|
|
|
||||||
= help: braced struct declarations are not followed by a semicolon
|
= help: braced struct declarations are not followed by a semicolon
|
||||||
|
help: remove this semicolon
|
||||||
|
|
|
||||||
|
LL - };
|
||||||
|
LL + }
|
||||||
|
|
|
||||||
|
|
||||||
error: aborting due to 1 previous error
|
error: aborting due to 1 previous error
|
||||||
|
|
||||||
|
|
|
@ -4,11 +4,14 @@ error[E0585]: found a documentation comment that doesn't document anything
|
||||||
LL | struct S {
|
LL | struct S {
|
||||||
| - while parsing this struct
|
| - while parsing this struct
|
||||||
LL | x: u8
|
LL | x: u8
|
||||||
| - help: missing comma here: `,`
|
|
||||||
LL | /// The ID of the parent core
|
LL | /// The ID of the parent core
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
|
|
||||||
= help: doc comments must come before what they document, if a comment was intended use `//`
|
= 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
|
error: aborting due to 1 previous error
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,13 @@ error: expected item, found `;`
|
||||||
--> $DIR/issue-49040.rs:1:28
|
--> $DIR/issue-49040.rs:1:28
|
||||||
|
|
|
|
||||||
LL | #![allow(unused_variables)];
|
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`
|
error[E0601]: `main` function not found in crate `issue_49040`
|
||||||
--> $DIR/issue-49040.rs:2:12
|
--> $DIR/issue-49040.rs:2:12
|
||||||
|
|
|
@ -2,7 +2,12 @@ error: float literals must have an integer part
|
||||||
--> $DIR/issue-52496.rs:4:24
|
--> $DIR/issue-52496.rs:4:24
|
||||||
|
|
|
|
||||||
LL | let _ = Foo { bar: .5, baz: 42 };
|
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 `.`
|
error: expected one of `,`, `:`, or `}`, found `.`
|
||||||
--> $DIR/issue-52496.rs:8:22
|
--> $DIR/issue-52496.rs:8:22
|
||||||
|
|
|
@ -2,25 +2,49 @@ error: unmatched angle brackets
|
||||||
--> $DIR/issue-54521-2.rs:11:25
|
--> $DIR/issue-54521-2.rs:11:25
|
||||||
|
|
|
|
||||||
LL | let _ = Vec::<usize>>>>>::new();
|
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
|
error: unmatched angle brackets
|
||||||
--> $DIR/issue-54521-2.rs:14:25
|
--> $DIR/issue-54521-2.rs:14:25
|
||||||
|
|
|
|
||||||
LL | let _ = Vec::<usize>>>>::new();
|
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
|
error: unmatched angle brackets
|
||||||
--> $DIR/issue-54521-2.rs:17:25
|
--> $DIR/issue-54521-2.rs:17:25
|
||||||
|
|
|
|
||||||
LL | let _ = Vec::<usize>>>::new();
|
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
|
error: unmatched angle bracket
|
||||||
--> $DIR/issue-54521-2.rs:20:25
|
--> $DIR/issue-54521-2.rs:20:25
|
||||||
|
|
|
|
||||||
LL | let _ = Vec::<usize>>::new();
|
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
|
error: aborting due to 4 previous errors
|
||||||
|
|
||||||
|
|
|
@ -2,25 +2,49 @@ error: unmatched angle brackets
|
||||||
--> $DIR/issue-54521-3.rs:11:60
|
--> $DIR/issue-54521-3.rs:11:60
|
||||||
|
|
|
|
||||||
LL | let _ = vec![1, 2, 3].into_iter().collect::<Vec<usize>>>>>>();
|
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
|
error: unmatched angle brackets
|
||||||
--> $DIR/issue-54521-3.rs:14:60
|
--> $DIR/issue-54521-3.rs:14:60
|
||||||
|
|
|
|
||||||
LL | let _ = vec![1, 2, 3].into_iter().collect::<Vec<usize>>>>>();
|
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
|
error: unmatched angle brackets
|
||||||
--> $DIR/issue-54521-3.rs:17:60
|
--> $DIR/issue-54521-3.rs:17:60
|
||||||
|
|
|
|
||||||
LL | let _ = vec![1, 2, 3].into_iter().collect::<Vec<usize>>>>();
|
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
|
error: unmatched angle bracket
|
||||||
--> $DIR/issue-54521-3.rs:20:60
|
--> $DIR/issue-54521-3.rs:20:60
|
||||||
|
|
|
|
||||||
LL | let _ = vec![1, 2, 3].into_iter().collect::<Vec<usize>>>();
|
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
|
error: aborting due to 4 previous errors
|
||||||
|
|
||||||
|
|
|
@ -2,17 +2,23 @@ error: expected `:`, found `=`
|
||||||
--> $DIR/issue-57684.rs:27:20
|
--> $DIR/issue-57684.rs:27:20
|
||||||
|
|
|
|
||||||
LL | let _ = X { f1 = 5 };
|
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 `=`
|
error: expected `:`, found `=`
|
||||||
--> $DIR/issue-57684.rs:32:12
|
--> $DIR/issue-57684.rs:32:12
|
||||||
|
|
|
|
||||||
LL | f1 = 5,
|
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
|
error: aborting due to 2 previous errors
|
||||||
|
|
||||||
|
|
|
@ -2,43 +2,85 @@ error: unmatched angle brackets
|
||||||
--> $DIR/issue-57819.rs:19:10
|
--> $DIR/issue-57819.rs:19:10
|
||||||
|
|
|
|
||||||
LL | bar::<<<<<T as Foo>::Output>();
|
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
|
error: unmatched angle brackets
|
||||||
--> $DIR/issue-57819.rs:22:10
|
--> $DIR/issue-57819.rs:22:10
|
||||||
|
|
|
|
||||||
LL | bar::<<<<T as Foo>::Output>();
|
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
|
error: unmatched angle bracket
|
||||||
--> $DIR/issue-57819.rs:25:10
|
--> $DIR/issue-57819.rs:25:10
|
||||||
|
|
|
|
||||||
LL | bar::<<<T as Foo>::Output>();
|
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
|
error: unmatched angle brackets
|
||||||
--> $DIR/issue-57819.rs:34:48
|
--> $DIR/issue-57819.rs:34:48
|
||||||
|
|
|
|
||||||
LL | let _ = vec![1, 2, 3].into_iter().collect::<<<<<Vec<usize>>();
|
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
|
error: unmatched angle brackets
|
||||||
--> $DIR/issue-57819.rs:37:48
|
--> $DIR/issue-57819.rs:37:48
|
||||||
|
|
|
|
||||||
LL | let _ = vec![1, 2, 3].into_iter().collect::<<<<Vec<usize>>();
|
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
|
error: unmatched angle brackets
|
||||||
--> $DIR/issue-57819.rs:40:48
|
--> $DIR/issue-57819.rs:40:48
|
||||||
|
|
|
|
||||||
LL | let _ = vec![1, 2, 3].into_iter().collect::<<<Vec<usize>>();
|
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
|
error: unmatched angle bracket
|
||||||
--> $DIR/issue-57819.rs:43:48
|
--> $DIR/issue-57819.rs:43:48
|
||||||
|
|
|
|
||||||
LL | let _ = vec![1, 2, 3].into_iter().collect::<<Vec<usize>>();
|
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
|
error: aborting due to 7 previous errors
|
||||||
|
|
||||||
|
|
|
@ -2,13 +2,18 @@ error: `mut` must be followed by a named binding
|
||||||
--> $DIR/issue-65122-mac-invoc-in-mut-patterns.rs:6:13
|
--> $DIR/issue-65122-mac-invoc-in-mut-patterns.rs:6:13
|
||||||
|
|
|
|
||||||
LL | let mut $eval = ();
|
LL | let mut $eval = ();
|
||||||
| ^^^^ help: remove the `mut` prefix
|
| ^^^^
|
||||||
...
|
...
|
||||||
LL | mac1! { does_not_exist!() }
|
LL | mac1! { does_not_exist!() }
|
||||||
| --------------------------- in this macro invocation
|
| --------------------------- in this macro invocation
|
||||||
|
|
|
|
||||||
= note: `mut` may be followed by `variable` and `variable @ pattern`
|
= 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)
|
= 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!()`
|
error: expected identifier, found `does_not_exist!()`
|
||||||
--> $DIR/issue-65122-mac-invoc-in-mut-patterns.rs:13:17
|
--> $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
|
--> $DIR/issue-65122-mac-invoc-in-mut-patterns.rs:13:13
|
||||||
|
|
|
|
||||||
LL | let mut $eval = ();
|
LL | let mut $eval = ();
|
||||||
| ^^^ help: remove the `mut` prefix
|
| ^^^
|
||||||
...
|
...
|
||||||
LL | mac2! { does_not_exist!() }
|
LL | mac2! { does_not_exist!() }
|
||||||
| --------------------------- in this macro invocation
|
| --------------------------- in this macro invocation
|
||||||
|
|
|
|
||||||
= note: `mut` may be followed by `variable` and `variable @ pattern`
|
= 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)
|
= 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
|
error: cannot find macro `does_not_exist` in this scope
|
||||||
--> $DIR/issue-65122-mac-invoc-in-mut-patterns.rs:22:13
|
--> $DIR/issue-65122-mac-invoc-in-mut-patterns.rs:22:13
|
||||||
|
|
|
@ -46,13 +46,23 @@ error: invalid variable declaration
|
||||||
--> $DIR/issue-65257-invalid-var-decl-recovery.rs:14:5
|
--> $DIR/issue-65257-invalid-var-decl-recovery.rs:14:5
|
||||||
|
|
|
|
||||||
LL | mut n = 0;
|
LL | mut n = 0;
|
||||||
| ^^^ help: missing keyword: `let mut`
|
| ^^^
|
||||||
|
|
|
||||||
|
help: missing keyword
|
||||||
|
|
|
||||||
|
LL | let mut n = 0;
|
||||||
|
| ~~~~~~~
|
||||||
|
|
||||||
error: invalid variable declaration
|
error: invalid variable declaration
|
||||||
--> $DIR/issue-65257-invalid-var-decl-recovery.rs:16:5
|
--> $DIR/issue-65257-invalid-var-decl-recovery.rs:16:5
|
||||||
|
|
|
|
||||||
LL | mut var;
|
LL | mut var;
|
||||||
| ^^^ help: missing keyword: `let mut`
|
| ^^^
|
||||||
|
|
|
||||||
|
help: missing keyword
|
||||||
|
|
|
||||||
|
LL | let mut var;
|
||||||
|
| ~~~~~~~
|
||||||
|
|
||||||
error[E0308]: mismatched types
|
error[E0308]: mismatched types
|
||||||
--> $DIR/issue-65257-invalid-var-decl-recovery.rs:20:33
|
--> $DIR/issue-65257-invalid-var-decl-recovery.rs:20:33
|
||||||
|
|
|
@ -2,19 +2,25 @@ error: unexpected `...`
|
||||||
--> $DIR/issue-70388-recover-dotdotdot-rest-pat.rs:4:13
|
--> $DIR/issue-70388-recover-dotdotdot-rest-pat.rs:4:13
|
||||||
|
|
|
|
||||||
LL | let Foo(...) = Foo(0);
|
LL | let Foo(...) = Foo(0);
|
||||||
| ^^^
|
| ^^^ not a valid pattern
|
||||||
| |
|
|
|
||||||
| not a valid pattern
|
help: for a rest pattern, use `..` instead of `...`
|
||||||
| help: for a rest pattern, use `..` instead of `...`
|
|
|
||||||
|
LL - let Foo(...) = Foo(0);
|
||||||
|
LL + let Foo(..) = Foo(0);
|
||||||
|
|
|
||||||
|
|
||||||
error: unexpected `...`
|
error: unexpected `...`
|
||||||
--> $DIR/issue-70388-recover-dotdotdot-rest-pat.rs:5:13
|
--> $DIR/issue-70388-recover-dotdotdot-rest-pat.rs:5:13
|
||||||
|
|
|
|
||||||
LL | let [_, ..., _] = [0, 1];
|
LL | let [_, ..., _] = [0, 1];
|
||||||
| ^^^
|
| ^^^ not a valid pattern
|
||||||
| |
|
|
|
||||||
| not a valid pattern
|
help: for a rest pattern, use `..` instead of `...`
|
||||||
| help: for a rest pattern, use `..` instead of `...`
|
|
|
||||||
|
LL - let [_, ..., _] = [0, 1];
|
||||||
|
LL + let [_, .., _] = [0, 1];
|
||||||
|
|
|
||||||
|
|
||||||
error[E0308]: mismatched types
|
error[E0308]: mismatched types
|
||||||
--> $DIR/issue-70388-recover-dotdotdot-rest-pat.rs:6:33
|
--> $DIR/issue-70388-recover-dotdotdot-rest-pat.rs:6:33
|
||||||
|
|
|
@ -2,19 +2,25 @@ error: unexpected `...`
|
||||||
--> $DIR/issue-70388-without-witness.rs:7:13
|
--> $DIR/issue-70388-without-witness.rs:7:13
|
||||||
|
|
|
|
||||||
LL | let Foo(...) = Foo(0);
|
LL | let Foo(...) = Foo(0);
|
||||||
| ^^^
|
| ^^^ not a valid pattern
|
||||||
| |
|
|
|
||||||
| not a valid pattern
|
help: for a rest pattern, use `..` instead of `...`
|
||||||
| help: for a rest pattern, use `..` instead of `...`
|
|
|
||||||
|
LL - let Foo(...) = Foo(0);
|
||||||
|
LL + let Foo(..) = Foo(0);
|
||||||
|
|
|
||||||
|
|
||||||
error: unexpected `...`
|
error: unexpected `...`
|
||||||
--> $DIR/issue-70388-without-witness.rs:8:13
|
--> $DIR/issue-70388-without-witness.rs:8:13
|
||||||
|
|
|
|
||||||
LL | let [_, ..., _] = [0, 1];
|
LL | let [_, ..., _] = [0, 1];
|
||||||
| ^^^
|
| ^^^ not a valid pattern
|
||||||
| |
|
|
|
||||||
| not a valid pattern
|
help: for a rest pattern, use `..` instead of `...`
|
||||||
| help: for a rest pattern, use `..` instead of `...`
|
|
|
||||||
|
LL - let [_, ..., _] = [0, 1];
|
||||||
|
LL + let [_, .., _] = [0, 1];
|
||||||
|
|
|
||||||
|
|
||||||
error: aborting due to 2 previous errors
|
error: aborting due to 2 previous errors
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,13 @@ error: unexpected lifetime `'static` in pattern
|
||||||
--> $DIR/issue-70549-resolve-after-recovered-self-ctor.rs:8:13
|
--> $DIR/issue-70549-resolve-after-recovered-self-ctor.rs:8:13
|
||||||
|
|
|
|
||||||
LL | fn bar(&'static mur Self) {}
|
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`
|
error: expected identifier, found keyword `Self`
|
||||||
--> $DIR/issue-70549-resolve-after-recovered-self-ctor.rs:8:25
|
--> $DIR/issue-70549-resolve-after-recovered-self-ctor.rs:8:25
|
||||||
|
|
|
@ -2,24 +2,38 @@ error: lifetime must precede `mut`
|
||||||
--> $DIR/issue-73568-lifetime-after-mut.rs:2:13
|
--> $DIR/issue-73568-lifetime-after-mut.rs:2:13
|
||||||
|
|
|
|
||||||
LL | fn x<'a>(x: &mut 'a i32){}
|
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`
|
error[E0178]: expected a path on the left-hand side of `+`, not `&mut 'a`
|
||||||
--> $DIR/issue-73568-lifetime-after-mut.rs:14:13
|
--> $DIR/issue-73568-lifetime-after-mut.rs:14:13
|
||||||
|
|
|
|
||||||
LL | fn y<'a>(y: &mut 'a + Send) {
|
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`
|
error: lifetime must precede `mut`
|
||||||
--> $DIR/issue-73568-lifetime-after-mut.rs:6:22
|
--> $DIR/issue-73568-lifetime-after-mut.rs:6:22
|
||||||
|
|
|
|
||||||
LL | fn w<$lt>(w: &mut $lt i32) {}
|
LL | fn w<$lt>(w: &mut $lt i32) {}
|
||||||
| ^^^^^^^^ help: place the lifetime before `mut`: `&$lt mut`
|
| ^^^^^^^^
|
||||||
...
|
...
|
||||||
LL | mac!('a);
|
LL | mac!('a);
|
||||||
| -------- in this macro invocation
|
| -------- in this macro invocation
|
||||||
|
|
|
|
||||||
= note: this error originates in the macro `mac` (in Nightly builds, run with -Z macro-backtrace for more info)
|
= 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`
|
error[E0423]: expected value, found trait `Send`
|
||||||
--> $DIR/issue-73568-lifetime-after-mut.rs:17:28
|
--> $DIR/issue-73568-lifetime-after-mut.rs:17:28
|
||||||
|
|
|
@ -2,25 +2,40 @@ error: expected `;`, found `println`
|
||||||
--> $DIR/issue-87197-missing-semicolon.rs:6:16
|
--> $DIR/issue-87197-missing-semicolon.rs:6:16
|
||||||
|
|
|
|
||||||
LL | let x = 100
|
LL | let x = 100
|
||||||
| ^ help: add `;` here
|
| ^
|
||||||
LL | println!("{}", x)
|
LL | println!("{}", x)
|
||||||
| ------- unexpected token
|
| ------- unexpected token
|
||||||
|
|
|
||||||
|
help: add `;` here
|
||||||
|
|
|
||||||
|
LL | let x = 100;
|
||||||
|
| +
|
||||||
|
|
||||||
error: expected `;`, found keyword `let`
|
error: expected `;`, found keyword `let`
|
||||||
--> $DIR/issue-87197-missing-semicolon.rs:7:22
|
--> $DIR/issue-87197-missing-semicolon.rs:7:22
|
||||||
|
|
|
|
||||||
LL | println!("{}", x)
|
LL | println!("{}", x)
|
||||||
| ^ help: add `;` here
|
| ^
|
||||||
LL | let y = 200
|
LL | let y = 200
|
||||||
| --- unexpected token
|
| --- unexpected token
|
||||||
|
|
|
||||||
|
help: add `;` here
|
||||||
|
|
|
||||||
|
LL | println!("{}", x);
|
||||||
|
| +
|
||||||
|
|
||||||
error: expected `;`, found `println`
|
error: expected `;`, found `println`
|
||||||
--> $DIR/issue-87197-missing-semicolon.rs:8:16
|
--> $DIR/issue-87197-missing-semicolon.rs:8:16
|
||||||
|
|
|
|
||||||
LL | let y = 200
|
LL | let y = 200
|
||||||
| ^ help: add `;` here
|
| ^
|
||||||
LL | println!("{}", y);
|
LL | println!("{}", y);
|
||||||
| ------- unexpected token
|
| ------- unexpected token
|
||||||
|
|
|
||||||
|
help: add `;` here
|
||||||
|
|
|
||||||
|
LL | let y = 200;
|
||||||
|
| +
|
||||||
|
|
||||||
error: aborting due to 3 previous errors
|
error: aborting due to 3 previous errors
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,12 @@ error: missing type for `const` item
|
||||||
--> $DIR/issue-89574.rs:2:22
|
--> $DIR/issue-89574.rs:2:22
|
||||||
|
|
|
|
||||||
LL | const EMPTY_ARRAY = [];
|
LL | const EMPTY_ARRAY = [];
|
||||||
| ^ help: provide a type for the item: `: <type>`
|
| ^
|
||||||
|
|
|
||||||
|
help: provide a type for the item
|
||||||
|
|
|
||||||
|
LL | const EMPTY_ARRAY: <type> = [];
|
||||||
|
| ++++++++
|
||||||
|
|
||||||
error[E0282]: type annotations needed
|
error[E0282]: type annotations needed
|
||||||
--> $DIR/issue-89574.rs:2:25
|
--> $DIR/issue-89574.rs:2:25
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue