Skip to content

Commit 40d7efa

Browse files
committed
Auto merge of rust-lang#79529 - Dylan-DPC:rollup-6k20msr, r=Dylan-DPC
Rollup of 11 pull requests Successful merges: - rust-lang#79327 (Require allocator to be static for boxed `Pin`-API) - rust-lang#79340 (Rename "stability" CSS class to "item-info" and combine `document_stability` with `document_short`) - rust-lang#79363 (BTreeMap: try to enhance various comments) - rust-lang#79395 (Move ui if tests from top-level into `expr/if`) - rust-lang#79443 (Improve rustdoc JS tests error output) - rust-lang#79464 (Extend doc keyword feature by allowing any ident) - rust-lang#79484 (add enable-full-tools to freebsd builds to prevent occasional link er…) - rust-lang#79505 (Cleanup: shorter and faster code) - rust-lang#79514 (Add test for issue rust-lang#54121: order dependent trait bounds) - rust-lang#79516 (Remove unnecessary `mut` binding) - rust-lang#79528 (Fix a bootstrap comment) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2 parents 914d07a + d0515ce commit 40d7efa

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+343
-171
lines changed

compiler/rustc_lint/src/nonstandard_style.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,9 @@ fn to_camel_case(s: &str) -> String {
9494
}
9595

9696
if new_word {
97-
camel_cased_component.push_str(&c.to_uppercase().to_string());
97+
camel_cased_component.extend(c.to_uppercase());
9898
} else {
99-
camel_cased_component.push_str(&c.to_lowercase().to_string());
99+
camel_cased_component.extend(c.to_lowercase());
100100
}
101101

102102
prev_is_lower_case = c.is_lowercase();

compiler/rustc_span/src/symbol.rs

-5
Original file line numberDiff line numberDiff line change
@@ -1590,11 +1590,6 @@ impl Symbol {
15901590
self == kw::Try
15911591
}
15921592

