Skip to content

Commit 0fb279b

Browse files
committed
Auto merge of #143867 - fmease:rollup-5tll6m9, r=fmease
Rollup of 12 pull requests Successful merges: - #143776 (std: move NuttX to use arc4random for random number generation) - #143778 (Some const_trait_impl test cleanups) - #143782 (Disambiguate between rustc vs std having debug assertions in `run-make-support` and `run-make` tests) - #143791 (Update sysinfo version to `0.36.0`) - #143796 (Fix ICE for parsed attributes with longer path not handled by CheckAttribute) - #143798 (Remove format short command trait) - #143803 (New tracking issues for const_ops and const_cmp) - #143814 (htmldocck: better error messages for some negative directives) - #143817 (Access `wasi_sdk_path` instead of reading environment variable in bootstrap) - #143822 (./x test miri: fix cleaning the miri_ui directory) - #143823 ([COMPILETEST-UNTANGLE 5/N] Test mode adjustments and other assorted cleanups) - #143841 (Label clippy changes with `T-clippy`) Failed merges: - #143850 (Compiletest: Simplify {Html,Json}DocCk directive handling) r? `@ghost` `@rustbot` modify labels: rollup
2 parents d2baa49 + 155eadf commit 0fb279b

Some content is hidden

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

52 files changed

+410
-285
lines changed

