Skip to content

Commit e58c811

Browse files
committed
Auto merge of #84909 - pietroalbini:beta-next, r=Mark-Simulacrum
[beta] Prepare beta 1.53.0 Along with updating the channel and updating the bootstrap compiler, this also includes: * 692454d - Fixes the diagnostics difference we had for some cycles already * 9157430 - Disables the known broken RLS builder on AArch64 Windows * #84183 - Update RELEASES.md for 1.52.0 * #84950 - Revert PR 83866 * #84886 - Update RLS and Rustfmt Changes we backported to 1.52.0 that we also need to include in 1.53.0 to avoid regressing: * #84867 - rustdoc: revert deref recur to resume inclusion of impl ExtTrait<Local> for ExtType * #84759 - [beta] remove assert_matches * #83171 - Revert PR 81473 to resolve (on beta) issues 81626 and 81658. r? `@ghost`
2 parents 8a9fa36 + 4894656 commit e58c811

38 files changed

+340
-694
lines changed

Cargo.lock

+58-129
Large diffs are not rendered by default.

RELEASES.md

+148
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,151 @@
1+
Version 1.52.0 (2021-05-06)
2+
============================
3+
4+
Language
5+
--------
6+
- [Added the `unsafe_op_in_unsafe_fn` lint, which checks whether the unsafe code
7+
in an `unsafe fn` is wrapped in a `unsafe` block.][79208] This lint
8+
is allowed by default, and may become a warning or hard error in a
9+
future edition.
10+
- [You can now cast mutable references to arrays to a pointer of the same type as
11+
the element.][81479]
12+
13+
Compiler
14+
--------
15+
- [Upgraded the default LLVM to LLVM 12.][81451]
16+
17+
Added tier 3\* support for the following targets.
18+
19+
- [`s390x-unknown-linux-musl`][82166]
20+
- [`riscv32gc-unknown-linux-musl` & `riscv64gc-unknown-linux-musl`][82202]
21+
- [`powerpc-unknown-openbsd`][82733]
22+
23+
\* Refer to Rust's [platform support page][platform-support-doc] for more
24+
information on Rust's tiered platform support.
25+
26+
Libraries
27+
---------
28+
- [`OsString` now implements `Extend` and `FromIterator`.][82121]
29+
- [`cmp::Reverse` now has `#[repr(transparent)]` representation.][81879]
30+
- [`Arc<impl Error>` now implements `error::Error`.][80553]
31+
- [All integer division and remainder operations are now `const`.][80962]
32+
33+
Stabilised APIs
34+
-------------
35+
- [`Arguments::as_str`]
36+
- [`char::MAX`]
37+
- [`char::REPLACEMENT_CHARACTER`]
38+
- [`char::UNICODE_VERSION`]
39+
- [`char::decode_utf16`]
40+
- [`char::from_digit`]
41+
- [`char::from_u32_unchecked`]
42+
- [`char::from_u32`]
43+
- [`slice::partition_point`]
44+
- [`str::rsplit_once`]
45+
- [`str::split_once`]
46+
47+
The following previously stable APIs are now `const`.
48+
49+
- [`char::len_utf8`]
50+
- [`char::len_utf16`]
51+
- [`char::to_ascii_uppercase`]
52+
- [`char::to_ascii_lowercase`]
53+
- [`char::eq_ignore_ascii_case`]
54+
- [`u8::to_ascii_uppercase`]
55+
- [`u8::to_ascii_lowercase`]
56+
- [`u8::eq_ignore_ascii_case`]
57+
58+
Rustdoc
59+
-------
60+
- [Rustdoc lints are now treated as a tool lint, meaning that
61+
lints are now prefixed with `rustdoc::` (e.g. `#[warn(rustdoc::non_autolinks)]`).][80527]
62+
Using the old style is still allowed, and will become a warning in
63+
a future release.
64+
- [Rustdoc now supports argument files.][82261]
65+
- [Rustdoc now generates smart punctuation for documentation.][79423]
66+
- [You can now use "task lists" in Rustdoc Markdown.][81766] E.g.
67+
```markdown
68+
- [x] Complete
69+
- [ ] Todo
70+
```
71+
72+
Misc
73+
----
74+
- [You can now pass multiple filters to tests.][81356] E.g.
75+
`cargo test -- foo bar` will run all tests that match `foo` and `bar`.
76+
- [Rustup now distributes PDB symbols for the `std` library on Windows,
77+
allowing you to see `std` symbols when debugging.][82218]
78+
79+
Internal Only
80+
-------------
81+
These changes provide no direct user facing benefits, but represent significant
82+
improvements to the internals and overall performance of rustc and
83+
related tools.
84+
85+
- [Check the result cache before the DepGraph when ensuring queries][81855]
86+
- [Try fast_reject::simplify_type in coherence before doing full check][81744]
87+
- [Only store a LocalDefId in some HIR nodes][81611]
88+
- [Store HIR attributes in a side table][79519]
89+
90+
Compatibility Notes
91+
-------------------
92+
- [Cargo build scripts are now forbidden from setting `RUSTC_BOOTSTRAP`.][cargo/9181]
93+
- [Removed support for the `x86_64-rumprun-netbsd` target.][82594]
94+
- [Deprecated the `x86_64-sun-solaris` target in favor of `x86_64-pc-solaris`.][82216]
95+
- [Rustdoc now only accepts `,`, ` `, and `\t` as delimiters for specifying
96+
languages in code blocks.][78429]
97+
- [Rustc now catches more cases of `pub_use_of_private_extern_crate`][80763]
98+
- [Changes in how proc macros handle whitespace may lead to panics when used
99+
with older `proc-macro-hack` versions. A `cargo update` should be sufficient to fix this in all cases.][84136]
100+
101+
[84136]: https://github.com/rust-lang/rust/issues/84136
102+
[80763]: https://github.com/rust-lang/rust/pull/80763
103+
[82166]: https://github.com/rust-lang/rust/pull/82166
104+
[82121]: https://github.com/rust-lang/rust/pull/82121
105+
[81879]: https://github.com/rust-lang/rust/pull/81879
106+
[82261]: https://github.com/rust-lang/rust/pull/82261
107+
[82218]: https://github.com/rust-lang/rust/pull/82218
108+
[82216]: https://github.com/rust-lang/rust/pull/82216
109+
[82202]: https://github.com/rust-lang/rust/pull/82202
110+
[81855]: https://github.com/rust-lang/rust/pull/81855
111+
[81766]: https://github.com/rust-lang/rust/pull/81766
112+
[81744]: https://github.com/rust-lang/rust/pull/81744
113+
[81611]: https://github.com/rust-lang/rust/pull/81611
114+
[81479]: https://github.com/rust-lang/rust/pull/81479
115+
[81451]: https://github.com/rust-lang/rust/pull/81451
116+
[81356]: https://github.com/rust-lang/rust/pull/81356
117+
[80962]: https://github.com/rust-lang/rust/pull/80962
118+
[80553]: https://github.com/rust-lang/rust/pull/80553
119+
[80527]: https://github.com/rust-lang/rust/pull/80527
120+
[79519]: https://github.com/rust-lang/rust/pull/79519
121+
[79423]: https://github.com/rust-lang/rust/pull/79423
122+
[79208]: https://github.com/rust-lang/rust/pull/79208
123+
[78429]: https://github.com/rust-lang/rust/pull/78429
124+
[82733]: https://github.com/rust-lang/rust/pull/82733
125+
[82594]: https://github.com/rust-lang/rust/pull/82594
126+
[cargo/9181]: https://github.com/rust-lang/cargo/pull/9181
127+
[`char::MAX`]: https://doc.rust-lang.org/std/primitive.char.html#associatedconstant.MAX
128+
[`char::REPLACEMENT_CHARACTER`]: https://doc.rust-lang.org/std/primitive.char.html#associatedconstant.REPLACEMENT_CHARACTER
129+
[`char::UNICODE_VERSION`]: https://doc.rust-lang.org/std/primitive.char.html#associatedconstant.UNICODE_VERSION
130+
[`char::decode_utf16`]: https://doc.rust-lang.org/std/primitive.char.html#method.decode_utf16
131+
[`char::from_u32`]: https://doc.rust-lang.org/std/primitive.char.html#method.from_u32
132+
[`char::from_u32_unchecked`]: https://doc.rust-lang.org/std/primitive.char.html#method.from_u32_unchecked
133+
[`char::from_digit`]: https://doc.rust-lang.org/std/primitive.char.html#method.from_digit
134+
[`Peekable::next_if`]: https://doc.rust-lang.org/stable/std/iter/struct.Peekable.html#method.next_if
135+
[`Peekable::next_if_eq`]: https://doc.rust-lang.org/stable/std/iter/struct.Peekable.html#method.next_if_eq
136+
[`Arguments::as_str`]: https://doc.rust-lang.org/stable/std/fmt/struct.Arguments.html#method.as_str
137+
[`str::split_once`]: https://doc.rust-lang.org/stable/std/primitive.str.html#method.split_once
138+
[`str::rsplit_once`]: https://doc.rust-lang.org/stable/std/primitive.str.html#method.rsplit_once
139+
[`slice::partition_point`]: https://doc.rust-lang.org/stable/std/primitive.slice.html#method.partition_point
140+
[`char::len_utf8`]: https://doc.rust-lang.org/stable/std/primitive.char.html#method.len_utf8
141+
[`char::len_utf16`]: https://doc.rust-lang.org/stable/std/primitive.char.html#method.len_utf16
142+
[`char::to_ascii_uppercase`]: https://doc.rust-lang.org/stable/std/primitive.char.html#method.to_ascii_uppercase
143+
[`char::to_ascii_lowercase`]: https://doc.rust-lang.org/stable/std/primitive.char.html#method.to_ascii_lowercase
144+
[`char::eq_ignore_ascii_case`]: https://doc.rust-lang.org/stable/std/primitive.char.html#method.eq_ignore_ascii_case
145+
[`u8::to_ascii_uppercase`]: https://doc.rust-lang.org/stable/std/primitive.u8.html#method.to_ascii_uppercase
146+
[`u8::to_ascii_lowercase`]: https://doc.rust-lang.org/stable/std/primitive.u8.html#method.to_ascii_lowercase
147+
[`u8::eq_ignore_ascii_case`]: https://doc.rust-lang.org/stable/std/primitive.u8.html#method.eq_ignore_ascii_case
148+
1149
Version 1.51.0 (2021-03-25)
2150
============================
3151

