Skip to content

Commit

Permalink
Auto merge of #38594 - steveklabnik:rollup, r=steveklabnik
Browse files Browse the repository at this point in the history
Rollup of 14 pull requests

- Successful merges: #37956, #38013, #38297, #38480, #38497, #38502, #38505, #38513, #38521, #38549, #38554, #38557, #38568, #38572
- Failed merges:
  • Loading branch information
bors committed Dec 24, 2016
2 parents 00e61d4 + df63b0c commit e60aa62
Show file tree
Hide file tree
Showing 18 changed files with 848 additions and 48 deletions.
2 changes: 1 addition & 1 deletion src/bootstrap/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ incremental builds:
```

The `--incremental` flag will store incremental compilation artifacts
in `build/stage0-incremental`. Note that we only use incremental
in `build/<host>/stage0-incremental`. Note that we only use incremental
compilation for the stage0 -> stage1 compilation -- this is because
the stage1 compiler is changing, and we don't try to cache and reuse
incremental artifacts across different versions of the compiler. For
Expand Down
18 changes: 9 additions & 9 deletions src/doc/book/casting-between-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,18 @@ function result.

The most common case of coercion is removing mutability from a reference:

* `&mut T` to `&T`
* `&mut T` to `&T`

An analogous conversion is to remove mutability from a
[raw pointer](raw-pointers.md):

* `*mut T` to `*const T`
* `*mut T` to `*const T`

References can also be coerced to raw pointers:

* `&T` to `*const T`
* `&T` to `*const T`

* `&mut T` to `*mut T`
* `&mut T` to `*mut T`

Custom coercions may be defined using [`Deref`](deref-coercions.md).

Expand Down Expand Up @@ -59,11 +59,11 @@ A cast `e as U` is valid if `e` has type `T` and `T` *coerces* to `U`.

A cast `e as U` is also valid in any of the following cases:

* `e` has type `T` and `T` and `U` are any numeric types; *numeric-cast*
* `e` is a C-like enum (with no data attached to the variants),
and `U` is an integer type; *enum-cast*
* `e` has type `bool` or `char` and `U` is an integer type; *prim-int-cast*
* `e` has type `u8` and `U` is `char`; *u8-char-cast*
* `e` has type `T` and `T` and `U` are any numeric types; *numeric-cast*
* `e` is a C-like enum (with no data attached to the variants),
and `U` is an integer type; *enum-cast*
* `e` has type `bool` or `char` and `U` is an integer type; *prim-int-cast*
* `e` has type `u8` and `U` is `char`; *u8-char-cast*

For example

Expand Down
5 changes: 3 additions & 2 deletions src/doc/book/documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -460,8 +460,9 @@ not actually pass as a test.
```

The `no_run` attribute will compile your code, but not run it. This is
important for examples such as "Here's how to start up a network service,"
which you would want to make sure compile, but might run in an infinite loop!
important for examples such as "Here's how to retrieve a web page,"
which you would want to ensure compiles, but might be run in a test
environment that has no network access.

### Documenting modules

Expand Down
9 changes: 4 additions & 5 deletions src/doc/book/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -589,11 +589,10 @@ please see the [Documentation chapter](documentation.html).

# Testing and concurrency

One thing that is important to note when writing tests is that they may be run
concurrently using threads. For this reason you should take care that your tests
are written in such a way as to not depend on each-other, or on any shared
state. "Shared state" can also include the environment, such as the current
working directory, or environment variables.
It is important to note that tests are run concurrently using threads. For this
reason, care should be taken to ensure your tests do not depend on each-other,
or on any shared state. "Shared state" can also include the environment, such
as the current working directory, or environment variables.

If this is an issue it is possible to control this concurrency, either by
setting the environment variable `RUST_TEST_THREADS`, or by passing the argument
Expand Down
20 changes: 17 additions & 3 deletions src/libcollections/linked_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,15 @@

//! A doubly-linked list with owned nodes.
//!
//! The `LinkedList` allows pushing and popping elements at either end and is thus
//! efficiently usable as a double-ended queue.
//! The `LinkedList` allows pushing and popping elements at either end
//! in constant time.
//!
//! Almost always it is better to use `Vec` or [`VecDeque`] instead of
//! [`LinkedList`]. In general, array-based containers are faster,
//! more memory efficient and make better use of CPU cache.
//!
//! [`LinkedList`]: ../linked_list/struct.LinkedList.html
//! [`VecDeque`]: ../vec_deque/struct.VecDeque.html

#![stable(feature = "rust1", since = "1.0.0")]

Expand All @@ -27,7 +34,14 @@ use core::ptr::{self, Shared};

use super::SpecExtend;

