Skip to content

Commit 37d85e5

Browse files
committed
Auto merge of #155941 - JonathanBrouwer:rollup-Ak66iXR, r=JonathanBrouwer
Rollup of 15 pull requests Successful merges: - #155923 (Subtree sync for rustc_codegen_cranelift) - #155930 (Sync from portable simd 2026 04 28) - #155850 (Only exclude the #155473 change for 1-byte bool-likes) - #151994 (switch to v0 mangling by default on stable) - #154325 (Tweak irrefutable let else warning output) - #155273 (Lock stable_crate_ids once in create_crate_num) - #155361 (Document that CFI diverges from Rust wrt. ABI-compatibility rules) - #155692 (disable naked-dead-code-elimination test if no RET mnemonic is available) - #155747 (Update documentation for `wasm32-wali-linux-musl` after integrating n…) - #155768 (compiletest: Overhaul the code for running an incremental test revision) - #155907 (Handle hkl const closures) - #155910 (misc stuff from reading borrowck again :)) - #155913 (Delete the 12 year old fixme) - #155920 (remove review queue triagebot mentions) - #155936 (Rename `SharedContext::emit_dyn_lint*` into `emit_lint*`)
2 parents 03c609a + 4dd31ca commit 37d85e5

85 files changed

Lines changed: 1181 additions & 603 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

