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

[beta] Rollup backports #59642

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
12 changes: 12 additions & 0 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,7 @@ version = "0.23.0"
dependencies = [
"curl 0.4.19 (registry+https://github.com/rust-lang/crates.io-index)",
"failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"http 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.82 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_derive 1.0.81 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_json 1.0.33 (registry+https://github.com/rust-lang/crates.io-index)",
Expand Down Expand Up @@ -1093,6 +1094,16 @@ dependencies = [
"syn 0.15.22 (registry+https://github.com/rust-lang/crates.io-index)",
]

[[package]]
name = "http"
version = "0.1.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"bytes 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)",
"fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)",
"itoa 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
]

[[package]]
name = "humantime"
version = "1.2.0"
Expand Down Expand Up @@ -4038,6 +4049,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
"checksum hex 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "805026a5d0141ffc30abb3be3173848ad46a1b1664fe632428479619a3644d77"
"checksum home 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "80dff82fb58cfbbc617fb9a9184b010be0529201553cda50ad04372bc2333aff"
"checksum html5ever 0.22.5 (registry+https://github.com/rust-lang/crates.io-index)" = "c213fa6a618dc1da552f54f85cba74b05d8e883c92ec4e89067736938084c26e"
"checksum http 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "fe67e3678f2827030e89cc4b9e7ecd16d52f132c0b940ab5005f88e821500f6a"
"checksum humantime 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3ca7e5f2e110db35f93b837c81797f3714500b81d517bf20c431b16d3ca4f114"
"checksum idna 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "38f09e0f0b1fb55fdee1f17470ad800da77af5186a1a76c026b679358b7e844e"
"checksum if_chain 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "4bac95d9aa0624e7b78187d6fb8ab012b41d9f6f54b1bcb61e61c4845f8357ec"
Expand Down
4 changes: 2 additions & 2 deletions src/ci/docker/disabled/dist-x86_64-redox/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ COPY scripts/crosstool-ng.sh /scripts/
RUN sh /scripts/crosstool-ng.sh

WORKDIR /tmp
COPY cross/install-x86_64-redox.sh /tmp/
RUN ./install-x86_64-redox.sh
COPY dist-various-1/install-x86_64-redox.sh /scripts/
RUN sh /scripts/install-x86_64-redox.sh

COPY scripts/sccache.sh /scripts/
RUN sh /scripts/sccache.sh
Expand Down
10 changes: 2 additions & 8 deletions src/ci/docker/dist-various-1/install-x86_64-redox.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,5 @@

set -ex

apt-get update
apt-get install -y --no-install-recommends software-properties-common apt-transport-https

apt-key adv --batch --yes --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys AA12E97F0881517F
add-apt-repository -y 'deb https://static.redox-os.org/toolchain/apt /'

apt-get update
apt-get install -y x86-64-unknown-redox-gcc
curl https://static.redox-os.org/toolchain/x86_64-unknown-redox/relibc-install.tar.gz | \
tar --extract --gzip --directory /usr/local
39 changes: 6 additions & 33 deletions src/libsyntax/ptr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
use std::fmt::{self, Display, Debug};
use std::iter::FromIterator;
use std::ops::{Deref, DerefMut};
use std::{mem, ptr, slice, vec};
use std::{slice, vec};

use serialize::{Encodable, Decodable, Encoder, Decoder};

Expand Down Expand Up @@ -66,45 +66,18 @@ impl<T: 'static> P<T> {
pub fn map<F>(mut self, f: F) -> P<T> where
F: FnOnce(T) -> T,
{
let p: *mut T = &mut *self.ptr;
let x = f(*self.ptr);
*self.ptr = x;

// Leak self in case of panic.
// FIXME(eddyb) Use some sort of "free guard" that
// only deallocates, without dropping the pointee,
// in case the call the `f` below ends in a panic.
mem::forget(self);

unsafe {
ptr::write(p, f(ptr::read(p)));

// Recreate self from the raw pointer.
P { ptr: Box::from_raw(p) }
}
self
}

/// Optionally produce a new `P<T>` from `self` without reallocating.
pub fn filter_map<F>(mut self, f: F) -> Option<P<T>> where
F: FnOnce(T) -> Option<T>,
{
let p: *mut T = &mut *self.ptr;

// Leak self in case of panic.
// FIXME(eddyb) Use some sort of "free guard" that
// only deallocates, without dropping the pointee,
// in case the call the `f` below ends in a panic.
mem::forget(self);

unsafe {
if let Some(v) = f(ptr::read(p)) {
ptr::write(p, v);

// Recreate self from the raw pointer.
Some(P { ptr: Box::from_raw(p) })
} else {
drop(Box::from_raw(p));
None
}
}
*self.ptr = f(*self.ptr)?;
Some(self)
}
}

Expand Down