1593-
/// Used for sanity checking rustdoc keyword sections.
1594-
pub fn is_doc_keyword(self) -> bool {
1595-
self <= kw::Union
1596-
}
1597-
15981593
/// A keyword or reserved identifier that can be used as a path segment.
15991594
pub fn is_path_segment_keyword(self) -> bool {
16001595
self == kw::Super

compiler/rustc_trait_selection/src/traits/select/mod.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -833,11 +833,10 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
833833
/// - it also appears in the backtrace at some position `X`,
834834
/// - all the predicates at positions `X..` between `X` and the top are
835835
/// also defaulted traits.
836-
pub fn coinductive_match<I>(&mut self, cycle: I) -> bool
836+
pub fn coinductive_match<I>(&mut self, mut cycle: I) -> bool
837837
where
838838
I: Iterator<Item = ty::Predicate<'tcx>>,
839839
{
840-
let mut cycle = cycle;
841840
cycle.all(|predicate| self.coinductive_predicate(predicate))
842841
}
843842

library/alloc/src/boxed.rs

+25-7
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,10 @@ impl<T, A: AllocRef> Box<T, A> {
327327
/// `x` will be pinned in memory and unable to be moved.
328328
#[unstable(feature = "allocator_api", issue = "32838")]
329329
#[inline(always)]
330-
pub fn pin_in(x: T, alloc: A) -> Pin<Self> {
330+
pub fn pin_in(x: T, alloc: A) -> Pin<Self>
331+
where
332+
A: 'static,
333+
{
331334
Self::new_in(x, alloc).into()
332335
}
333336

@@ -802,7 +805,10 @@ impl<T: ?Sized, A: AllocRef> Box<T, A> {
802805
///
803806
/// This is also available via [`From`].
804807
#[unstable(feature = "box_into_pin", issue = "62370")]
805-
pub fn into_pin(boxed: Self) -> Pin<Self> {
808+
pub fn into_pin(boxed: Self) -> Pin<Self>
809+
where
810+
A: 'static,
811+
{
806812
// It's not possible to move or replace the insides of a `Pin<Box<T>>`
807813
// when `T: !Unpin`, so it's safe to pin it directly without any
808814
// additional requirements.
@@ -1010,7 +1016,10 @@ impl<T> From<T> for Box<T> {
10101016
}
10111017

10121018
#[stable(feature = "pin", since = "1.33.0")]
1013-
impl<T: ?Sized, A: AllocRef> From<Box<T, A>> for Pin<Box<T, A>> {
1019+
impl<T: ?Sized, A: AllocRef> From<Box<T, A>> for Pin<Box<T, A>>
1020+
where
1021+
A: 'static,
1022+
{
10141023
/// Converts a `Box<T>` into a `Pin<Box<T>>`
10151024
///
10161025
/// This conversion does not allocate on the heap and happens in place.
@@ -1413,10 +1422,13 @@ impl<T: ?Sized, A: AllocRef> AsMut<T> for Box<T, A> {
14131422
* could have a method to project a Pin<T> from it.
14141423
*/
14151424
#[stable(feature = "pin", since = "1.33.0")]
1416-
impl<T: ?Sized, A: AllocRef> Unpin for Box<T, A> {}
1425+
impl<T: ?Sized, A: AllocRef> Unpin for Box<T, A> where A: 'static {}
14171426

14181427
#[unstable(feature = "generator_trait", issue = "43122")]
1419-
impl<G: ?Sized + Generator<R> + Unpin, R, A: AllocRef> Generator<R> for Box<G, A> {
1428+
impl<G: ?Sized + Generator<R> + Unpin, R, A: AllocRef> Generator<R> for Box<G, A>
1429+
where
1430+
A: 'static,
1431+
{
14201432
type Yield = G::Yield;
14211433
type Return = G::Return;
14221434

@@ -1426,7 +1438,10 @@ impl<G: ?Sized + Generator<R> + Unpin, R, A: AllocRef> Generator<R> for Box<G, A
14261438
}
14271439

14281440
#[unstable(feature = "generator_trait", issue = "43122")]
1429-
impl<G: ?Sized + Generator<R>, R, A: AllocRef> Generator<R> for Pin<Box<G, A>> {
1441+
impl<G: ?Sized + Generator<R>, R, A: AllocRef> Generator<R> for Pin<Box<G, A>>
1442+
where
1443+
A: 'static,
1444+
{
14301445
type Yield = G::Yield;
14311446
type Return = G::Return;
14321447

@@ -1436,7 +1451,10 @@ impl<G: ?Sized + Generator<R>, R, A: AllocRef> Generator<R> for Pin<Box<G, A>> {
14361451
}
14371452

14381453
#[stable(feature = "futures_api", since = "1.36.0")]
1439-
impl<F: ?Sized + Future + Unpin, A: AllocRef> Future for Box<F, A> {
1454+
impl<F: ?Sized + Future + Unpin, A: AllocRef> Future for Box<F, A>
1455+
where
1456+
A: 'static,
1457+
{
14401458
type Output = F::Output;
14411459

14421460
fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,7 @@ impl<'a, K: Ord, V> OccupiedEntry<'a, K, V> {
459459
self.remove_kv().1
460460
}
461461

462-
// Body of `remove_entry`, separate to keep the above implementations short.
462+
// Body of `remove_entry`, probably separate because the name reflects the returned pair.
463463
pub(super) fn remove_kv(self) -> (K, V) {
464464
let mut emptied_internal_root = false;
465465
let (old_kv, _) = self.handle.remove_kv_tracking(|| emptied_internal_root = true);

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

+9
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ use super::search::{self, SearchResult};
99
use super::unwrap_unchecked;
1010

1111
/// Finds the leaf edges delimiting a specified range in or underneath a node.
12+
///
13+
/// The result is meaningful only if the tree is ordered by key, like the tree
14+
/// in a `BTreeMap` is.
1215
fn range_search<BorrowType, K, V, Q, R>(
1316
root1: NodeRef<BorrowType, K, V, marker::LeafOrInternal>,
1417
root2: NodeRef<BorrowType, K, V, marker::LeafOrInternal>,
@@ -122,6 +125,9 @@ fn full_range<BorrowType, K, V>(
122125

123126
impl<'a, K: 'a, V: 'a> NodeRef<marker::Immut<'a>, K, V, marker::LeafOrInternal> {
124127
/// Creates a pair of leaf edges delimiting a specified range in or underneath a node.
128+
///
129+
/// The result is meaningful only if the tree is ordered by key, like the tree
130+
/// in a `BTreeMap` is.
125131
pub fn range_search<Q, R>(
126132
self,
127133
range: R,
@@ -152,6 +158,9 @@ impl<'a, K: 'a, V: 'a> NodeRef<marker::ValMut<'a>, K, V, marker::LeafOrInternal>
152158
/// Splits a unique reference into a pair of leaf edges delimiting a specified range.
153159
/// The result are non-unique references allowing (some) mutation, which must be used
154160
/// carefully.
161+
///
162+
/// The result is meaningful only if the tree is ordered by key, like the tree
163+
/// in a `BTreeMap` is.
155164
pub fn range_search<Q, R>(
156165
self,
157166
range: R,

0 commit comments

Comments
 (0)