1
Fork 0

Rollup merge of #105078 - TaKO8Ki:fix-105011, r=nnethercote

Fix `expr_to_spanned_string` ICE

Fixes #105011
This commit is contained in:
Matthias Krüger 2022-12-01 11:58:59 +01:00 committed by GitHub
commit 741f8c9166
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 19 additions and 8 deletions

View file

@ -197,12 +197,12 @@ pub enum UnleashedFeatureHelp {
#[derive(Diagnostic)]
#[diag(session_invalid_literal_suffix)]
pub(crate) struct InvalidLiteralSuffix {
pub(crate) struct InvalidLiteralSuffix<'a> {
#[primary_span]
#[label]
pub span: Span,
// FIXME(#100717)
pub kind: String,
pub kind: &'a str,
pub suffix: Symbol,
}
@ -311,11 +311,7 @@ pub fn report_lit_error(sess: &ParseSess, err: LitError, lit: token::Lit, span:
LitError::LexerError => {}
LitError::InvalidSuffix => {
if let Some(suffix) = suffix {
sess.emit_err(InvalidLiteralSuffix {
span,
kind: format!("{}", kind.descr()),
suffix,
});
sess.emit_err(InvalidLiteralSuffix { span, kind: kind.descr(), suffix });
}
}
LitError::InvalidIntSuffix => {