Skip to content
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

Rollup of 11 pull requests #79529

Merged
merged 27 commits into from
Nov 29, 2020
Merged
Changes from 2 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
32 changes: 25 additions & 7 deletions library/alloc/src/boxed.rs
Original file line number Diff line number Diff line change
@@ -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()
}

@@ -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.
@@ -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.
@@ -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;

@@ -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;

@@ -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> {