From 6288aada6de5c593a3d37bf51bbfda297d1b150b Mon Sep 17 00:00:00 2001 From: Mara Bos Date: Tue, 8 Jun 2021 16:45:54 +0200 Subject: [PATCH 1/9] Stabilize span_open() and span_close(). --- library/proc_macro/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/proc_macro/src/lib.rs b/library/proc_macro/src/lib.rs index 3990826ce42..32fe0ad83d9 100644 --- a/library/proc_macro/src/lib.rs +++ b/library/proc_macro/src/lib.rs @@ -707,7 +707,7 @@ impl Group { /// pub fn span_open(&self) -> Span { /// ^ /// ``` - #[unstable(feature = "proc_macro_span", issue = "54725")] + #[stable(feature = "proc_macro_group_span", since = "1.55.0")] pub fn span_open(&self) -> Span { Span(self.0.span_open()) } @@ -718,7 +718,7 @@ impl Group { /// pub fn span_close(&self) -> Span { /// ^ /// ``` - #[unstable(feature = "proc_macro_span", issue = "54725")] + #[stable(feature = "proc_macro_group_span", since = "1.55.0")] pub fn span_close(&self) -> Span { Span(self.0.span_close()) } From e4b3131584bab1b4a5bf3480e79e305945762479 Mon Sep 17 00:00:00 2001 From: Deadbeef Date: Thu, 17 Jun 2021 03:23:17 +0800 Subject: [PATCH 2/9] Use as_secs_f64 in JunitFormatter --- library/test/src/formatters/junit.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/library/test/src/formatters/junit.rs b/library/test/src/formatters/junit.rs index ec66fc1219f..c4b0e1e5c23 100644 --- a/library/test/src/formatters/junit.rs +++ b/library/test/src/formatters/junit.rs @@ -79,7 +79,7 @@ impl OutputFormatter for JunitFormatter { name=\"{}\" time=\"{}\">", class_name, test_name, - duration.as_secs() + duration.as_secs_f64() ))?; self.write_message("")?; self.write_message("")?; @@ -91,7 +91,7 @@ impl OutputFormatter for JunitFormatter { name=\"{}\" time=\"{}\">", class_name, test_name, - duration.as_secs() + duration.as_secs_f64() ))?; self.write_message(&*format!("", m))?; self.write_message("")?; @@ -103,7 +103,7 @@ impl OutputFormatter for JunitFormatter { name=\"{}\" time=\"{}\">", class_name, test_name, - duration.as_secs() + duration.as_secs_f64() ))?; self.write_message("")?; self.write_message("")?; @@ -123,7 +123,7 @@ impl OutputFormatter for JunitFormatter { name=\"{}\" time=\"{}\"/>", class_name, test_name, - duration.as_secs() + duration.as_secs_f64() ))?; } } From 68f9172fc136ab0b5cbc082eb7a51a725c108a7d Mon Sep 17 00:00:00 2001 From: Matteo Briani Date: Thu, 17 Jun 2021 09:57:48 +0200 Subject: [PATCH 3/9] Fix rustdoc stabilized versions layout --- src/librustdoc/html/render/print_item.rs | 5 +++-- src/librustdoc/html/static/rustdoc.css | 6 ++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/librustdoc/html/render/print_item.rs b/src/librustdoc/html/render/print_item.rs index 04464b622d7..a606d0d01ef 100644 --- a/src/librustdoc/html/render/print_item.rs +++ b/src/librustdoc/html/render/print_item.rs @@ -979,7 +979,9 @@ fn item_enum(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, e: &clean::Enum } w.write_str(")"); } - w.write_str(""); + w.write_str(""); + render_stability_since(w, variant, it, cx.tcx()); + w.write_str(""); document(w, cx, variant, Some(it)); document_non_exhaustive(w, variant); @@ -1021,7 +1023,6 @@ fn item_enum(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, e: &clean::Enum w.write_str(""); toggle_close(w); } - render_stability_since(w, variant, it, cx.tcx()); } } let def_id = it.def_id.expect_real(); diff --git a/src/librustdoc/html/static/rustdoc.css b/src/librustdoc/html/static/rustdoc.css index 7535145caa5..51bd6a79f94 100644 --- a/src/librustdoc/html/static/rustdoc.css +++ b/src/librustdoc/html/static/rustdoc.css @@ -654,6 +654,12 @@ a { background: transparent; } +.small-section-header { + display: flex; + justify-content: space-between; + position: relative; +} + .small-section-header:hover > .anchor { display: initial; } From 7cadf7bc0167d254d564ec81361db257e7ed2e82 Mon Sep 17 00:00:00 2001 From: Rupert Rutledge <1982481+Eosis@users.noreply.github.com> Date: Thu, 17 Jun 2021 11:02:16 +0100 Subject: [PATCH 4/9] Alter std::cell::Cell::get_mut documentation I find this more consistent with RefCell's equivalent method. --- library/core/src/cell.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/library/core/src/cell.rs b/library/core/src/cell.rs index f88a6e418c7..6fd49361585 100644 --- a/library/core/src/cell.rs +++ b/library/core/src/cell.rs @@ -488,6 +488,13 @@ impl Cell { /// This call borrows `Cell` mutably (at compile-time) which guarantees /// that we possess the only reference. /// + /// However be cautious: this method expects `self` to be mutable, which is + /// generally not the case when using a `Cell`. If you require interior + /// mutability by reference, consider using `RefCell` which provides + /// run-time checked mutable borrows through its [`borrow_mut`] method. + /// + /// [`borrow_mut`]: RefCell::borrow_mut() + /// /// # Examples /// /// ``` From 382ba79380c3e294cb18c2439f6aff945ee7b2d2 Mon Sep 17 00:00:00 2001 From: LingMan Date: Thu, 17 Jun 2021 19:39:58 +0200 Subject: [PATCH 5/9] Use `map_or` instead of open-coding it --- compiler/rustc_mir/src/transform/const_prop.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/compiler/rustc_mir/src/transform/const_prop.rs b/compiler/rustc_mir/src/transform/const_prop.rs index 73a0f5537c3..b56c247127c 100644 --- a/compiler/rustc_mir/src/transform/const_prop.rs +++ b/compiler/rustc_mir/src/transform/const_prop.rs @@ -1205,12 +1205,9 @@ impl<'mir, 'tcx> MutVisitor<'tcx> for ConstPropagator<'mir, 'tcx> { let mut eval_to_int = |op| { // This can be `None` if the lhs wasn't const propagated and we just // triggered the assert on the value of the rhs. - match self.eval_operand(op, source_info) { - Some(op) => DbgVal::Val( - self.ecx.read_immediate(&op).unwrap().to_const_int(), - ), - None => DbgVal::Underscore, - } + self.eval_operand(op, source_info).map_or(DbgVal::Underscore, |op| { + DbgVal::Val(self.ecx.read_immediate(&op).unwrap().to_const_int()) + }) }; let msg = match msg { AssertKind::DivisionByZero(op) => { From fbfc079d4af01f821c62f7977c01f7fbdb3da2f3 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Thu, 17 Jun 2021 22:34:55 -0700 Subject: [PATCH 6/9] Update rustversion to 1.0.5 --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2f06506eaa4..bc8b79342b2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4609,9 +4609,9 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.4" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb5d2a036dc6d2d8fd16fde3498b04306e29bd193bf306a57427019b823d5acd" +checksum = "61b3909d758bb75c79f23d4736fac9433868679d3ad2ea7a61e3c25cfda9a088" [[package]] name = "ryu" From 8776b0f41cb6b02a6e85450b81606d23acc4a7bf Mon Sep 17 00:00:00 2001 From: Mara Bos Date: Fri, 18 Jun 2021 18:44:09 +0200 Subject: [PATCH 7/9] Update library tracking issue for libs-api rename. --- .github/ISSUE_TEMPLATE/library_tracking_issue.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/library_tracking_issue.md b/.github/ISSUE_TEMPLATE/library_tracking_issue.md index cbc4465fcfe..e879594b87a 100644 --- a/.github/ISSUE_TEMPLATE/library_tracking_issue.md +++ b/.github/ISSUE_TEMPLATE/library_tracking_issue.md @@ -2,7 +2,7 @@ name: Library Tracking Issue about: A tracking issue for an unstable library feature. title: Tracking Issue for XXX -labels: C-tracking-issue, T-libs +labels: C-tracking-issue, T-libs-api --- $DIR/issue-83505-repr-simd.rs:9:1 + | +LL | static CLs: Es; + | ^^^^^^^^^^^^^^- + | | + | help: provide a definition for the static: `= ;` + +error[E0517]: attribute should be applied to a struct + --> $DIR/issue-83505-repr-simd.rs:5:8 + | +LL | #[repr(simd)] + | ^^^^ +... +LL | enum Es {} + | ---------- not a struct + +error[E0084]: unsupported representation for zero-variant enum + --> $DIR/issue-83505-repr-simd.rs:5:1 + | +LL | #[repr(simd)] + | ^^^^^^^^^^^^^ +... +LL | enum Es {} + | ---------- zero-variant enum + +error: aborting due to 3 previous errors + +Some errors have detailed explanations: E0084, E0517. +For more information about an error, try `rustc --explain E0084`. From c688e70d66ad11f32e988f92f774f831ce9464ff Mon Sep 17 00:00:00 2001 From: Alexander Kiselev Date: Fri, 18 Jun 2021 17:43:18 -0700 Subject: [PATCH 9/9] Fixed typo `BorroeError` => `BorrowError` in RefCell docs --- library/core/src/cell.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/core/src/cell.rs b/library/core/src/cell.rs index f88a6e418c7..0c1224ce56c 100644 --- a/library/core/src/cell.rs +++ b/library/core/src/cell.rs @@ -578,7 +578,7 @@ pub struct RefCell { // Stores the location of the earliest currently active borrow. // This gets updated whenver we go from having zero borrows // to having a single borrow. When a borrow occurs, this gets included - // in the generated `BorroeError/`BorrowMutError` + // in the generated `BorrowError/`BorrowMutError` #[cfg(feature = "debug_refcell")] borrowed_at: Cell>>, value: UnsafeCell,