Skip to content

Commit e60aa62

Browse files
committed
Auto merge of #38594 - steveklabnik:rollup, r=steveklabnik
Rollup of 14 pull requests - Successful merges: #37956, #38013, #38297, #38480, #38497, #38502, #38505, #38513, #38521, #38549, #38554, #38557, #38568, #38572 - Failed merges:
2 parents 00e61d4 + df63b0c commit e60aa62

File tree

18 files changed

+848
-48
lines changed

18 files changed

+848
-48
lines changed

src/bootstrap/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ incremental builds:
142142
```
143143

144144
The `--incremental` flag will store incremental compilation artifacts
145-
in `build/stage0-incremental`. Note that we only use incremental
145+
in `build/<host>/stage0-incremental`. Note that we only use incremental
146146
compilation for the stage0 -> stage1 compilation -- this is because
147147
the stage1 compiler is changing, and we don't try to cache and reuse
148148
incremental artifacts across different versions of the compiler. For

src/doc/book/casting-between-types.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,18 @@ function result.
1616

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

19-
* `&mut T` to `&T`
19+
* `&mut T` to `&T`
2020

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

24-
* `*mut T` to `*const T`
24+
* `*mut T` to `*const T`
2525

2626
References can also be coerced to raw pointers:
2727

28-
* `&T` to `*const T`
28+
* `&T` to `*const T`
2929

30-
* `&mut T` to `*mut T`
30+
* `&mut T` to `*mut T`
3131

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

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

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

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

6868
For example
6969

src/doc/book/documentation.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -460,8 +460,9 @@ not actually pass as a test.
460460
```
461461

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

466467
### Documenting modules
467468

src/doc/book/testing.md

+4-5
Original file line numberDiff line numberDiff line change
@@ -589,11 +589,10 @@ please see the [Documentation chapter](documentation.html).
589589

590590
# Testing and concurrency
591591

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

598597
If this is an issue it is possible to control this concurrency, either by
599598
setting the environment variable `RUST_TEST_THREADS`, or by passing the argument

src/libcollections/linked_list.rs

+17-3
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,15 @@
1010

1111
//! A doubly-linked list with owned nodes.
1212
//!
13-
//! The `LinkedList` allows pushing and popping elements at either end and is thus
14-
//! efficiently usable as a double-ended queue.
13+
//! The `LinkedList` allows pushing and popping elements at either end
14+
//! in constant time.
15+
//!
16+
//! Almost always it is better to use `Vec` or [`VecDeque`] instead of
17+
//! [`LinkedList`]. In general, array-based containers are faster,
18+
//! more memory efficient and make better use of CPU cache.
19+
//!
20+
//! [`LinkedList`]: ../linked_list/struct.LinkedList.html
21+
//! [`VecDeque`]: ../vec_deque/struct.VecDeque.html
1522
1623
#![stable(feature = "rust1", since = "1.0.0")]
1724

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

2835
use super::SpecExtend;
2936

