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 17 pull requests #48104

Closed
wants to merge 37 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
838ddbf
derive PartialEq and Eq for `ParseCharError`
tinaun Jan 26, 2018
505ef7b
Remove unused blake2b implementation
Mark-Simulacrum Jan 22, 2018
caa42e1
Remove VecCell
Mark-Simulacrum Jan 22, 2018
79d85da
Create a directory for --out-dir if it does not already exist
varkor Jan 29, 2018
7be8e2f
Add build.tools option to manage installation of extended rust tools.
o01eg Feb 5, 2018
daaa9a4
Fix ICE for mismatched args on target without span
etaoins Feb 7, 2018
528d6b6
rustdoc: Hide `-> ()` in cross crate inlined Fn* bounds
ollie27 Feb 7, 2018
78a0b7f
Refactor checks on list of extended tools.
o01eg Feb 7, 2018
37b5af2
Update binaryen to fix -Werror with GCC 8
cuviper Feb 7, 2018
04fde1c
intra-doc-links: bail early for linky things
Manishearth Feb 8, 2018
35dca7e
Add `rustc_args_required_const` to the feature whitelist
alexcrichton Feb 8, 2018
7a20fc1
Disallow function pointers to #[rustc_args_required_const]
alexcrichton Feb 8, 2018
e9bcb4e
Hide theme button under menu in mobile mode and fix top margin issue …
GuillaumeGomez Feb 8, 2018
64a8730
rustbuild: Pass `ccache` to build scripts
alexcrichton Feb 7, 2018
bb0df96
Update the dlmalloc submodule
alexcrichton Feb 9, 2018
774997d
Fix visitation order of calls so that it matches execution order. Fix…
Zoxc Feb 9, 2018
b521c77
Forcibly disable optimizations in backtrace-debuginfo
alexcrichton Feb 9, 2018
866d13a
Don't cross-compile Emscripten's LLVM
alexcrichton Feb 9, 2018
9c05bab
ci: Actually bootstrap on i686 dist
alexcrichton Feb 9, 2018
fe8e0d9
Update books for next release
Mark-Simulacrum Feb 9, 2018
270e6aa
Rollup merge of #47790 - tinaun:patch-1, r=sfackler
kennytm Feb 9, 2018
df1c16c
Rollup merge of #47835 - Mark-Simulacrum:remove-data-structs, r=nikom…
kennytm Feb 9, 2018
7c17ac8
Rollup merge of #47854 - varkor:create-out-dir, r=pnkfelix
kennytm Feb 9, 2018
ebbc35b
Rollup merge of #48015 - o01eg:disableable-installation, r=alexcrichton
kennytm Feb 9, 2018
67d4800
Rollup merge of #48047 - etaoins:fix-ice-for-mismatched-args-on-targe…
kennytm Feb 9, 2018
f3ee01e
Rollup merge of #48051 - ollie27:rustdoc_fn_unit_return, r=QuietMisdr…
kennytm Feb 9, 2018
b7f8fa6
Rollup merge of #48058 - cuviper:binaryen-gcc8, r=alexcrichton
kennytm Feb 9, 2018
b182bf1
Rollup merge of #48059 - alexcrichton:sccachebs, r=Mark-Simulacrum
kennytm Feb 9, 2018
ec01b28
Rollup merge of #48064 - Manishearth:intra-doc-bail, r=QuietMisdreavus
kennytm Feb 9, 2018
6747b17
Rollup merge of #48078 - alexcrichton:fix-required-const-and-proc-mac…
kennytm Feb 9, 2018
cbc3b8c
Rollup merge of #48080 - GuillaumeGomez:mobile-docs-fixes, r=QuietMis…
kennytm Feb 9, 2018
1ef535e
Rollup merge of #48085 - alexcrichton:update-dlmalloc, r=Mark-Simulacrum
kennytm Feb 9, 2018
4ed1ba6
Rollup merge of #48086 - Zoxc:gen-fix, r=nikomatsakis
kennytm Feb 9, 2018
671206b
Rollup merge of #48090 - alexcrichton:disable-opt-test, r=nikomatsakis
kennytm Feb 9, 2018
e471747
Rollup merge of #48093 - alexcrichton:dont-cross-emscripten, r=Mark-S…
kennytm Feb 9, 2018
258be62
Rollup merge of #48098 - alexcrichton:fix-i686-dist-bootstrap, r=Mark…
kennytm Feb 9, 2018
878e701
Rollup merge of #48101 - Mark-Simulacrum:new-books, r=steveklabnik Up…
kennytm Feb 9, 2018
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
4 changes: 4 additions & 0 deletions config.toml.example
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,10 @@
# default.
#extended = false