compiler/rustc_codegen_ssa/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
2-
#![feature(assert_matches)]
32
#![feature(bool_to_option)]
43
#![feature(box_patterns)]
54
#![feature(drain_filter)]

compiler/rustc_middle/src/ich/impls_syntax.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,7 @@ impl<'ctx> rustc_ast::HashStableContext for StableHashingContext<'ctx> {
4545
item.hash_stable(self, hasher);
4646
style.hash_stable(self, hasher);
4747
span.hash_stable(self, hasher);
48-
assert_matches!(
49-
tokens.as_ref(),
50-
None,
51-
"Tokens should have been removed during lowering!"
52-
);
48+
assert!(tokens.as_ref().is_none(), "Tokens should have been removed during lowering!");
5349
} else {
5450
unreachable!();
5551
}

compiler/rustc_middle/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
2525
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
2626
#![feature(array_windows)]
27-
#![feature(assert_matches)]
2827
#![feature(backtrace)]
2928
#![feature(bool_to_option)]
3029
#![feature(box_patterns)]

compiler/rustc_middle/src/mir/interpret/allocation.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ impl<'tcx, Tag: Copy, Extra: AllocationExtra<Tag>> Allocation<Tag, Extra> {
339339
for dest in bytes {
340340
*dest = src.next().expect("iterator was shorter than it said it would be");
341341
}
342-
assert_matches!(src.next(), None, "iterator was longer than it said it would be");
342+
assert!(src.next().is_none(), "iterator was longer than it said it would be");
343343
Ok(())
344344
}
345345

