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 14 pull requests #38594

Merged
merged 30 commits into from Dec 25, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
517fce0
Simplify notes on testing and concurrency
wezm Nov 26, 2016
71de148
Advertise Vec in LinkedList docs
matklad Dec 11, 2016
17dd0e5
Don't @import normalize.css.
clarfonthey Dec 19, 2016
941b6b0
rustdoc: properly calculate line length for impl where clauses
Dec 20, 2016
78f630f
ICH: Add test cases for inherent impls.
michaelwoerister Dec 20, 2016
24334a0
Docs: Explain why/when `.lines()` returns an error
estebank Dec 21, 2016
9952982
Add missing examples in some thread functions
GuillaumeGomez Dec 21, 2016
88af5bf
Removes magenta build warning.
jxson Dec 21, 2016
40b9352
Fix Markdown list formatting.
chris-morgan Dec 22, 2016
20b92db
Correct path of incremental artifacts
aidanhs Dec 22, 2016
2432f69
ICH: Make InlineAsm hashes stable.
michaelwoerister Dec 22, 2016
531ac79
Add relative hyperlink
DirkyJerky Dec 22, 2016
fc9719c
Rename README.txt to README.md
DirkyJerky Dec 22, 2016
6a51d37
ICH: Add test case for InlineAsm hashes.
michaelwoerister Dec 22, 2016
d8ee074
book: replace example I do not understand
tshepang Dec 23, 2016
00645e8
Add JoinHandle missing examples
GuillaumeGomez Dec 23, 2016
639568c
Rollup merge of #37956 - tshepang:patch-2, r=steveklabnik
steveklabnik Dec 24, 2016
685027a
Rollup merge of #38013 - wezm:simplify-test-notes, r=steveklabnik
steveklabnik Dec 24, 2016
d15a477
Rollup merge of #38297 - matklad:linked-lists-are-not-cool, r=Guillau…
steveklabnik Dec 24, 2016
80d745a
Rollup merge of #38480 - clarcharr:import_css, r=steveklabnik
steveklabnik Dec 24, 2016
10b6097
Rollup merge of #38497 - QuietMisdreavus:rustdoc-where-again, r=steve…
steveklabnik Dec 24, 2016
0f0e74e
Rollup merge of #38502 - michaelwoerister:ich-test-inherent-impls, r=…
steveklabnik Dec 24, 2016
3c26ff4
Rollup merge of #38505 - estebank:why-lines, r=frewsxcv
steveklabnik Dec 24, 2016
67bef48
Rollup merge of #38513 - GuillaumeGomez:thread_fn_docs, r=frewsxcv
steveklabnik Dec 24, 2016
e9a2a77
Rollup merge of #38521 - jxson:remove-magenta-warnings, r=sfackler
steveklabnik Dec 24, 2016
8669b5d
Rollup merge of #38549 - aidanhs:aphs-incremental-readme-note, r=niko…
steveklabnik Dec 24, 2016
abf4784
Rollup merge of #38554 - DirkyJerky:master, r=frewsxcv
steveklabnik Dec 24, 2016
8836a9d
Rollup merge of #38557 - michaelwoerister:inline-asm-ich, r=nikomatsakis
steveklabnik Dec 24, 2016
637818f
Rollup merge of #38568 - chris-morgan:fix-markdown-lists, r=frewsxcv
steveklabnik Dec 24, 2016
df63b0c
Rollup merge of #38572 - GuillaumeGomez:join_handle_docs, r=frewsxcv
steveklabnik Dec 24, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/bootstrap/README.md
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
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
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
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
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
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
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
@@ -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
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
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
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
@@ -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
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
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