Skip to content

Commit

Permalink
Auto merge of rust-lang#79529 - Dylan-DPC:rollup-6k20msr, r=Dylan-DPC
Browse files Browse the repository at this point in the history
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
  • Loading branch information
bors committed Nov 29, 2020
2 parents 914d07a + d0515ce commit 40d7efa
Show file tree
Hide file tree
Showing 73 changed files with 343 additions and 171 deletions.
4 changes: 2 additions & 2 deletions compiler/rustc_lint/src/nonstandard_style.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@ fn to_camel_case(s: &str) -> String {
}

if new_word {
camel_cased_component.push_str(&c.to_uppercase().to_string());
camel_cased_component.extend(c.to_uppercase());
} else {
camel_cased_component.push_str(&c.to_lowercase().to_string());
camel_cased_component.extend(c.to_lowercase());
}

prev_is_lower_case = c.is_lowercase();
Expand Down
5 changes: 0 additions & 5 deletions compiler/rustc_span/src/symbol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1590,11 +1590,6 @@ impl Symbol {
self == kw::Try
}

/// Used for sanity checking rustdoc keyword sections.
pub fn is_doc_keyword(self) -> bool {
self <= kw::Union
}

/// A keyword or reserved identifier that can be used as a path segment.
pub fn is_path_segment_keyword(self) -> bool {
self == kw::Super
Expand Down
3 changes: 1 addition & 2 deletions compiler/rustc_trait_selection/src/traits/select/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -833,11 +833,10 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
/// - it also appears in the backtrace at some position `X`,
/// - all the predicates at positions `X..` between `X` and the top are
/// also defaulted traits.
pub fn coinductive_match<I>(&mut self, cycle: I) -> bool
pub fn coinductive_match<I>(&mut self, mut cycle: I) -> bool
where
I: Iterator<Item = ty::Predicate<'tcx>>,
{
let mut cycle = cycle;
cycle.all(|predicate| self.coinductive_predicate(predicate))
}

Expand Down
32 changes: 25 additions & 7 deletions library/alloc/src/boxed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,10 @@ impl<T, A: AllocRef> Box<T, A> {
/// `x` will be pinned in memory and unable to be moved.
#[unstable(feature = "allocator_api", issue = "32838")]
#[inline(always)]
pub fn pin_in(x: T, alloc: A) -> Pin<Self> {
pub fn pin_in(x: T, alloc: A) -> Pin<Self>
where
A: 'static,
{
Self::new_in(x, alloc).into()
}

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

#[stable(feature = "pin", since = "1.33.0")]
impl<T: ?Sized, A: AllocRef> From<Box<T, A>> for Pin<Box<T, A>> {
impl<T: ?Sized, A: AllocRef> From<Box<T, A>> for Pin<Box<T, A>>
where
A: 'static,
{
/// Converts a `Box<T>` into a `Pin<Box<T>>`
///
/// This conversion does not allocate on the heap and happens in place.
Expand Down Expand Up @@ -1413,10 +1422,13 @@ impl<T: ?Sized, A: AllocRef> AsMut<T> for Box<T, A> {
* could have a method to project a Pin<T> from it.
*/
#[stable(feature = "pin", since = "1.33.0")]
impl<T: ?Sized, A: AllocRef> Unpin for Box<T, A> {}
impl<T: ?Sized, A: AllocRef> Unpin for Box<T, A> where A: 'static {}

#[unstable(feature = "generator_trait", issue = "43122")]
impl<G: ?Sized + Generator<R> + Unpin, R, A: AllocRef> Generator<R> for Box<G, A> {
impl<G: ?Sized + Generator<R> + Unpin, R, A: AllocRef> Generator<R> for Box<G, A>
where
A: 'static,
{
type Yield = G::Yield;
type Return = G::Return;

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

#[unstable(feature = "generator_trait", issue = "43122")]
impl<G: ?Sized + Generator<R>, R, A: AllocRef> Generator<R> for Pin<Box<G, A>> {
impl<G: ?Sized + Generator<R>, R, A: AllocRef> Generator<R> for Pin<Box<G, A>>
where
A: 'static,
{
type Yield = G::Yield;
type Return = G::Return;

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

#[stable(feature = "futures_api", since = "1.36.0")]
impl<F: ?Sized + Future + Unpin, A: AllocRef> Future for Box<F, A> {
impl<F: ?Sized + Future + Unpin, A: AllocRef> Future for Box<F, A>
where
A: 'static,
{
type Output = F::Output;

fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
Expand Down
2 changes: 1 addition & 1 deletion library/alloc/src/collections/btree/map/entry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ impl<'a, K: Ord, V> OccupiedEntry<'a, K, V> {
self.remove_kv().1
}

// Body of `remove_entry`, separate to keep the above implementations short.
// Body of `remove_entry`, probably separate because the name reflects the returned pair.
pub(super) fn remove_kv(self) -> (K, V) {
let mut emptied_internal_root = false;
let (old_kv, _) = self.handle.remove_kv_tracking(|| emptied_internal_root = true);
Expand Down
9 changes: 9 additions & 0 deletions library/alloc/src/collections/btree/navigate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ use super::search::{self, SearchResult};
use super::unwrap_unchecked;

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

impl<'a, K: 'a, V: 'a> NodeRef<marker::Immut<'a>, K, V, marker::LeafOrInternal> {
/// Creates a pair of leaf edges delimiting a specified range in or underneath a node.
///
/// The result is meaningful only if the tree is ordered by key, like the tree
/// in a `BTreeMap` is.
pub fn range_search<Q, R>(
self,
range: R,
Expand Down Expand Up @@ -152,6 +158,9 @@ impl<'a, K: 'a, V: 'a> NodeRef<marker::ValMut<'a>, K, V, marker::LeafOrInternal>
/// Splits a unique reference into a pair of leaf edges delimiting a specified range.
/// The result are non-unique references allowing (some) mutation, which must be used
/// carefully.
///
/// The result is meaningful only if the tree is ordered by key, like the tree
/// in a `BTreeMap` is.
pub fn range_search<Q, R>(
self,
range: R,
Expand Down
Loading

0 comments on commit 40d7efa

Please sign in to comment.