Skip to content

Rollup of 6 pull requests #41735

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 21 commits into from
May 4, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
ac8892b
Accept arbitrary filenames into URLs in build-manifest
ranma42 Apr 25, 2017
5439c9b
Define the unavailable target just once and re-use it
ranma42 Apr 25, 2017
08514b4
rewrote the thread struct docs
Apr 25, 2017
bdb6bb9
added move
Apr 26, 2017
cf52121
restructured docs for thread and added links
Apr 26, 2017
b1ab145
Fix up @martinhath's mailmap entry
May 2, 2017
aa10fce
Update Duration::from_secs doc example to show underlying values.
frewsxcv May 3, 2017
ee8ad8e
Update Duration::from_millis doc example to show underlying values.
frewsxcv May 3, 2017
bdd8e7f
Update Duration::as_secs doc example to demonstrate truncation.
frewsxcv May 3, 2017
a3e8f36
Add doc example for how to determine total number of secs in Duration.
frewsxcv May 3, 2017
28a4f57
Update ChildStdin/ChildStdout docs to be clearer
mgattozzi May 3, 2017
5dfa08e
Emit information about XZ packages in manifest
ranma42 Apr 25, 2017
5e522d7
Fix MacOSX build
ranma42 May 1, 2017
7b05b88
Document the reasoning for the Acquire/Release handshake when droppin…
bholley May 2, 2017
98dd82c
Retry `brew` commands upon failure
ranma42 May 3, 2017
9f06dfb
Rollup merge of #41543 - z1mvader:master, r=steveklabnik
frewsxcv May 3, 2017
10fde33
Rollup merge of #41600 - ranma42:xz-dist, r=alexcrichton
frewsxcv May 3, 2017
e2cedb2
Rollup merge of #41715 - martinhath:master, r=aturon
frewsxcv May 3, 2017
3bfc72f
Rollup merge of #41720 - frewsxcv:duration-doc-examples, r=steveklabnik
frewsxcv May 3, 2017
a7c8bd1
Rollup merge of #41721 - mgattozzi:stdin-stdout-update, r=steveklabnik
frewsxcv May 3, 2017
e20b282
Rollup merge of #41730 - bholley:arc_comment, r=aturon
frewsxcv May 3, 2017
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
1 change: 1 addition & 0 deletions .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ Margaret Meyerhofer <[email protected]> <mmeyerho@andrew>
Mark Sinclair <[email protected]>
Mark Sinclair <[email protected]> =Mark Sinclair <[email protected]>
Markus Westerlind <[email protected]> Markus <[email protected]>
Martin Hafskjold Thoresen <[email protected]>
Matej Lach <[email protected]> Matej Ľach <[email protected]>
Matt Brubeck <[email protected]> <[email protected]>
Matthew Auld <[email protected]>
Expand Down
15 changes: 12 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,10 @@ matrix:
MACOSX_DEPLOYMENT_TARGET=10.7
os: osx
osx_image: xcode7
install: *osx_install_sccache
install:
- travis_retry brew update
- travis_retry brew install xz
- *osx_install_sccache
- env: >
RUST_CHECK_TARGET=dist
RUST_CONFIGURE_ARGS="--target=aarch64-apple-ios,armv7-apple-ios,armv7s-apple-ios,i386-apple-ios,x86_64-apple-ios --enable-extended --enable-sanitizers"
Expand All @@ -106,7 +109,10 @@ matrix:
MACOSX_DEPLOYMENT_TARGET=10.7
os: osx
osx_image: xcode7
install: *osx_install_sccache
install:
- travis_retry brew update
- travis_retry brew install xz
- *osx_install_sccache

# "alternate" deployments, these are "nightlies" but don't have assertions
# turned on, they're deployed to a different location primarily for projects
Expand All @@ -123,7 +129,10 @@ matrix:
MACOSX_DEPLOYMENT_TARGET=10.7
os: osx
osx_image: xcode7
install: *osx_install_sccache
install:
- travis_retry brew update
- travis_retry brew install xz
- *osx_install_sccache