compiler/rustc_mir/src/interpret/memory.rs

+3-11
Original file line numberDiff line numberDiff line change
@@ -854,11 +854,7 @@ impl<'mir, 'tcx, M: Machine<'mir, 'tcx>> Memory<'mir, 'tcx, M> {
854854
Some(ptr) => ptr,
855855
None => {
856856
// zero-sized access
857-
assert_matches!(
858-
src.next(),
859-
None,
860-
"iterator said it was empty but returned an element"
861-
);
857+
assert!(src.next().is_none(), "iterator said it was empty but returned an element");
862858
return Ok(());
863859
}
864860
};
@@ -884,11 +880,7 @@ impl<'mir, 'tcx, M: Machine<'mir, 'tcx>> Memory<'mir, 'tcx, M> {
884880
Some(ptr) => ptr,
885881
None => {
886882
// zero-sized access
887-
assert_matches!(
888-
src.next(),
889-
None,
890-
"iterator said it was empty but returned an element"
891-
);
883+
assert!(src.next().is_none(), "iterator said it was empty but returned an element");
892884
return Ok(());
893885
}
894886
};
@@ -902,7 +894,7 @@ impl<'mir, 'tcx, M: Machine<'mir, 'tcx>> Memory<'mir, 'tcx, M> {
902894
let offset_ptr = ptr.offset(Size::from_bytes(idx) * 2, &tcx)?; // `Size` multiplication
903895
allocation.write_scalar(&tcx, offset_ptr, val.into(), Size::from_bytes(2))?;
904896
}
905-
assert_matches!(src.next(), None, "iterator was longer than it said it would be");
897+
assert!(src.next().is_none(), "iterator was longer than it said it would be");
906898
Ok(())
907899
}
908900