# Installs choosen set of extended tools if enables. By default builds all.
# If choosen tool failed to build the installation fails.
#tools = ["cargo", "rls", "rustfmt", "analysis", "src"]

# Verbosity level: 0 == not verbose, 1 == verbose, 2 == very verbose
#verbose = 0

Expand Down
2 changes: 1 addition & 1 deletion src/binaryen
27 changes: 22 additions & 5 deletions src/bootstrap/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -600,9 +600,25 @@ impl<'a> Builder<'a> {
//
// FIXME: the guard against msvc shouldn't need to be here
if !target.contains("msvc") {
let cc = self.cc(target);
cargo.env(format!("CC_{}", target), cc)
.env("CC", cc);
let ccache = self.config.ccache.as_ref();
let ccacheify = |s: &Path| {
let ccache = match ccache {
Some(ref s) => s,
None => return s.display().to_string(),
};
// FIXME: the cc-rs crate only recognizes the literal strings
// `ccache` and `sccache` when doing caching compilations, so we
// mirror that here. It should probably be fixed upstream to
// accept a new env var or otherwise work with custom ccache
// vars.
match &ccache[..] {
"ccache" | "sccache" => format!("{} {}", ccache, s.display()),
_ => s.display().to_string(),
}
};
let cc = ccacheify(&self.cc(target));
cargo.env(format!("CC_{}", target), &cc)
.env("CC", &cc);

let cflags = self.cflags(target).join(" ");
cargo.env(format!("CFLAGS_{}", target), cflags.clone())
Expand All @@ -617,8 +633,9 @@ impl<'a> Builder<'a> {
}

if let Ok(cxx) = self.cxx(target) {
cargo.env(format!("CXX_{}", target), cxx)
.env("CXX", cxx)
let cxx = ccacheify(&cxx);
cargo.env(format!("CXX_{}", target), &cxx)
.env("CXX", &cxx)
.env(format!("CXXFLAGS_{}", target), cflags.clone())
.env("CXXFLAGS", cflags);
}
Expand Down
5 changes: 4 additions & 1 deletion src/bootstrap/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
//! This module implements parsing `config.toml` configuration files to tweak
//! how the build runs.

use std::collections::HashMap;
use std::collections::{HashMap, HashSet};
use std::env;
use std::fs::File;
use std::io::prelude::*;
Expand Down Expand Up @@ -52,6 +52,7 @@ pub struct Config {
pub target_config: HashMap<Interned<String>, Target>,
pub full_bootstrap: bool,
pub extended: bool,
pub tools: Option<HashSet<String>>,
pub sanitizers: bool,
pub profiler: bool,
pub ignore_git: bool,
Expand Down Expand Up @@ -191,6 +192,7 @@ struct Build {
python: Option<String>,
full_bootstrap: Option<bool>,
extended: Option<bool>,
tools: Option<HashSet<String>>,
verbose: Option<usize>,
sanitizers: Option<bool>,
profiler: Option<bool>,
Expand Down Expand Up @@ -395,6 +397,7 @@ impl Config {
set(&mut config.vendor, build.vendor);
set(&mut config.full_bootstrap, build.full_bootstrap);
set(&mut config.extended, build.extended);
config.tools = build.tools;
set(&mut config.verbose, build.verbose);
set(&mut config.sanitizers, build.sanitizers);
set(&mut config.profiler, build.profiler);
Expand Down
1 change: 1 addition & 0 deletions src/bootstrap/configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ def v(*args):
o("full-bootstrap", "build.full-bootstrap", "build three compilers instead of two")
o("extended", "build.extended", "build an extended rust tool set")

v("tools", "build.tools", "List of extended tools will be installed")
v("build", "build.build", "GNUs ./configure syntax LLVM build triple")
v("host", None, "GNUs ./configure syntax LLVM host triples")
v("target", None, "GNUs ./configure syntax LLVM target triples")
Expand Down
7 changes: 7 additions & 0 deletions src/bootstrap/dist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ use channel;
use util::{cp_r, libdir, is_dylib, cp_filtered, copy, replace_in_file};
use builder::{Builder, RunConfig, ShouldRun, Step};
use compile;
use native;
use tool::{self, Tool};
use cache::{INTERNER, Interned};
use time;
Expand Down Expand Up @@ -898,6 +899,12 @@ impl Step for PlainSourceTarball {
.arg("--vers").arg(CARGO_VENDOR_VERSION)
.arg("cargo-vendor")
.env("RUSTC", &build.initial_rustc);
if let Some(dir) = build.openssl_install_dir(build.config.build) {
builder.ensure(native::Openssl {
target: build.config.build,
});
cmd.env("OPENSSL_DIR", dir);
}
build.run(&mut cmd);
}

Expand Down
30 changes: 23 additions & 7 deletions src/bootstrap/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ use dist::{self, pkgname, sanitize_sh, tmpdir};

use builder::{Builder, RunConfig, ShouldRun, Step};
use cache::Interned;
use config::Config;

pub fn install_docs(builder: &Builder, stage: u32, host: Interned<String>) {
install_sh(builder, "docs", "rust-docs", stage, Some(host));
Expand Down Expand Up @@ -144,6 +145,19 @@ macro_rules! install {
pub host: Interned<String>,
}

impl $name {
#[allow(dead_code)]
fn should_build(config: &Config) -> bool {
config.extended && config.tools.as_ref()
.map_or(true, |t| t.contains($path))
}

#[allow(dead_code)]
fn should_install(builder: &Builder) -> bool {
builder.config.tools.as_ref().map_or(false, |t| t.contains($path))
}
}

impl Step for $name {
type Output = ();
const DEFAULT: bool = true;
Expand Down Expand Up @@ -185,32 +199,34 @@ install!((self, builder, _config),
install_std(builder, self.stage, *target);
}
};
Cargo, "cargo", _config.extended, only_hosts: true, {
Cargo, "cargo", Self::should_build(_config), only_hosts: true, {
builder.ensure(dist::Cargo { stage: self.stage, target: self.target });
install_cargo(builder, self.stage, self.target);
};
Rls, "rls", _config.extended, only_hosts: true, {
if builder.ensure(dist::Rls { stage: self.stage, target: self.target }).is_some() {
Rls, "rls", Self::should_build(_config), only_hosts: true, {
if builder.ensure(dist::Rls { stage: self.stage, target: self.target }).is_some() ||
Self::should_install(builder) {
install_rls(builder, self.stage, self.target);
} else {
println!("skipping Install RLS stage{} ({})", self.stage, self.target);
}
};
Rustfmt, "rustfmt", _config.extended, only_hosts: true, {
if builder.ensure(dist::Rustfmt { stage: self.stage, target: self.target }).is_some() {
Rustfmt, "rustfmt", Self::should_build(_config), only_hosts: true, {
if builder.ensure(dist::Rustfmt { stage: self.stage, target: self.target }).is_some() ||
Self::should_install(builder) {
install_rustfmt(builder, self.stage, self.target);
} else {
println!("skipping Install Rustfmt stage{} ({})", self.stage, self.target);
}
};
Analysis, "analysis", _config.extended, only_hosts: false, {
Analysis, "analysis", Self::should_build(_config), only_hosts: false, {
builder.ensure(dist::Analysis {
compiler: builder.compiler(self.stage, self.host),
target: self.target
});
install_analysis(builder, self.stage, self.target);
};
Src, "src", _config.extended, only_hosts: true, {
Src, "src", Self::should_build(_config) , only_hosts: true, {
builder.ensure(dist::Src);
install_src(builder, self.stage);
}, ONLY_BUILD;
Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap/native.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ impl Step for Llvm {
}

// http://llvm.org/docs/HowToCrossCompileLLVM.html
if target != build.build {
if target != build.build && !self.emscripten {
builder.ensure(Llvm {
target: build.build,
emscripten: false,
Expand Down
3 changes: 2 additions & 1 deletion src/ci/docker/dist-i686-linux/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ ENV RUST_CONFIGURE_ARGS \
--enable-extended \
--enable-sanitizers \
--enable-profiler \
--enable-emscripten
--enable-emscripten \
--build=i686-unknown-linux-gnu
ENV SCRIPT python2.7 ../x.py dist --host $HOSTS --target $HOSTS

# This is the only builder which will create source tarballs
Expand Down
2 changes: 1 addition & 1 deletion src/dlmalloc
Submodule dlmalloc updated 2 files
+2 −2 src/dlmalloc.rs
+4 −1 src/wasm.rs
2 changes: 1 addition & 1 deletion src/doc/book
Submodule book updated 32 files
+2 −2 second-edition/dictionary.txt
+1 −0 second-edition/dot/trpl04-01.dot
+1 −0 second-edition/dot/trpl04-02.dot
+1 −0 second-edition/dot/trpl04-03.dot
+1 −0 second-edition/dot/trpl04-04.dot
+1 −0 second-edition/dot/trpl04-05.dot
+1 −0 second-edition/dot/trpl04-06.dot
+1 −0 second-edition/dot/trpl15-01.dot
+1 −0 second-edition/dot/trpl15-02.dot
+1 −0 second-edition/dot/trpl15-03.dot
+797 −1,274 second-edition/nostarch/chapter15.md
+ second-edition/nostarch/odt/chapter15.docx
+1 −1 second-edition/src/ch08-01-vectors.md
+2 −2 second-edition/src/ch10-02-traits.md
+37 −78 second-edition/src/ch15-00-smart-pointers.md
+116 −188 second-edition/src/ch15-01-box.md
+133 −201 second-edition/src/ch15-02-deref.md
+66 −111 second-edition/src/ch15-03-drop.md
+95 −119 second-edition/src/ch15-04-rc.md
+178 −217 second-edition/src/ch15-05-interior-mutability.md
+183 −257 second-edition/src/ch15-06-reference-cycles.md
+1 −1 second-edition/src/ch17-02-trait-objects.md
+6 −6 second-edition/src/ch18-01-all-the-places-for-patterns.md
+52 −49 second-edition/src/img/trpl04-01.svg
+75 −70 second-edition/src/img/trpl04-02.svg
+101 −95 second-edition/src/img/trpl04-03.svg
+76 −71 second-edition/src/img/trpl04-04.svg
+67 −62 second-edition/src/img/trpl04-05.svg
+95 −90 second-edition/src/img/trpl04-06.svg
+31 −30 second-edition/src/img/trpl15-01.svg
+14 −13 second-edition/src/img/trpl15-02.svg
+68 −53 second-edition/src/img/trpl15-03.svg
2 changes: 1 addition & 1 deletion src/doc/nomicon
2 changes: 1 addition & 1 deletion src/doc/reference
2 changes: 1 addition & 1 deletion src/libcore/char.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ impl From<u8> for char {

/// An error which can be returned when parsing a char.
#[stable(feature = "char_from_str", since = "1.20.0")]
#[derive(Clone, Debug)]
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct ParseCharError {
kind: CharErrorKind,
}
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/hir/intravisit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -965,8 +965,8 @@ pub fn walk_expr<'v, V: Visitor<'v>>(visitor: &mut V, expression: &'v Expr) {
walk_list!(visitor, visit_expr, subexpressions);
}
ExprCall(ref callee_expression, ref arguments) => {
visitor.visit_expr(callee_expression);
walk_list!(visitor, visit_expr, arguments);
visitor.visit_expr(callee_expression)
}
ExprMethodCall(ref segment, _, ref arguments) => {
visitor.visit_path_segment(expression.span, segment);
Expand Down
93 changes: 49 additions & 44 deletions src/librustc/traits/error_reporting.rs
Original file line number Diff line number Diff line change
Expand Up @@ -764,8 +764,10 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
} else {
let (closure_span, found) = found_did
.and_then(|did| self.tcx.hir.get_if_local(did))
.map(|node| self.get_fn_like_arguments(node))
.unwrap_or((found_span.unwrap(), found));
.map(|node| {
let (found_span, found) = self.get_fn_like_arguments(node);
(Some(found_span), found)
}).unwrap_or((found_span, found));

self.report_arg_count_mismatch(span,
closure_span,
Expand Down Expand Up @@ -875,7 +877,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
fn report_arg_count_mismatch(
&self,
span: Span,
found_span: Span,
found_span: Option<Span>,
expected_args: Vec<ArgKind>,
found_args: Vec<ArgKind>,
is_closure: bool,
Expand Down Expand Up @@ -913,48 +915,51 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
);

err.span_label(span, format!( "expected {} that takes {}", kind, expected_str));
err.span_label(found_span, format!("takes {}", found_str));

if let &[ArgKind::Tuple(_, ref fields)] = &found_args[..] {
if fields.len() == expected_args.len() {
let sugg = fields.iter()
.map(|(name, _)| name.to_owned())
.collect::<Vec<String>>().join(", ");
err.span_suggestion(found_span,
"change the closure to take multiple arguments instead of \
a single tuple",
format!("|{}|", sugg));

if let Some(found_span) = found_span {
err.span_label(found_span, format!("takes {}", found_str));

if let &[ArgKind::Tuple(_, ref fields)] = &found_args[..] {
if fields.len() == expected_args.len() {
let sugg = fields.iter()
.map(|(name, _)| name.to_owned())
.collect::<Vec<String>>().join(", ");
err.span_suggestion(found_span,
"change the closure to take multiple arguments instead of \
a single tuple",
format!("|{}|", sugg));
}
}
}
if let &[ArgKind::Tuple(_, ref fields)] = &expected_args[..] {
if fields.len() == found_args.len() && is_closure {
let sugg = format!(
"|({}){}|",
found_args.iter()
.map(|arg| match arg {
ArgKind::Arg(name, _) => name.to_owned(),
_ => "_".to_owned(),
})
.collect::<Vec<String>>()
.join(", "),
// add type annotations if available
if found_args.iter().any(|arg| match arg {
ArgKind::Arg(_, ty) => ty != "_",
_ => false,
}) {
format!(": ({})",
fields.iter()
.map(|(_, ty)| ty.to_owned())
.collect::<Vec<String>>()
.join(", "))
} else {
"".to_owned()
},
);
err.span_suggestion(found_span,
"change the closure to accept a tuple instead of individual \
arguments",
sugg);
if let &[ArgKind::Tuple(_, ref fields)] = &expected_args[..] {
if fields.len() == found_args.len() && is_closure {
let sugg = format!(
"|({}){}|",
found_args.iter()
.map(|arg| match arg {
ArgKind::Arg(name, _) => name.to_owned(),
_ => "_".to_owned(),
})
.collect::<Vec<String>>()
.join(", "),
// add type annotations if available
if found_args.iter().any(|arg| match arg {
ArgKind::Arg(_, ty) => ty != "_",
_ => false,
}) {
format!(": ({})",
fields.iter()
.map(|(_, ty)| ty.to_owned())
.collect::<Vec<String>>()
.join(", "))
} else {
"".to_owned()
},
);
err.span_suggestion(found_span,
"change the closure to accept a tuple instead of \
individual arguments",
sugg);
}
}
}

Expand Down
Loading