Skip to content

Commit 9839f9c

Browse files
committed
Auto merge of #86456 - JohnTitor:rollup-jjzupny, r=JohnTitor
Rollup of 9 pull requests Successful merges: - #86136 (Stabilize span_open() and span_close().) - #86359 (Use as_secs_f64 in JunitFormatter) - #86370 (Fix rustdoc stabilized versions layout) - #86397 (Alter std::cell::Cell::get_mut documentation) - #86407 (Use `map_or` instead of open-coding it) - #86425 (Update rustversion to 1.0.5) - #86440 (Update library tracking issue for libs-api rename.) - #86444 (Fix ICE with `#[repr(simd)]` on enum) - #86453 (stdlib: Fix typo in internal RefCell docs ) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2 parents ec57c60 + ad79aba commit 9839f9c

File tree

11 files changed

+79
-19
lines changed

11 files changed

+79
-19
lines changed

.github/ISSUE_TEMPLATE/library_tracking_issue.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name: Library Tracking Issue
33
about: A tracking issue for an unstable library feature.
44
title: Tracking Issue for XXX
5-
labels: C-tracking-issue, T-libs
5+
labels: C-tracking-issue, T-libs-api
66
---
77
<!--
88
Thank you for creating a tracking issue!
@@ -60,7 +60,7 @@ unresolved questions left, the feature might be ready for stabilization.
6060
If this feature didn't go through the RFC process, a final commenting period
6161
(FCP) is always needed before stabilization. This works as follows:
6262
63-
A library team member can kick off the stabilization process, at which point
63+
A library API team member can kick off the stabilization process, at which point
6464
the rfcbot will ask all the team members to verify they agree with
6565
stabilization. Once enough members agree and there are no concerns, the final
6666
commenting period begins: this issue will be marked as such and will be listed

Cargo.lock

+2-2
Original file line numberDiff line numberDiff line change
@@ -4609,9 +4609,9 @@ dependencies = [
46094609

46104610
[[package]]
46114611
name = "rustversion"
4612-
version = "1.0.4"
4612+
version = "1.0.5"
46134613
source = "registry+https://github.com/rust-lang/crates.io-index"
4614-
checksum = "cb5d2a036dc6d2d8fd16fde3498b04306e29bd193bf306a57427019b823d5acd"
4614+
checksum = "61b3909d758bb75c79f23d4736fac9433868679d3ad2ea7a61e3c25cfda9a088"
46154615

46164616
[[package]]
46174617
name = "ryu"

compiler/rustc_middle/src/ty/layout.rs

+9
Original file line numberDiff line numberDiff line change
@@ -672,6 +672,15 @@ impl<'tcx> LayoutCx<'tcx, TyCtxt<'tcx>> {
672672

673673
// SIMD vector types.
674674
ty::Adt(def, substs) if def.repr.simd() => {
675+
if !def.is_struct() {
676+
// Should have yielded E0517 by now.
677+
tcx.sess.delay_span_bug(
678+
DUMMY_SP,
679+
"#[repr(simd)] was applied to an ADT that is not a struct",
680+
);
681+
return Err(LayoutError::Unknown(ty));
682+
}
683+
675684
// Supported SIMD vectors are homogeneous ADTs with at least one field:
676685
//
677686
// * #[repr(simd)] struct S(T, T, T, T);

compiler/rustc_mir/src/transform/const_prop.rs

+3-6
Original file line numberDiff line numberDiff line change
@@ -1205,12 +1205,9 @@ impl<'mir, 'tcx> MutVisitor<'tcx> for ConstPropagator<'mir, 'tcx> {
12051205
let mut eval_to_int = |op| {
12061206
// This can be `None` if the lhs wasn't const propagated and we just
12071207
// triggered the assert on the value of the rhs.
1208-
match self.eval_operand(op, source_info) {
1209-
Some(op) => DbgVal::Val(
1210-
self.ecx.read_immediate(&op).unwrap().to_const_int(),
1211-
),
1212-
None => DbgVal::Underscore,
1213-
}
1208+
self.eval_operand(op, source_info).map_or(DbgVal::Underscore, |op| {
1209+
DbgVal::Val(self.ecx.read_immediate(&op).unwrap().to_const_int())
1210+
})
12141211
};
12151212
let msg = match msg {
12161213
AssertKind::DivisionByZero(op) => {

library/core/src/cell.rs

+8-1
Original file line numberDiff line numberDiff line change
@@ -488,6 +488,13 @@ impl<T: ?Sized> Cell<T> {
488488
/// This call borrows `Cell` mutably (at compile-time) which guarantees
489489
/// that we possess the only reference.
490490
///
491+
/// However be cautious: this method expects `self` to be mutable, which is
492+
/// generally not the case when using a `Cell`. If you require interior
493+
/// mutability by reference, consider using `RefCell` which provides
494+
/// run-time checked mutable borrows through its [`borrow_mut`] method.
495+
///
496+
/// [`borrow_mut`]: RefCell::borrow_mut()
497+
///
491498
/// # Examples
492499
///
493500
/// ```
@@ -578,7 +585,7 @@ pub struct RefCell<T: ?Sized> {
578585
// Stores the location of the earliest currently active borrow.
579586
// This gets updated whenver we go from having zero borrows
580587
// to having a single borrow. When a borrow occurs, this gets included
581-
// in the generated `BorroeError/`BorrowMutError`
588+
// in the generated `BorrowError/`BorrowMutError`
582589
#[cfg(feature = "debug_refcell")]
583590
borrowed_at: Cell<Option<&'static crate::panic::Location<'static>>>,
584591
value: UnsafeCell<T>,

library/proc_macro/src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -708,7 +708,7 @@ impl Group {
708708
/// pub fn span_open(&self) -> Span {
709709
/// ^
710710
/// ```
711-
#[unstable(feature = "proc_macro_span", issue = "54725")]
711+
#[stable(feature = "proc_macro_group_span", since = "1.55.0")]
712712
pub fn span_open(&self) -> Span {
713713
Span(self.0.span_open())
714714
}
@@ -719,7 +719,7 @@ impl Group {
719719
/// pub fn span_close(&self) -> Span {
720720
/// ^
721721
/// ```
722-
#[unstable(feature = "proc_macro_span", issue = "54725")]
722+
#[stable(feature = "proc_macro_group_span", since = "1.55.0")]
723723
pub fn span_close(&self) -> Span {
724724
Span(self.0.span_close())
725725
}

library/test/src/formatters/junit.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ impl<T: Write> OutputFormatter for JunitFormatter<T> {
7979
name=\"{}\" time=\"{}\">",
8080
class_name,
8181
test_name,
82-
duration.as_secs()
82+
duration.as_secs_f64()
8383
))?;
8484
self.write_message("<failure type=\"assert\"/>")?;
8585
self.write_message("</testcase>")?;
@@ -91,7 +91,7 @@ impl<T: Write> OutputFormatter for JunitFormatter<T> {
9191
name=\"{}\" time=\"{}\">",
9292
class_name,
9393
test_name,
94-
duration.as_secs()
94+
duration.as_secs_f64()
9595
))?;
9696
self.write_message(&*format!("<failure message=\"{}\" type=\"assert\"/>", m))?;
9797
self.write_message("</testcase>")?;
@@ -103,7 +103,7 @@ impl<T: Write> OutputFormatter for JunitFormatter<T> {
103103
name=\"{}\" time=\"{}\">",
104104
class_name,
105105
test_name,
106-
duration.as_secs()
106+
duration.as_secs_f64()
107107
))?;
108108
self.write_message("<failure type=\"timeout\"/>")?;
109109
self.write_message("</testcase>")?;
@@ -123,7 +123,7 @@ impl<T: Write> OutputFormatter for JunitFormatter<T> {
123123
name=\"{}\" time=\"{}\"/>",
124124
class_name,
125125
test_name,
126-
duration.as_secs()
126+
duration.as_secs_f64()
127127
))?;
128128
}
129129
}

src/librustdoc/html/render/print_item.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -981,7 +981,9 @@ fn item_enum(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, e: &clean::Enum
981981
}
982982
w.write_str(")");
983983
}
984-
w.write_str("</code></div>");
984+
w.write_str("</code>");
985+
render_stability_since(w, variant, it, cx.tcx());
986+
w.write_str("</div>");
985987
document(w, cx, variant, Some(it));
986988
document_non_exhaustive(w, variant);
987989

@@ -1023,7 +1025,6 @@ fn item_enum(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, e: &clean::Enum
10231025
w.write_str("</div></div>");
10241026
toggle_close(w);
10251027
}
1026-
render_stability_since(w, variant, it, cx.tcx());
10271028
}
10281029
}
10291030
let def_id = it.def_id.expect_real();

