Skip to content

Rollup of 8 pull requests #44058

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
Aug 23, 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
f51e64f
Point "deref coercions" links to new book
ruuda Aug 3, 2017
01000fb
Replace space in Markdown link label
ruuda Aug 3, 2017
e63d979
Docs: restore link text after renaming anchor
ruuda Aug 4, 2017
b272f6c
redox: Require scheme for path to be absolute
ids1024 Aug 18, 2017
b8f4e74
Remove outline when details have focus
GuillaumeGomez Aug 18, 2017
e0f0fd0
Correct has_root() on Redox
ids1024 Aug 18, 2017
d46660e
libproc_macro docs: fix brace and bracket mixup
steffengy Aug 21, 2017
ab48de8
Use cfg! instead of #[cfg]
ids1024 Aug 22, 2017
c987f30
Mention null_mut on the pointer primitive docs.
Aug 22, 2017
fe2d661
Simplify code for handling Redox paths
ids1024 Aug 22, 2017
081f32a
Clarify windows build instructions in README
mattico Aug 22, 2017
b1e8c72
Fix little-endian assumptions in run-pass/union/union-basic
cuviper Aug 22, 2017
1d5ee63
Thread spawning: don't run `min_stack` if the user has specified stac…
frewsxcv Aug 22, 2017
1182e52
Rollup merge of #43631 - ruuda:update-docs, r=QuietMisdreavus
frewsxcv Aug 23, 2017
4902e67
Rollup merge of #43977 - GuillaumeGomez:remove-outline, r=QuietMisdre…
frewsxcv Aug 23, 2017
dd58d4e
Rollup merge of #43983 - ids1024:redox-path-prefix, r=alexcrichton
frewsxcv Aug 23, 2017
99ab319
Rollup merge of #44016 - steffengy:master, r=alexcrichton
frewsxcv Aug 23, 2017
4d83634
Rollup merge of #44039 - remexre:master, r=steveklabnik
frewsxcv Aug 23, 2017
86f0f44
Rollup merge of #44043 - mattico:patch-1, r=alexcrichton
frewsxcv Aug 23, 2017
e9853c4
Rollup merge of #44047 - cuviper:union-basic-endian, r=petrochenkov
frewsxcv Aug 23, 2017
96efcdf
Rollup merge of #44054 - frewsxcv:frewsxcv-libstd-thread-unwrap-or-el…
frewsxcv Aug 23, 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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ Windows build triples are:
- `i686-pc-windows-msvc`
- `x86_64-pc-windows-msvc`

