Skip to content

Commit 5258a74

Browse files
committed
Auto merge of rust-lang#84153 - Dylan-DPC:rollup-5jiqrwu, r=Dylan-DPC
Rollup of 6 pull requests Successful merges: - rust-lang#83438 (Update RELEASES.md) - rust-lang#83707 (Remove `T: Debug` bound on UnsafeCell Debug impl) - rust-lang#84084 (Stabilize duration_zero.) - rust-lang#84121 (Stabilize BTree{Map,Set}::retain) - rust-lang#84140 (Don't call bump in check_mistyped_turbofish_with_multiple_type_params) - rust-lang#84141 (Fix typo in error message) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2 parents 2e7eb85 + 91c0828 commit 5258a74

File tree

12 files changed

+97
-31
lines changed

12 files changed

+97
-31
lines changed

RELEASES.md

+9
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ Libraries
5050
- [`io::Empty` now implements `io::Seek`.][78044]
5151
- [`rc::Weak<T>` and `sync::Weak<T>`'s methods such as `as_ptr` are now implemented for
5252
`T: ?Sized` types.][80764]
53+
- [`Div` and `Rem` by their `NonZero` variant is now implemented for all unsigned integers.][79134]
54+
5355

5456
Stabilized APIs
5557
---------------
@@ -72,6 +74,8 @@ Stabilized APIs
7274
- [`str::split_inclusive`]
7375
- [`sync::OnceState`]
7476
- [`task::Wake`]
77+
- [`VecDeque::range`]
78+
- [`VecDeque::range_mut`]
7579

7680
Cargo
7781
-----
@@ -115,6 +119,7 @@ Compatibility Notes
115119
- `thumbv7neon-unknown-linux-gnueabihf`
116120
- `armv7-unknown-linux-gnueabi`
117121
- `x86_64-unknown-linux-gnux32`
122+
- [`atomic::spin_loop_hint` has been deprecated.][80966] It's recommended to use `hint::spin_loop` instead.
118123

119124
Internal Only
120125
-------------
@@ -145,6 +150,8 @@ Internal Only
145150
[80764]: https://github.com/rust-lang/rust/pull/80764
146151
[80749]: https://github.com/rust-lang/rust/pull/80749
147152
[80662]: https://github.com/rust-lang/rust/pull/80662
153+
[79134]: https://github.com/rust-lang/rust/pull/79134
154+
[80966]: https://github.com/rust-lang/rust/pull/80966
148155
[cargo/8997]: https://github.com/rust-lang/cargo/pull/8997
149156
[cargo/9112]: https://github.com/rust-lang/cargo/pull/9112
150157
[[email protected]]: https://doc.rust-lang.org/nightly/cargo/reference/features.html#feature-resolver-version-2
@@ -166,6 +173,8 @@ Internal Only
166173
[`Seek::stream_position`]: https://doc.rust-lang.org/nightly/std/io/trait.Seek.html#method.stream_position
167174
[`Peekable::next_if`]: https://doc.rust-lang.org/nightly/std/iter/struct.Peekable.html#method.next_if
168175
[`Peekable::next_if_eq`]: https://doc.rust-lang.org/nightly/std/iter/struct.Peekable.html#method.next_if_eq
176+
[`VecDeque::range`]: https://doc.rust-lang.org/nightly/std/collections/struct.VecDeque.html#method.range
177+
[`VecDeque::range_mut`]: https://doc.rust-lang.org/nightly/std/collections/struct.VecDeque.html#method.range_mut
169178

170179
Version 1.50.0 (2021-02-11)
171180
============================

compiler/rustc_parse/src/parser/diagnostics.rs

