Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
101 commits
Select commit Hold shift + click to select a range
65a91d1
Add suggestion for E0401 on inner const items
JohnTitor Mar 8, 2026
3f7c645
Suggest public re-exports when a private module blocks an import path
jakubadamw Mar 30, 2026
70fd887
Add and update tests for public re-export suggestions on private modu…
jakubadamw Mar 30, 2026
d4617fa
Parametrise the newly added test by all four editions
jakubadamw Mar 30, 2026
d09d4c9
Update the expected results for two other tests
jakubadamw Mar 30, 2026
526f3d9
Move test files from issues/ to appropriate subdirectories
ujjwalvishwakarma2006 Apr 19, 2026
c4f6148
Add issue links
ujjwalvishwakarma2006 Apr 19, 2026
560a630
Update link to queries.rs in tracing.md
reddevilmidzy Apr 23, 2026
b7a2ece
Merge pull request rust-lang/rustc-dev-guide#2847 from rust-lang/query
reddevilmidzy Apr 23, 2026
3a55fcb
Clarify THIR element layout description
cijiugechu Apr 23, 2026
4bbca88
Merge pull request #2848 from cijiugechu/fix/thir-docs-elements-descr…
tshepang Apr 23, 2026
5736354
sembr src/thir.md
tshepang Apr 23, 2026
8679acc
sembr src/name-resolution.md
tshepang Apr 23, 2026
cd43421
missing pause
tshepang Apr 23, 2026
4bcdedb
sembr src/building/suggested.md
tshepang Apr 23, 2026
2fa6f28
sembr src/building/prerequisites.md
tshepang Apr 23, 2026
f7f2886
reflow
tshepang Apr 23, 2026
364e9eb
whose laptop
tshepang Apr 23, 2026
4ee98f7
sembr src/mir/construction.md
tshepang Apr 23, 2026
64e9964
reflow
tshepang Apr 23, 2026
5a36fea
Merge pull request #2849 from rust-lang/tshepang/sembr
tshepang Apr 23, 2026
2d1be67
Prepare for merging from rust-lang/rust
invalid-email-address Apr 24, 2026
5c30f6c
Merge ref 'd493b7c5ac63' from rust-lang/rust
invalid-email-address Apr 24, 2026
a648b65
Merge pull request #2850 from rust-lang/rustc-pull
tshepang Apr 24, 2026
f365db2
sembr src/offload/installation.md
tshepang Apr 24, 2026
01918c0
use a more correct code marker
tshepang Apr 24, 2026
1f56bde
sembr src/autodiff/installation.md
tshepang Apr 24, 2026
04a5aa6
sembr src/offload/internals.md
tshepang Apr 24, 2026
b2267ae
reflow
tshepang Apr 24, 2026
183c7e5
sembr src/offload/contributing.md
tshepang Apr 24, 2026
4bafa9e
sembr src/offload/usage.md
tshepang Apr 24, 2026
91debb5
Merge pull request #2851 from rust-lang/tshepang/sembr
tshepang Apr 24, 2026
b430a1f
Reflect code renames and API changes in panic docs
reddevilmidzy Apr 24, 2026
459c871
Merge pull request rust-lang/rustc-dev-guide#2853 from reddevilmidzy/…
reddevilmidzy Apr 24, 2026
1a681b0
Use `_mcount` as the mcount symbol name on RISC-V Linux GNU targets
lapla-cogito Apr 27, 2026
ff45649
Prepare for merging from rust-lang/rust
invalid-email-address Apr 27, 2026
183a3ed
Merge ref 'ca9a134e0985' from rust-lang/rust
invalid-email-address Apr 27, 2026
1103639
Merge pull request rust-lang/rustc-dev-guide#2854 from rust-lang/rust…
reddevilmidzy Apr 27, 2026
d3db8df
Add Fuchsia to the list of notification groups
reddevilmidzy Apr 27, 2026
300a0ff
Merge pull request rust-lang/rustc-dev-guide#2855 from rust-lang/fuchsia
reddevilmidzy Apr 27, 2026
9f9ad74
Update `CodegenBackend` path
cijiugechu Apr 28, 2026
c13cfc6
move `AstFragment::to_string` out of `ast_fragments!`
cyrgani Apr 15, 2026
712d30f
merge `$mut_visit_ast` and `$visit_ast`
cyrgani Apr 15, 2026
210f03a
smaller tweaks
cyrgani Apr 19, 2026
5ad560f
remove `MethodReceiverExpr` special-casing
cyrgani Apr 28, 2026
b072d24
Fix: On wasm targets, call `panic_in_cleanup` if panic occurs in cleanup
hoodmane Jan 27, 2026
d3992fa
Add feature gate for view_types
scrabsha Apr 28, 2026
72a59e7
move fragment printing code
cyrgani Apr 29, 2026
afd0fa1
Merge pull request #2856 from cijiugechu/codegen-backend-path
tshepang Apr 29, 2026
77fb8d1
Parse view type syntax, mark it as unstable
scrabsha Apr 29, 2026
41796ec
add `c_variadic_experimental_arch` feature
folkertdev Apr 29, 2026
6d79bc6
Move `feature*` methods from `parse` mod to `errors` mod.
nnethercote Apr 28, 2026
ee7e430
Remove unnecessary `lift` calls.
nnethercote Apr 28, 2026
a762dbf
Make lifting infallible.
nnethercote Apr 30, 2026
ef93fbb
tests/run-make/print-cfg: add Android target_env case
Vastargazing Apr 30, 2026
09e9d3f
rustdoc: preserve parent doc cfg for macro_export macros
cijiugechu Apr 30, 2026
e4eb91c
catch callback unwinding to finalize in-flight self-profiling events …
lqd Apr 29, 2026
74060d4
Fix ICE when using -Zinstrument-mcount and -Clinker-flavor=lld
pmur Apr 30, 2026
f51cf63
Allow to use `Diagnostic` directly in `SharedContext::emit_lint`
GuillaumeGomez Apr 28, 2026
c5e38b7
Pass Session to optimize_and_codegen_fat_lto
bjorn3 Apr 30, 2026
a0db15f
Prepare for merging from rust-lang/rust
invalid-email-address Apr 30, 2026
6d2abd7
Merge ref 'f53b654a8882' from rust-lang/rust
invalid-email-address Apr 30, 2026
219cd1f
Merge pull request #2859 from rust-lang/rustc-pull
tshepang Apr 30, 2026
714854d
sembr src/backend/backend-agnostic.md
tshepang Apr 30, 2026
d2b6863
"the LLVM" sounds wrong
tshepang Apr 30, 2026
dc2397c
capitalise first word in sentence
tshepang Apr 30, 2026
80f3a50
sembr src/asm.md
tshepang Apr 30, 2026
d6af96f
reflow
tshepang Apr 30, 2026
44034ec
inclusive wording
tshepang Apr 30, 2026
eb8f85e
c-variadic: document `Clone` and `Drop` instances
folkertdev Apr 26, 2026
ab19cd3
c-variadic: add a `Copy` bound to `VaArgSafe`
folkertdev Apr 26, 2026
ba9444c
c-variadic: test that const and mutable void and char pointers implem…
folkertdev Apr 26, 2026
d12e52d
reflow
tshepang Apr 30, 2026
958600a
sembr src/backend/backend-agnostic.md
tshepang Apr 30, 2026
ac12c69
remove custom `va_end` implementation in the LLVM backend
folkertdev Apr 30, 2026
373f5d3
sembr src/tests/compiletest.md
tshepang Apr 30, 2026
c4ad303
sembr src/tests/directives.md
tshepang Apr 30, 2026
cd47965
sembr src/panic-implementation.md
tshepang Apr 30, 2026
c0e3f05
reflow
tshepang Apr 30, 2026
8eedc9f
Merge pull request #2860 from rust-lang/tshepang/sembr
tshepang Apr 30, 2026
9454be3
Invert dependency between `rustc_error_messages` and `rustc_ast*`.
nnethercote Apr 13, 2026
339797e
Eliminate `rustc_lint_defs`' dependency on `rustc_ast`.
nnethercote Apr 13, 2026
f5304d2
Rollup merge of #155237 - nnethercote:ast-errors-rejig, r=petrochenkov
jhpratt May 1, 2026
0649c3f
Rollup merge of #155249 - hoodmane:wasm-panic-in-cleanup-reland, r=bj…
jhpratt May 1, 2026
6e290de
Rollup merge of #155853 - lapla-cogito:rv_mcount, r=mati865
jhpratt May 1, 2026
d0836bb
Rollup merge of #155919 - cyrgani:ast-fragments, r=petrochenkov
jhpratt May 1, 2026
f7b1e7d
Rollup merge of #155939 - scrabsha:view-types/feature-gate, r=nikomat…
jhpratt May 1, 2026
0a05ddf
Rollup merge of #155954 - cijiugechu:doc_cfg-decl-macro, r=notriddle
jhpratt May 1, 2026
fae8c6e
Rollup merge of #155974 - folkertdev:c-variadic-experimental-arch, r=…
jhpratt May 1, 2026
4e12409
Rollup merge of #155991 - lqd:in-flight-query-profiling, r=bjorn3
jhpratt May 1, 2026
560cc23
Rollup merge of #156003 - bjorn3:lto_refactors17, r=lqd
jhpratt May 1, 2026
248756d
Rollup merge of #153566 - JohnTitor:sugg-generic-params-from-outer-it…
jhpratt May 1, 2026
654c350
Rollup merge of #154610 - jakubadamw:issue-13065, r=TaKO8Ki
jhpratt May 1, 2026
5b91e27
Rollup merge of #155523 - ujjwalvishwakarma2006:reorg-tests-02, r=Kiv…
jhpratt May 1, 2026
0ab1a47
Rollup merge of #155821 - folkertdev:doc-va-list-clone, r=joshtriplett
jhpratt May 1, 2026
894bdf2
Rollup merge of #155980 - nnethercote:mv-feature-methods, r=TaKO8Ki
jhpratt May 1, 2026
96b94a8
Rollup merge of #155987 - nnethercote:infallible-Lifting, r=oli-obk
jhpratt May 1, 2026
b39cdf5
Rollup merge of #155988 - Vastargazing:tests/android-target-env-print…
jhpratt May 1, 2026
cf60705
Rollup merge of #156000 - pmur:murp/fix-155972, r=wesleywiser
jhpratt May 1, 2026
a89e69e
Rollup merge of #156002 - GuillaumeGomez:diagnostic-instead-of-closur…
jhpratt May 1, 2026
fbde425
Rollup merge of #156015 - tshepang:rdg-sync, r=tshepang
jhpratt May 1, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3853,8 +3853,6 @@ dependencies = [
"icu_list",
"icu_locale",
"intl-memoizer",
"rustc_ast",
"rustc_ast_pretty",
"rustc_baked_icu_data",
"rustc_data_structures",
"rustc_macros",
Expand Down Expand Up @@ -4186,7 +4184,6 @@ dependencies = [
name = "rustc_lint_defs"
version = "0.0.0"
dependencies = [
"rustc_ast",
"rustc_data_structures",
"rustc_error_messages",
"rustc_hir_id",
Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_abi/src/extern_abi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ impl StableOrd for ExternAbi {
rustc_error_messages::into_diag_arg_using_display!(ExternAbi);

#[cfg(feature = "nightly")]
#[derive(Debug)]
pub enum CVariadicStatus {
NotSupported,
Stable,
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_ast_lowering/src/asm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use rustc_data_structures::fx::{FxHashMap, FxHashSet, FxIndexMap};
use rustc_errors::msg;
use rustc_hir as hir;
use rustc_hir::def::{DefKind, Res};
use rustc_session::parse::feature_err;
use rustc_session::errors::feature_err;
use rustc_span::{Span, sym};
use rustc_target::asm;

Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_ast_lowering/src/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1693,7 +1693,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
&& !self.tcx.features().coroutines()
&& !self.tcx.features().gen_blocks()
{
rustc_session::parse::feature_err(
rustc_session::errors::feature_err(
&self.tcx.sess,
sym::yield_expr,
span,
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_ast_lowering/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ use rustc_macros::extension;
use rustc_middle::hir::{self as mid_hir};
use rustc_middle::span_bug;
use rustc_middle::ty::{DelegationInfo, ResolverAstLowering, TyCtxt};
use rustc_session::parse::add_feature_diagnostics;
use rustc_session::errors::add_feature_diagnostics;
use rustc_span::symbol::{Ident, Symbol, kw, sym};
use rustc_span::{DUMMY_SP, DesugaringKind, Span};
use smallvec::SmallVec;
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_ast_lowering/src/path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use rustc_hir::def::{DefKind, PartialRes, PerNS, Res};
use rustc_hir::def_id::DefId;
use rustc_hir::{self as hir, GenericArg};
use rustc_middle::{span_bug, ty};
use rustc_session::parse::add_feature_diagnostics;
use rustc_session::errors::add_feature_diagnostics;
use rustc_span::{BytePos, DUMMY_SP, DesugaringKind, Ident, Span, Symbol, sym};
use smallvec::smallvec;
use tracing::{debug, instrument};
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_ast_lowering/src/stability.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::fmt;
use rustc_abi::ExternAbi;
use rustc_feature::Features;
use rustc_session::Session;
use rustc_session::parse::feature_err;
use rustc_session::errors::feature_err;
use rustc_span::symbol::sym;
use rustc_span::{Span, Symbol};

Expand Down
29 changes: 20 additions & 9 deletions compiler/rustc_ast_passes/src/ast_validation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ use rustc_data_structures::fx::FxIndexMap;
use rustc_errors::{DiagCtxtHandle, Diagnostic, LintBuffer};
use rustc_feature::Features;
use rustc_session::Session;
use rustc_session::errors::feature_err;
use rustc_session::lint::builtin::{
DEPRECATED_WHERE_CLAUSE_LOCATION, MISSING_ABI, MISSING_UNSAFE_ON_EXTERN,
PATTERNS_IN_FNS_WITHOUT_BODY, UNUSED_VISIBILITIES,
};
use rustc_session::parse::feature_err;
use rustc_span::{Ident, Span, kw, sym};
use rustc_target::spec::{AbiMap, AbiMapping};
use thin_vec::thin_vec;
Expand Down Expand Up @@ -762,12 +762,23 @@ impl<'a> AstValidator<'a> {
match fn_ctxt {
FnCtxt::Foreign => return,
FnCtxt::Free | FnCtxt::Assoc(_) => {
if !self.sess.target.supports_c_variadic_definitions() {
self.dcx().emit_err(errors::CVariadicNotSupported {
variadic_span: variadic_param.span,
target: &*self.sess.target.llvm_target,
});
return;
match self.sess.target.supports_c_variadic_definitions() {
CVariadicStatus::NotSupported => {
self.dcx().emit_err(errors::CVariadicNotSupported {
variadic_span: variadic_param.span,
target: &*self.sess.target.llvm_target,
});
return;
}
CVariadicStatus::Unstable { feature } if !self.features.enabled(feature) => {
let msg =
format!("C-variadic function definitions on this target are unstable");
feature_err(&self.sess, feature, variadic_param.span, msg).emit();
return;
}
CVariadicStatus::Unstable { .. } | CVariadicStatus::Stable => {
/* fall through */
}
}

match sig.header.ext {
Expand Down Expand Up @@ -1117,8 +1128,8 @@ fn validate_generic_param_order(dcx: DiagCtxtHandle<'_>, generics: &[GenericPara
dcx.emit_err(errors::OutOfOrderParams {
spans: spans.clone(),
sugg_span: span,
param_ord,
max_param,
param_ord: param_ord.to_string(),
max_param: max_param.to_string(),
ordered_params: &ordered_params,
});
}
Expand Down
5 changes: 2 additions & 3 deletions compiler/rustc_ast_passes/src/errors.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
//! Errors emitted by ast_passes.

use rustc_abi::ExternAbi;
use rustc_ast::ParamKindOrd;
use rustc_errors::codes::*;
use rustc_errors::{Applicability, Diag, EmissionGuarantee, Subdiagnostic};
use rustc_macros::{Diagnostic, Subdiagnostic};
Expand Down Expand Up @@ -632,8 +631,8 @@ pub(crate) struct OutOfOrderParams<'a> {
applicability = "machine-applicable"
)]
pub sugg_span: Span,
pub param_ord: &'a ParamKindOrd,
pub max_param: &'a ParamKindOrd,
pub param_ord: String,
pub max_param: String,
pub ordered_params: &'a str,
}

Expand Down
3 changes: 2 additions & 1 deletion compiler/rustc_ast_passes/src/feature_gate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use rustc_feature::{AttributeGate, BUILTIN_ATTRIBUTE_MAP, BuiltinAttribute, Feat
use rustc_hir::Attribute;
use rustc_hir::attrs::AttributeKind;
use rustc_session::Session;
use rustc_session::parse::{feature_err, feature_warn};
use rustc_session::errors::{feature_err, feature_warn};
use rustc_span::{Span, Spanned, Symbol, sym};
use thin_vec::ThinVec;

Expand Down Expand Up @@ -510,6 +510,7 @@ pub fn check_crate(krate: &ast::Crate, sess: &Session, features: &Features) {
gate_all!(try_blocks_heterogeneous, "`try bikeshed` expression is experimental");
gate_all!(unsafe_binders, "unsafe binder types are experimental");
gate_all!(unsafe_fields, "`unsafe` fields are experimental");
gate_all!(view_types, "view types are experimental");
gate_all!(where_clause_attrs, "attributes in `where` clause are unstable");
gate_all!(yeet_expr, "`do yeet` expression is experimental");
// tidy-alphabetical-end
Expand Down
3 changes: 2 additions & 1 deletion compiler/rustc_attr_parsing/src/attributes/cfg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ use rustc_parse::parser::{ForceCollect, Parser, Recovery};
use rustc_parse::{exp, parse_in};
use rustc_session::Session;
use rustc_session::config::ExpectedValues;
use rustc_session::errors::feature_err;
use rustc_session::lint::builtin::UNEXPECTED_CFGS;
use rustc_session::parse::{ParseSess, feature_err};
use rustc_session::parse::ParseSess;
use rustc_span::{ErrorGuaranteed, Span, Symbol, sym};
use thin_vec::ThinVec;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use rustc_hir::attrs::{CoverageAttrKind, OptimizeAttr, RtsanSetting, SanitizerSet, UsedBy};
use rustc_session::parse::feature_err;
use rustc_session::errors::feature_err;
use rustc_span::edition::Edition::Edition2024;

use super::prelude::*;
Expand Down
9 changes: 2 additions & 7 deletions compiler/rustc_attr_parsing/src/attributes/crate_level.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use rustc_errors::Diagnostic;
use rustc_hir::attrs::{CrateType, WindowsSubsystemKind};
use rustc_session::lint::builtin::UNKNOWN_CRATE_TYPES;
use rustc_span::Symbol;
Expand Down Expand Up @@ -61,12 +60,8 @@ impl CombineAttributeParser for CrateTypeParser {
let span = n.value_span;
cx.emit_lint(
UNKNOWN_CRATE_TYPES,
move |dcx, level| {
UnknownCrateTypes {
sugg: candidate
.map(|s| UnknownCrateTypesSuggestion { span, snippet: s }),
}
.into_diag(dcx, level)
UnknownCrateTypes {
sugg: candidate.map(|s| UnknownCrateTypesSuggestion { span, snippet: s }),
},
span,
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use rustc_errors::Diagnostic;
use rustc_feature::{AttributeTemplate, template};
use rustc_hir::Target;
use rustc_hir::attrs::AttributeKind;
Expand Down Expand Up @@ -26,7 +25,7 @@ impl SingleAttributeParser for DoNotRecommendParser {
if !matches!(args, ArgParser::NoArgs) {
cx.emit_lint(
MALFORMED_DIAGNOSTIC_ATTRIBUTES,
|dcx, level| crate::errors::DoNotRecommendDoesNotExpectArgs.into_diag(dcx, level),
crate::errors::DoNotRecommendDoesNotExpectArgs,
attr_span,
);
}
Expand All @@ -35,9 +34,7 @@ impl SingleAttributeParser for DoNotRecommendParser {
let target_span = cx.target_span;
cx.emit_lint(
MISPLACED_DIAGNOSTIC_ATTRIBUTES,
move |dcx, level| {
IncorrectDoNotRecommendLocation { target_span }.into_diag(dcx, level)
},
IncorrectDoNotRecommendLocation { target_span },
attr_span,
);
return None;
Expand Down
61 changes: 21 additions & 40 deletions compiler/rustc_attr_parsing/src/attributes/diagnostic/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::ops::Range;

use rustc_errors::{Diagnostic, E0232};
use rustc_errors::E0232;
use rustc_hir::AttrPath;
use rustc_hir::attrs::diagnostic::{
Directive, FilterFormatString, Flag, FormatArg, FormatString, LitOrArg, Name, NameValue,
Expand Down Expand Up @@ -142,10 +142,7 @@ fn merge<T>(
let first_span = *first_span;
cx.emit_lint(
MALFORMED_DIAGNOSTIC_ATTRIBUTES,
move |dcx, level| {
IgnoredDiagnosticOption { first_span, later_span, option_name }
.into_diag(dcx, level)
},
IgnoredDiagnosticOption { first_span, later_span, option_name },
later_span,
);
}
Expand All @@ -169,33 +166,27 @@ fn parse_list<'p>(
// if the user used non-metaitem syntax. See `ArgParser::from_attr_args`.
cx.emit_lint(
MALFORMED_DIAGNOSTIC_ATTRIBUTES,
move |dcx, level| NonMetaItemDiagnosticAttribute.into_diag(dcx, level),
NonMetaItemDiagnosticAttribute,
list.span,
);
}
ArgParser::NoArgs => {
cx.emit_lint(
MALFORMED_DIAGNOSTIC_ATTRIBUTES,
move |dcx, level| {
MissingOptionsForDiagnosticAttribute {
attribute: mode.as_str(),
options: mode.expected_options(),
}
.into_diag(dcx, level)
MissingOptionsForDiagnosticAttribute {
attribute: mode.as_str(),
options: mode.expected_options(),
},
span,
);
}
ArgParser::NameValue(_) => {
cx.emit_lint(
MALFORMED_DIAGNOSTIC_ATTRIBUTES,
move |dcx, level| {
MalFormedDiagnosticAttributeLint {
attribute: mode.as_str(),
options: mode.allowed_options(),
span,
}
.into_diag(dcx, level)
MalFormedDiagnosticAttributeLint {
attribute: mode.as_str(),
options: mode.allowed_options(),
span,
},
span,
);
Expand Down Expand Up @@ -223,13 +214,10 @@ fn parse_directive_items<'p>(
macro malformed() {{
cx.emit_lint(
MALFORMED_DIAGNOSTIC_ATTRIBUTES,
move |dcx, level| {
MalFormedDiagnosticAttributeLint {
attribute: mode.as_str(),
options: mode.allowed_options(),
span,
}
.into_diag(dcx, level)
MalFormedDiagnosticAttributeLint {
attribute: mode.as_str(),
options: mode.allowed_options(),
span,
},
span,
);
Expand All @@ -251,11 +239,11 @@ fn parse_directive_items<'p>(
let first_span = $($first_span)*;
cx.emit_lint(
MALFORMED_DIAGNOSTIC_ATTRIBUTES,
move |dcx, level| IgnoredDiagnosticOption {
IgnoredDiagnosticOption {
first_span,
later_span: span,
option_name: $name,
}.into_diag(dcx, level),
},
span,
);
}}
Expand Down Expand Up @@ -285,25 +273,18 @@ fn parse_directive_items<'p>(
| FormatWarning::PositionalArgument { span }
| FormatWarning::IndexedArgument { span }
| FormatWarning::DisallowedPlaceholder { span, .. }) = warning;
cx.emit_lint(
MALFORMED_DIAGNOSTIC_FORMAT_LITERALS,
move |dcx, level| warning.into_diag(dcx, level),
span,
);
cx.emit_lint(MALFORMED_DIAGNOSTIC_FORMAT_LITERALS, warning, span);
}

f
}
Err(e) => {
cx.emit_lint(
MALFORMED_DIAGNOSTIC_FORMAT_LITERALS,
move |dcx, level| {
WrappedParserError {
description: &e.description,
label: &e.label,
span: slice_span(input.span, e.span.clone(), is_snippet),
}
.into_diag(dcx, level)
WrappedParserError {
description: e.description,
label: e.label,
span: slice_span(input.span, e.span.clone(), is_snippet),
},
input.span,
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use rustc_errors::Diagnostic;
use rustc_hir::attrs::diagnostic::Directive;
use rustc_session::lint::builtin::MISPLACED_DIAGNOSTIC_ATTRIBUTES;

Expand Down Expand Up @@ -30,9 +29,7 @@ impl AttributeParser for OnConstParser {
let target_span = cx.target_span;
cx.emit_lint(
MISPLACED_DIAGNOSTIC_ATTRIBUTES,
move |dcx, level| {
DiagnosticOnConstOnlyForTraitImpls { target_span }.into_diag(dcx, level)
},
DiagnosticOnConstOnlyForTraitImpls { target_span },
span,
);
return;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use rustc_errors::Diagnostic;
use rustc_feature::template;
use rustc_hir::attrs::AttributeKind;
use rustc_session::lint::builtin::MISPLACED_DIAGNOSTIC_ATTRIBUTES;
Expand Down Expand Up @@ -28,11 +27,7 @@ impl OnMoveParser {
self.span = Some(span);

if !matches!(cx.target, Target::Enum | Target::Struct | Target::Union) {
cx.emit_lint(
MISPLACED_DIAGNOSTIC_ATTRIBUTES,
move |dcx, level| DiagnosticOnMoveOnlyForAdt.into_diag(dcx, level),
span,
);
cx.emit_lint(MISPLACED_DIAGNOSTIC_ATTRIBUTES, DiagnosticOnMoveOnlyForAdt, span);
return;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use rustc_errors::Diagnostic;
use rustc_hir::attrs::diagnostic::Directive;
use rustc_session::lint::builtin::MISPLACED_DIAGNOSTIC_ATTRIBUTES;

Expand All @@ -20,7 +19,7 @@ impl OnUnimplementedParser {
if !matches!(cx.target, Target::Trait) {
cx.emit_lint(
MISPLACED_DIAGNOSTIC_ATTRIBUTES,
move |dcx, level| DiagnosticOnUnimplementedOnlyForTraits.into_diag(dcx, level),
DiagnosticOnUnimplementedOnlyForTraits,
span,
);
return;
Expand Down
Loading
Loading