Skip to content

Commit d340e8c

Browse files
committed
Auto merge of #148650 - GuillaumeGomez:rollup-p7esi5w, r=GuillaumeGomez
Rollup of 7 pull requests Successful merges: - #145656 (Stabilize s390x `vector` target feature and `is_s390x_feature_detected!` macro) - #148204 (Modify contributor email entries in .mailmap) - #148556 (Fix suggestion for returning async closures) - #148585 ([rustdoc] Replace `print` methods with functions to improve code readability) - #148600 (re-use `self.get_all_attrs` result for pass indirectly attribute) - #148612 (Add note for identifier with attempted hygiene violation) - #148613 (Switch hexagon targets to rust-lld) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 843f8ce + 07d76d4 commit d340e8c

Some content is hidden

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

45 files changed

+1055
-741
lines changed

.mailmap

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Aaron Todd <[email protected]>
99
Abhishek Chanda <[email protected]> Abhishek Chanda <[email protected]>
1010
Abhijeet Bhagat <[email protected]>
1111
Abroskin Alexander <[email protected]>
12-
Adolfo Ochagavía <[email protected]>
12+
1313
Adrian Heine né Lang <[email protected]>
1414
Adrien Tétar <[email protected]>
1515
@@ -36,6 +36,7 @@ Amanda Stjerna <[email protected]> <[email protected]>
3636
3737
3838
39+
3940
Ana-Maria Mihalache <[email protected]>
4041
Anatoly Ikorsky <[email protected]>
4142
Andre Bogus <[email protected]>
@@ -276,7 +277,8 @@ Irina Popa <[email protected]>
276277
Ivan Ivaschenko <[email protected]>
277278
ivan tkachenko <[email protected]>
278279
J. J. Weber <[email protected]>
279-
280+
281+
280282
281283
Jacob Hoffman-Andrews <[email protected]> <[email protected]>
282284
Jacob Greenfield <[email protected]>
@@ -292,6 +294,8 @@ Jakub Adam Wieczorek <[email protected]>
292294
Jakub Adam Wieczorek <[email protected]> <[email protected]>
293295
Jakub Adam Wieczorek <[email protected]> <[email protected]>
294296
Jakub Adam Wieczorek <[email protected]> <[email protected]>
297+
Jakub Adam Wieczorek <[email protected]> <[email protected]>
298+
Jakub Adam Wieczorek <[email protected]> <[email protected]>
295299
296300
James [Undefined] <[email protected]>
297301
@@ -303,6 +307,7 @@ Jamie Hill-Daniel <[email protected]> <[email protected]>
303307
Jana Dönszelmann <[email protected]>
304308
305309
310+
306311
307312
Jaro Fietz <[email protected]>
308313
Jason Fager <[email protected]>
@@ -313,6 +318,7 @@ Jason Toffaletti <[email protected]> Jason Toffaletti <[email protected]>
313318
Jauhien Piatlicki <[email protected]> Jauhien Piatlicki <[email protected]>
314319
315320
Jeremy Letang <[email protected]>
321+
316322
Jeremy Sorensen <[email protected]>
317323
318324
@@ -336,6 +342,7 @@ John Kåre Alsaker <[email protected]>
336342
John Kåre Alsaker <[email protected]> <[email protected]>
337343
John Talling <[email protected]>
338344
John Van Enk <[email protected]>
345+
339346
Jonas Tepe <[email protected]>
340347
341348
Jonathan Chan Kwan Yin <[email protected]>
@@ -424,7 +431,7 @@ Malo Jaffré <[email protected]>
424431
Manish Goregaokar <[email protected]>
425432
426433
Marcell Pardavi <[email protected]>
427-
Marco Ieni <[email protected]>
434+
428435
Marcus Klaas de Vries <[email protected]>
429436
Margaret Meyerhofer <[email protected]> <mmeyerho@andrew>
430437
@@ -531,6 +538,7 @@ Oliver Scherer <[email protected]> <[email protected]>
531538
532539
533540
Oliver Scherer <[email protected]>
541+
534542
535543
Onur Özkan <[email protected]>
536544
Ömer Sinan Ağacan <[email protected]>
@@ -591,6 +599,7 @@ Rusty Blitzerr <[email protected]>
591599
RustyYato <[email protected]>
592600
Ruud van Asseldonk <[email protected]> Ruud van Asseldonk <[email protected]>
593601
Ryan Leung <[email protected]>
602+
594603
Ryan Scheel <[email protected]>
595604
Ryan Sullivant <[email protected]>
596605
Ryan Wiedemann <[email protected]>
@@ -686,6 +695,8 @@ Weihang Lo <[email protected]>
686695
687696
688697
whitequark <[email protected]>
698+
699+
689700
690701
691702
@@ -695,6 +706,8 @@ Xinye Tao <[email protected]>
695706
Xuefeng Wu <[email protected]> Xuefeng Wu <[email protected]>
696707
Xuefeng Wu <[email protected]> XuefengWu <[email protected]>
697708
York Xiang <[email protected]>
709+
710+
698711
699712
700713
Youngsuk Kim <[email protected]>