env:
global:
Expand Down
11 changes: 11 additions & 0 deletions src/liballoc/arc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -767,7 +767,18 @@ unsafe impl<#[may_dangle] T: ?Sized> Drop for Arc<T> {
// > through this reference must obviously happened before), and an
// > "acquire" operation before deleting the object.
//
// In particular, while the contents of an Arc are usually immutable, it's
// possible to have interior writes to something like a Mutex<T>. Since a
// Mutex is not acquired when it is deleted, we can't rely on its
// synchronization logic to make writes in thread A visible to a destructor
// running in thread B.
//
// Also note that the Acquire fence here could probably be replaced with an
// Acquire load, which could improve performance in highly-contended
// situations. See [2].
//
// [1]: (www.boost.org/doc/libs/1_55_0/doc/html/atomic/usage_examples.html)
// [2]: (https://github.com/rust-lang/rust/pull/41714)
atomic::fence(Acquire);

unsafe {
Expand Down
10 changes: 6 additions & 4 deletions src/libstd/process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,9 @@ impl fmt::Debug for Child {
}
}

/// A handle to a child process's stdin. This struct is used in the [`stdin`]
/// field on [`Child`].
/// A handle to a child process's stdin.
///
/// This struct is used in the [`stdin`] field on [`Child`].
///
/// [`Child`]: struct.Child.html
/// [`stdin`]: struct.Child.html#structfield.stdin
Expand Down Expand Up @@ -190,8 +191,9 @@ impl fmt::Debug for ChildStdin {
}
}