/// A doubly-linked list.
/// A doubly-linked list with owned nodes.
///
/// The `LinkedList` allows pushing and popping elements at either end
/// in constant time.
///
/// Almost always it is better to use `Vec` or `VecDeque` instead of
/// `LinkedList`. In general, array-based containers are faster,
/// more memory efficient and make better use of CPU cache.
#[stable(feature = "rust1", since = "1.0.0")]
pub struct LinkedList<T> {
head: Option<Shared<Node<T>>>,
Expand Down
46 changes: 43 additions & 3 deletions src/librustc_incremental/calculate_svh/svh_visitor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ use rustc::hir::def_id::DefId;
use rustc::hir::intravisit as visit;
use rustc::ty::TyCtxt;
use rustc_data_structures::fnv;
use std::hash::Hash;
use std::hash::{Hash, Hasher};

use super::def_path_hash::DefPathHashes;
use super::caching_codemap_view::CachingCodemapView;
Expand Down Expand Up @@ -264,7 +264,7 @@ enum SawExprComponent<'a> {
SawExprPath,
SawExprAddrOf(hir::Mutability),
SawExprRet,
SawExprInlineAsm(&'a hir::InlineAsm),
SawExprInlineAsm(StableInlineAsm<'a>),
SawExprStruct,
SawExprRepeat,
}
Expand Down Expand Up @@ -340,7 +340,7 @@ fn saw_expr<'a>(node: &'a Expr_,
ExprBreak(label, _) => (SawExprBreak(label.map(|l| l.name.as_str())), false),
ExprAgain(label) => (SawExprAgain(label.map(|l| l.name.as_str())), false),
ExprRet(..) => (SawExprRet, false),
ExprInlineAsm(ref a,..) => (SawExprInlineAsm(a), false),
ExprInlineAsm(ref a,..) => (SawExprInlineAsm(StableInlineAsm(a)), false),
ExprStruct(..) => (SawExprStruct, false),
ExprRepeat(..) => (SawExprRepeat, false),
}
Expand Down Expand Up @@ -491,6 +491,46 @@ enum SawSpanExpnKind {
SomeExpansion,
}

/// A wrapper that provides a stable Hash implementation.
struct StableInlineAsm<'a>(&'a InlineAsm);

impl<'a> Hash for StableInlineAsm<'a> {
fn hash<H: Hasher>(&self, state: &mut H) {
let InlineAsm {
asm,
asm_str_style,
ref outputs,
ref inputs,
ref clobbers,
volatile,
alignstack,
dialect,
expn_id: _, // This is used for error reporting
} = *self.0;

asm.as_str().hash(state);
asm_str_style.hash(state);
outputs.len().hash(state);
for output in outputs {
let InlineAsmOutput { constraint, is_rw, is_indirect } = *output;
constraint.as_str().hash(state);
is_rw.hash(state);
is_indirect.hash(state);
}
inputs.len().hash(state);
for input in inputs {
input.as_str().hash(state);
}
clobbers.len().hash(state);
for clobber in clobbers {
clobber.as_str().hash(state);
}
volatile.hash(state);
alignstack.hash(state);
dialect.hash(state);
}
}

macro_rules! hash_attrs {
($visitor:expr, $attrs:expr) => ({
let attrs = $attrs;
Expand Down
6 changes: 3 additions & 3 deletions src/librustc_metadata/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ An unknown "kind" was specified for a link attribute. Erroneous code example:
Please specify a valid "kind" value, from one of the following:
* static
* dylib
* framework
* static
* dylib
* framework
"##,

Expand Down
1 change: 1 addition & 0 deletions src/librustc_trans/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
See [librustc/README.md](../librustc/README.md).
1 change: 0 additions & 1 deletion src/librustc_trans/README.txt

This file was deleted.

4 changes: 2 additions & 2 deletions src/librustc_typeck/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1378,8 +1378,8 @@ let x = |_| {}; // error: cannot determine a type for this expression
You have two possibilities to solve this situation:
* Give an explicit definition of the expression
* Infer the expression
* Give an explicit definition of the expression
* Infer the expression
Examples:
Expand Down
2 changes: 1 addition & 1 deletion src/librustdoc/html/format.rs
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ impl<'a> fmt::Display for WhereClause<'a> {
if !f.alternate() {
clause.push_str("</span>");
let plain = format!("{:#}", self);
if plain.len() > 80 {
if plain.len() + pad > 80 {
//break it onto its own line regardless, but make sure method impls and trait
//blocks keep their fixed padding (2 and 9, respectively)
let padding = if pad > 10 {
Expand Down
1 change: 1 addition & 0 deletions src/librustdoc/html/layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ r##"<!DOCTYPE html>
<title>{title}</title>
<link rel="stylesheet" type="text/css" href="{root_path}normalize.css">
<link rel="stylesheet" type="text/css" href="{root_path}rustdoc.css">
<link rel="stylesheet" type="text/css" href="{root_path}main.css">
{css_extension}
Expand Down
2 changes: 0 additions & 2 deletions src/librustdoc/html/static/rustdoc.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
@import "normalize.css";

/**
* Copyright 2013 The Rust Project Developers. See the COPYRIGHT
* file at the top-level directory of this distribution and at
Expand Down
6 changes: 6 additions & 0 deletions src/libstd/io/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1425,6 +1425,12 @@ pub trait BufRead: Read {
/// println!("{}", line.unwrap());
/// }
/// ```
///
/// # Errors
///
/// Each line of the iterator has the same error semantics as [`BufRead::read_line()`].
///
/// [`BufRead::read_line()`]: trait.BufRead.html#method.read_line
#[stable(feature = "rust1", since = "1.0.0")]
fn lines(self) -> Lines<Self> where Self: Sized {
Lines { buf: self }
Expand Down
1 change: 0 additions & 1 deletion src/libstd/sys/unix/process/magenta.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ pub type mx_rights_t = u32;
pub type mx_status_t = i32;

pub type mx_size_t = usize;
pub type mx_ssize_t = isize;

pub const MX_HANDLE_INVALID: mx_handle_t = 0;

Expand Down
Loading

0 comments on commit e60aa62

Please sign in to comment.