Skip to content

Commit d2c24aa

Browse files
committed
Auto merge of rust-lang#91203 - GuillaumeGomez:rollup-kwtqvb1, r=GuillaumeGomez
Rollup of 7 pull requests Successful merges: - rust-lang#89542 (Partially stabilize `duration_consts_2`) - rust-lang#90044 (Restrict aarch64 outline atomics to glibc for now.) - rust-lang#90420 (Create rustdoc_internals feature gate) - rust-lang#91075 (Reduce prominence of item-infos) - rust-lang#91151 (Fix test in std::process on android) - rust-lang#91179 (Fix more <a> color) - rust-lang#91199 (rustdoc: Add test for mixing doc comments and attrs) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2 parents b426445 + ae9681e commit d2c24aa

36 files changed

+199
-127
lines changed

compiler/rustc_ast_passes/src/feature_gate.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -325,8 +325,12 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
325325
cfg_hide => doc_cfg_hide
326326
masked => doc_masked
327327
notable_trait => doc_notable_trait
328-
keyword => doc_keyword
329328
);
329+
330+
if nested_meta.has_name(sym::keyword) {
331+
let msg = "`#[doc(keyword)]` is meant for internal use only";
332+
gate_feature_post!(self, rustdoc_internals, attr.span, msg);
333+
}
330334
}
331335
}
332336