30-
/// A doubly-linked list.
37+
/// A doubly-linked list with owned nodes.
38+
///
39+
/// The `LinkedList` allows pushing and popping elements at either end
40+
/// in constant time.
41+
///
42+
/// Almost always it is better to use `Vec` or `VecDeque` instead of
43+
/// `LinkedList`. In general, array-based containers are faster,
44+
/// more memory efficient and make better use of CPU cache.
3145
#[stable(feature = "rust1", since = "1.0.0")]
3246
pub struct LinkedList<T> {
3347
head: Option<Shared<Node<T>>>,

src/librustc_incremental/calculate_svh/svh_visitor.rs

+43-3
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ use rustc::hir::def_id::DefId;
2828
use rustc::hir::intravisit as visit;
2929
use rustc::ty::TyCtxt;
3030
use rustc_data_structures::fnv;
31-
use std::hash::Hash;
31+
use std::hash::{Hash, Hasher};
3232

3333
use super::def_path_hash::DefPathHashes;
3434
use super::caching_codemap_view::CachingCodemapView;
@@ -264,7 +264,7 @@ enum SawExprComponent<'a> {
264264
SawExprPath,
265265
SawExprAddrOf(hir::Mutability),
266266
SawExprRet,
267-
SawExprInlineAsm(&'a hir::InlineAsm),
267+
SawExprInlineAsm(StableInlineAsm<'a>),
268268
SawExprStruct,
269269
SawExprRepeat,
270270
}
@@ -340,7 +340,7 @@ fn saw_expr<'a>(node: &'a Expr_,
340340
ExprBreak(label, _) => (SawExprBreak(label.map(|l| l.name.as_str())), false),
341341
ExprAgain(label) => (SawExprAgain(label.map(|l| l.name.as_str())), false),
342342
ExprRet(..) => (SawExprRet, false),
343-
ExprInlineAsm(ref a,..) => (SawExprInlineAsm(a), false),
343+
ExprInlineAsm(ref a,..) => (SawExprInlineAsm(StableInlineAsm(a)), false),
344344
ExprStruct(..) => (SawExprStruct, false),
345345
ExprRepeat(..) => (SawExprRepeat, false),
346346
}
@@ -491,6 +491,46 @@ enum SawSpanExpnKind {
491491
SomeExpansion,
492492
}
493493

494+
/// A wrapper that provides a stable Hash implementation.
495+
struct StableInlineAsm<'a>(&'a InlineAsm);
496+
497+
impl<'a> Hash for StableInlineAsm<'a> {
498+
fn hash<H: Hasher>(&self, state: &mut H) {
499+
let InlineAsm {
500+
asm,
501+
asm_str_style,
502+
ref outputs,
503+
ref inputs,
504+
ref clobbers,
505+
volatile,
506+
alignstack,
507+
dialect,
508+
expn_id: _, // This is used for error reporting
509+
} = *self.0;
510+
511+
asm.as_str().hash(state);
512+
asm_str_style.hash(state);
513+
outputs.len().hash(state);
514+
for output in outputs {
515+
let InlineAsmOutput { constraint, is_rw, is_indirect } = *output;
516+
constraint.as_str().hash(state);
517+
is_rw.hash(state);
518+
is_indirect.hash(state);
519+
}
520+
inputs.len().hash(state);
521+
for input in inputs {
522+
input.as_str().hash(state);
523+
}
524+
clobbers.len().hash(state);
525+
for clobber in clobbers {
526+
clobber.as_str().hash(state);
527+
}
528+
volatile.hash(state);
529+
alignstack.hash(state);
530+
dialect.hash(state);
531+
}
532+
}
533+
494534
macro_rules! hash_attrs {
495535
($visitor:expr, $attrs:expr) => ({
496536
let attrs = $attrs;

src/librustc_metadata/diagnostics.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@ An unknown "kind" was specified for a link attribute. Erroneous code example:
5757
5858
Please specify a valid "kind" value, from one of the following:
5959
60-
* static
61-
* dylib
62-
* framework
60+
* static
61+
* dylib
62+
* framework
6363
6464
"##,
6565

src/librustc_trans/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
See [librustc/README.md](../librustc/README.md).

src/librustc_trans/README.txt

-1
This file was deleted.

src/librustc_typeck/diagnostics.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1378,8 +1378,8 @@ let x = |_| {}; // error: cannot determine a type for this expression
13781378
13791379
You have two possibilities to solve this situation:
13801380
1381-
* Give an explicit definition of the expression
1382-
* Infer the expression
1381+
* Give an explicit definition of the expression
1382+
* Infer the expression
13831383
13841384
Examples:
13851385

src/librustdoc/html/format.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ impl<'a> fmt::Display for WhereClause<'a> {
207207
if !f.alternate() {
208208
clause.push_str("</span>");
209209
let plain = format!("{:#}", self);
210-
if plain.len() > 80 {
210+
if plain.len() + pad > 80 {
211211
//break it onto its own line regardless, but make sure method impls and trait
212212
//blocks keep their fixed padding (2 and 9, respectively)
213213
let padding = if pad > 10 {

src/librustdoc/html/layout.rs

+1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ r##"<!DOCTYPE html>
4646
4747
<title>{title}</title>
4848
49+
<link rel="stylesheet" type="text/css" href="{root_path}normalize.css">
4950
<link rel="stylesheet" type="text/css" href="{root_path}rustdoc.css">
5051
<link rel="stylesheet" type="text/css" href="{root_path}main.css">
5152
{css_extension}

src/librustdoc/html/static/rustdoc.css

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
@import "normalize.css";
2-
31
/**
42
* Copyright 2013 The Rust Project Developers. See the COPYRIGHT
53
* file at the top-level directory of this distribution and at

src/libstd/io/mod.rs

+6
Original file line numberDiff line numberDiff line change
@@ -1425,6 +1425,12 @@ pub trait BufRead: Read {
14251425
/// println!("{}", line.unwrap());
14261426
/// }
14271427
/// ```
1428+
///
1429+
/// # Errors
1430+
///
1431+
/// Each line of the iterator has the same error semantics as [`BufRead::read_line()`].
1432+
///
1433+
/// [`BufRead::read_line()`]: trait.BufRead.html#method.read_line
14281434
#[stable(feature = "rust1", since = "1.0.0")]
14291435
fn lines(self) -> Lines<Self> where Self: Sized {
14301436
Lines { buf: self }

src/libstd/sys/unix/process/magenta.rs

-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ pub type mx_rights_t = u32;
2323
pub type mx_status_t = i32;
2424

2525
pub type mx_size_t = usize;
26-
pub type mx_ssize_t = isize;
2726

2827
pub const MX_HANDLE_INVALID: mx_handle_t = 0;
2928

0 commit comments

Comments
 (0)