compiler/rustc_feature/src/accepted.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,8 @@ declare_features! (
387387
(accepted, return_position_impl_trait_in_trait, "1.75.0", Some(91611)),
388388
/// Allows code like `let x: &'static u32 = &42` to work (RFC 1414).
389389
(accepted, rvalue_static_promotion, "1.21.0", Some(38865)),
390+
/// Allows use of the `vector` and related s390x target features.
391+
(accepted, s390x_target_feature_vector, "CURRENT_RUSTC_VERSION", Some(145649)),
390392
/// Allows `Self` in type definitions (RFC 2300).
391393
(accepted, self_in_typedefs, "1.32.0", Some(49303)),
392394
/// Allows `Self` struct constructor (RFC 2302).

compiler/rustc_hir_analysis/src/collect.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1263,6 +1263,21 @@ pub fn suggest_impl_trait<'tcx>(
12631263
infcx.tcx.lang_items().future_output(),
12641264
format_as_assoc,
12651265
),
1266+
(
1267+
infcx.tcx.lang_items().async_fn_trait(),
1268+
infcx.tcx.lang_items().async_fn_once_output(),
1269+
format_as_parenthesized,
1270+
),
1271+
(
1272+
infcx.tcx.lang_items().async_fn_mut_trait(),
1273+
infcx.tcx.lang_items().async_fn_once_output(),
1274+
format_as_parenthesized,
1275+
),
1276+
(
1277+
infcx.tcx.lang_items().async_fn_once_trait(),
1278+
infcx.tcx.lang_items().async_fn_once_output(),
1279+
format_as_parenthesized,
1280+
),
12661281
(
12671282
infcx.tcx.lang_items().fn_trait(),
12681283
infcx.tcx.lang_items().fn_once_output(),

compiler/rustc_middle/src/ty/mod.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1512,9 +1512,8 @@ impl<'tcx> TyCtxt<'tcx> {
15121512
field_shuffle_seed ^= user_seed;
15131513
}
15141514

1515-
if let Some(reprs) =
1516-
find_attr!(self.get_all_attrs(did), AttributeKind::Repr { reprs, .. } => reprs)
1517-
{
1515+
let attributes = self.get_all_attrs(did);
1516+
if let Some(reprs) = find_attr!(attributes, AttributeKind::Repr { reprs, .. } => reprs) {
15181517
for (r, _) in reprs {
15191518
flags.insert(match *r {
15201519
attr::ReprRust => ReprFlags::empty(),
@@ -1574,10 +1573,7 @@ impl<'tcx> TyCtxt<'tcx> {
15741573
}
15751574

15761575
// See `TyAndLayout::pass_indirectly_in_non_rustic_abis` for details.
1577-
if find_attr!(
1578-
self.get_all_attrs(did),
1579-
AttributeKind::RustcPassIndirectlyInNonRusticAbis(..)
1580-
) {
1576+
if find_attr!(attributes, AttributeKind::RustcPassIndirectlyInNonRusticAbis(..)) {
15811577
flags.insert(ReprFlags::PASS_INDIRECTLY_IN_NON_RUSTIC_ABIS);
15821578
}
15831579

compiler/rustc_resolve/src/late/diagnostics.rs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1125,6 +1125,8 @@ impl<'ast, 'ra, 'tcx> LateResolutionVisitor<'_, 'ast, 'ra, 'tcx> {
11251125
}
11261126
}
11271127
}
1128+
1129+
self.suggest_ident_hidden_by_hygiene(err, path, span);
11281130
} else if err_code == E0412 {
11291131
if let Some(correct) = Self::likely_rust_type(path) {
11301132
err.span_suggestion(
@@ -1138,6 +1140,28 @@ impl<'ast, 'ra, 'tcx> LateResolutionVisitor<'_, 'ast, 'ra, 'tcx> {
11381140
}
11391141
}
11401142

1143+
fn suggest_ident_hidden_by_hygiene(&self, err: &mut Diag<'_>, path: &[Segment], span: Span) {
1144+
let [segment] = path else { return };
1145+
1146+
let ident = segment.ident;
1147+
let callsite_span = span.source_callsite();
1148+
for rib in self.ribs[ValueNS].iter().rev() {
1149+
for (binding_ident, _) in &rib.bindings {
1150+
if binding_ident.name == ident.name
1151+
&& !binding_ident.span.eq_ctxt(span)
1152+
&& !binding_ident.span.from_expansion()
1153+
&& binding_ident.span.lo() < callsite_span.lo()
1154+
{
1155+
err.span_help(
1156+
binding_ident.span,
1157+
"an identifier with the same name exists, but is not accessible due to macro hygiene",
1158+
);
1159+
return;
1160+
}
1161+
}
1162+
}
1163+
}
1164+
11411165
/// Emit special messages for unresolved `Self` and `self`.
11421166
fn suggest_self_ty(
11431167
&self,

compiler/rustc_span/src/symbol.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2000,6 +2000,7 @@ symbols! {
20002000
s,
20012001
s390x,
20022002
s390x_target_feature,
2003+
s390x_target_feature_vector,
20032004
safety,
20042005
sanitize,
20052006
sanitizer_cfi_generalize_pointers,

compiler/rustc_target/src/spec/targets/hexagon_unknown_linux_musl.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ pub(crate) fn target() -> Target {
88
base.features = "-small-data,+hvx-length128b".into();
99

1010
base.has_rpath = true;
11+
base.linker = Some("rust-lld".into());
1112
base.linker_flavor = LinkerFlavor::Unix(Cc::Yes);
1213

1314
base.c_enum_min_bits = Some(8);

compiler/rustc_target/src/spec/targets/hexagon_unknown_none_elf.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ pub(crate) fn target() -> Target {
2727
max_atomic_width: Some(32),
2828
emit_debug_gdb_scripts: false,
2929
c_enum_min_bits: Some(8),
30+
linker: Some("rust-lld".into()),
3031
..Default::default()
3132
},
3233
}

compiler/rustc_target/src/target_features.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -844,20 +844,20 @@ const IBMZ_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[
844844
("message-security-assist-extension8", Unstable(sym::s390x_target_feature), &["message-security-assist-extension3"]),
845845
("message-security-assist-extension9", Unstable(sym::s390x_target_feature), &["message-security-assist-extension3", "message-security-assist-extension4"]),
846846
("message-security-assist-extension12", Unstable(sym::s390x_target_feature), &[]),
847-
("miscellaneous-extensions-2", Unstable(sym::s390x_target_feature), &[]),
848-
("miscellaneous-extensions-3", Unstable(sym::s390x_target_feature), &[]),
849-
("miscellaneous-extensions-4", Unstable(sym::s390x_target_feature), &[]),
850-
("nnp-assist", Unstable(sym::s390x_target_feature), &["vector"]),
847+
("miscellaneous-extensions-2", Stable, &[]),
848+
("miscellaneous-extensions-3", Stable, &[]),
849+
("miscellaneous-extensions-4", Stable, &[]),
850+
("nnp-assist", Stable, &["vector"]),
851851
("soft-float", Forbidden { reason: "currently unsupported ABI-configuration feature" }, &[]),
852852
("transactional-execution", Unstable(sym::s390x_target_feature), &[]),
853-
("vector", Unstable(sym::s390x_target_feature), &[]),
854-
("vector-enhancements-1", Unstable(sym::s390x_target_feature), &["vector"]),
855-
("vector-enhancements-2", Unstable(sym::s390x_target_feature), &["vector-enhancements-1"]),
856-
("vector-enhancements-3", Unstable(sym::s390x_target_feature), &["vector-enhancements-2"]),
857-
("vector-packed-decimal", Unstable(sym::s390x_target_feature), &["vector"]),
858-
("vector-packed-decimal-enhancement", Unstable(sym::s390x_target_feature), &["vector-packed-decimal"]),
859-
("vector-packed-decimal-enhancement-2", Unstable(sym::s390x_target_feature), &["vector-packed-decimal-enhancement"]),
860-
("vector-packed-decimal-enhancement-3", Unstable(sym::s390x_target_feature), &["vector-packed-decimal-enhancement-2"]),
853+
("vector", Stable, &[]),
854+
("vector-enhancements-1", Stable, &["vector"]),
855+
("vector-enhancements-2", Stable, &["vector-enhancements-1"]),
856+
("vector-enhancements-3", Stable, &["vector-enhancements-2"]),
857+
("vector-packed-decimal", Stable, &["vector"]),
858+
("vector-packed-decimal-enhancement", Stable, &["vector-packed-decimal"]),
859+
("vector-packed-decimal-enhancement-2", Stable, &["vector-packed-decimal-enhancement"]),
860+
("vector-packed-decimal-enhancement-3", Stable, &["vector-packed-decimal-enhancement-2"]),
861861
// tidy-alphabetical-end
862862
];
863863

library/std/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -672,7 +672,7 @@ pub mod arch {
672672
pub use std_detect::is_loongarch_feature_detected;
673673
#[unstable(feature = "is_riscv_feature_detected", issue = "111192")]
674674
pub use std_detect::is_riscv_feature_detected;
675-
#[unstable(feature = "stdarch_s390x_feature_detection", issue = "135413")]
675+
#[stable(feature = "stdarch_s390x_feature_detection", since = "CURRENT_RUSTC_VERSION")]
676676
pub use std_detect::is_s390x_feature_detected;
677677
#[stable(feature = "simd_x86", since = "1.27.0")]
678678
pub use std_detect::is_x86_feature_detected;

0 commit comments

Comments
 (0)