Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
52525bd
Codegen tests for Arm Cortex-R82
jonathanpallant Jan 19, 2026
5f76adf
fix adk installer link
reddevilmidzy Jan 30, 2026
c57471e
Merge pull request #2751 from reddevilmidzy/fix
reddevilmidzy Jan 30, 2026
5cb9163
Fix typo in debugging.md
thealtofwar Jan 31, 2026
c8d2f3e
Prepare for merging from rust-lang/rust
invalid-email-address Jan 31, 2026
678328a
Merge ref '44e34e1ac6d7' from rust-lang/rust
invalid-email-address Jan 31, 2026
8a133ce
Merge pull request #2753 from rust-lang/rustc-pull
tshepang Jan 31, 2026
a77b9e6
Fix tense
ada4a Jan 31, 2026
48a76d2
Merge pull request #2752 from thealtofwar/patch-1
reddevilmidzy Jan 31, 2026
3f3a544
Merge pull request #2754 from ada4a/patch-3
jyn514 Jan 31, 2026
4cf181b
suggested.md: improve a bit
tshepang Jan 31, 2026
15bba04
Merge pull request #2757 from rust-lang/tshepang-patch-2
tshepang Jan 31, 2026
b4bf57b
Move the `fingerprint_style` special case into `DepKindVTable` creation
Zalathar Jan 25, 2026
2292d53
Add codegen test for SLP vectorization
chahar-ritik Feb 1, 2026
0a60bd6
fix: remove trailing newline for tidy
chahar-ritik Feb 1, 2026
1c396d2
Restrict test to x86_64 per reviewer feedback
chahar-ritik Feb 1, 2026
f3b7a1a
Update documentation for `Result::ok()`
clundin55 Feb 2, 2026
c64f9a0
Add backlink to issue
chahar-ritik Feb 2, 2026
0cbbe56
Work around rustfmt giving up on a large expression
Zalathar Feb 2, 2026
95ac567
Fix SLP vectorization test CHECK patterns
chahar-ritik Feb 2, 2026
0830a5a
fix: add min-llvm-version
chahar-ritik Feb 2, 2026
4956604
external-rustc-drivers.md: some improvements
tshepang Jan 31, 2026
0e10f69
Merge pull request #2756 from rust-lang/tshepang-patch-1
tshepang Feb 2, 2026
6176945
fix: remove space for tidy and only for x86_64
chahar-ritik Feb 2, 2026
5aba6b1
Fix missing unused_variables lint when using a match guard
eggyal Feb 2, 2026
8476e89
Update min-llvm-version: 22
chahar-ritik Feb 2, 2026
30ae46f
Use rustc_parse's Recovery instead of a boolean
mejrs Feb 2, 2026
aef8217
Pass `Recovery` down to rustc_parse's Parser
mejrs Feb 2, 2026
bdd19d0
clarity that the neon extension is present
japaric Feb 2, 2026
6490e0e
stabilize ptr_as_ref_unchecked
RalfJung Feb 2, 2026
06fe819
use sentence case for titles
tshepang Feb 2, 2026
6b1d405
Port rustc_preserve_ub_checks to attr parser.
Ozzy1423 Feb 2, 2026
adb3861
sembr src/profiling/wpa-profiling.md
tshepang Feb 2, 2026
f599313
Make parser naming consistent for dump parsers.
Ozzy1423 Feb 2, 2026
957f28c
add some pauses
tshepang Feb 2, 2026
f285d5d
provide the full path
tshepang Feb 2, 2026
6169f2e
sembr src/effects.md
tshepang Feb 2, 2026
5143080
some improvements
tshepang Feb 2, 2026
06d17c0
use convenient notation, as seen in bootstrap.example.toml
tshepang Feb 2, 2026
ed50cc9
I do not expect there will be any confusion
tshepang Feb 2, 2026
ca24637
sembr src/backend/debugging.md
tshepang Feb 2, 2026
4c958e7
this is text with multiple authors
tshepang Feb 2, 2026
b658d15
a symlink is now helpfully provided
tshepang Feb 2, 2026
c305590
more clean
tshepang Feb 2, 2026
b55c621
reflow
tshepang Feb 2, 2026
616954b
whitespace
tshepang Feb 2, 2026
9bafb77
sembr src/backend/updating-llvm.md
tshepang Feb 2, 2026
299b429
sembr src/building/how-to-build-and-run.md
tshepang Feb 2, 2026
d4ff9c8
less awkward
tshepang Feb 2, 2026
e83ee8a
missing pause
tshepang Feb 2, 2026
222e521
sembr src/building/optimized-build.md
tshepang Feb 2, 2026
670fec6
reflow
tshepang Feb 2, 2026
a2fa618
sembr src/compiler-debugging.md
tshepang Feb 2, 2026
faea313
whitespace
tshepang Feb 2, 2026
8c322fc
sembr src/llvm-coverage-instrumentation.md
tshepang Feb 2, 2026
4876061
replace html with markdown
tshepang Feb 2, 2026
0c6e040
sembr src/profiling.md
tshepang Feb 2, 2026
809bf79
sembr src/tests/docker.md
tshepang Feb 2, 2026
06af960
sounds better as separate sentences
tshepang Feb 2, 2026
3ea1571
reflow
tshepang Feb 2, 2026
060ca1f
Merge pull request #2762 from rust-lang/tshepang/sembr
tshepang Feb 2, 2026
89799e9
Merge pull request #2760 from rust-lang/tshepang-patch-1
tshepang Feb 2, 2026
28feae0
Move bigint helper tracking issues
clarfonthey Feb 2, 2026
c908ea2
Rollup merge of #151378 - ferrocene:add-cortexr82-testing, r=jdonszel…
jhpratt Feb 3, 2026
91a2ec3
Rollup merge of #151936 - Zalathar:fingerprint-style, r=petrochenkov
jhpratt Feb 3, 2026
b75cdc9
Rollup merge of #152018 - clarfonthey:bigint-tracking-issues, r=scottmcm
jhpratt Feb 3, 2026
e2c5b89
Rollup merge of #151958 - chahar-ritik:add-slp-vectorization-test, r=…
jhpratt Feb 3, 2026
7fd1009
Rollup merge of #151974 - clundin55:doc-fix, r=jhpratt
jhpratt Feb 3, 2026
4923aec
Rollup merge of #151975 - Zalathar:interface-fmt, r=BoxyUwU
jhpratt Feb 3, 2026
b73b822
Rollup merge of #151990 - eggyal:unused-in-match-with-guard, r=nnethe…
jhpratt Feb 3, 2026
5559034
Rollup merge of #151995 - RalfJung:ptr_as_ref_unchecked, r=jhpratt
jhpratt Feb 3, 2026
cbebacd
Rollup merge of #151999 - mejrs:ignore_nonmeta_v2, r=JonathanBrouwer
jhpratt Feb 3, 2026
9e21300
Rollup merge of #152009 - Ozzy1423:attrs4, r=JonathanBrouwer
jhpratt Feb 3, 2026
3b8a503
Rollup merge of #152022 - tshepang:rdg-sync, r=tshepang
jhpratt Feb 3, 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
10 changes: 6 additions & 4 deletions compiler/rustc_attr_parsing/src/attributes/cfg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use rustc_feature::{
use rustc_hir::attrs::CfgEntry;
use rustc_hir::lints::AttributeLintKind;
use rustc_hir::{AttrPath, RustcVersion, Target};
use rustc_parse::parser::{ForceCollect, Parser};
use rustc_parse::parser::{ForceCollect, Parser, Recovery};
use rustc_parse::{exp, parse_in};
use rustc_session::Session;
use rustc_session::config::ExpectedValues;
Expand Down Expand Up @@ -360,8 +360,10 @@ fn parse_cfg_attr_internal<'a>(
) -> PResult<'a, (CfgEntry, Vec<(ast::AttrItem, Span)>)> {
// Parse cfg predicate
let pred_start = parser.token.span;
let meta =
MetaItemOrLitParser::parse_single(parser, ShouldEmit::ErrorsAndLints { recover: true })?;
let meta = MetaItemOrLitParser::parse_single(
parser,
ShouldEmit::ErrorsAndLints { recovery: Recovery::Allowed },
)?;
let pred_span = pred_start.with_hi(parser.token.span.hi());