compiler/rustc_mir/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ Rust MIR: a lowered representation of Rust.
77
#![feature(nll)]
88
#![feature(in_band_lifetimes)]
99
#![feature(array_windows)]
10-
#![feature(assert_matches)]
1110
#![feature(bindings_after_at)]
1211
#![feature(bool_to_option)]
1312
#![feature(box_patterns)]

compiler/rustc_passes/src/dead.rs

-21
Original file line numberDiff line numberDiff line change
@@ -133,22 +133,6 @@ impl<'tcx> MarkSymbolVisitor<'tcx> {
133133
}
134134
}
135135

136-
fn handle_assign(&mut self, expr: &'tcx hir::Expr<'tcx>) {
137-
if self
138-
.typeck_results()
139-
.expr_adjustments(expr)
140-
.iter()
141-
.any(|adj| matches!(adj.kind, ty::adjustment::Adjust::Deref(_)))
142-
{
143-
self.visit_expr(expr);
144-
} else if let hir::ExprKind::Field(base, ..) = expr.kind {
145-
// Ignore write to field
146-
self.handle_assign(base);
147-
} else {
148-
self.visit_expr(expr);
149-
}
150-
}
151-
152136
fn handle_field_pattern_match(
153137
&mut self,
154138
lhs: &hir::Pat<'_>,
@@ -277,11 +261,6 @@ impl<'tcx> Visitor<'tcx> for MarkSymbolVisitor<'tcx> {
277261
hir::ExprKind::MethodCall(..) => {
278262
self.lookup_and_handle_method(expr.hir_id);
279263
}
280-
hir::ExprKind::Assign(ref left, ref right, ..) => {
281-
self.handle_assign(left);
282-
self.visit_expr(right);
283-
return;
284-
}
285264
hir::ExprKind::Field(ref lhs, ..) => {
286265
self.handle_field_access(&lhs, expr.hir_id);
287266
}

library/core/src/macros/mod.rs

-90
Original file line numberDiff line numberDiff line change
@@ -110,60 +110,6 @@ macro_rules! assert_ne {
110110
});
111111
}
112112