Cargo.lock

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4349,6 +4349,7 @@ dependencies = [
43494349
"rustc_ast_lowering",
43504350
"rustc_ast_pretty",
43514351
"rustc_attr_data_structures",
4352+
"rustc_attr_parsing",
43524353
"rustc_data_structures",
43534354
"rustc_errors",
43544355
"rustc_expand",
@@ -5230,9 +5231,9 @@ dependencies = [
52305231

52315232
[[package]]
52325233
name = "sysinfo"
5233-
version = "0.35.2"
5234+
version = "0.36.0"
52345235
source = "registry+https://github.com/rust-lang/crates.io-index"
5235-
checksum = "3c3ffa3e4ff2b324a57f7aeb3c349656c7b127c3c189520251a648102a92496e"
5236+
checksum = "aab138f5c1bb35231de19049060a87977ad23e04f2303e953bc5c2947ac7dec4"
52365237
dependencies = [
52375238
"libc",
52385239
"objc2-core-foundation",

compiler/rustc_attr_parsing/src/context.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -735,6 +735,11 @@ impl<'sess, S: Stage> AttributeParser<'sess, S> {
735735
attributes
736736
}
737737

738+
/// Returns whether there is a parser for an attribute with this name
739+
pub fn is_parsed_attribute(path: &[Symbol]) -> bool {
740+
Late::parsers().0.contains_key(path)
741+
}
742+
738743
fn lower_attr_args(&self, args: &ast::AttrArgs, lower_span: impl Fn(Span) -> Span) -> AttrArgs {
739744
match args {
740745
ast::AttrArgs::Empty => AttrArgs::Empty,

compiler/rustc_passes/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ rustc_ast = { path = "../rustc_ast" }
1010
rustc_ast_lowering = { path = "../rustc_ast_lowering" }
1111
rustc_ast_pretty = { path = "../rustc_ast_pretty" }
1212
rustc_attr_data_structures = { path = "../rustc_attr_data_structures" }
13+
rustc_attr_parsing = { path = "../rustc_attr_parsing" }
1314
rustc_data_structures = { path = "../rustc_data_structures" }
1415
rustc_errors = { path = "../rustc_errors" }
1516
rustc_expand = { path = "../rustc_expand" }

compiler/rustc_passes/src/check_attr.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@
77
88
use std::cell::Cell;
99
use std::collections::hash_map::Entry;
10+
use std::slice;
1011

1112
use rustc_abi::{Align, ExternAbi, Size};
1213
use rustc_ast::{AttrStyle, LitKind, MetaItemInner, MetaItemKind, ast};
1314
use rustc_attr_data_structures::{AttributeKind, InlineAttr, ReprAttr, find_attr};
15+
use rustc_attr_parsing::{AttributeParser, Late};
1416
use rustc_data_structures::fx::FxHashMap;
1517
use rustc_errors::{Applicability, DiagCtxtHandle, IntoDiagArg, MultiSpan, StashKey};
1618
use rustc_feature::{AttributeDuplicates, AttributeType, BUILTIN_ATTRIBUTE_MAP, BuiltinAttribute};
@@ -384,11 +386,18 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
384386
| sym::custom_mir,
385387
..
386388
] => {}
387-
[name, ..] => {
389+
[name, rest@..] => {
388390
match BUILTIN_ATTRIBUTE_MAP.get(name) {
389391
// checked below
390392
Some(BuiltinAttribute { type_: AttributeType::CrateLevel, .. }) => {}
391393
Some(_) => {
394+
if rest.len() > 0 && AttributeParser::<Late>::is_parsed_attribute(slice::from_ref(name)) {
395+
// Check if we tried to use a builtin attribute as an attribute namespace, like `#[must_use::skip]`.
396+
// This check is here to solve https://github.com/rust-lang/rust/issues/137590
397+
// An error is already produced for this case elsewhere
398+
continue
399+
}
400+
392401
// FIXME: differentiate between unstable and internal attributes just
393402
// like we do with features instead of just accepting `rustc_`
394403
// attributes by name. That should allow trimming the above list, too.

library/core/src/cmp.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ use crate::ops::ControlFlow;
248248
)]
249249
#[rustc_diagnostic_item = "PartialEq"]
250250
#[const_trait]
251-
#[rustc_const_unstable(feature = "const_trait_impl", issue = "67792")]
251+
#[rustc_const_unstable(feature = "const_cmp", issue = "143800")]
252252
pub trait PartialEq<Rhs: PointeeSized = Self>: PointeeSized {
253253
/// Tests for `self` and `other` values to be equal, and is used by `==`.
254254
#[must_use]
@@ -1809,7 +1809,7 @@ mod impls {
18091809
macro_rules! partial_eq_impl {
18101810
($($t:ty)*) => ($(
18111811
#[stable(feature = "rust1", since = "1.0.0")]
1812-
#[rustc_const_unstable(feature = "const_cmp", issue = "92391")]
1812+
#[rustc_const_unstable(feature = "const_cmp", issue = "143800")]
18131813
impl const PartialEq for $t {
18141814
#[inline]
18151815
fn eq(&self, other: &Self) -> bool { *self == *other }
@@ -2017,7 +2017,7 @@ mod impls {
20172017
// & pointers
20182018

20192019
#[stable(feature = "rust1", since = "1.0.0")]
2020-
#[rustc_const_unstable(feature = "const_cmp", issue = "92391")]
2020+
#[rustc_const_unstable(feature = "const_cmp", issue = "143800")]
20212021
impl<A: PointeeSized, B: PointeeSized> const PartialEq<&B> for &A
20222022
where
20232023
A: ~const PartialEq<B>,
@@ -2089,7 +2089,7 @@ mod impls {
20892089
// &mut pointers
20902090

20912091
#[stable(feature = "rust1", since = "1.0.0")]
2092-
#[rustc_const_unstable(feature = "const_cmp", issue = "92391")]
2092+
#[rustc_const_unstable(feature = "const_cmp", issue = "143800")]
20932093
impl<A: PointeeSized, B: PointeeSized> const PartialEq<&mut B> for &mut A
20942094
where
20952095
A: ~const PartialEq<B>,
@@ -2159,7 +2159,7 @@ mod impls {
21592159
impl<A: PointeeSized> Eq for &mut A where A: Eq {}
21602160

21612161
#[stable(feature = "rust1", since = "1.0.0")]
2162-
#[rustc_const_unstable(feature = "const_cmp", issue = "92391")]
2162+
#[rustc_const_unstable(feature = "const_cmp", issue = "143800")]
21632163
impl<A: PointeeSized, B: PointeeSized> const PartialEq<&mut B> for &A
21642164
where
21652165
A: ~const PartialEq<B>,
@@ -2175,7 +2175,7 @@ mod impls {
21752175
}
21762176

21772177
#[stable(feature = "rust1", since = "1.0.0")]
2178-
#[rustc_const_unstable(feature = "const_cmp", issue = "92391")]
2178+
#[rustc_const_unstable(feature = "const_cmp", issue = "143800")]
21792179
impl<A: PointeeSized, B: PointeeSized> const PartialEq<&B> for &mut A
21802180
where
21812181
A: ~const PartialEq<B>,

library/core/src/ops/arith.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
/// ```
6666
#[lang = "add"]
6767
#[stable(feature = "rust1", since = "1.0.0")]
68-
#[rustc_const_unstable(feature = "const_ops", issue = "90080")]
68+
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
6969
#[rustc_on_unimplemented(
7070
on(all(Self = "{integer}", Rhs = "{float}"), message = "cannot add a float to an integer",),
7171
on(all(Self = "{float}", Rhs = "{integer}"), message = "cannot add an integer to a float",),
@@ -96,7 +96,7 @@ pub trait Add<Rhs = Self> {
9696
macro_rules! add_impl {
9797
($($t:ty)*) => ($(
9898
#[stable(feature = "rust1", since = "1.0.0")]
99-
#[rustc_const_unstable(feature = "const_ops", issue = "90080")]
99+
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
100100
impl const Add for $t {
101101
type Output = $t;
102102

@@ -179,7 +179,7 @@ add_impl! { usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 f16 f32 f64 f128
179179
/// ```
180180
#[lang = "sub"]
181181
#[stable(feature = "rust1", since = "1.0.0")]
182-
#[rustc_const_unstable(feature = "const_ops", issue = "90080")]
182+
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
183183
#[rustc_on_unimplemented(
184184
message = "cannot subtract `{Rhs}` from `{Self}`",
185185
label = "no implementation for `{Self} - {Rhs}`",
@@ -208,7 +208,7 @@ pub trait Sub<Rhs = Self> {
208208
macro_rules! sub_impl {
209209
($($t:ty)*) => ($(
210210
#[stable(feature = "rust1", since = "1.0.0")]
211-
#[rustc_const_unstable(feature = "const_ops", issue = "90080")]
211+
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
212212
impl const Sub for $t {
213213
type Output = $t;
214214

@@ -313,7 +313,7 @@ sub_impl! { usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 f16 f32 f64 f128
313313
/// ```
314314
#[lang = "mul"]
315315
#[stable(feature = "rust1", since = "1.0.0")]
316-
#[rustc_const_unstable(feature = "const_ops", issue = "90080")]
316+
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
317317
#[diagnostic::on_unimplemented(
318318
message = "cannot multiply `{Self}` by `{Rhs}`",
319319
label = "no implementation for `{Self} * {Rhs}`"
@@ -341,7 +341,7 @@ pub trait Mul<Rhs = Self> {
341341
macro_rules! mul_impl {
342342
($($t:ty)*) => ($(
343343
#[stable(feature = "rust1", since = "1.0.0")]
344-
#[rustc_const_unstable(feature = "const_ops", issue = "90080")]
344+
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
345345
impl const Mul for $t {
346346
type Output = $t;
347347

@@ -450,7 +450,7 @@ mul_impl! { usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 f16 f32 f64 f128
450450
/// ```
451451
#[lang = "div"]
452452
#[stable(feature = "rust1", since = "1.0.0")]
453-
#[rustc_const_unstable(feature = "const_ops", issue = "90080")]
453+
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
454454
#[diagnostic::on_unimplemented(
455455
message = "cannot divide `{Self}` by `{Rhs}`",
456456
label = "no implementation for `{Self} / {Rhs}`"
@@ -484,7 +484,7 @@ macro_rules! div_impl_integer {
484484
///
485485
#[doc = $panic]
486486
#[stable(feature = "rust1", since = "1.0.0")]
487-
#[rustc_const_unstable(feature = "const_ops", issue = "90080")]
487+
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
488488
impl const Div for $t {
489489
type Output = $t;
490490

@@ -505,7 +505,7 @@ div_impl_integer! {
505505
macro_rules! div_impl_float {
506506
($($t:ty)*) => ($(
507507
#[stable(feature = "rust1", since = "1.0.0")]
508-
#[rustc_const_unstable(feature = "const_ops", issue = "90080")]
508+
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
509509
impl const Div for $t {
510510
type Output = $t;
511511

@@ -556,7 +556,7 @@ div_impl_float! { f16 f32 f64 f128 }
556556
/// ```
557557
#[lang = "rem"]
558558
#[stable(feature = "rust1", since = "1.0.0")]
559-
#[rustc_const_unstable(feature = "const_ops", issue = "90080")]
559+
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
560560
#[diagnostic::on_unimplemented(
561561
message = "cannot calculate the remainder of `{Self}` divided by `{Rhs}`",
562562
label = "no implementation for `{Self} % {Rhs}`"
@@ -590,7 +590,7 @@ macro_rules! rem_impl_integer {
590590
///
591591
#[doc = $panic]
592592
#[stable(feature = "rust1", since = "1.0.0")]
593-
#[rustc_const_unstable(feature = "const_ops", issue = "90080")]
593+
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
594594
impl const Rem for $t {
595595
type Output = $t;
596596

@@ -626,7 +626,7 @@ macro_rules! rem_impl_float {
626626
/// assert_eq!(x % y, remainder);
627627
/// ```
628628
#[stable(feature = "rust1", since = "1.0.0")]
629-
#[rustc_const_unstable(feature = "const_ops", issue = "90080")]
629+
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
630630
impl const Rem for $t {
631631
type Output = $t;
632632

library/std/src/sys/random/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ cfg_if::cfg_if! {
2020
target_os = "rtems",
2121
target_os = "solaris",
2222
target_os = "vita",
23+
target_os = "nuttx",
2324
))] {
2425
mod arc4random;
2526
pub use arc4random::fill_bytes;
@@ -44,7 +45,6 @@ cfg_if::cfg_if! {
4445
target_os = "hurd",
4546
target_os = "l4re",
4647
target_os = "nto",
47-
target_os = "nuttx",
4848
))] {
4949
mod unix_legacy;
5050
pub use unix_legacy::fill_bytes;

src/bootstrap/Cargo.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -386,9 +386,9 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe"
386386

387387
[[package]]
388388
name = "libc"
389-
version = "0.2.172"
389+
version = "0.2.174"
390390
source = "registry+https://github.com/rust-lang/crates.io-index"
391-
checksum = "d750af042f7ef4f724306de029d18836c26c1765a54a6a3f094cbd23a7267ffa"
391+
checksum = "1171693293099992e19cddea4e8b849964e9846f4acee11b3948bcc337be8776"
392392

393393
[[package]]
394394
name = "libredox"
@@ -730,9 +730,9 @@ dependencies = [
730730

731731
[[package]]
732732
name = "sysinfo"
733-
version = "0.35.0"
733+
version = "0.36.0"
734734
source = "registry+https://github.com/rust-lang/crates.io-index"
735-
checksum = "b897c8ea620e181c7955369a31be5f48d9a9121cb59fd33ecef9ff2a34323422"
735+
checksum = "aab138f5c1bb35231de19049060a87977ad23e04f2303e953bc5c2947ac7dec4"
736736
dependencies = [
737737
"libc",
738738
"memchr",

src/bootstrap/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ walkdir = "2.4"
5858
xz2 = "0.1"
5959

6060
# Dependencies needed by the build-metrics feature
61-
sysinfo = { version = "0.35.0", default-features = false, optional = true, features = ["system"] }
61+
sysinfo = { version = "0.36.0", default-features = false, optional = true, features = ["system"] }
6262

6363
# Dependencies needed by the `tracing` feature
6464
tracing = { version = "0.1", optional = true, features = ["attributes"] }

src/bootstrap/src/core/build_steps/test.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -556,8 +556,13 @@ impl Step for Miri {
556556
// Miri has its own "target dir" for ui test dependencies. Make sure it gets cleared when
557557
// the sysroot gets rebuilt, to avoid "found possibly newer version of crate `std`" errors.
558558
if !builder.config.dry_run() {
559-
let ui_test_dep_dir =
560-
builder.stage_out(miri.build_compiler, Mode::ToolStd).join("miri_ui");
559+
// This has to match `CARGO_TARGET_TMPDIR` in Miri's `ui.rs`.
560+
// This means we need `host` here as that's the target `ui.rs` is built for.
561+
let ui_test_dep_dir = builder
562+
.stage_out(miri.build_compiler, Mode::ToolStd)
563+
.join(host)
564+
.join("tmp")
565+
.join("miri_ui");
561566
// The mtime of `miri_sysroot` changes when the sysroot gets rebuilt (also see
562567
// <https://github.com/RalfJung/rustc-build-sysroot/commit/10ebcf60b80fe2c3dc765af0ff19fdc0da4b7466>).
563568
// We can hence use that directly as a signal to clear the ui test dir.

0 commit comments

Comments
 (0)