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 #44093

Closed
wants to merge 23 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
49ee9f3
Fix inconsistent doc headings
Aug 24, 2017
8cd4cac
include Cargo.{toml,lock} in rust-src tarball
RalfJung Aug 24, 2017
b8d8dc3
Fix #43457 (and avoid some unneeded lookups to boot, woo).
pnkfelix Aug 25, 2017
d1a15cd
Regression test.
pnkfelix Aug 25, 2017
e13f02e
rustbuild: Automatically enable Ninja on MSVC
alexcrichton Aug 25, 2017
6a72131
Allow htmldocck to run using Python 3.
kennytm Aug 25, 2017
5a71e12
Fix a byte/char confusion issue in the error emitter
est31 Aug 25, 2017
0a6c724
Add missing link in string doc
GuillaumeGomez Aug 25, 2017
6ca124b
haiku/librustc_back: Remove incorrect no_integrated_as
kallisti5 Aug 25, 2017
898be21
rustc_errors: Add the ability to delay as bugs
alexcrichton Aug 23, 2017
05051fb
rustc: Change the return of a query's `try_get`
alexcrichton Aug 23, 2017
9ab9446
rustc: Fix two instances of `try_get`
alexcrichton Aug 23, 2017
1cc87fd
rustc: Add a FIXME for `try_get` in MIR inlining
alexcrichton Aug 24, 2017
b43afc7
rustc: Skip cyclic checks in `item_path`
alexcrichton Aug 24, 2017
1f43ed4
rustc: Make `report_cycle` and `CycleError` private
alexcrichton Aug 24, 2017
9e5c679
Rollup merge of #44072 - lukaramu:fix-doc-headings, r=steveklabnik
alexcrichton Aug 26, 2017
df51036
Rollup merge of #44076 - RalfJung:src, r=alexcrichton
alexcrichton Aug 26, 2017
4ecbc7f
Rollup merge of #44081 - est31:master, r=eddyb
alexcrichton Aug 26, 2017
4e5c225
Rollup merge of #44082 - pnkfelix:issue-43457, r=eddyb
alexcrichton Aug 26, 2017
9392636
Rollup merge of #44084 - alexcrichton:msvc-ninja, r=Mark-Simulacrum
alexcrichton Aug 26, 2017
4c845f8
Rollup merge of #44086 - kennytm:htmldocck-python3, r=Mark-Simulacrum
alexcrichton Aug 26, 2017
5c64008
Rollup merge of #44090 - GuillaumeGomez:str-doc, r=steveklabnik
alexcrichton Aug 26, 2017
f0ba1b9
Rollup merge of #44091 - kallisti5:haiku-fix, r=eddyb
alexcrichton Aug 26, 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
7 changes: 7 additions & 0 deletions src/bootstrap/dist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -724,6 +724,10 @@ impl Step for Src {
let dst_src = dst.join("rust");
t!(fs::create_dir_all(&dst_src));

let src_files = [
"src/Cargo.toml",
"src/Cargo.lock",
];
// This is the reduced set of paths which will become the rust-src component
// (essentially libstd and all of its path dependencies)
let std_src_dirs = [
Expand Down Expand Up @@ -759,6 +763,9 @@ impl Step for Src {
];

copy_src_dirs(build, &std_src_dirs[..], &std_src_dirs_exclude[..], &dst_src);
for file in src_files.iter() {
copy(&build.src.join(file), &dst_src.join(file));
}

// Create source tarball in rust-installer format
let mut cmd = rust_installer(builder);
Expand Down
25 changes: 21 additions & 4 deletions src/bootstrap/sanity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,27 @@ pub fn check(build: &mut Build) {
}

// Ninja is currently only used for LLVM itself.
// Some Linux distros rename `ninja` to `ninja-build`.
// CMake can work with either binary name.
if building_llvm && build.config.ninja && cmd_finder.maybe_have("ninja-build").is_none() {
cmd_finder.must_have("ninja");
if building_llvm {
if build.config.ninja {
// Some Linux distros rename `ninja` to `ninja-build`.
// CMake can work with either binary name.
if cmd_finder.maybe_have("ninja-build").is_none() {
cmd_finder.must_have("ninja");
}
}

// If ninja isn't enabled but we're building for MSVC then we try
// doubly hard to enable it. It was realized in #43767 that the msbuild
// CMake generator for MSVC doesn't respect configuration options like
// disabling LLVM assertions, which can often be quite important!
//
// In these cases we automatically enable Ninja if we find it in the
// environment.
if !build.config.ninja && build.config.build.contains("msvc") {
if cmd_finder.maybe_have("ninja").is_some() {
build.config.ninja = true;
}
}
}

build.config.python = build.config.python.take().map(|p| cmd_finder.must_have(p))
Expand Down
33 changes: 20 additions & 13 deletions src/etc/htmldocck.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

In order to avoid one-off dependencies for this task, this script uses
a reasonably working HTML parser and the existing XPath implementation
from Python 2's standard library. Hopefully we won't render
from Python's standard library. Hopefully we won't render
non-well-formed HTML.

# Commands
Expand Down Expand Up @@ -110,11 +110,17 @@
import re
import shlex
from collections import namedtuple
from HTMLParser import HTMLParser
try:
from html.parser import HTMLParser
except ImportError:
from HTMLParser import HTMLParser
from xml.etree import cElementTree as ET

# ⇤/⇥ are not in HTML 4 but are in HTML 5
from htmlentitydefs import entitydefs
try:
from html.entities import entitydefs
except ImportError:
from htmlentitydefs import entitydefs
entitydefs['larrb'] = u'\u21e4'
entitydefs['rarrb'] = u'\u21e5'
entitydefs['nbsp'] = ' '
Expand All @@ -123,6 +129,11 @@
VOID_ELEMENTS = set(['area', 'base', 'br', 'col', 'embed', 'hr', 'img', 'input', 'keygen',
'link', 'menuitem', 'meta', 'param', 'source', 'track', 'wbr'])

# Python 2 -> 3 compatibility
try:
unichr
except NameError:
unichr = chr

class CustomHTMLParser(HTMLParser):
"""simplified HTML parser.
Expand Down Expand Up @@ -184,12 +195,8 @@ def concat_multi_lines(f):

# strip the common prefix from the current line if needed
if lastline is not None:
maxprefix = 0
for i in xrange(min(len(line), len(lastline))):
if line[i] != lastline[i]:
break
maxprefix += 1
line = line[maxprefix:].lstrip()
common_prefix = os.path.commonprefix([line, lastline])
line = line[len(common_prefix):].lstrip()

firstlineno = firstlineno or lineno
if line.endswith('\\'):
Expand All @@ -213,7 +220,7 @@ def concat_multi_lines(f):


def get_commands(template):
with open(template, 'rUb') as f:
with open(template, 'rU') as f:
for lineno, line in concat_multi_lines(f):
m = LINE_PATTERN.search(line)
if not m:
Expand Down Expand Up @@ -372,7 +379,7 @@ def check_command(c, cache):
cache.get_file(c.args[0])
ret = True
except FailedCheck as err:
cerr = err.message
cerr = str(err)
ret = False
elif len(c.args) == 2: # @has/matches <path> <pat> = string test
cerr = "`PATTERN` did not match"
Expand Down Expand Up @@ -413,9 +420,9 @@ def check_command(c, cache):

except FailedCheck as err:
message = '@{}{} check failed'.format('!' if c.negated else '', c.cmd)
print_err(c.lineno, c.context, err.message, message)
print_err(c.lineno, c.context, str(err), message)
except InvalidCheck as err:
print_err(c.lineno, c.context, err.message)
print_err(c.lineno, c.context, str(err))

def check(target, commands):
cache = CachedFiles(target)
Expand Down
24 changes: 12 additions & 12 deletions src/liballoc/allocator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ impl Layout {

/// Creates a layout, bypassing all checks.
///
/// # Unsafety
/// # Safety
///
/// This function is unsafe as it does not verify that `align` is
/// a power-of-two that is also less than or equal to 2^31, nor
Expand Down Expand Up @@ -485,7 +485,7 @@ pub unsafe trait Alloc {
/// behavior, e.g. to ensure initialization to particular sets of
/// bit patterns.)
///
/// # Unsafety
/// # Safety
///
/// This function is unsafe because undefined behavior can result
/// if the caller does not ensure that `layout` has non-zero size.
Expand Down Expand Up @@ -513,7 +513,7 @@ pub unsafe trait Alloc {

/// Deallocate the memory referenced by `ptr`.
///
/// # Unsafety
/// # Safety
///
/// This function is unsafe because undefined behavior can result
/// if the caller does not ensure all of the following:
Expand Down Expand Up @@ -617,7 +617,7 @@ pub unsafe trait Alloc {
/// behavior is well-defined (though underspecified) when this
/// constraint is violated; further discussion below.
///
/// # Unsafety
/// # Safety
///
/// This function is unsafe because undefined behavior can result
/// if the caller does not ensure all of the following:
Expand Down Expand Up @@ -688,7 +688,7 @@ pub unsafe trait Alloc {
/// Behaves like `alloc`, but also ensures that the contents
/// are set to zero before being returned.
///
/// # Unsafety
/// # Safety
///
/// This function is unsafe for the same reasons that `alloc` is.
///
Expand All @@ -714,7 +714,7 @@ pub unsafe trait Alloc {
/// the returned block. For some `layout` inputs, like arrays, this
/// may include extra storage usable for additional data.
///
/// # Unsafety
/// # Safety
///
/// This function is unsafe for the same reasons that `alloc` is.
///
Expand All @@ -736,7 +736,7 @@ pub unsafe trait Alloc {
/// the returned block. For some `layout` inputs, like arrays, this
/// may include extra storage usable for additional data.
///
/// # Unsafety
/// # Safety
///
/// This function is unsafe for the same reasons that `realloc` is.
///
Expand Down Expand Up @@ -770,7 +770,7 @@ pub unsafe trait Alloc {
/// memory block referenced by `ptr` has not been transferred, and
/// the contents of the memory block are unaltered.
///
/// # Unsafety
/// # Safety
///
/// This function is unsafe because undefined behavior can result
/// if the caller does not ensure all of the following:
Expand Down Expand Up @@ -827,7 +827,7 @@ pub unsafe trait Alloc {
/// the memory block has not been transferred, and the contents of
/// the memory block are unaltered.
///
/// # Unsafety
/// # Safety
///
/// This function is unsafe because undefined behavior can result
/// if the caller does not ensure all of the following:
Expand Down Expand Up @@ -920,7 +920,7 @@ pub unsafe trait Alloc {
///
/// Captures a common usage pattern for allocators.
///
/// # Unsafety
/// # Safety
///
/// This function is unsafe because undefined behavior can result
/// if the caller does not ensure both:
Expand Down Expand Up @@ -993,7 +993,7 @@ pub unsafe trait Alloc {
/// The returned block is suitable for passing to the
/// `alloc`/`realloc` methods of this allocator.
///
/// # Unsafety
/// # Safety
///
/// This function is unsafe because undefined behavior can result
/// if the caller does not ensure all of the following:
Expand Down Expand Up @@ -1037,7 +1037,7 @@ pub unsafe trait Alloc {
///
/// Captures a common usage pattern for allocators.
///
/// # Unsafety
/// # Safety
///
/// This function is unsafe because undefined behavior can result
/// if the caller does not ensure both:
Expand Down
2 changes: 1 addition & 1 deletion src/liballoc/boxed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,7 @@ impl<I: FusedIterator + ?Sized> FusedIterator for Box<I> {}
/// that `FnBox` may be deprecated in the future if `Box<FnOnce()>`
/// closures become directly usable.)
///
/// ### Example
/// # Examples
///
/// Here is a snippet of code which creates a hashmap full of boxed
/// once closures and then removes them one by one, calling each
Expand Down
18 changes: 9 additions & 9 deletions src/liballoc/slice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ mod hack {
impl<T> [T] {
/// Returns the number of elements in the slice.
///
/// # Example
/// # Examples
///
/// ```
/// let a = [1, 2, 3];
Expand All @@ -185,7 +185,7 @@ impl<T> [T] {

/// Returns `true` if the slice has a length of 0.
///
/// # Example
/// # Examples
///
/// ```
/// let a = [1, 2, 3];
Expand Down Expand Up @@ -523,7 +523,7 @@ impl<T> [T] {

/// Reverses the order of elements in the slice, in place.
///
/// # Example
/// # Examples
///
/// ```
/// let mut v = [1, 2, 3];
Expand Down Expand Up @@ -580,7 +580,7 @@ impl<T> [T] {
///
/// Panics if `size` is 0.
///
/// # Example
/// # Examples
///
/// ```
/// let slice = ['r', 'u', 's', 't'];
Expand Down Expand Up @@ -613,7 +613,7 @@ impl<T> [T] {
///
/// Panics if `size` is 0.
///
/// # Example
/// # Examples
///
/// ```
/// let slice = ['l', 'o', 'r', 'e', 'm'];
Expand Down Expand Up @@ -1040,7 +1040,7 @@ impl<T> [T] {
/// `Err` is returned, containing the index where a matching
/// element could be inserted while maintaining sorted order.
///
/// # Example
/// # Examples
///
/// Looks up a series of four elements. The first is found, with a
/// uniquely determined position; the second and third are not
Expand Down Expand Up @@ -1074,7 +1074,7 @@ impl<T> [T] {
/// `Err` is returned, containing the index where a matching
/// element could be inserted while maintaining sorted order.
///
/// # Example
/// # Examples
///
/// Looks up a series of four elements. The first is found, with a
/// uniquely determined position; the second and third are not
Expand Down Expand Up @@ -1419,7 +1419,7 @@ impl<T> [T] {
///
/// This function will panic if the two slices have different lengths.
///
/// # Example
/// # Examples
///
/// ```
/// let mut dst = [0, 0, 0];
Expand All @@ -1445,7 +1445,7 @@ impl<T> [T] {
///
/// This function will panic if the two slices have different lengths.
///
/// # Example
/// # Examples
///
/// ```
/// let mut dst = [0, 0, 0];
Expand Down
2 changes: 1 addition & 1 deletion src/liballoc/str.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1714,7 +1714,7 @@ impl str {
///
/// [`Err`]: str/trait.FromStr.html#associatedtype.Err
///
/// # Example
/// # Examples
///
/// Basic usage
///
Expand Down
3 changes: 2 additions & 1 deletion src/liballoc/string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ use boxed::Box;
///
/// # Examples
///
/// You can create a `String` from a literal string with `String::from`:
/// You can create a `String` from a literal string with [`String::from`]:
///
/// ```
/// let hello = String::from("Hello, world!");
Expand All @@ -98,6 +98,7 @@ use boxed::Box;
/// hello.push_str("orld!");
/// ```
///
/// [`String::from`]: #method.from
/// [`char`]: ../../std/primitive.char.html
/// [`push`]: #method.push
/// [`push_str`]: #method.push_str
Expand Down
4 changes: 2 additions & 2 deletions src/libcore/cell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -998,7 +998,7 @@ impl<'b, T: ?Sized> Ref<'b, T> {
/// A method would interfere with methods of the same name on the contents
/// of a `RefCell` used through `Deref`.
///
/// # Example
/// # Examples
///
/// ```
/// use std::cell::{RefCell, Ref};
Expand Down Expand Up @@ -1040,7 +1040,7 @@ impl<'b, T: ?Sized> RefMut<'b, T> {
/// `RefMut::map(...)`. A method would interfere with methods of the same
/// name on the contents of a `RefCell` used through `Deref`.
///
/// # Example
/// # Examples
///
/// ```
/// use std::cell::{RefCell, RefMut};
Expand Down
Loading