113-
/// Asserts that an expression matches any of the given patterns.
114-
///
115-
/// Like in a `match` expression, the pattern can be optionally followed by `if`
116-
/// and a guard expression that has access to names bound by the pattern.
117-
///
118-
/// On panic, this macro will print the value of the expression with its
119-
/// debug representation.
120-
///
121-
/// Like [`assert!`], this macro has a second form, where a custom
122-
/// panic message can be provided.
123-
///
124-
/// # Examples
125-
///
126-
/// ```
127-
/// #![feature(assert_matches)]
128-
///
129-
/// let a = 1u32.checked_add(2);
130-
/// let b = 1u32.checked_sub(2);
131-
/// assert_matches!(a, Some(_));
132-
/// assert_matches!(b, None);
133-
///
134-
/// let c = Ok("abc".to_string());
135-
/// assert_matches!(c, Ok(x) | Err(x) if x.len() < 100);
136-
/// ```
137-
#[macro_export]
138-
#[unstable(feature = "assert_matches", issue = "82775")]
139-
#[allow_internal_unstable(core_panic)]
140-
macro_rules! assert_matches {
141-
($left:expr, $( $pattern:pat )|+ $( if $guard: expr )? $(,)?) => ({
142-
match $left {
143-
$( $pattern )|+ $( if $guard )? => {}
144-
ref left_val => {
145-
$crate::panicking::assert_matches_failed(
146-
left_val,
147-
$crate::stringify!($($pattern)|+ $(if $guard)?),
148-
$crate::option::Option::None
149-
);
150-
}
151-
}
152-
});
153-
($left:expr, $( $pattern:pat )|+ $( if $guard: expr )?, $($arg:tt)+) => ({
154-
match $left {
155-
$( $pattern )|+ $( if $guard )? => {}
156-
ref left_val => {
157-
$crate::panicking::assert_matches_failed(
158-
left_val,
159-
$crate::stringify!($($pattern)|+ $(if $guard)?),
160-
$crate::option::Option::Some($crate::format_args!($($arg)+))
161-
);
162-
}
163-
}
164-
});
165-
}
166-
167113
/// Asserts that a boolean expression is `true` at runtime.
168114
///
169115
/// This will invoke the [`panic!`] macro if the provided expression cannot be
@@ -262,42 +208,6 @@ macro_rules! debug_assert_ne {
262208
($($arg:tt)*) => (if $crate::cfg!(debug_assertions) { $crate::assert_ne!($($arg)*); })
263209
}
264210

265-
/// Asserts that an expression matches any of the given patterns.
266-
///
267-
/// Like in a `match` expression, the pattern can be optionally followed by `if`
268-
/// and a guard expression that has access to names bound by the pattern.
269-
///
270-
/// On panic, this macro will print the value of the expression with its
271-
/// debug representation.
272-
///
273-
/// Unlike [`assert_matches!`], `debug_assert_matches!` statements are only
274-
/// enabled in non optimized builds by default. An optimized build will not
275-
/// execute `debug_assert_matches!` statements unless `-C debug-assertions` is
276-
/// passed to the compiler. This makes `debug_assert_matches!` useful for
277-
/// checks that are too expensive to be present in a release build but may be
278-
/// helpful during development. The result of expanding `debug_assert_matches!`
279-
/// is always type checked.
280-
///
281-
/// # Examples
282-
///
283-
/// ```
284-
/// #![feature(assert_matches)]
285-
///
286-
/// let a = 1u32.checked_add(2);
287-
/// let b = 1u32.checked_sub(2);
288-
/// debug_assert_matches!(a, Some(_));
289-
/// debug_assert_matches!(b, None);
290-
///
291-
/// let c = Ok("abc".to_string());
292-
/// debug_assert_matches!(c, Ok(x) | Err(x) if x.len() < 100);
293-
/// ```
294-
#[macro_export]
295-
#[unstable(feature = "assert_matches", issue = "82775")]
296-
#[allow_internal_unstable(assert_matches)]
297-
macro_rules! debug_assert_matches {
298-
($($arg:tt)*) => (if $crate::cfg!(debug_assertions) { $crate::assert_matches!($($arg)*); })
299-
}
300-
301211
/// Returns whether the given expression matches any of the given patterns.
302212
///
303213
/// Like in a `match` expression, the pattern can be optionally followed by `if`

0 commit comments

Comments
 (0)