1
Fork 0

Rollup merge of #110124 - Nilstrieb:📎-told-me-so, r=compiler-errors

Some clippy fixes in the compiler

Best reviewed commit-by-commit 📎.
This commit is contained in:
Dylan DPC 2023-04-10 14:13:16 +05:30 committed by GitHub
commit 97921abc06
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
54 changed files with 141 additions and 139 deletions

View file

@ -1426,7 +1426,7 @@ pub fn rustc_short_optgroups() -> Vec<RustcOptGroup> {
opt::opt_s(
"",
"edition",
&*EDITION_STRING,
&EDITION_STRING,
EDITION_NAME_LIST,
),
opt::multi_s(

View file

@ -84,12 +84,12 @@ impl SymbolGallery {
/// Construct a diagnostic for a language feature error due to the given `span`.
/// The `feature`'s `Symbol` is the one you used in `active.rs` and `rustc_span::symbols`.
pub fn feature_err<'a>(
sess: &'a ParseSess,
pub fn feature_err(
sess: &ParseSess,
feature: Symbol,
span: impl Into<MultiSpan>,
explain: impl Into<DiagnosticMessage>,
) -> DiagnosticBuilder<'a, ErrorGuaranteed> {
) -> DiagnosticBuilder<'_, ErrorGuaranteed> {
feature_err_issue(sess, feature, span, GateIssue::Language, explain)
}
@ -98,20 +98,21 @@ pub fn feature_err<'a>(
/// This variant allows you to control whether it is a library or language feature.
/// Almost always, you want to use this for a language feature. If so, prefer `feature_err`.
#[track_caller]
pub fn feature_err_issue<'a>(
sess: &'a ParseSess,
pub fn feature_err_issue(
sess: &ParseSess,
feature: Symbol,
span: impl Into<MultiSpan>,
issue: GateIssue,
explain: impl Into<DiagnosticMessage>,
) -> DiagnosticBuilder<'a, ErrorGuaranteed> {
) -> DiagnosticBuilder<'_, ErrorGuaranteed> {
let span = span.into();
// Cancel an earlier warning for this same error, if it exists.
if let Some(span) = span.primary_span() {
sess.span_diagnostic
.steal_diagnostic(span, StashKey::EarlySyntaxWarning)
.map(|err| err.cancel());
if let Some(err) = sess.span_diagnostic.steal_diagnostic(span, StashKey::EarlySyntaxWarning)
{
err.cancel()
}
}
let mut err = sess.create_err(FeatureGateError { span, explain: explain.into() });