Skip to content

Rollup of 11 pull requests #79529

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 27 commits into from
Nov 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
caf6c57
Rename "stability" CSS class to "item-info"
GuillaumeGomez Nov 23, 2020
be0484b
Clean up document_item_info calls
GuillaumeGomez Nov 24, 2020
37b97f0
Move src/test/ui/if to src/test/ui/expr/if
Havvy Nov 25, 2020
011bef8
Move src/test/ui/if-attrs to src/test/ui/expr/if/attrs
Havvy Nov 25, 2020
6919a77
Move src/test/ui/if-*.rs to src/test/expr/if/if-*.rs
Havvy Nov 25, 2020
fa14f22
Improve rustdoc JS tests error output
GuillaumeGomez Nov 26, 2020
f663093
Allow to have any valid ident used as keyword in doc_keyword feature
GuillaumeGomez Nov 27, 2020
af2040f
Add tests for doc_keyword feature extension
GuillaumeGomez Nov 27, 2020
482b3ac
Remove unused is_doc_keyword function
GuillaumeGomez Nov 27, 2020
7e00222
add enable-full-tools to freebsd builds to prevent occasional link er…
sreehax Nov 27, 2020
d1a2c0f
BTreeMap: try to enhance various comments & local identifiers
ssomers Nov 5, 2020
7387f48
Require allocator to be static for boxed `Pin`-API
TimDiekmann Nov 28, 2020
30d331f
Cleanup: shorter and faster code
matklad Nov 28, 2020
1fa4325
Add test for issue #54121:
Nov 28, 2020
870a041
Remove unnecessary `mut` binding
jyn514 Nov 28, 2020
331d526
Fix a bootstrap comment
nooberfsh Nov 29, 2020
a2b4d97
Rollup merge of #79327 - TimDiekmann:static-alloc-pin-in-box, r=Mark-…
Dylan-DPC Nov 29, 2020
858b44a
Rollup merge of #79340 - GuillaumeGomez:rename-stability, r=jyn514
Dylan-DPC Nov 29, 2020
bfa854d
Rollup merge of #79363 - ssomers:btree_cleanup_comments, r=Mark-Simul…
Dylan-DPC Nov 29, 2020
851def2
Rollup merge of #79395 - Havvy:test-move-if, r=Mark-Simulacrum
Dylan-DPC Nov 29, 2020
d5d6036
Rollup merge of #79443 - GuillaumeGomez:improve-rustdoc-js-error-outp…
Dylan-DPC Nov 29, 2020
ca8a1b0
Rollup merge of #79464 - GuillaumeGomez:doc-keyword-ident, r=jyn514
Dylan-DPC Nov 29, 2020
c9c81d9
Rollup merge of #79484 - sreehax:master, r=Mark-Simulacrum
Dylan-DPC Nov 29, 2020
6eb5245
Rollup merge of #79505 - matklad:cleanup, r=jonas-schievink
Dylan-DPC Nov 29, 2020
f0e41ce
Rollup merge of #79514 - Julian-Wollersberger:order-dependent-bounds,…
Dylan-DPC Nov 29, 2020
47e74a9
Rollup merge of #79516 - jyn514:cleanup-trait-solver, r=Aaron1011
Dylan-DPC Nov 29, 2020
d0515ce
Rollup merge of #79528 - nooberfsh:fix_doc, r=Mark-Simulacrum
Dylan-DPC Nov 29, 2020
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 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