The build triple can be specified by either specifying `--build=ABI` when
The build triple can be specified by either specifying `--build=<triple>` when
invoking `x.py` commands, or by copying the `config.toml` file (as described
in Building From Source), and modifying the `build` option under the `[build]`
section.
Expand Down
4 changes: 2 additions & 2 deletions src/libproc_macro/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -246,9 +246,9 @@ pub enum TokenNode {
pub enum Delimiter {
/// `( ... )`
Parenthesis,
/// `[ ... ]`
Brace,
/// `{ ... }`
Brace,
/// `[ ... ]`
Bracket,
/// An implicit delimiter, e.g. `$var`, where $var is `...`.
None,
Expand Down
4 changes: 4 additions & 0 deletions src/librustdoc/html/static/rustdoc.css
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,10 @@ p {
margin: 0 0 .6em 0;
}

summary {
outline: none;
}

code, pre {
font-family: "Source Code Pro", Menlo, Monaco, Consolas, "DejaVu Sans Mono", Inconsolata, monospace;
white-space: pre-wrap;
Expand Down
4 changes: 2 additions & 2 deletions src/libstd/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
//! Note the documentation for the primitives [`str`] and [`[T]`][slice] (also
//! called 'slice'). Many method calls on [`String`] and [`Vec<T>`] are actually
//! calls to methods on [`str`] and [`[T]`][slice] respectively, via [deref
//! coercions].
//! coercions][deref-coercions].
//!
//! Third, the standard library defines [The Rust Prelude], a small collection
//! of items - mostly traits - that are imported into every module of every
Expand Down Expand Up @@ -203,7 +203,7 @@
//! [`use`]: ../book/first-edition/crates-and-modules.html#importing-modules-with-use
//! [crate root]: ../book/first-edition/crates-and-modules.html#basic-terminology-crates-and-modules
//! [crates.io]: https://crates.io
//! [deref coercions]: ../book/first-edition/deref-coercions.html
//! [deref-coercions]: ../book/second-edition/ch15-02-deref.html#implicit-deref-coercions-with-functions-and-methods
//! [files]: fs/struct.File.html
//! [multithreading]: thread/index.html
//! [other]: #what-is-in-the-standard-library-documentation
Expand Down
16 changes: 13 additions & 3 deletions src/libstd/path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,11 @@ unsafe fn u8_slice_as_os_str(s: &[u8]) -> &OsStr {
mem::transmute(s)
}

// Detect scheme on Redox
fn has_redox_scheme(s: &[u8]) -> bool {
cfg!(target_os = "redox") && s.split(|b| *b == b'/').next().unwrap_or(b"").contains(&b':')
}

////////////////////////////////////////////////////////////////////////////////
// Cross-platform, iterator-independent parsing
////////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -1685,8 +1690,12 @@ impl Path {
#[stable(feature = "rust1", since = "1.0.0")]
#[allow(deprecated)]
pub fn is_absolute(&self) -> bool {
// FIXME: Remove target_os = "redox" and allow Redox prefixes
self.has_root() && (cfg!(unix) || cfg!(target_os = "redox") || self.prefix().is_some())
if !cfg!(target_os = "redox") {
self.has_root() && (cfg!(unix) || self.prefix().is_some())
} else {
// FIXME: Allow Redox prefixes
has_redox_scheme(self.as_u8_slice())
}
}

/// Returns `true` if the `Path` is relative, i.e. not absolute.
Expand Down Expand Up @@ -2050,7 +2059,8 @@ impl Path {
Components {
path: self.as_u8_slice(),
prefix,
has_physical_root: has_physical_root(self.as_u8_slice(), prefix),
has_physical_root: has_physical_root(self.as_u8_slice(), prefix) ||
has_redox_scheme(self.as_u8_slice()),
front: State::Prefix,
back: State::Body,
}
Expand Down
8 changes: 5 additions & 3 deletions src/libstd/primitive_docs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,10 @@ mod prim_unit { }
/// Working with raw pointers in Rust is uncommon,
/// typically limited to a few patterns.
///
/// Use the [`null`] function to create null pointers, and the [`is_null`] method
/// of the `*const T` type to check for null. The `*const T` type also defines
/// the [`offset`] method, for pointer math.
/// Use the [`null`] and [`null_mut`] functions to create null pointers, and the
/// [`is_null`] method of the `*const T` and `*mut T` types to check for null.
/// The `*const T` and `*mut T` types also define the [`offset`] method, for
/// pointer math.
///
/// # Common ways to create raw pointers
///
Expand Down Expand Up @@ -261,6 +262,7 @@ mod prim_unit { }
/// *[See also the `std::ptr` module](ptr/index.html).*
///
/// [`null`]: ../std/ptr/fn.null.html
/// [`null_mut`]: ../std/ptr/fn.null_mut.html
/// [`is_null`]: ../std/primitive.pointer.html#method.is_null
/// [`offset`]: ../std/primitive.pointer.html#method.offset
/// [`into_raw`]: ../std/boxed/struct.Box.html#method.into_raw
Expand Down
2 changes: 1 addition & 1 deletion src/libstd/thread/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ impl Builder {
{
let Builder { name, stack_size } = self;

let stack_size = stack_size.unwrap_or(util::min_stack());
let stack_size = stack_size.unwrap_or_else(util::min_stack);

let my_thread = Thread::new(name);
let their_thread = my_thread.clone();
Expand Down
8 changes: 2 additions & 6 deletions src/test/run-pass/union/union-basic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@

// aux-build:union.rs

// FIXME: This test case makes little-endian assumptions.
// ignore-s390x
// ignore-sparc

extern crate union;
use std::mem::{size_of, align_of, zeroed};

Expand All @@ -39,7 +35,7 @@ fn local() {
assert_eq!(w.b, 0);
w.a = 1;
assert_eq!(w.a, 1);
assert_eq!(w.b, 1);
assert_eq!(w.b.to_le(), 1);
}
}

Expand All @@ -60,7 +56,7 @@ fn xcrate() {
assert_eq!(w.b, 0);
w.a = 1;
assert_eq!(w.a, 1);
assert_eq!(w.b, 1);
assert_eq!(w.b.to_le(), 1);
}
}

Expand Down