Skip to content

Rollup of 17 pull requests #48531

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

Merged
merged 63 commits into from
Feb 25, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
7d296c4
Add Condvar APIs not susceptible to spurious wake
Feb 2, 2018
404e1a6
Fix typo
Feb 2, 2018
e72bd6d
Review response
Feb 2, 2018
95e4dc2
Simplify wait_timeout_until & fix condition typo
Feb 5, 2018
770fded
Stabilize 'entry_and_modify' feature for BTreeMap
hedgehog1024 Feb 12, 2018
862132b
Stabilize 'entry_and_modify' feature for HashMap
hedgehog1024 Feb 12, 2018
4360dfa
Delete information about 'entry_and_modify' from Unstable book
hedgehog1024 Feb 12, 2018
97df227
Fix wait_timeout value
Feb 13, 2018
f45a474
rustc_trans: add abi::CastTarget::ChunkedPrefix
jcowgill Feb 6, 2018
6fe2d1d
Misc fixes
Feb 13, 2018
1635052
pass correct pie args to gcc linker
canarysnort01 Feb 8, 2018
8a72f58
pass correct pie args to gcc linker 2
canarysnort01 Feb 10, 2018
f0e9af1
verify passed -no-pie arg before retrying failed link
canarysnort01 Feb 11, 2018
c8def92
handle -no-pie error from clang
canarysnort01 Feb 12, 2018
ab9cae1
only pass -no-pie if linker_is_gnu
canarysnort01 Feb 14, 2018
68042ba
rustc_trans: rewrite mips64 abi
jcowgill Feb 8, 2018
05d66dc
rustc_trans: add chunked prefix fields to CastTarget
jcowgill Feb 14, 2018
47c33f7
rustc_trans: adjust mips64 abi to use new CastTarget
jcowgill Feb 14, 2018
ebec5e3
Add powerpc-unknown-netbsd target
jakllsch Feb 16, 2018
b1f04a3
Fix unit test compilation
Feb 15, 2018
d549db8
Fix tidy violation
Feb 17, 2018
6ad328c
Move macro-at-most-once-rep-ambig test to ui test
mark-i-m Feb 17, 2018
d17d645
Add tests ensuring zero-Duration timeouts result in errors.
frewsxcv Feb 18, 2018
c0e87f1
Make ".e0" not parse as 0.0
varkor Feb 15, 2018
80970e6
rustbuild: Restore Config.libdir_relative
cuviper Feb 19, 2018
8174c0d
rustbuild: make libdir_relative a method
cuviper Feb 20, 2018
6af23f9
add Iterator::flatten and redefine flat_map(f) in terms of map(f).fla…
Centril Feb 20, 2018
36be763
Iterator::flatten: fix tracking issue number on FusedIterator for Fla…
Centril Feb 10, 2018
0e39401
core::iter::Flatten: update FlatMap & Flatten according to discussion
Centril Feb 13, 2018
3d74c74
core::iter::Iterator::flatten: tracking issue is #48213
Centril Feb 14, 2018
819d57a
core::iter::Iterator::flatten: improve docs wrt. deep vs. shallow fla…
Centril Feb 16, 2018
98d8fc1
added rdrand feature and removed rdrnd feature
newpavlov Feb 20, 2018
4c6b9bc
features in alphabetic order
newpavlov Feb 20, 2018
14b403c
Fix doc compile error
Feb 20, 2018
a33c1da
typo fix
newpavlov Feb 21, 2018
a895d43
bootstrap: Add missing cputype matching for sparc
glaubitz Feb 17, 2018
871e82e
bootstrap: Add openssl configuration for sparc-unknown-linux-gnu
glaubitz Feb 17, 2018
100469f
librustc_back: Add support for sparc-linux-gnu
glaubitz Feb 17, 2018
84aae4e
Add sparc-unknown-linux-gnu target
glaubitz Feb 23, 2018
0b6583e
bootstrap: Add openssl configuration for x86_64-unknown-linux-gnux32
glaubitz Feb 24, 2018
e3781c6
test: Fix s390x-unknown-linux-gnu atomic-lock-free test not run for s…
glaubitz Feb 24, 2018
34b45c1
Workaround abort(2) on compilation error on FreeBSD.
bdrewery Feb 24, 2018
264a921
Added error-format flag to x.py.
Feb 24, 2018
6423609
Fixes docs for ASCII functions to no longer claim U+0021 is '@'.
Feb 25, 2018
0aa753b
1.25.0 -> 1.26.-
Manishearth Feb 25, 2018
f5116e7
Rollup merge of #47964 - jcowgill:mips64-abi, r=eddyb
kennytm Feb 25, 2018
e253224
Rollup merge of #47970 - vlovich:condvar_wait_until, r=dtolnay
kennytm Feb 25, 2018
725856d
Rollup merge of #48076 - canarysnort01:fix_pie, r=alexcrichton
kennytm Feb 25, 2018
562626a
Rollup merge of #48115 - Centril:feature/iterator_flatten, r=alexcric…
kennytm Feb 25, 2018
b443e57
Rollup merge of #48166 - hedgehog1024:hedgehog1024-stabilize-entry_an…
kennytm Feb 25, 2018
3e2072e
Rollup merge of #48281 - jakllsch:netbsd-powerpc, r=alexcrichton
kennytm Feb 25, 2018
b571155
Rollup merge of #48297 - glaubitz:sparc-linux, r=estebank
kennytm Feb 25, 2018
6627cba
Rollup merge of #48302 - mark-i-m:markim_macro-test, r=aturon
kennytm Feb 25, 2018
f28931f
Rollup merge of #48362 - cuviper:libdir_relative, r=Mark-Simulacrum
kennytm Feb 25, 2018
c9b6dca
Rollup merge of #48369 - newpavlov:rdrand, r=nagisa
kennytm Feb 25, 2018
266386a
Rollup merge of #48489 - glaubitz:x32-linux, r=alexcrichton
kennytm Feb 25, 2018
1c62067
Rollup merge of #48491 - glaubitz:s390x-linux, r=sanxiyn
kennytm Feb 25, 2018
4ab2184
Rollup merge of #48494 - bdrewery:freebsd-omit-frame-pointer, r=eddyb
kennytm Feb 25, 2018
eb0ab5e
Rollup merge of #48517 - penpalperson:master, r=Mark-Simulacrum
kennytm Feb 25, 2018
268b6d6
Rollup merge of #48529 - remexre:docs/fix/unicode-0021, r=kennytm
kennytm Feb 25, 2018
0652af2
Rollup merge of #48235 - varkor:parse-float-lonely-exponent, r=alexcr…
kennytm Feb 25, 2018
a554a2f
Return error if timeout is zero-Duration on Redox.
frewsxcv Feb 19, 2018
1aa1035
Rollup merge of #48330 - frewsxcv:frewsxcv-tests-zero-duration, r=sfa…
kennytm Feb 25, 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
5 changes: 5 additions & 0 deletions src/bootstrap/bin/rustc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ fn main() {
args.remove(n);
}