src/librustdoc/html/static/rustdoc.css

+6
Original file line numberDiff line numberDiff line change
@@ -653,6 +653,12 @@ a {
653653
background: transparent;
654654
}
655655

656+
.small-section-header {
657+
display: flex;
658+
justify-content: space-between;
659+
position: relative;
660+
}
661+
656662
.small-section-header:hover > .anchor {
657663
display: initial;
658664
}
+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// Regression test for the ICE described in #83505.
2+
3+
#![crate_type="lib"]
4+
5+
#[repr(simd)]
6+
//~^ ERROR: attribute should be applied to a struct [E0517]
7+
//~| ERROR: unsupported representation for zero-variant enum [E0084]
8+
enum Es {}
9+
static CLs: Es;
10+
//~^ ERROR: free static item without body
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
error: free static item without body
2+
--> $DIR/issue-83505-repr-simd.rs:9:1
3+
|
4+
LL | static CLs: Es;
5+
| ^^^^^^^^^^^^^^-
6+
| |
7+
| help: provide a definition for the static: `= <expr>;`
8+
9+
error[E0517]: attribute should be applied to a struct
10+
--> $DIR/issue-83505-repr-simd.rs:5:8
11+
|
12+
LL | #[repr(simd)]
13+
| ^^^^
14+
...
15+
LL | enum Es {}
16+
| ---------- not a struct
17+
18+
error[E0084]: unsupported representation for zero-variant enum
19+
--> $DIR/issue-83505-repr-simd.rs:5:1
20+
|
21+
LL | #[repr(simd)]
22+
| ^^^^^^^^^^^^^
23+
...
24+
LL | enum Es {}
25+
| ---------- zero-variant enum
26+
27+
error: aborting due to 3 previous errors
28+
29+
Some errors have detailed explanations: E0084, E0517.
30+
For more information about an error, try `rustc --explain E0084`.

0 commit comments

Comments
 (0)