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 <github@opprobrio.us>
99
Abhishek Chanda <abhishek.becs@gmail.com> Abhishek Chanda <abhishek@cloudscaling.com>
1010
Abhijeet Bhagat <abhijeet.bhagat@gmx.com>
1111
Abroskin Alexander <arkweid@evilmartians.com>
12-
Adolfo Ochagavía <aochagavia92@gmail.com>
12+
Adolfo Ochagavía <aochagavia92@gmail.com> <github@adolfo.ochagavia.xyz>
1313
Adrian Heine né Lang <mail@adrianheine.de>
1414
Adrien Tétar <adri-from-59@hotmail.fr>
1515
Ahmed Charles <ahmedcharles@gmail.com> <acharles@outlook.com>
@@ -36,6 +36,7 @@ Amanda Stjerna <mail@amandastjerna.se> <albin.stjerna@gmail.com>
3636
Amanda Stjerna <mail@amandastjerna.se> <amanda.stjerna@it.uu.se>
3737
Amanieu d'Antras <amanieu@gmail.com> <amanieu.dantras@huawei.com>
3838
Amos Onn <amosonn@gmail.com>
39+
Amos Wenger <amoswenger@gmail.com> <fasterthanlime@users.noreply.github.com>
3940
Ana-Maria Mihalache <mihalacheana.maria@yahoo.com>
4041
Anatoly Ikorsky <aikorsky@gmail.com>
4142
Andre Bogus <bogusandre@gmail.com>
@@ -276,7 +277,8 @@ Irina Popa <irinagpopa@gmail.com>
276277
Ivan Ivaschenko <defuz.net@gmail.com>
277278
ivan tkachenko <me@ratijas.tk>
278279
J. J. Weber <jjweber@gmail.com>
279-
Jack Huey <jack.huey@umassmed.edu> <jackh726@gmail.com>
280+
Jack Huey <jackh726@gmail.com> <jack.huey@umassmed.edu>
281+
Jack Huey <jackh726@gmail.com> <31162821+jackh726@users.noreply.github.com>
280282
Jacob <jacob.macritchie@gmail.com>
281283
Jacob Hoffman-Andrews <rust@hoffman-andrews.com> <github@hoffman-andrews.com>
282284
Jacob Greenfield <xales@naveria.com>
@@ -292,6 +294,8 @@ Jakub Adam Wieczorek <jakub.adam.wieczorek@gmail.com>
292294
Jakub Adam Wieczorek <jakub.adam.wieczorek@gmail.com> <jakub.bukaj@yahoo.com>
293295
Jakub Adam Wieczorek <jakub.adam.wieczorek@gmail.com> <jakub@jakub.cc>
294296
Jakub Adam Wieczorek <jakub.adam.wieczorek@gmail.com> <jakubw@jakubw.net>
297+
Jakub Adam Wieczorek <jakub.adam.wieczorek@gmail.com> <ja.wieczorek@student.uw.edu.pl>
298+
Jakub Adam Wieczorek <jakub.adam.wieczorek@gmail.com> <software@jacobadam.net>
295299
Jakub Beránek <berykubik@gmail.com> <jakub.beranek@vsb.cz>
296300
James [Undefined] <tpzker@thepuzzlemaker.info>
297301
James Deng <cnjamesdeng@gmail.com> <cnJamesDeng@gmail.com>
@@ -303,6 +307,7 @@ Jamie Hill-Daniel <jamie@hill-daniel.co.uk> <clubby789@gmail.com>
303307
Jana Dönszelmann <jana@donsz.nl>
304308
Jana Dönszelmann <jana@donsz.nl> <jonathan@donsz.nl>
305309
Jana Dönszelmann <jana@donsz.nl> <jonabent@gmail.com>
310+
Jane Lusby <jlusby42@gmail.com> <jlusby@yaah.dev>
306311
Jan-Erik Rediger <janerik@fnordig.de> <badboy@archlinux.us>
307312
Jaro Fietz <jaro.fietz@gmx.de>
308313
Jason Fager <jfager@gmail.com>
@@ -313,6 +318,7 @@ Jason Toffaletti <toffaletti@gmail.com> Jason Toffaletti <jason@topsy.com>
313318
Jauhien Piatlicki <jauhien@gentoo.org> Jauhien Piatlicki <jpiatlicki@zertisa.com>
314319
Jay True <glacjay@gmail.com>
315320
Jeremy Letang <letang.jeremy@gmail.com>
321+
Jeremy Soller <jackpot51@gmail.com> <jeremy@system76.com>
316322
Jeremy Sorensen <jeremy.a.sorensen@gmail.com>
317323
Jeremy Stucki <dev@jeremystucki.ch> <stucki.jeremy@gmail.com>
318324
Jeremy Stucki <dev@jeremystucki.ch> <jeremy@myelin.ch>
@@ -336,6 +342,7 @@ John Kåre Alsaker <john.kare.alsaker@gmail.com>
336342
John Kåre Alsaker <john.kare.alsaker@gmail.com> <zoxc32@gmail.com>
337343
John Talling <inrustwetrust@users.noreply.github.com>
338344
John Van Enk <vanenkj@gmail.com>
345+
Jon Gjengset <jon@thesquareplanet.com> <jongje@amazon.com>
339346
Jonas Tepe <jonasprogrammer@gmail.com>
340347
Jonathan Bailey <jbailey@mozilla.com> <jbailey@jbailey-20809.local>
341348
Jonathan Chan Kwan Yin <sofe2038@gmail.com>
@@ -424,7 +431,7 @@ Malo Jaffré <jaffre.malo@gmail.com>
424431
Manish Goregaokar <manishsmail@gmail.com>
425432
Mara Bos <m-ou.se@m-ou.se>
426433
Marcell Pardavi <marcell.pardavi@gmail.com>
427-
Marco Ieni <11428655+MarcoIeni@users.noreply.github.com>
434+
Marco Ieni <marcoieni@rustfoundation.org> <11428655+MarcoIeni@users.noreply.github.com>
428435
Marcus Klaas de Vries <mail@marcusklaas.nl>
429436
Margaret Meyerhofer <mmeyerho@andrew.cmu.edu> <mmeyerho@andrew>
430437
Marijn Schouten <mhkbst@gmail.com> <hkBst@users.noreply.github.com>
@@ -531,6 +538,7 @@ Oliver Scherer <oli-obk@users.noreply.github.com> <oliver.schneider@kit.edu>
531538
Oliver Scherer <oli-obk@users.noreply.github.com> <obk8176014uqher834@olio-obk.de>
532539
Oliver Scherer <oli-obk@users.noreply.github.com> <rustc-contact@oli-obk.de>
533540
Oliver Scherer <oli-obk@users.noreply.github.com>
541+
Onur Özkan <onurozkan.dev@outlook.com> <contact@onurozkan.dev>
534542
Onur Özkan <onurozkan.dev@outlook.com> <work@onurozkan.dev>
535543
Onur Özkan <onurozkan.dev@outlook.com>
536544
Ömer Sinan Ağacan <omeragacan@gmail.com>
@@ -591,6 +599,7 @@ Rusty Blitzerr <rusty.blitzerr@gmail.com>
591599
RustyYato <krishna.sd.2012@gmail.com>
592600
Ruud van Asseldonk <dev@veniogames.com> Ruud van Asseldonk <ruuda@google.com>
593601
Ryan Leung <rleungx@gmail.com>
602+
Ryan Levick <me@ryanlevick.com> <rylev@users.noreply.github.com>
594603
Ryan Scheel <ryan.havvy@gmail.com>
595604
Ryan Sullivant <rsulli55@gmail.com>
596605
Ryan Wiedemann <Ryan1729@gmail.com>
@@ -686,6 +695,8 @@ Weihang Lo <me@weihanglo.tw>
686695
Weihang Lo <me@weihanglo.tw> <weihanglo@users.noreply.github.com>
687696
Wesley Wiser <wwiser@gmail.com> <wesleywiser@microsoft.com>
688697
whitequark <whitequark@whitequark.org>
698+
Will Crichton <crichton.will@gmail.com> <wcrichto@stanford.edu>
699+
Will Crichton <crichton.will@gmail.com> <wcrichto@cs.stanford.edu>
689700
William Ting <io@williamting.com> <william.h.ting@gmail.com>
690701
Wim Looman <wim@nemo157.com> <rust-lang@nemo157.com>
691702
Wim Looman <wim@nemo157.com> <git@nemo157.com>
@@ -695,6 +706,8 @@ Xinye Tao <xy.tao@outlook.com>
695706
Xuefeng Wu <benewu@gmail.com> Xuefeng Wu <xfwu@thoughtworks.com>
696707
Xuefeng Wu <benewu@gmail.com> XuefengWu <benewu@gmail.com>
697708
York Xiang <bombless@126.com>
709+
Yoshua Wuyts <yoshuawuyts@gmail.com> <yoshuawuyts+github@gmail.com>
710+
Yoshua Wuyts <yoshuawuyts@gmail.com> <2467194+yoshuawuyts@users.noreply.github.com>
698711
Yotam Ofek <yotam.ofek@gmail.com> <yotamofek@microsoft.com>
699712
Youngsoo Son <ysson83@gmail.com> <ysoo.son@samsung.com>
700713
Youngsuk Kim <joseph942010@gmail.com>

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)