Skip to content

Commit 7fabdea

Browse files
committed
Remove non-useful code path.
It has no effect on anything in the test suite.
1 parent 5ce244d commit 7fabdea

File tree

3 files changed

+0
-19
lines changed

3 files changed

+0
-19
lines changed

compiler/rustc_parse/messages.ftl

-2
Original file line numberDiff line numberDiff line change
@@ -390,8 +390,6 @@ parse_invalid_dyn_keyword = invalid `dyn` keyword
390390
parse_invalid_expression_in_let_else = a `{$operator}` expression cannot be directly assigned in `let...else`
391391
parse_invalid_identifier_with_leading_number = identifiers cannot start with a number
392392
393-
parse_invalid_interpolated_expression = invalid interpolated expression
394-
395393
parse_invalid_literal_suffix_on_tuple_index = suffixes on a tuple index are invalid
396394
.label = invalid suffix `{$suffix}`
397395
.tuple_exception_line_1 = `{$suffix}` is *temporarily* accepted on tuple index fields as it was incorrectly accepted on stable for a few releases

compiler/rustc_parse/src/errors.rs

-7
Original file line numberDiff line numberDiff line change
@@ -850,13 +850,6 @@ pub(crate) struct StructLiteralNotAllowedHereSugg {
850850
pub right: Span,
851851
}
852852

853-
#[derive(Diagnostic)]
854-
#[diag(parse_invalid_interpolated_expression)]
855-
pub(crate) struct InvalidInterpolatedExpression {
856-
#[primary_span]
857-
pub span: Span,
858-
}
859-
860853
#[derive(Diagnostic)]
861854
#[diag(parse_invalid_literal_suffix_on_tuple_index)]
862855
pub(crate) struct InvalidLiteralSuffixOnTupleIndex {

compiler/rustc_parse/src/parser/expr.rs

-10
Original file line numberDiff line numberDiff line change
@@ -2040,16 +2040,6 @@ impl<'a> Parser<'a> {
20402040
&mut self,
20412041
mk_lit_char: impl FnOnce(Symbol, Span) -> L,
20422042
) -> PResult<'a, L> {
2043-
if let token::Interpolated(nt) = &self.token.kind
2044-
&& let token::NtExpr(e) | token::NtLiteral(e) = &nt.0
2045-
&& matches!(e.kind, ExprKind::Err(_))
2046-
{
2047-
let mut err = self
2048-
.dcx()
2049-
.create_err(errors::InvalidInterpolatedExpression { span: self.token.span });
2050-
err.downgrade_to_delayed_bug();
2051-
return Err(err);
2052-
}
20532043
let token = self.token.clone();
20542044
let err = |self_: &Self| {
20552045
let msg = format!("unexpected token: {}", super::token_descr(&token));

0 commit comments

Comments
 (0)