if let Some(s) = env::var_os("RUSTC_ERROR_FORMAT") {
args.push("--error-format".into());
args.push(s);
}

// Detect whether or not we're a build script depending on whether --target
// is passed (a bit janky...)
let target = args.windows(2)
Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ def default_build_triple():
raise ValueError('unknown byteorder: {}'.format(sys.byteorder))
# only the n64 ABI is supported, indicate it
ostype += 'abi64'
elif cputype == 'sparcv9' or cputype == 'sparc64':
elif cputype == 'sparc' or cputype == 'sparcv9' or cputype == 'sparc64':
pass
else:
err = "unknown cpu type: {}".format(cputype)
Expand Down
10 changes: 7 additions & 3 deletions src/bootstrap/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -444,10 +444,11 @@ impl<'a> Builder<'a> {

fn run(self, builder: &Builder) -> Interned<PathBuf> {
let compiler = self.compiler;
let lib = if compiler.stage >= 1 && builder.build.config.libdir.is_some() {
builder.build.config.libdir.clone().unwrap()
let config = &builder.build.config;
let lib = if compiler.stage >= 1 && config.libdir_relative().is_some() {
builder.build.config.libdir_relative().unwrap()
} else {
PathBuf::from("lib")
Path::new("lib")
};
let sysroot = builder.sysroot(self.compiler).join(lib)
.join("rustlib").join(self.target).join("lib");
Expand Down Expand Up @@ -598,6 +599,9 @@ impl<'a> Builder<'a> {
if let Some(target_linker) = self.build.linker(target) {
cargo.env("RUSTC_TARGET_LINKER", target_linker);
}
if let Some(ref error_format) = self.config.rustc_error_format {
cargo.env("RUSTC_ERROR_FORMAT", error_format);
}
if cmd != "build" && cmd != "check" {
cargo.env("RUSTDOC_LIBDIR", self.rustc_libdir(self.compiler(2, self.build.build)));
}
Expand Down
3 changes: 1 addition & 2 deletions src/bootstrap/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -516,8 +516,7 @@ fn rustc_cargo_env(build: &Build, cargo: &mut Command) {
.env("CFG_VERSION", build.rust_version())
.env("CFG_PREFIX", build.config.prefix.clone().unwrap_or_default());

let libdir_relative =
build.config.libdir.clone().unwrap_or(PathBuf::from("lib"));
let libdir_relative = build.config.libdir_relative().unwrap_or(Path::new("lib"));
cargo.env("CFG_LIBDIR_RELATIVE", libdir_relative);

// If we're not building a compiler with debugging information then remove
Expand Down
15 changes: 14 additions & 1 deletion src/bootstrap/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use std::collections::{HashMap, HashSet};
use std::env;
use std::fs::File;
use std::io::prelude::*;
use std::path::PathBuf;
use std::path::{Path, PathBuf};
use std::process;
use std::cmp;

Expand Down Expand Up @@ -57,6 +57,7 @@ pub struct Config {
pub profiler: bool,
pub ignore_git: bool,
pub exclude: Vec<PathBuf>,
pub rustc_error_format: Option<String>,

pub run_host_only: bool,

Expand Down Expand Up @@ -330,6 +331,7 @@ impl Config {
config.test_miri = false;
config.rust_codegen_backends = vec![INTERNER.intern_str("llvm")];

config.rustc_error_format = flags.rustc_error_format;
config.on_fail = flags.on_fail;
config.stage = flags.stage;
config.src = flags.src;
Expand Down Expand Up @@ -564,6 +566,17 @@ impl Config {
config
}

/// Try to find the relative path of `libdir`.
pub fn libdir_relative(&self) -> Option<&Path> {
let libdir = self.libdir.as_ref()?;
if libdir.is_relative() {
Some(libdir)
} else {
// Try to make it relative to the prefix.
libdir.strip_prefix(self.prefix.as_ref()?).ok()
}
}

pub fn verbose(&self) -> bool {
self.verbose > 0
}
Expand Down
3 changes: 3 additions & 0 deletions src/bootstrap/flags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ pub struct Flags {
pub cmd: Subcommand,
pub incremental: bool,
pub exclude: Vec<PathBuf>,
pub rustc_error_format: Option<String>,
}

pub enum Subcommand {
Expand Down Expand Up @@ -118,6 +119,7 @@ To learn more about a subcommand, run `./x.py <subcommand> -h`");
opts.optopt("", "src", "path to the root of the rust checkout", "DIR");
opts.optopt("j", "jobs", "number of jobs to run in parallel", "JOBS");
opts.optflag("h", "help", "print this help message");
opts.optflag("", "error-format", "rustc error format");

// fn usage()
let usage = |exit_code: i32, opts: &Options, subcommand_help: &str, extra_help: &str| -> ! {
Expand Down Expand Up @@ -370,6 +372,7 @@ Arguments:
verbose: matches.opt_count("verbose"),
stage,
on_fail: matches.opt_str("on-fail"),
rustc_error_format: matches.opt_str("error-format"),
keep_stage: matches.opt_str("keep-stage").map(|j| j.parse().unwrap()),
build: matches.opt_str("build").map(|s| INTERNER.intern_string(s)),
host: split(matches.opt_strs("host"))
Expand Down
3 changes: 3 additions & 0 deletions src/bootstrap/native.rs
Original file line number Diff line number Diff line change
Expand Up @@ -480,16 +480,19 @@ impl Step for Openssl {
"mips64el-unknown-linux-gnuabi64" => "linux64-mips64",
"mipsel-unknown-linux-gnu" => "linux-mips32",
"powerpc-unknown-linux-gnu" => "linux-ppc",
"powerpc-unknown-netbsd" => "BSD-generic32",
"powerpc64-unknown-linux-gnu" => "linux-ppc64",
"powerpc64le-unknown-linux-gnu" => "linux-ppc64le",
"s390x-unknown-linux-gnu" => "linux64-s390x",
"sparc-unknown-linux-gnu" => "linux-sparcv9",
"sparc64-unknown-linux-gnu" => "linux64-sparcv9",
"sparc64-unknown-netbsd" => "BSD-sparc64",
"x86_64-apple-darwin" => "darwin64-x86_64-cc",
"x86_64-linux-android" => "linux-x86_64",
"x86_64-unknown-freebsd" => "BSD-x86_64",
"x86_64-unknown-dragonfly" => "BSD-x86_64",
"x86_64-unknown-linux-gnu" => "linux-x86_64",
"x86_64-unknown-linux-gnux32" => "linux-x32",
"x86_64-unknown-linux-musl" => "linux-x86_64",
"x86_64-unknown-netbsd" => "BSD-x86_64",
_ => panic!("don't know how to configure OpenSSL for {}", target),
Expand Down
77 changes: 0 additions & 77 deletions src/doc/unstable-book/src/library-features/entry-and-modify.md

This file was deleted.

3 changes: 1 addition & 2 deletions src/liballoc/btree/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2114,7 +2114,6 @@ impl<'a, K: Ord, V> Entry<'a, K, V> {
/// # Examples
///
/// ```
/// #![feature(entry_and_modify)]
/// use std::collections::BTreeMap;
///
/// let mut map: BTreeMap<&str, usize> = BTreeMap::new();
Expand All @@ -2129,7 +2128,7 @@ impl<'a, K: Ord, V> Entry<'a, K, V> {
/// .or_insert(42);
/// assert_eq!(map["poneyland"], 43);
/// ```
#[unstable(feature = "entry_and_modify", issue = "44733")]
#[stable(feature = "entry_and_modify", since = "1.26.0")]
pub fn and_modify<F>(self, mut f: F) -> Self
where F: FnMut(&mut V)
{
Expand Down
81 changes: 79 additions & 2 deletions src/libcore/iter/iterator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ use cmp::Ordering;
use ops::Try;

use super::{AlwaysOk, LoopState};
use super::{Chain, Cycle, Cloned, Enumerate, Filter, FilterMap, FlatMap, Fuse};
use super::{Chain, Cycle, Cloned, Enumerate, Filter, FilterMap, Fuse};
use super::{Flatten, FlatMap, flatten_compat};
use super::{Inspect, Map, Peekable, Scan, Skip, SkipWhile, StepBy, Take, TakeWhile, Rev};
use super::{Zip, Sum, Product};
use super::{ChainState, FromIterator, ZipImpl};
Expand Down Expand Up @@ -997,11 +998,15 @@ pub trait Iterator {
/// an extra layer of indirection. `flat_map()` will remove this extra layer
/// on its own.
///
/// You can think of [`flat_map(f)`][flat_map] as the semantic equivalent
/// of [`map`]ping, and then [`flatten`]ing as in `map(f).flatten()`.
///
/// Another way of thinking about `flat_map()`: [`map`]'s closure returns
/// one item for each element, and `flat_map()`'s closure returns an
/// iterator for each element.
///
/// [`map`]: #method.map
/// [`flatten`]: #method.flatten
///
/// # Examples
///
Expand All @@ -1021,7 +1026,79 @@ pub trait Iterator {
fn flat_map<U, F>(self, f: F) -> FlatMap<Self, U, F>
where Self: Sized, U: IntoIterator, F: FnMut(Self::Item) -> U,
{
FlatMap{iter: self, f: f, frontiter: None, backiter: None }
FlatMap { inner: flatten_compat(self.map(f)) }
}

/// Creates an iterator that flattens nested structure.
///
/// This is useful when you have an iterator of iterators or an iterator of
/// things that can be turned into iterators and you want to remove one
/// level of indirection.
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// #![feature(iterator_flatten)]
///
/// let data = vec![vec![1, 2, 3, 4], vec![5, 6]];
/// let flattened = data.into_iter().flatten().collect::<Vec<u8>>();
/// assert_eq!(flattened, &[1, 2, 3, 4, 5, 6]);
/// ```
///
/// Mapping and then flattening:
///
/// ```
/// #![feature(iterator_flatten)]
///
/// let words = ["alpha", "beta", "gamma"];
///
/// // chars() returns an iterator
/// let merged: String = words.iter()
/// .map(|s| s.chars())
/// .flatten()
/// .collect();
/// assert_eq!(merged, "alphabetagamma");
/// ```
///
/// You can also rewrite this in terms of [`flat_map()`] which is preferable
/// in this case since that conveys intent clearer:
///
/// ```
/// let words = ["alpha", "beta", "gamma"];
///
/// // chars() returns an iterator
/// let merged: String = words.iter()
/// .flat_map(|s| s.chars())
/// .collect();
/// assert_eq!(merged, "alphabetagamma");
/// ```
///
/// Flattening once only removes one level of nesting:
///
/// ```
/// #![feature(iterator_flatten)]
///
/// let d3 = [[[1, 2], [3, 4]], [[5, 6], [7, 8]]];
///
/// let d2 = d3.iter().flatten().collect::<Vec<_>>();
/// assert_eq!(d2, [&[1, 2], &[3, 4], &[5, 6], &[7, 8]]);
///
/// let d1 = d3.iter().flatten().flatten().collect::<Vec<_>>();
/// assert_eq!(d1, [&1, &2, &3, &4, &5, &6, &7, &8]);
/// ```
///
/// Here we see that `flatten()` does not perform a "deep" flatten.
/// Instead, only one level of nesting is removed. That is, if you
/// `flatten()` a three-dimensional array the result will be
/// two-dimensional and not one-dimensional. To get a one-dimensional
/// structure, you have to `flatten()` again.
#[inline]
#[unstable(feature = "iterator_flatten", issue = "48213")]
fn flatten(self) -> Flatten<Self>
where Self: Sized, Self::Item: IntoIterator {
Flatten { inner: flatten_compat(self) }
}

/// Creates an iterator which ends after the first [`None`].
Expand Down
Loading