compiler/rustc_feature/src/active.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,8 @@ declare_features! (
206206
(active, rustc_allow_const_fn_unstable, "1.49.0", Some(69399), None),
207207
/// Allows using compiler's own crates.
208208
(active, rustc_private, "1.0.0", Some(27812), None),
209+
/// Allows using internal rustdoc features like `doc(primitive)` or `doc(keyword)`.
210+
(active, rustdoc_internals, "1.58.0", Some(90418), None),
209211
/// Allows using `#[start]` on a function indicating that it is the program entrypoint.
210212
(active, start, "1.0.0", Some(29633), None),
211213
/// Allows using `#[structural_match]` which indicates that a type is structurally matchable.
@@ -366,12 +368,8 @@ declare_features! (
366368
(active, doc_cfg, "1.21.0", Some(43781), None),
367369
/// Allows `#[doc(cfg_hide(...))]`.
368370
(active, doc_cfg_hide, "1.57.0", Some(43781), None),
369-
/// Allows using `#[doc(keyword = "...")]`.
370-
(active, doc_keyword, "1.28.0", Some(51315), None),
371371
/// Allows `#[doc(masked)]`.
372372
(active, doc_masked, "1.21.0", Some(44027), None),
373-
/// Allows using doc(primitive) without a future-incompat warning
374-
(active, doc_primitive, "1.56.0", Some(88070), None),
375373
/// Allows `X..Y` patterns.
376374
(active, exclusive_range_pattern, "1.11.0", Some(37854), None),
377375
/// Allows exhaustive pattern matching on types that contain uninhabited types.

compiler/rustc_feature/src/removed.rs

+6
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,12 @@ declare_features! (
7676
/// Allows the use of `#[derive(Anything)]` as sugar for `#[derive_Anything]`.
7777
(removed, custom_derive, "1.32.0", Some(29644), None,
7878
Some("subsumed by `#[proc_macro_derive]`")),
79+
/// Allows using `#[doc(keyword = "...")]`.
80+
(removed, doc_keyword, "1.28.0", Some(51315), None,
81+
Some("merged into `#![feature(rustdoc_internals)]`")),
82+
/// Allows using `doc(primitive)` without a future-incompat warning.
83+
(removed, doc_primitive, "1.56.0", Some(88070), None,
84+
Some("merged into `#![feature(rustdoc_internals)]`")),
7985
/// Allows `#[doc(spotlight)]`.
8086
/// The attribute was renamed to `#[doc(notable_trait)]`
8187
/// and the feature to `doc_notable_trait`.

compiler/rustc_passes/src/check_attr.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -982,7 +982,7 @@ impl CheckAttrVisitor<'tcx> {
982982
}
983983

984984
sym::primitive => {
985-
if !self.tcx.features().doc_primitive {
985+
if !self.tcx.features().rustdoc_internals {
986986
self.tcx.struct_span_lint_hir(
987987
INVALID_DOC_ATTRIBUTES,
988988
hir_id,

compiler/rustc_span/src/symbol.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1155,6 +1155,7 @@ symbols! {
11551155
rustc_unsafe_specialization_marker,
11561156
rustc_variance,
11571157
rustdoc,
1158+
rustdoc_internals,
11581159
rustfmt,
11591160
rvalue_static_promotion,
11601161
s,

compiler/rustc_target/src/spec/aarch64_unknown_linux_musl.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@ pub fn target() -> Target {
99
pointer_width: 64,
1010
data_layout: "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128".to_string(),
1111
arch: "aarch64".to_string(),
12-
options: TargetOptions {
13-
features: "+outline-atomics".to_string(),
14-
mcount: "\u{1}_mcount".to_string(),
15-
..base
16-
},
12+
options: TargetOptions { mcount: "\u{1}_mcount".to_string(), ..base },
1713
}
1814
}

library/core/src/lib.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@
138138
#![feature(const_type_id)]
139139
#![feature(const_type_name)]
140140
#![feature(const_default_impls)]
141-
#![feature(duration_consts_2)]
141+
#![feature(duration_consts_float)]
142142
#![feature(ptr_metadata)]
143143
#![feature(slice_ptr_get)]
144144
#![feature(str_internals)]
@@ -166,7 +166,8 @@
166166
#![feature(derive_default_enum)]
167167
#![feature(doc_cfg)]
168168
#![feature(doc_notable_trait)]
169-
#![feature(doc_primitive)]
169+
#![cfg_attr(bootstrap, feature(doc_primitive))]
170+
#![cfg_attr(not(bootstrap), feature(rustdoc_internals))]
170171
#![feature(exhaustive_patterns)]
171172
#![feature(doc_cfg_hide)]
172173
#![feature(extern_types)]

library/core/src/time.rs

+23-18
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,9 @@ impl Duration {
180180
/// ```
181181
#[stable(feature = "duration", since = "1.3.0")]
182182
#[inline]
183-
#[rustc_const_unstable(feature = "duration_consts_2", issue = "72440")]
184183
#[must_use]
184+
#[rustc_const_stable(feature = "duration_consts_2", since = "1.58.0")]
185+
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_panic))]
185186
pub const fn new(secs: u64, nanos: u32) -> Duration {
186187
let secs = match secs.checked_add((nanos / NANOS_PER_SEC) as u64) {
187188
Some(secs) => secs,
@@ -480,7 +481,8 @@ impl Duration {
480481
#[must_use = "this returns the result of the operation, \
481482
without modifying the original"]
482483
#[inline]
483-
#[rustc_const_unstable(feature = "duration_consts_2", issue = "72440")]
484+
#[rustc_const_stable(feature = "duration_consts_2", since = "1.58.0")]
485+
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_panic))]
484486
pub const fn checked_add(self, rhs: Duration) -> Option<Duration> {
485487
if let Some(mut secs) = self.secs.checked_add(rhs.secs) {
486488
let mut nanos = self.nanos + rhs.nanos;
@@ -515,7 +517,7 @@ impl Duration {
515517
#[must_use = "this returns the result of the operation, \
516518
without modifying the original"]
517519
#[inline]
518-
#[rustc_const_unstable(feature = "duration_consts_2", issue = "72440")]
520+
#[rustc_const_stable(feature = "duration_consts_2", since = "1.58.0")]
519521
pub const fn saturating_add(self, rhs: Duration) -> Duration {
520522
match self.checked_add(rhs) {
521523
Some(res) => res,
@@ -540,7 +542,8 @@ impl Duration {
540542
#[must_use = "this returns the result of the operation, \
541543
without modifying the original"]
542544
#[inline]
543-
#[rustc_const_unstable(feature = "duration_consts_2", issue = "72440")]
545+
#[rustc_const_stable(feature = "duration_consts_2", since = "1.58.0")]
546+
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_panic))]
544547
pub const fn checked_sub(self, rhs: Duration) -> Option<Duration> {
545548
if let Some(mut secs) = self.secs.checked_sub(rhs.secs) {
546549
let nanos = if self.nanos >= rhs.nanos {
@@ -573,7 +576,7 @@ impl Duration {
573576
#[must_use = "this returns the result of the operation, \
574577
without modifying the original"]
575578
#[inline]
576-
#[rustc_const_unstable(feature = "duration_consts_2", issue = "72440")]
579+
#[rustc_const_stable(feature = "duration_consts_2", since = "1.58.0")]
577580
pub const fn saturating_sub(self, rhs: Duration) -> Duration {
578581
match self.checked_sub(rhs) {
579582
Some(res) => res,
@@ -598,7 +601,8 @@ impl Duration {
598601
#[must_use = "this returns the result of the operation, \
599602
without modifying the original"]
600603
#[inline]
601-
#[rustc_const_unstable(feature = "duration_consts_2", issue = "72440")]
604+
#[rustc_const_stable(feature = "duration_consts_2", since = "1.58.0")]
605+
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_panic))]
602606
pub const fn checked_mul(self, rhs: u32) -> Option<Duration> {
603607
// Multiply nanoseconds as u64, because it cannot overflow that way.
604608
let total_nanos = self.nanos as u64 * rhs as u64;
@@ -629,7 +633,7 @@ impl Duration {
629633
#[must_use = "this returns the result of the operation, \
630634
without modifying the original"]
631635
#[inline]
632-
#[rustc_const_unstable(feature = "duration_consts_2", issue = "72440")]
636+
#[rustc_const_stable(feature = "duration_consts_2", since = "1.58.0")]
633637
pub const fn saturating_mul(self, rhs: u32) -> Duration {
634638
match self.checked_mul(rhs) {
635639
Some(res) => res,
@@ -655,7 +659,8 @@ impl Duration {
655659
#[must_use = "this returns the result of the operation, \
656660
without modifying the original"]
657661
#[inline]
658-
#[rustc_const_unstable(feature = "duration_consts_2", issue = "72440")]
662+
#[rustc_const_stable(feature = "duration_consts_2", since = "1.58.0")]
663+
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_panic))]
659664
pub const fn checked_div(self, rhs: u32) -> Option<Duration> {
660665
if rhs != 0 {
661666
let secs = self.secs / (rhs as u64);
@@ -683,7 +688,7 @@ impl Duration {
683688
#[stable(feature = "duration_float", since = "1.38.0")]
684689
#[must_use]
685690
#[inline]
686-
#[rustc_const_unstable(feature = "duration_consts_2", issue = "72440")]
691+
#[rustc_const_unstable(feature = "duration_consts_float", issue = "72440")]
687692
pub const fn as_secs_f64(&self) -> f64 {
688693
(self.secs as f64) + (self.nanos as f64) / (NANOS_PER_SEC as f64)
689694
}
@@ -702,7 +707,7 @@ impl Duration {
702707
#[stable(feature = "duration_float", since = "1.38.0")]
703708
#[must_use]
704709
#[inline]
705-
#[rustc_const_unstable(feature = "duration_consts_2", issue = "72440")]
710+
#[rustc_const_unstable(feature = "duration_consts_float", issue = "72440")]
706711
pub const fn as_secs_f32(&self) -> f32 {
707712
(self.secs as f32) + (self.nanos as f32) / (NANOS_PER_SEC as f32)
708713
}
@@ -723,7 +728,7 @@ impl Duration {
723728
#[stable(feature = "duration_float", since = "1.38.0")]
724729
#[must_use]
725730
#[inline]
726-
#[rustc_const_unstable(feature = "duration_consts_2", issue = "72440")]
731+
#[rustc_const_unstable(feature = "duration_consts_float", issue = "72440")]
727732
pub const fn from_secs_f64(secs: f64) -> Duration {
728733
match Duration::try_from_secs_f64(secs) {
729734
Ok(v) => v,
@@ -784,7 +789,7 @@ impl Duration {
784789
#[stable(feature = "duration_float", since = "1.38.0")]
785790
#[must_use]
786791
#[inline]
787-
#[rustc_const_unstable(feature = "duration_consts_2", issue = "72440")]
792+
#[rustc_const_unstable(feature = "duration_consts_float", issue = "72440")]
788793
pub const fn from_secs_f32(secs: f32) -> Duration {
789794
match Duration::try_from_secs_f32(secs) {
790795
Ok(v) => v,
@@ -846,7 +851,7 @@ impl Duration {
846851
#[must_use = "this returns the result of the operation, \
847852
without modifying the original"]
848853
#[inline]
849-
#[rustc_const_unstable(feature = "duration_consts_2", issue = "72440")]
854+
#[rustc_const_unstable(feature = "duration_consts_float", issue = "72440")]
850855
pub const fn mul_f64(self, rhs: f64) -> Duration {
851856
Duration::from_secs_f64(rhs * self.as_secs_f64())
852857
}
@@ -870,7 +875,7 @@ impl Duration {
870875
#[must_use = "this returns the result of the operation, \
871876
without modifying the original"]
872877
#[inline]
873-
#[rustc_const_unstable(feature = "duration_consts_2", issue = "72440")]
878+
#[rustc_const_unstable(feature = "duration_consts_float", issue = "72440")]
874879
pub const fn mul_f32(self, rhs: f32) -> Duration {
875880
Duration::from_secs_f32(rhs * self.as_secs_f32())
876881
}
@@ -893,7 +898,7 @@ impl Duration {
893898
#[must_use = "this returns the result of the operation, \
894899
without modifying the original"]
895900
#[inline]
896-
#[rustc_const_unstable(feature = "duration_consts_2", issue = "72440")]
901+
#[rustc_const_unstable(feature = "duration_consts_float", issue = "72440")]
897902
pub const fn div_f64(self, rhs: f64) -> Duration {
898903
Duration::from_secs_f64(self.as_secs_f64() / rhs)
899904
}
@@ -918,7 +923,7 @@ impl Duration {
918923
#[must_use = "this returns the result of the operation, \
919924
without modifying the original"]
920925
#[inline]
921-
#[rustc_const_unstable(feature = "duration_consts_2", issue = "72440")]
926+
#[rustc_const_unstable(feature = "duration_consts_float", issue = "72440")]
922927
pub const fn div_f32(self, rhs: f32) -> Duration {
923928
Duration::from_secs_f32(self.as_secs_f32() / rhs)
924929
}
@@ -938,7 +943,7 @@ impl Duration {
938943
#[must_use = "this returns the result of the operation, \
939944
without modifying the original"]
940945
#[inline]
941-
#[rustc_const_unstable(feature = "duration_consts_2", issue = "72440")]
946+
#[rustc_const_unstable(feature = "duration_consts_float", issue = "72440")]
942947
pub const fn div_duration_f64(self, rhs: Duration) -> f64 {
943948
self.as_secs_f64() / rhs.as_secs_f64()
944949
}
@@ -958,7 +963,7 @@ impl Duration {
958963
#[must_use = "this returns the result of the operation, \
959964
without modifying the original"]
960965
#[inline]
961-
#[rustc_const_unstable(feature = "duration_consts_2", issue = "72440")]
966+
#[rustc_const_unstable(feature = "duration_consts_float", issue = "72440")]
962967
pub const fn div_duration_f32(self, rhs: Duration) -> f32 {
963968
self.as_secs_f32() / rhs.as_secs_f32()
964969
}

library/core/tests/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
#![feature(core_private_diy_float)]
2222
#![feature(dec2flt)]
2323
#![feature(div_duration)]
24-
#![feature(duration_consts_2)]
24+
#![feature(duration_consts_float)]
2525
#![feature(duration_constants)]
2626
#![feature(exact_size_is_empty)]
2727
#![feature(extern_types)]

library/std/src/lib.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -275,10 +275,11 @@
275275
#![feature(decl_macro)]
276276
#![feature(doc_cfg)]
277277
#![feature(doc_cfg_hide)]
278-
#![feature(doc_keyword)]
278+
#![cfg_attr(bootstrap, feature(doc_primitive))]
279+
#![cfg_attr(bootstrap, feature(doc_keyword))]
280+
#![cfg_attr(not(bootstrap), feature(rustdoc_internals))]
279281
#![feature(doc_masked)]
280282
#![feature(doc_notable_trait)]
281-
#![feature(doc_primitive)]
282283
#![feature(dropck_eyepatch)]
283284
#![feature(duration_checked_float)]
284285
#![feature(duration_constants)]

0 commit comments

Comments
 (0)