Skip to content

Rollup of 9 pull requests #86456

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 18 commits into from
Jun 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/library_tracking_issue.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
---
<!--
Thank you for creating a tracking issue!
Expand Down Expand Up @@ -60,7 +60,7 @@ unresolved questions left, the feature might be ready for stabilization.
If this feature didn't go through the RFC process, a final commenting period
(FCP) is always needed before stabilization. This works as follows:

A library team member can kick off the stabilization process, at which point
A library API team member can kick off the stabilization process, at which point
the rfcbot will ask all the team members to verify they agree with
stabilization. Once enough members agree and there are no concerns, the final
commenting period begins: this issue will be marked as such and will be listed
Expand Down
4 changes: 2 additions & 2 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
9 changes: 9 additions & 0 deletions compiler/rustc_middle/src/ty/layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -672,6 +672,15 @@ impl<'tcx> LayoutCx<'tcx, TyCtxt<'tcx>> {

// SIMD vector types.
ty::Adt(def, substs) if def.repr.simd() => {
if !def.is_struct() {
// Should have yielded E0517 by now.
tcx.sess.delay_span_bug(
DUMMY_SP,
"#[repr(simd)] was applied to an ADT that is not a struct",
);
return Err(LayoutError::Unknown(ty));
}

// Supported SIMD vectors are homogeneous ADTs with at least one field:
//
// * #[repr(simd)] struct S(T, T, T, T);
Expand Down
9 changes: 3 additions & 6 deletions compiler/rustc_mir/src/transform/const_prop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down
9 changes: 8 additions & 1 deletion library/core/src/cell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,13 @@ impl<T: ?Sized> Cell<T> {
/// 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
///
/// ```
Expand Down Expand Up @@ -578,7 +585,7 @@ pub struct RefCell<T: ?Sized> {
// 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<Option<&'static crate::panic::Location<'static>>>,
value: UnsafeCell<T>,
Expand Down
4 changes: 2 additions & 2 deletions library/proc_macro/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -708,7 +708,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())
}
Expand All @@ -719,7 +719,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())
}
Expand Down
8 changes: 4 additions & 4 deletions library/test/src/formatters/junit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ impl<T: Write> OutputFormatter for JunitFormatter<T> {
name=\"{}\" time=\"{}\">",
class_name,
test_name,
duration.as_secs()
duration.as_secs_f64()
))?;
self.write_message("<failure type=\"assert\"/>")?;
self.write_message("</testcase>")?;
Expand All @@ -91,7 +91,7 @@ impl<T: Write> OutputFormatter for JunitFormatter<T> {
name=\"{}\" time=\"{}\">",
class_name,
test_name,
duration.as_secs()
duration.as_secs_f64()
))?;
self.write_message(&*format!("<failure message=\"{}\" type=\"assert\"/>", m))?;
self.write_message("</testcase>")?;
Expand All @@ -103,7 +103,7 @@ impl<T: Write> OutputFormatter for JunitFormatter<T> {
name=\"{}\" time=\"{}\">",
class_name,
test_name,
duration.as_secs()
duration.as_secs_f64()
))?;
self.write_message("<failure type=\"timeout\"/>")?;
self.write_message("</testcase>")?;
Expand All @@ -123,7 +123,7 @@ impl<T: Write> OutputFormatter for JunitFormatter<T> {
name=\"{}\" time=\"{}\"/>",
class_name,
test_name,
duration.as_secs()
duration.as_secs_f64()
))?;
}
}
Expand Down
5 changes: 3 additions & 2 deletions src/librustdoc/html/render/print_item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -981,7 +981,9 @@ fn item_enum(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, e: &clean::Enum
}
w.write_str(")");
}
w.write_str("</code></div>");
w.write_str("</code>");
render_stability_since(w, variant, it, cx.tcx());
w.write_str("</div>");
document(w, cx, variant, Some(it));
document_non_exhaustive(w, variant);

Expand Down Expand Up @@ -1023,7 +1025,6 @@ fn item_enum(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, e: &clean::Enum
w.write_str("</div></div>");
toggle_close(w);
}
render_stability_since(w, variant, it, cx.tcx());
}
}
let def_id = it.def_id.expect_real();
Expand Down
6 changes: 6 additions & 0 deletions src/librustdoc/html/static/rustdoc.css
Original file line number Diff line number Diff line change
Expand Up @@ -653,6 +653,12 @@ a {
background: transparent;
}

.small-section-header {
display: flex;
justify-content: space-between;
position: relative;
}

.small-section-header:hover > .anchor {
display: initial;
}
Expand Down
10 changes: 10 additions & 0 deletions src/test/ui/repr/issue-83505-repr-simd.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// Regression test for the ICE described in #83505.

#![crate_type="lib"]

#[repr(simd)]
//~^ ERROR: attribute should be applied to a struct [E0517]
//~| ERROR: unsupported representation for zero-variant enum [E0084]
enum Es {}
static CLs: Es;
//~^ ERROR: free static item without body
30 changes: 30 additions & 0 deletions src/test/ui/repr/issue-83505-repr-simd.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
error: free static item without body
--> $DIR/issue-83505-repr-simd.rs:9:1
|
LL | static CLs: Es;
| ^^^^^^^^^^^^^^-
| |
| help: provide a definition for the static: `= <expr>;`

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`.