/// A handle to a child process's stdout. This struct is used in the [`stdout`]
/// field on [`Child`].
/// A handle to a child process's stdout.
///
/// This struct is used in the [`stdout`] field on [`Child`].
///
/// [`Child`]: struct.Child.html
/// [`stdout`]: struct.Child.html#structfield.stdout
Expand Down
33 changes: 22 additions & 11 deletions src/libstd/thread/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -715,21 +715,32 @@ struct Inner {
#[stable(feature = "rust1", since = "1.0.0")]
/// A handle to a thread.
///
/// You can use it to identify a thread (by name, for example). Most of the
/// time, there is no need to directly create a `Thread` struct using the
/// constructor, instead you should use a function like `spawn` to create
/// new threads, see the docs of [`Builder`] and [`spawn`] for more.
///
/// # Examples
///
/// ```
/// use std::thread;
///
/// let handler = thread::Builder::new()
/// .name("foo".into())
/// .spawn(|| {
/// let thread = thread::current();
/// println!("thread name: {}", thread.name().unwrap());
/// })
/// .unwrap();
///
/// handler.join().unwrap();
/// use std::thread::Builder;
///
/// for i in 0..5 {
/// let thread_name = format!("thread_{}", i);
/// Builder::new()
/// .name(thread_name) // Now you can identify which thread panicked
/// // thanks to the handle's name
/// .spawn(move || {
/// if i == 3 {
/// panic!("I'm scared!!!");
/// }
/// })
/// .unwrap();
/// }
/// ```
/// [`Builder`]: ../../std/thread/struct.Builder.html
/// [`spawn`]: ../../std/thread/fn.spawn.html

pub struct Thread {
inner: Arc<Inner>,
}
Expand Down
29 changes: 25 additions & 4 deletions src/libstd/time/duration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,10 @@ impl Duration {
/// ```
/// use std::time::Duration;
///
/// let five_seconds = Duration::from_secs(5);
/// let duration = Duration::from_secs(5);
///
/// assert_eq!(5, duration.as_secs());
/// assert_eq!(0, duration.subsec_nanos());
/// ```
#[stable(feature = "duration", since = "1.3.0")]
#[inline]
Expand All @@ -99,7 +102,10 @@ impl Duration {
/// ```
/// use std::time::Duration;
///
/// let five_seconds = Duration::from_millis(5000);
/// let duration = Duration::from_millis(2569);
///
/// assert_eq!(2, duration.as_secs());
/// assert_eq!(569000000, duration.subsec_nanos());
/// ```
#[stable(feature = "duration", since = "1.3.0")]
#[inline]
Expand All @@ -119,9 +125,24 @@ impl Duration {
/// ```
/// use std::time::Duration;
///
/// let five_seconds = Duration::new(5, 0);
/// assert_eq!(five_seconds.as_secs(), 5);
/// let duration = Duration::new(5, 730023852);
/// assert_eq!(duration.as_secs(), 5);
/// ```
///
/// To determine the total number of seconds represented by the `Duration`,
/// use `as_secs` in combination with [`subsec_nanos`]:
///
/// ```
/// use std::time::Duration;
///
/// let duration = Duration::new(5, 730023852);
///
/// assert_eq!(5.730023852,
/// duration.as_secs() as f64
/// + duration.subsec_nanos() as f64 * 1e-9);
/// ```
///
/// [`subsec_nanos`]: #method.subsec_nanos
#[stable(feature = "duration", since = "1.3.0")]
#[inline]
pub fn as_secs(&self) -> u64 { self.secs }
Expand Down
2 changes: 1 addition & 1 deletion src/rust-installer
50 changes: 30 additions & 20 deletions src/tools/build-manifest/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,26 @@ struct Target {
available: bool,
url: Option<String>,
hash: Option<String>,
xz_url: Option<String>,
xz_hash: Option<String>,
components: Option<Vec<Component>>,
extensions: Option<Vec<Component>>,
}

impl Target {
fn unavailable() -> Target {
Target {
available: false,
url: None,
hash: None,
xz_url: None,
xz_hash: None,
components: None,
extensions: None,
}
}
}

#[derive(RustcEncodable)]
struct Component {
pkg: String,
Expand Down Expand Up @@ -242,16 +258,12 @@ impl Builder {
let digest = match self.digests.remove(&filename) {
Some(digest) => digest,
None => {
pkg.target.insert(host.to_string(), Target {
available: false,
url: None,
hash: None,
components: None,
extensions: None,
});
pkg.target.insert(host.to_string(), Target::unavailable());
continue
}
};
let xz_filename = filename.replace(".tar.gz", ".tar.xz");
let xz_digest = self.digests.remove(&xz_filename);
let mut components = Vec::new();
let mut extensions = Vec::new();

Expand Down Expand Up @@ -293,8 +305,10 @@ impl Builder {

pkg.target.insert(host.to_string(), Target {
available: true,
url: Some(self.url("rust", host)),
url: Some(self.url(&filename)),
hash: Some(digest),
xz_url: xz_digest.as_ref().map(|_| self.url(&xz_filename)),
xz_hash: xz_digest,
components: Some(components),
extensions: Some(extensions),
});
Expand All @@ -312,21 +326,17 @@ impl Builder {
let filename = self.filename(pkgname, name);
let digest = match self.digests.remove(&filename) {
Some(digest) => digest,
None => {
return (name.to_string(), Target {
available: false,
url: None,
hash: None,
components: None,
extensions: None,
})
}
None => return (name.to_string(), Target::unavailable()),
};
let xz_filename = filename.replace(".tar.gz", ".tar.xz");
let xz_digest = self.digests.remove(&xz_filename);

(name.to_string(), Target {
available: true,
url: Some(self.url(pkgname, name)),
url: Some(self.url(&filename)),
hash: Some(digest),
xz_url: xz_digest.as_ref().map(|_| self.url(&xz_filename)),
xz_hash: xz_digest,
components: None,
extensions: None,
})
Expand All @@ -338,11 +348,11 @@ impl Builder {
});
}

fn url(&self, component: &str, target: &str) -> String {
fn url(&self, filename: &str) -> String {
format!("{}/{}/{}",
self.s3_address,
self.date,
self.filename(component, target))
filename)
}

fn filename(&self, component: &str, target: &str) -> String {
Expand Down