compiler/rustc_abi/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2084,7 +2084,8 @@ impl Niche {
20842084
let distance_end_zero = max_value - v.end;
20852085
// FIXME: this ought to work for `bool` too, but that seems to be hitting a miscompilation
20862086
// <https://github.com/rust-lang/rust/pull/155473#issuecomment-4302036343>
2087-
if count == 1 && v != (WrappingRange { start: 0, end: 1 }) {
2087+
let is_bool = size.bytes() == 1 && v == WrappingRange { start: 0, end: 1 };
2088+
if count == 1 && !is_bool {
20882089
// We only need one, so just pick the one closest to zero.
20892090
// Not only does that obviously use zero if it's possible, but it also
20902091
// simplifies testing things like `Option<char>`, since looking for `-1`

compiler/rustc_attr_parsing/src/attributes/cfg.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,15 +224,15 @@ pub(crate) fn parse_name_value<S: Stage>(
224224

225225
match cx.sess.psess.check_config.expecteds.get(&name) {
226226
Some(ExpectedValues::Some(values)) if !values.contains(&value.map(|(v, _)| v)) => cx
227-
.emit_dyn_lint_with_sess(
227+
.emit_lint_with_sess(
228228
UNEXPECTED_CFGS,
229229
move |dcx, level, sess| {
230230
check_cfg::unexpected_cfg_value(sess, (name, name_span), value)
231231
.into_diag(dcx, level)
232232
},
233233
span,
234234
),
235-
None if cx.sess.psess.check_config.exhaustive_names => cx.emit_dyn_lint_with_sess(
235+
None if cx.sess.psess.check_config.exhaustive_names => cx.emit_lint_with_sess(
236236
UNEXPECTED_CFGS,
237237
move |dcx, level, sess| {
238238
check_cfg::unexpected_cfg_name(sess, (name, name_span), value).into_diag(dcx, level)

compiler/rustc_attr_parsing/src/attributes/crate_level.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ impl<S: Stage> CombineAttributeParser<S> for CrateTypeParser {
6767
None,
6868
);
6969
let span = n.value_span;
70-
cx.emit_dyn_lint(
70+
cx.emit_lint(
7171
UNKNOWN_CRATE_TYPES,
7272
move |dcx, level| {
7373
UnknownCrateTypes {

compiler/rustc_attr_parsing/src/attributes/diagnostic/do_not_recommend.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ impl<S: Stage> SingleAttributeParser<S> for DoNotRecommendParser {
2424
fn convert(cx: &mut AcceptContext<'_, '_, S>, args: &ArgParser) -> Option<AttributeKind> {
2525
let attr_span = cx.attr_span;
2626
if !matches!(args, ArgParser::NoArgs) {
27-
cx.emit_dyn_lint(
27+
cx.emit_lint(
2828
MALFORMED_DIAGNOSTIC_ATTRIBUTES,
2929
|dcx, level| crate::errors::DoNotRecommendDoesNotExpectArgs.into_diag(dcx, level),
3030
attr_span,
@@ -33,7 +33,7 @@ impl<S: Stage> SingleAttributeParser<S> for DoNotRecommendParser {
3333

3434
if !matches!(cx.target, Target::Impl { of_trait: true }) {
3535
let target_span = cx.target_span;
36-
cx.emit_dyn_lint(
36+
cx.emit_lint(
3737
MISPLACED_DIAGNOSTIC_ATTRIBUTES,
3838
move |dcx, level| {
3939
IncorrectDoNotRecommendLocation { target_span }.into_diag(dcx, level)

compiler/rustc_attr_parsing/src/attributes/diagnostic/mod.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ fn merge<T, S: Stage>(
140140
(Some(_) | None, None) => {}
141141
(Some((first_span, _)), Some((later_span, _))) => {
142142
let first_span = *first_span;
143-
cx.emit_dyn_lint(
143+
cx.emit_lint(
144144
MALFORMED_DIAGNOSTIC_ATTRIBUTES,
145145
move |dcx, level| {
146146
IgnoredDiagnosticOption { first_span, later_span, option_name }
@@ -167,14 +167,14 @@ fn parse_list<'p, S: Stage>(
167167
// We're dealing with `#[diagnostic::attr()]`.
168168
// This can be because that is what the user typed, but that's also what we'd see
169169
// if the user used non-metaitem syntax. See `ArgParser::from_attr_args`.
170-
cx.emit_dyn_lint(
170+
cx.emit_lint(
171171
MALFORMED_DIAGNOSTIC_ATTRIBUTES,
172172
move |dcx, level| NonMetaItemDiagnosticAttribute.into_diag(dcx, level),
173173
list.span,
174174
);
175175
}
176176
ArgParser::NoArgs => {
177-
cx.emit_dyn_lint(
177+
cx.emit_lint(
178178
MALFORMED_DIAGNOSTIC_ATTRIBUTES,
179179
move |dcx, level| {
180180
MissingOptionsForDiagnosticAttribute {
@@ -187,7 +187,7 @@ fn parse_list<'p, S: Stage>(
187187
);
188188
}
189189
ArgParser::NameValue(_) => {
190-
cx.emit_dyn_lint(
190+
cx.emit_lint(
191191
MALFORMED_DIAGNOSTIC_ATTRIBUTES,
192192
move |dcx, level| {
193193
MalFormedDiagnosticAttributeLint {
@@ -221,7 +221,7 @@ fn parse_directive_items<'p, S: Stage>(
221221
let span = item.span();
222222

223223
macro malformed() {{
224-
cx.emit_dyn_lint(
224+
cx.emit_lint(
225225
MALFORMED_DIAGNOSTIC_ATTRIBUTES,
226226
move |dcx, level| {
227227
MalFormedDiagnosticAttributeLint {
@@ -249,7 +249,7 @@ fn parse_directive_items<'p, S: Stage>(
249249

250250
macro duplicate($name: ident, $($first_span:tt)*) {{
251251
let first_span = $($first_span)*;
252-
cx.emit_dyn_lint(
252+
cx.emit_lint(
253253
MALFORMED_DIAGNOSTIC_ATTRIBUTES,
254254
move |dcx, level| IgnoredDiagnosticOption {
255255
first_span,
@@ -285,7 +285,7 @@ fn parse_directive_items<'p, S: Stage>(
285285
| FormatWarning::PositionalArgument { span }
286286
| FormatWarning::IndexedArgument { span }
287287
| FormatWarning::DisallowedPlaceholder { span, .. }) = warning;
288-
cx.emit_dyn_lint(
288+
cx.emit_lint(
289289
MALFORMED_DIAGNOSTIC_FORMAT_LITERALS,
290290
move |dcx, level| warning.into_diag(dcx, level),
291291
span,
@@ -295,7 +295,7 @@ fn parse_directive_items<'p, S: Stage>(
295295
f
296296
}
297297
Err(e) => {
298-
cx.emit_dyn_lint(
298+
cx.emit_lint(
299299
MALFORMED_DIAGNOSTIC_FORMAT_LITERALS,
300300
move |dcx, level| {
301301
WrappedParserError {

compiler/rustc_attr_parsing/src/attributes/diagnostic/on_const.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ impl<S: Stage> AttributeParser<S> for OnConstParser {
2828
// so non-constness is still checked in check_attr.rs
2929
if !matches!(cx.target, Target::Impl { of_trait: true }) {
3030
let target_span = cx.target_span;
31-
cx.emit_dyn_lint(
31+
cx.emit_lint(
3232
MISPLACED_DIAGNOSTIC_ATTRIBUTES,
3333
move |dcx, level| {
3434
DiagnosticOnConstOnlyForTraitImpls { target_span }.into_diag(dcx, level)

compiler/rustc_attr_parsing/src/attributes/diagnostic/on_move.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ impl OnMoveParser {
3333
self.span = Some(span);
3434

3535
if !matches!(cx.target, Target::Enum | Target::Struct | Target::Union) {
36-
cx.emit_dyn_lint(
36+
cx.emit_lint(
3737
MISPLACED_DIAGNOSTIC_ATTRIBUTES,
3838
move |dcx, level| DiagnosticOnMoveOnlyForAdt.into_diag(dcx, level),
3939
span,

compiler/rustc_attr_parsing/src/attributes/diagnostic/on_unimplemented.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ impl OnUnimplementedParser {
2323
self.span = Some(span);
2424

2525
if !matches!(cx.target, Target::Trait) {
26-
cx.emit_dyn_lint(
26+
cx.emit_lint(
2727
MISPLACED_DIAGNOSTIC_ATTRIBUTES,
2828
move |dcx, level| DiagnosticOnUnimplementedOnlyForTraits.into_diag(dcx, level),
2929
span,

compiler/rustc_attr_parsing/src/attributes/diagnostic/on_unknown.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ impl OnUnknownParser {
3535

3636
if !early && !matches!(cx.target, Target::Use) {
3737
let target_span = cx.target_span;
38-
cx.emit_dyn_lint(
38+
cx.emit_lint(
3939
MISPLACED_DIAGNOSTIC_ATTRIBUTES,
4040
move |dcx, level| {
4141
DiagnosticOnUnknownOnlyForImports { target_span }.into_diag(dcx, level)

compiler/rustc_attr_parsing/src/attributes/diagnostic/on_unmatch_args.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ impl<S: Stage> AttributeParser<S> for OnUnmatchArgsParser {
2525
this.span = Some(span);
2626

2727
if !matches!(cx.target, Target::MacroDef) {
28-
cx.emit_dyn_lint(
28+
cx.emit_lint(
2929
MISPLACED_DIAGNOSTIC_ATTRIBUTES,
3030
move |dcx, level| DiagnosticOnUnmatchArgsOnlyForMacros.into_diag(dcx, level),
3131
span,

0 commit comments

Comments
 (0)