+17-15
Original file line numberDiff line numberDiff line change
@@ -666,21 +666,23 @@ impl<'a> Parser<'a> {
666666
);
667667
match x {
668668
Ok((_, _, false)) => {
669-
self.bump(); // `>`
670-
match self.parse_expr() {
671-
Ok(_) => {
672-
e.span_suggestion_verbose(
673-
binop.span.shrink_to_lo(),
674-
TURBOFISH_SUGGESTION_STR,
675-
"::".to_string(),
676-
Applicability::MaybeIncorrect,
677-
);
678-
e.emit();
679-
*expr = self.mk_expr_err(expr.span.to(self.prev_token.span));
680-
return Ok(());
681-
}
682-
Err(mut err) => {
683-
err.cancel();
669+
if self.eat(&token::Gt) {
670+
match self.parse_expr() {
671+
Ok(_) => {
672+
e.span_suggestion_verbose(
673+
binop.span.shrink_to_lo(),
674+
TURBOFISH_SUGGESTION_STR,
675+
"::".to_string(),
676+
Applicability::MaybeIncorrect,
677+
);
678+
e.emit();
679+
*expr =
680+
self.mk_expr_err(expr.span.to(self.prev_token.span));
681+
return Ok(());
682+
}
683+
Err(mut err) => {
684+
err.cancel();
685+
}
684686
}
685687
}
686688
}

compiler/rustc_typeck/src/astconv/generics.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
8282
if param_type.is_suggestable() {
8383
err.span_suggestion(
8484
tcx.def_span(src_def_id),
85-
"consider changing this type paramater to a `const`-generic",
85+
"consider changing this type parameter to be a `const` generic",
8686
format!("const {}: {}", param_name, param_type),
8787
Applicability::MaybeIncorrect,
8888
);

library/alloc/src/collections/btree/map.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -940,7 +940,6 @@ impl<K, V> BTreeMap<K, V> {
940940
/// # Examples
941941
///
942942
/// ```
943-
/// #![feature(btree_retain)]
944943
/// use std::collections::BTreeMap;
945944
///
946945
/// let mut map: BTreeMap<i32, i32> = (0..8).map(|x| (x, x*10)).collect();
@@ -949,7 +948,7 @@ impl<K, V> BTreeMap<K, V> {
949948
/// assert!(map.into_iter().eq(vec![(0, 0), (2, 20), (4, 40), (6, 60)]));
950949
/// ```
951950
#[inline]
952-
#[unstable(feature = "btree_retain", issue = "79025")]
951+
#[stable(feature = "btree_retain", since = "1.53.0")]
953952
pub fn retain<F>(&mut self, mut f: F)
954953
where
955954
K: Ord,

library/alloc/src/collections/btree/set.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -851,7 +851,6 @@ impl<T> BTreeSet<T> {
851851
/// # Examples
852852
///
853853
/// ```
854-
/// #![feature(btree_retain)]
855854
/// use std::collections::BTreeSet;
856855
///
857856
/// let xs = [1, 2, 3, 4, 5, 6];
@@ -860,7 +859,7 @@ impl<T> BTreeSet<T> {
860859
/// set.retain(|&k| k % 2 == 0);
861860
/// assert!(set.iter().eq([2, 4, 6].iter()));
862861
/// ```
863-
#[unstable(feature = "btree_retain", issue = "79025")]
862+
#[stable(feature = "btree_retain", since = "1.53.0")]
864863
pub fn retain<F>(&mut self, mut f: F)
865864
where
866865
T: Ord,

library/core/src/fmt/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2268,7 +2268,7 @@ impl<T: ?Sized + Debug> Debug for RefMut<'_, T> {
22682268
}
22692269

22702270
#[stable(feature = "core_impl_debug", since = "1.9.0")]
2271-
impl<T: ?Sized + Debug> Debug for UnsafeCell<T> {
2271+
impl<T: ?Sized> Debug for UnsafeCell<T> {
22722272
fn fmt(&self, f: &mut Formatter<'_>) -> Result {
22732273
f.pad("UnsafeCell")
22742274
}

library/core/src/time.rs

+3-5
Original file line numberDiff line numberDiff line change
@@ -124,14 +124,13 @@ impl Duration {
124124
/// # Examples
125125
///
126126
/// ```
127-
/// #![feature(duration_zero)]
128127
/// use std::time::Duration;
129128
///
130129
/// let duration = Duration::ZERO;
131130
/// assert!(duration.is_zero());
132131
/// assert_eq!(duration.as_nanos(), 0);
133132
/// ```
134-
#[unstable(feature = "duration_zero", issue = "73544")]
133+
#[stable(feature = "duration_zero", since = "1.53.0")]
135134
pub const ZERO: Duration = Duration::from_nanos(0);
136135

137136
/// The maximum duration.
@@ -269,7 +268,6 @@ impl Duration {
269268
/// # Examples
270269
///
271270
/// ```
272-
/// #![feature(duration_zero)]
273271
/// use std::time::Duration;
274272
///
275273
/// assert!(Duration::ZERO.is_zero());
@@ -281,7 +279,8 @@ impl Duration {
281279
/// assert!(!Duration::from_nanos(1).is_zero());
282280
/// assert!(!Duration::from_secs(1).is_zero());
283281
/// ```
284-
#[unstable(feature = "duration_zero", issue = "73544")]
282+
#[stable(feature = "duration_zero", since = "1.53.0")]
283+
#[rustc_const_stable(feature = "duration_zero", since = "1.53.0")]
285284
#[inline]
286285
pub const fn is_zero(&self) -> bool {
287286
self.secs == 0 && self.nanos == 0
@@ -536,7 +535,6 @@ impl Duration {
536535
/// # Examples
537536
///
538537
/// ```
539-
/// #![feature(duration_zero)]
540538
/// use std::time::Duration;
541539
///
542540
/// assert_eq!(Duration::new(0, 1).saturating_sub(Duration::new(0, 0)), Duration::new(0, 1));

library/core/tests/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
#![feature(div_duration)]
2525
#![feature(duration_consts_2)]
2626
#![feature(duration_constants)]
27-
#![feature(duration_zero)]
2827
#![feature(exact_size_is_empty)]
2928
#![feature(extern_types)]
3029
#![feature(flt2dec)]

library/std/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,6 @@
261261
#![cfg_attr(not(bootstrap), feature(doc_notable_trait))]
262262
#![feature(dropck_eyepatch)]
263263
#![feature(duration_constants)]
264-
#![feature(duration_zero)]
265264
#![feature(edition_panic)]
266265
#![feature(exact_size_is_empty)]
267266
#![feature(exhaustive_patterns)]

src/test/ui/const-generics/diagnostics.stderr

+6-3
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,12 @@ error[E0747]: type provided when a constant was expected
3131
--> $DIR/diagnostics.rs:12:19
3232
|
3333
LL | impl<N> Foo for B<N> {}
34-
| - ^
35-
| |
36-
| help: consider changing this type paramater to a `const`-generic: `const N: u8`
34+
| ^
35+
|
36+
help: consider changing this type parameter to be a `const` generic
37+
|
38+
LL | impl<const N: u8> Foo for B<N> {}
39+
| ^^^^^^^^^^^
3740

3841
error[E0747]: unresolved item provided when a constant was expected
3942
--> $DIR/diagnostics.rs:16:32

src/test/ui/parser/issue-84117.rs

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
fn main() {
2+
let outer_local:e_outer<&str, { let inner_local:e_inner<&str, }
3+
//~^ ERROR expected one of `>`, a const expression
4+
//~| ERROR expected one of `>`, a const expression, lifetime, or type, found `}`
5+
//~| ERROR expected one of `!`, `.`, `::`, `;`, `?`, `{`, or an operator, found `,`
6+
//~| ERROR expected one of `!`, `.`, `::`, `;`, `?`, `{`, or an operator, found `,`
7+
//~| ERROR expected one of `!`, `.`, `::`, `;`, `?`, `{`, or an operator, found `,`
8+
}
9+
//~^ ERROR expected one of `,`, `:`, `=`, or `>`, found `}`

src/test/ui/parser/issue-84117.stderr

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
error: expected one of `>`, a const expression, lifetime, or type, found `}`
2+
--> $DIR/issue-84117.rs:2:67
3+
|
4+
LL | let outer_local:e_outer<&str, { let inner_local:e_inner<&str, }
5+
| ------------ ^ expected one of `>`, a const expression, lifetime, or type
6+
| | |
7+
| | help: use `=` if you meant to assign
8+
| while parsing the type for `inner_local`
9+
10+
error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, or an operator, found `,`
11+
--> $DIR/issue-84117.rs:2:65
12+
|
13+
LL | let outer_local:e_outer<&str, { let inner_local:e_inner<&str, }
14+
| ^ expected one of 7 possible tokens
15+
16+
error: expected one of `,`, `:`, `=`, or `>`, found `}`
17+
--> $DIR/issue-84117.rs:8:1
18+
|
19+
LL | let outer_local:e_outer<&str, { let inner_local:e_inner<&str, }
20+
| ------------ help: use `=` if you meant to assign - expected one of `,`, `:`, `=`, or `>`
21+
| |
22+
| while parsing the type for `outer_local`
23+
...
24+
LL | }
25+
| ^ unexpected token
26+
27+
error: expected one of `>`, a const expression, lifetime, or type, found `}`
28+
--> $DIR/issue-84117.rs:2:67
29+
|
30+
LL | let outer_local:e_outer<&str, { let inner_local:e_inner<&str, }
31+
| ------------ ^ expected one of `>`, a const expression, lifetime, or type
32+
| | |
33+
| | help: use `=` if you meant to assign
34+
| while parsing the type for `inner_local`
35+
36+
error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, or an operator, found `,`
37+
--> $DIR/issue-84117.rs:2:65
38+
|
39+
LL | let outer_local:e_outer<&str, { let inner_local:e_inner<&str, }
40+
| ^ expected one of 7 possible tokens
41+
42+
error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, or an operator, found `,`
43+
--> $DIR/issue-84117.rs:2:33
44+
|
45+
LL | let outer_local:e_outer<&str, { let inner_local:e_inner<&str, }
46+
| ^ expected one of 7 possible tokens
47+
48+
error: aborting due to 6 previous errors
49+

0 commit comments

Comments
 (0)