let cfg_predicate = AttributeParser::parse_single_args(
Expand All @@ -376,7 +378,7 @@ fn parse_cfg_attr_internal<'a>(
CRATE_NODE_ID,
Target::Crate,
features,
ShouldEmit::ErrorsAndLints { recover: true },
ShouldEmit::ErrorsAndLints { recovery: Recovery::Allowed },
&meta,
parse_cfg_entry,
&CFG_ATTR_TEMPLATE,
Expand Down
12 changes: 7 additions & 5 deletions compiler/rustc_attr_parsing/src/attributes/cfg_select.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use rustc_feature::{AttributeTemplate, Features};
use rustc_hir::attrs::CfgEntry;
use rustc_hir::{AttrPath, Target};
use rustc_parse::exp;
use rustc_parse::parser::Parser;
use rustc_parse::parser::{Parser, Recovery};
use rustc_session::Session;
use rustc_span::{ErrorGuaranteed, Span, sym};

Expand Down Expand Up @@ -78,9 +78,11 @@ pub fn parse_cfg_select(
}
}
} else {
let meta =
MetaItemOrLitParser::parse_single(p, ShouldEmit::ErrorsAndLints { recover: true })
.map_err(|diag| diag.emit())?;
let meta = MetaItemOrLitParser::parse_single(
p,
ShouldEmit::ErrorsAndLints { recovery: Recovery::Allowed },
)
.map_err(|diag| diag.emit())?;
let cfg_span = meta.span();
let cfg = AttributeParser::parse_single_args(
sess,
Expand All @@ -95,7 +97,7 @@ pub fn parse_cfg_select(
// Doesn't matter what the target actually is here.
Target::Crate,
features,
ShouldEmit::ErrorsAndLints { recover: true },
ShouldEmit::ErrorsAndLints { recovery: Recovery::Allowed },
&meta,
parse_cfg_entry,
&AttributeTemplate::default(),
Expand Down
9 changes: 9 additions & 0 deletions compiler/rustc_attr_parsing/src/attributes/crate_level.rs
Original file line number Diff line number Diff line change
Expand Up @@ -274,3 +274,12 @@ impl<S: Stage> NoArgsAttributeParser<S> for NoBuiltinsParser {
const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowList(&[Allow(Target::Crate)]);
const CREATE: fn(Span) -> AttributeKind = |_| AttributeKind::NoBuiltins;
}

pub(crate) struct RustcPreserveUbChecksParser;

impl<S: Stage> NoArgsAttributeParser<S> for RustcPreserveUbChecksParser {
const PATH: &[Symbol] = &[sym::rustc_preserve_ub_checks];
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Error;
const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowList(&[Allow(Target::Crate)]);
const CREATE: fn(Span) -> AttributeKind = |_| AttributeKind::RustcPreserveUbChecks;
}
20 changes: 10 additions & 10 deletions compiler/rustc_attr_parsing/src/attributes/rustc_dump.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,36 +7,36 @@ use crate::attributes::{NoArgsAttributeParser, OnDuplicate};
use crate::context::Stage;
use crate::target_checking::AllowedTargets;

pub(crate) struct RustcDumpUserArgs;
pub(crate) struct RustcDumpUserArgsParser;

impl<S: Stage> NoArgsAttributeParser<S> for RustcDumpUserArgs {
impl<S: Stage> NoArgsAttributeParser<S> for RustcDumpUserArgsParser {
const PATH: &[Symbol] = &[sym::rustc_dump_user_args];
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Error;
const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowList(&[Allow(Target::Fn)]);
const CREATE: fn(Span) -> AttributeKind = |_| AttributeKind::RustcDumpUserArgs;
}

pub(crate) struct RustcDumpDefParents;
pub(crate) struct RustcDumpDefParentsParser;

impl<S: Stage> NoArgsAttributeParser<S> for RustcDumpDefParents {
impl<S: Stage> NoArgsAttributeParser<S> for RustcDumpDefParentsParser {
const PATH: &[Symbol] = &[sym::rustc_dump_def_parents];
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Error;
const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowList(&[Allow(Target::Fn)]);
const CREATE: fn(Span) -> AttributeKind = |_| AttributeKind::RustcDumpDefParents;
}

pub(crate) struct RustcDumpItemBounds;
pub(crate) struct RustcDumpItemBoundsParser;

impl<S: Stage> NoArgsAttributeParser<S> for RustcDumpItemBounds {
impl<S: Stage> NoArgsAttributeParser<S> for RustcDumpItemBoundsParser {
const PATH: &[Symbol] = &[sym::rustc_dump_item_bounds];
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Error;
const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowList(&[Allow(Target::AssocTy)]);
const CREATE: fn(Span) -> AttributeKind = |_| AttributeKind::RustcDumpItemBounds;
}

pub(crate) struct RustcDumpPredicates;
pub(crate) struct RustcDumpPredicatesParser;

impl<S: Stage> NoArgsAttributeParser<S> for RustcDumpPredicates {
impl<S: Stage> NoArgsAttributeParser<S> for RustcDumpPredicatesParser {
const PATH: &[Symbol] = &[sym::rustc_dump_predicates];
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Error;
const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowList(&[
Expand All @@ -49,9 +49,9 @@ impl<S: Stage> NoArgsAttributeParser<S> for RustcDumpPredicates {
const CREATE: fn(Span) -> AttributeKind = |_| AttributeKind::RustcDumpPredicates;
}

pub(crate) struct RustcDumpVtable;
pub(crate) struct RustcDumpVtableParser;

impl<S: Stage> NoArgsAttributeParser<S> for RustcDumpVtable {
impl<S: Stage> NoArgsAttributeParser<S> for RustcDumpVtableParser {
const PATH: &[Symbol] = &[sym::rustc_dump_vtable];
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Error;
const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowList(&[
Expand Down
29 changes: 16 additions & 13 deletions compiler/rustc_attr_parsing/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ use rustc_feature::{AttrSuggestionStyle, AttributeTemplate};
use rustc_hir::attrs::AttributeKind;
use rustc_hir::lints::AttributeLintKind;
use rustc_hir::{AttrPath, HirId};
use rustc_parse::parser::Recovery;
use rustc_session::Session;
use rustc_session::lint::{Lint, LintId};
use rustc_span::{ErrorGuaranteed, Span, Symbol};
Expand All @@ -31,7 +32,8 @@ use crate::attributes::crate_level::{
CrateNameParser, CrateTypeParser, MoveSizeLimitParser, NeedsPanicRuntimeParser,
NoBuiltinsParser, NoCoreParser, NoMainParser, NoStdParser, PanicRuntimeParser,
PatternComplexityLimitParser, ProfilerRuntimeParser, RecursionLimitParser,
RustcCoherenceIsCoreParser, TypeLengthLimitParser, WindowsSubsystemParser,
RustcCoherenceIsCoreParser, RustcPreserveUbChecksParser, TypeLengthLimitParser,
WindowsSubsystemParser,
};
use crate::attributes::debugger::DebuggerViualizerParser;
use crate::attributes::deprecation::DeprecationParser;
Expand Down Expand Up @@ -71,8 +73,8 @@ use crate::attributes::rustc_allocator::{
RustcDeallocatorParser, RustcReallocatorParser,
};
use crate::attributes::rustc_dump::{
RustcDumpDefParents, RustcDumpItemBounds, RustcDumpPredicates, RustcDumpUserArgs,
RustcDumpVtable,
RustcDumpDefParentsParser, RustcDumpItemBoundsParser, RustcDumpPredicatesParser,
RustcDumpUserArgsParser, RustcDumpVtableParser,
};
use crate::attributes::rustc_internal::{
RustcHasIncoherentInherentImplsParser, RustcLayoutParser, RustcLayoutScalarValidRangeEndParser,
Expand Down Expand Up @@ -293,11 +295,11 @@ attribute_parsers!(
Single<WithoutArgs<RustcAllocatorZeroedParser>>,
Single<WithoutArgs<RustcCoherenceIsCoreParser>>,
Single<WithoutArgs<RustcDeallocatorParser>>,
Single<WithoutArgs<RustcDumpDefParents>>,
Single<WithoutArgs<RustcDumpItemBounds>>,
Single<WithoutArgs<RustcDumpPredicates>>,
Single<WithoutArgs<RustcDumpUserArgs>>,
Single<WithoutArgs<RustcDumpVtable>>,
Single<WithoutArgs<RustcDumpDefParentsParser>>,
Single<WithoutArgs<RustcDumpItemBoundsParser>>,
Single<WithoutArgs<RustcDumpPredicatesParser>>,
Single<WithoutArgs<RustcDumpUserArgsParser>>,
Single<WithoutArgs<RustcDumpVtableParser>>,
Single<WithoutArgs<RustcHasIncoherentInherentImplsParser>>,
Single<WithoutArgs<RustcLintOptTyParser>>,
Single<WithoutArgs<RustcLintQueryInstabilityParser>>,
Expand All @@ -309,6 +311,7 @@ attribute_parsers!(
Single<WithoutArgs<RustcNounwindParser>>,
Single<WithoutArgs<RustcOffloadKernelParser>>,
Single<WithoutArgs<RustcPassIndirectlyInNonRusticAbisParser>>,
Single<WithoutArgs<RustcPreserveUbChecksParser>>,
Single<WithoutArgs<RustcReallocatorParser>>,
Single<WithoutArgs<RustcShouldNotBeCalledOnConstItems>>,
Single<WithoutArgs<RustcVarianceOfOpaquesParser>>,
Expand Down Expand Up @@ -383,7 +386,7 @@ impl Stage for Late {
}

fn should_emit(&self) -> ShouldEmit {
ShouldEmit::ErrorsAndLints { recover: true }
ShouldEmit::ErrorsAndLints { recovery: Recovery::Allowed }
}
}

Expand Down Expand Up @@ -770,10 +773,10 @@ pub enum ShouldEmit {
ErrorsAndLints {
/// Whether [`ArgParser`] will attempt to recover from errors.
///
/// If true, it will attempt to recover from bad input (like an invalid literal). Setting
/// this to false will instead return early, and not raise errors except at the top level
/// (in [`ArgParser::from_attr_args`]).
recover: bool,
/// Whether it is allowed to recover from bad input (like an invalid literal). Setting
/// this to `Forbidden` will instead return early, and not raise errors except at the top
/// level (in [`ArgParser::from_attr_args`]).
recovery: Recovery,
},
/// The operation will *not* emit errors and lints.
///
Expand Down
18 changes: 14 additions & 4 deletions compiler/rustc_attr_parsing/src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use rustc_ast_pretty::pprust;
use rustc_errors::{Diag, PResult};
use rustc_hir::{self as hir, AttrPath};
use rustc_parse::exp;
use rustc_parse::parser::{ForceCollect, Parser, PathStyle, token_descr};
use rustc_parse::parser::{ForceCollect, Parser, PathStyle, Recovery, token_descr};
use rustc_session::errors::create_lit_error;
use rustc_session::parse::ParseSess;
use rustc_span::{Ident, Span, Symbol, sym};
Expand Down Expand Up @@ -121,7 +121,7 @@ impl ArgParser {
&args.tokens,
args.dspan.entire(),
psess,
ShouldEmit::ErrorsAndLints { recover: false },
ShouldEmit::ErrorsAndLints { recovery: Recovery::Forbidden },
) {
Ok(p) => return Some(ArgParser::List(p)),
Err(e) => {
Expand Down Expand Up @@ -373,7 +373,10 @@ fn expr_to_lit<'sess>(
}
Err(err) => {
let err = create_lit_error(psess, err, token_lit, expr.span);
if matches!(should_emit, ShouldEmit::ErrorsAndLints { recover: false }) {
if matches!(
should_emit,
ShouldEmit::ErrorsAndLints { recovery: Recovery::Forbidden }
) {
Err(err)
} else {
let lit = MetaItemLit {
Expand Down Expand Up @@ -431,7 +434,10 @@ impl<'a, 'sess> MetaItemListParserContext<'a, 'sess> {
if !lit.kind.is_unsuffixed() {
// Emit error and continue, we can still parse the attribute as if the suffix isn't there
let err = self.parser.dcx().create_err(SuffixedLiteralInAttribute { span: lit.span });
if matches!(self.should_emit, ShouldEmit::ErrorsAndLints { recover: false }) {
if matches!(
self.should_emit,
ShouldEmit::ErrorsAndLints { recovery: Recovery::Forbidden }
) {
return Err(err);
} else {
self.should_emit.emit_err(err)
Expand Down Expand Up @@ -569,6 +575,10 @@ impl<'a, 'sess> MetaItemListParserContext<'a, 'sess> {
should_emit: ShouldEmit,
) -> PResult<'sess, MetaItemListParser> {
let mut parser = Parser::new(psess, tokens, None);
if let ShouldEmit::ErrorsAndLints { recovery } = should_emit {
parser = parser.recovery(recovery);
}

let mut this = MetaItemListParserContext { parser: &mut parser, should_emit };

// Presumably, the majority of the time there will only be one attr.
Expand Down
5 changes: 3 additions & 2 deletions compiler/rustc_builtin_macros/src/cfg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ use rustc_expand::base::{DummyResult, ExpandResult, ExtCtxt, MacEager, MacroExpa
use rustc_hir::attrs::CfgEntry;
use rustc_hir::{AttrPath, Target};
use rustc_parse::exp;
use rustc_parse::parser::Recovery;
use rustc_span::{ErrorGuaranteed, Span, sym};

use crate::errors;
Expand Down Expand Up @@ -42,7 +43,7 @@ fn parse_cfg(cx: &ExtCtxt<'_>, span: Span, tts: TokenStream) -> Result<CfgEntry,

let meta = MetaItemOrLitParser::parse_single(
&mut parser,
ShouldEmit::ErrorsAndLints { recover: true },
ShouldEmit::ErrorsAndLints { recovery: Recovery::Allowed },
)
.map_err(|diag| diag.emit())?;
let cfg = AttributeParser::parse_single_args(
Expand All @@ -58,7 +59,7 @@ fn parse_cfg(cx: &ExtCtxt<'_>, span: Span, tts: TokenStream) -> Result<CfgEntry,
// Doesn't matter what the target actually is here.
Target::Crate,
Some(cx.ecfg.features),
ShouldEmit::ErrorsAndLints { recover: true },
ShouldEmit::ErrorsAndLints { recovery: Recovery::Allowed },
&meta,
parse_cfg_entry,
&CFG_TEMPLATE,
Expand Down
5 changes: 4 additions & 1 deletion compiler/rustc_expand/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ use rustc_feature::{
UNSTABLE_LANG_FEATURES,
};
use rustc_hir::Target;
use rustc_parse::parser::Recovery;
use rustc_session::Session;
use rustc_session::parse::feature_err;
use rustc_span::{STDLIB_STABLE_CRATES, Span, Symbol, sym};
Expand Down Expand Up @@ -395,7 +396,9 @@ impl<'a> StripUnconfigured<'a> {
fn in_cfg(&self, attrs: &[Attribute]) -> bool {
attrs.iter().all(|attr| {
!is_cfg(attr)
|| self.cfg_true(attr, ShouldEmit::ErrorsAndLints { recover: true }).as_bool()
|| self
.cfg_true(attr, ShouldEmit::ErrorsAndLints { recovery: Recovery::Allowed })
.as_bool()
})
}

Expand Down
6 changes: 3 additions & 3 deletions compiler/rustc_expand/src/expand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ use rustc_hir::def::MacroKinds;
use rustc_hir::limit::Limit;
use rustc_parse::parser::{
AllowConstBlockItems, AttemptLocalParseRecovery, CommaRecoveryMode, ForceCollect, Parser,
RecoverColon, RecoverComma, token_descr,
RecoverColon, RecoverComma, Recovery, token_descr,
};
use rustc_session::Session;
use rustc_session::lint::builtin::{UNUSED_ATTRIBUTES, UNUSED_DOC_COMMENTS};
Expand Down Expand Up @@ -2170,7 +2170,7 @@ impl<'a, 'b> InvocationCollector<'a, 'b> {
call.span(),
self.cx.current_expansion.lint_node_id,
Some(self.cx.ecfg.features),
ShouldEmit::ErrorsAndLints { recover: true },
ShouldEmit::ErrorsAndLints { recovery: Recovery::Allowed },
);

let current_span = if let Some(sp) = span { sp.to(attr.span) } else { attr.span };
Expand Down Expand Up @@ -2220,7 +2220,7 @@ impl<'a, 'b> InvocationCollector<'a, 'b> {
// Target doesn't matter for `cfg` parsing.
Target::Crate,
self.cfg().features,
ShouldEmit::ErrorsAndLints { recover: true },
ShouldEmit::ErrorsAndLints { recovery: Recovery::Allowed },
parse_cfg,
&CFG_TEMPLATE,
) else {
Expand Down
3 changes: 3 additions & 0 deletions compiler/rustc_hir/src/attrs/data_structures.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1123,6 +1123,9 @@ pub enum AttributeKind {
/// Represents `#[rustc_pass_indirectly_in_non_rustic_abis]`
RustcPassIndirectlyInNonRusticAbis(Span),

/// Represents `#[rustc_preserve_ub_checks]`
RustcPreserveUbChecks,

/// Represents `#[rustc_pub_transparent]` (used by the `repr_transparent_external_private_fields` lint).
RustcPubTransparent(Span),

Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_hir/src/attrs/encode_cross_crate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ impl AttributeKind {
RustcParenSugar(..) => No,
RustcPassByValue(..) => Yes,
RustcPassIndirectlyInNonRusticAbis(..) => No,
RustcPreserveUbChecks => No,
RustcPubTransparent(..) => Yes,
RustcReallocator => No,
RustcScalableVector { .. } => Yes,
Expand Down
22 changes: 16 additions & 6 deletions compiler/rustc_interface/src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,12 @@ pub(crate) fn run_in_thread_pool_with_globals<
.name("rustc query cycle handler".to_string())
.spawn(move || {
let on_panic = defer(|| {
eprintln!("internal compiler error: query cycle handler thread panicked, aborting process");
// Split this long string so that it doesn't cause rustfmt to
// give up on the entire builder expression.
// <https://github.com/rust-lang/rustfmt/issues/3863>
const MESSAGE: &str = "\
internal compiler error: query cycle handler thread panicked, aborting process";
eprintln!("{MESSAGE}");
// We need to abort here as we failed to resolve the deadlock,
// otherwise the compiler could just hang,
process::abort();
Expand All @@ -244,11 +249,16 @@ pub(crate) fn run_in_thread_pool_with_globals<
tls::with(|tcx| {
// Accessing session globals is sound as they outlive `GlobalCtxt`.
// They are needed to hash query keys containing spans or symbols.
let query_map = rustc_span::set_session_globals_then(unsafe { &*(session_globals as *const SessionGlobals) }, || {
// Ensure there was no errors collecting all active jobs.
// We need the complete map to ensure we find a cycle to break.
QueryCtxt::new(tcx).collect_active_jobs(false).expect("failed to collect active queries in deadlock handler")
});
let query_map = rustc_span::set_session_globals_then(
unsafe { &*(session_globals as *const SessionGlobals) },
|| {
// Ensure there were no errors collecting all active jobs.
// We need the complete map to ensure we find a cycle to break.
QueryCtxt::new(tcx).collect_active_jobs(false).expect(
"failed to collect active queries in deadlock handler",
)
},
);
break_query_cycles(query_map, &registry);
})
})
Expand Down
Loading
Loading