Skip to content

Rollup of 6 pull requests #142432

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 22 commits into from
Jun 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
8bbc080
Added `Clone` implementation for `ChunkBy`
nwoods-cimpress Mar 4, 2025
e48617f
Changing #[stable] tag
nwoods-cimpress Mar 6, 2025
c0851d7
Update ABI compatibility docs about null-pointer-optimized enums.
zachs18 Jun 3, 2025
959d6de
refactor `AttributeGate` and `rustc_attr!` to emit notes during feat…
mejrs May 18, 2025
81eb182
Remove rustc_feature::Stability
mejrs Jun 6, 2025
70f78fb
Add test for flailing diagnostic spans
mejrs May 23, 2025
7161906
rustc_parse_format: introduce `peek` and `peek_ahead`
mejrs May 23, 2025
d3137d9
Move the "missing closing brace" error creation to one place
mejrs May 23, 2025
cf3af23
refactor matching and if let chains
mejrs May 23, 2025
b68c06b
implement Default for FormatSpec
mejrs May 23, 2025
f002aba
change FormatString::parse to only return the first error
mejrs May 23, 2025
c7174a7
rename Parser's lifetime to `'input`
mejrs May 23, 2025
03c846e
Introduce ParseMode::diagnostic and fix multiline spans
mejrs May 24, 2025
ba1c650
Add ParseMode::Diagnostic unit tests
mejrs Jun 9, 2025
2095211
core docs: improve clarity of considerations about atomic CAS operations
fu5ha Jun 10, 2025
2a10f12
miri: add flag to suppress float non-determinism
RalfJung Jun 11, 2025
315b76f
Rollup merge of #138016 - nwoods-cimpress:slice_chunkby_clone, r=dtolnay
matthiaskrgr Jun 12, 2025
2591439
Rollup merge of #141162 - mejrs:gated, r=fee1-dead
matthiaskrgr Jun 12, 2025
94e8a24
Rollup merge of #141474 - mejrs:diagnostic_mode, r=compiler-errors
matthiaskrgr Jun 12, 2025
0c81fd0
Rollup merge of #141947 - zachs18:patch-4, r=workingjubilee,traviscross
matthiaskrgr Jun 12, 2025
764be85
Rollup merge of #142252 - fu5ha:doc-cas-ops, r=ibraheemdev
matthiaskrgr Jun 12, 2025
88df5a5
Rollup merge of #142337 - RalfJung:miri-float-nondet, r=oli-obk
matthiaskrgr Jun 12, 2025
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
14 changes: 12 additions & 2 deletions compiler/rustc_ast_passes/src/feature_gate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,16 @@ macro_rules! gate_alt {
feature_err(&$visitor.sess, $name, $span, $explain).emit();
}
}};
($visitor:expr, $has_feature:expr, $name:expr, $span:expr, $explain:expr, $notes: expr) => {{
if !$has_feature && !$span.allows_unstable($name) {
#[allow(rustc::untranslatable_diagnostic)] // FIXME: make this translatable
let mut diag = feature_err(&$visitor.sess, $name, $span, $explain);
for note in $notes {
diag.note(*note);
}
diag.emit();
}
}};
}

/// The case involving a multispan.
Expand Down Expand Up @@ -154,11 +164,11 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
let attr_info = attr.ident().and_then(|ident| BUILTIN_ATTRIBUTE_MAP.get(&ident.name));
// Check feature gates for built-in attributes.
if let Some(BuiltinAttribute {
gate: AttributeGate::Gated(_, name, descr, has_feature),
gate: AttributeGate::Gated { feature, message, check, notes, .. },
..
}) = attr_info
{
gate_alt!(self, has_feature(self.features), *name, attr.span, *descr);
gate_alt!(self, check(self.features), *feature, attr.span, *message, *notes);
}
// Check unstable flavors of the `#[doc]` attribute.
if attr.has_name(sym::doc) {
Expand Down
Loading
Loading