Skip to content

Rollup of 12 pull requests #36818

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 29 commits into from
Sep 29, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
d9bd4d5
Add docs for "!" empty Never type (rfc 1216)
dns2utf8 Aug 20, 2016
da3c6b7
map create numbers between compilations
mikhail-m1 Sep 5, 2016
20c1091
Merge branch 'master' into 35123-map3
mikhail-m1 Sep 23, 2016
dfe8bd1
Move ty_align and ty_size out of most C ABI code
Mark-Simulacrum Sep 25, 2016
a33b921
run rustfmt on typecheck/coherence folder
srinivasreddy Sep 19, 2016
300e138
Remove CString drop test.
matklad Sep 26, 2016
dd47815
Avoid re-export errors in the generated test harness.
jseyfried Sep 27, 2016
28393be
Add regression test.
jseyfried Sep 27, 2016
cbb967f
add a panic-strategy field to the target specification
Sep 28, 2016
e8a4db2
Allow supplying an error destination via the compiler driver
nrc Sep 26, 2016
8a46e78
fix librustc test: panic is Option<PanicStrategy> now
Sep 28, 2016
27588dd
Move nodejs detection into bootstrap
brson Sep 28, 2016
6ffb39b
Update bootstrap compiler
brson Sep 28, 2016
c48b7ab
Add link to format! docs
palango Sep 28, 2016
ce5ad1d
Allow non-inline modules in more places.
jseyfried Sep 27, 2016
174f093
Add regression test.
jseyfried Sep 27, 2016
3b49c60
Remove stage0 hacks
brson Sep 28, 2016
83c54dc
Rollup merge of #35286 - dns2utf8:doc_never_expression, r=nikomatsakis
Sep 29, 2016
55c9bc2
Rollup merge of #35892 - srinivasreddy:typeck/coherence, r=nikomatsakis
Sep 29, 2016
9462226
Rollup merge of #36460 - mikhail-m1:35123-map3, r=nikomatsakis
Sep 29, 2016
725d0f5
Rollup merge of #36704 - Mark-Simulacrum:cleanup-cabi, r=Aatch
Sep 29, 2016
8f2c000
Rollup merge of #36741 - matklad:no-flacky-test, r=alexcrichton
Sep 29, 2016
45fd062
Rollup merge of #36760 - nrc:input2, r=alexcrichton
Sep 29, 2016
13c8e76
Rollup merge of #36787 - jseyfried:fix_test_harness_reexport_errors, …
Sep 29, 2016
f1ea5cc
Rollup merge of #36789 - jseyfried:non_inline_mod_in_block, r=nikomat…
Sep 29, 2016
9143c3c
Rollup merge of #36794 - japaric:target-panic, r=alexcrichton
Sep 29, 2016
47a335b
Rollup merge of #36803 - brson:node, r=alexcrichton
Sep 29, 2016
02c0506
Rollup merge of #36811 - brson:bootstrap, r=alexcrichton
Sep 29, 2016
f12f950
Rollup merge of #36813 - palango:link-to-fmt, r=steveklabnik
Sep 29, 2016
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: 0 additions & 4 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,6 @@ valopt datadir "${CFG_PREFIX}/share" "install data"
valopt infodir "${CFG_PREFIX}/share/info" "install additional info"
valopt llvm-root "" "set LLVM root"
valopt python "" "set path to python"
valopt nodejs "" "set path to nodejs"
valopt jemalloc-root "" "set directory where libjemalloc_pic.a is located"
valopt build "${DEFAULT_BUILD}" "GNUs ./configure syntax LLVM build triple"
valopt android-cross-path "" "Android NDK standalone path (deprecated)"
Expand Down Expand Up @@ -762,9 +761,6 @@ if [ $(echo $python_version | grep -c '^Python 2\.7') -ne 1 ]; then
err "Found $python_version, but Python 2.7 is required"
fi

# Checking for node, but not required
probe CFG_NODEJS nodejs node

# If we have no git directory then we are probably a tarball distribution
# and shouldn't attempt to load submodules
if [ ! -e ${CFG_SRC_DIR}.git ]
Expand Down
3 changes: 1 addition & 2 deletions src/bootstrap/bin/rustc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,7 @@ fn main() {
let is_panic_abort = args.windows(2).any(|a| {
&*a[0] == "--crate-name" && &*a[1] == "panic_abort"
});
// FIXME(stage0): remove this `stage != "0"` condition
if is_panic_abort && stage != "0" {
if is_panic_abort {
cmd.arg("-C").arg("panic=abort");
}

Expand Down
16 changes: 1 addition & 15 deletions src/bootstrap/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use std::process::Command;
use build_helper::output;
use filetime::FileTime;

use util::{exe, staticlib, libdir, mtime, is_dylib, copy};
use util::{exe, libdir, mtime, is_dylib, copy};
use {Build, Compiler, Mode};

/// Build the standard library.
Expand All @@ -40,20 +40,6 @@ pub fn std<'a>(build: &'a Build, target: &str, compiler: &Compiler<'a>) {
let libdir = build.sysroot_libdir(compiler, target);
let _ = fs::remove_dir_all(&libdir);
t!(fs::create_dir_all(&libdir));
// FIXME(stage0) remove this `if` after the next snapshot
// The stage0 compiler still passes the `-lcompiler-rt` flag to the linker but now `bootstrap`
// never builds a `libcopmiler-rt.a`! We'll fill the hole by simply copying stage0's
// `libcompiler-rt.a` to where the stage1's one is expected (though we could as well just use
// an empty `.a` archive). Note that the symbols of that stage0 `libcompiler-rt.a` won't make
// it to the final binary because now `libcore.rlib` also contains the symbols that
// `libcompiler-rt.a` provides. Since that rlib appears first in the linker arguments, its
// symbols are used instead of `libcompiler-rt.a`'s.
if compiler.stage == 0 {
let rtlib = &staticlib("compiler-rt", target);
let src = build.rustc.parent().unwrap().parent().unwrap().join("lib").join("rustlib")
.join(target).join("lib").join(rtlib);
copy(&src, &libdir.join(rtlib));
}

// Some platforms have startup objects that may be required to produce the
// libstd dynamic library, for example.
Expand Down
3 changes: 0 additions & 3 deletions src/bootstrap/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -396,9 +396,6 @@ impl Config {
self.rustc = Some(PathBuf::from(value).join("bin/rustc"));
self.cargo = Some(PathBuf::from(value).join("bin/cargo"));
}
"CFG_NODEJS" if value.len() > 0 => {
self.nodejs = Some(PathBuf::from(value));
}
_ => {}
}
}
Expand Down
27 changes: 19 additions & 8 deletions src/bootstrap/sanity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,23 @@ pub fn check(build: &mut Build) {
panic!("PATH contains invalid character '\"'");
}
}
let mut need_cmd = |cmd: &OsStr| {
if !checked.insert(cmd.to_owned()) {
return
}
let have_cmd = |cmd: &OsStr| {
for path in env::split_paths(&path).map(|p| p.join(cmd)) {
if fs::metadata(&path).is_ok() ||
fs::metadata(path.with_extension("exe")).is_ok() {
return
return Some(path);
}
}
panic!("\n\ncouldn't find required command: {:?}\n\n", cmd);
return None;
};

let mut need_cmd = |cmd: &OsStr| {
if !checked.insert(cmd.to_owned()) {
return
}
if have_cmd(cmd).is_none() {
panic!("\n\ncouldn't find required command: {:?}\n\n", cmd);
}
};

// If we've got a git directory we're gona need git to update
Expand All @@ -75,8 +81,13 @@ pub fn check(build: &mut Build) {

need_cmd("python".as_ref());

// If a manual nodejs was added to the config,
// of if a nodejs install is detected through config, use it.
// Look for the nodejs command, needed for emscripten testing
if let Some(node) = have_cmd("node".as_ref()) {
build.config.nodejs = Some(node);
} else if let Some(node) = have_cmd("nodejs".as_ref()) {
build.config.nodejs = Some(node);
}

if let Some(ref s) = build.config.nodejs {
need_cmd(s.as_ref());
}
Expand Down
5 changes: 4 additions & 1 deletion src/doc/book/syntax-index.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@
* `-` (`- expr`): arithmetic negation. Overloadable (`Neg`).
* `-=` (`var -= expr`): arithmetic subtraction & assignment. Overloadable (`SubAssign`).
* `->` (`fn(…) -> type`, `|…| -> type`): function and closure return type. See [Functions], [Closures].
* `-> !` (`fn(…) -> !`, `|…| -> !`): diverging function or closure. See [Diverging Functions].
* `.` (`expr.ident`): member access. See [Structs], [Method Syntax].
* `..` (`..`, `expr..`, `..expr`, `expr..expr`): right-exclusive range literal.
* `..` (`..expr`): struct literal update syntax. See [Structs (Update syntax)].
Expand Down Expand Up @@ -159,6 +158,10 @@
* `/*!…*/`: inner block doc comment. See [Comments].
* `/**…*/`: outer block doc comment. See [Comments].

<!-- Special types -->

* `!`: always empty Never type. See [Diverging Functions].

<!-- Various things involving parens and tuples -->

* `()`: empty tuple (*a.k.a.* unit), both literal and type.
Expand Down
7 changes: 7 additions & 0 deletions src/doc/grammar.md
Original file line number Diff line number Diff line change
Expand Up @@ -764,6 +764,13 @@ bound-list := bound | bound '+' bound-list
bound := path | lifetime
```

### Never type
An empty type

```antlr
never_type : "!" ;
```

### Object types

**FIXME:** grammar?
Expand Down
2 changes: 0 additions & 2 deletions src/liballoc/arc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ const MAX_REFCOUNT: usize = (isize::MAX) as usize;
/// }
/// ```

#[cfg_attr(stage0, unsafe_no_drop_flag)]
#[stable(feature = "rust1", since = "1.0.0")]
pub struct Arc<T: ?Sized> {
ptr: Shared<ArcInner<T>>,
Expand All @@ -153,7 +152,6 @@ impl<T: ?Sized + Unsize<U>, U: ?Sized> CoerceUnsized<Arc<U>> for Arc<T> {}
/// nodes behind strong `Arc<T>` pointers, and then storing the parent pointers
/// as `Weak<T>` pointers.

#[cfg_attr(stage0, unsafe_no_drop_flag)]
#[stable(feature = "arc_weak", since = "1.4.0")]
pub struct Weak<T: ?Sized> {
ptr: Shared<ArcInner<T>>,
Expand Down
1 change: 0 additions & 1 deletion src/liballoc/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@
#![feature(staged_api)]
#![feature(unboxed_closures)]
#![feature(unique)]
#![cfg_attr(stage0, feature(unsafe_no_drop_flag))]
#![feature(unsize)]

#![cfg_attr(not(test), feature(fused, fn_traits, placement_new_protocol))]
Expand Down
1 change: 0 additions & 1 deletion src/liballoc/raw_vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ use core::cmp;
/// `shrink_to_fit`, and `from_box` will actually set RawVec's private capacity
/// field. This allows zero-sized types to not be special-cased by consumers of
/// this type.
#[cfg_attr(stage0, unsafe_no_drop_flag)]
pub struct RawVec<T> {
ptr: Unique<T>,
cap: usize,
Expand Down
2 changes: 0 additions & 2 deletions src/liballoc/rc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,6 @@ struct RcBox<T: ?Sized> {
/// that you have to call them as e.g. `Rc::get_mut(&value)` instead of
/// `value.get_mut()`. This avoids conflicts with methods of the inner
/// type `T`.
#[cfg_attr(stage0, unsafe_no_drop_flag)]
#[stable(feature = "rust1", since = "1.0.0")]
pub struct Rc<T: ?Sized> {
ptr: Shared<RcBox<T>>,
Expand Down Expand Up @@ -873,7 +872,6 @@ impl<T> From<T> for Rc<T> {
///
/// [rc]: struct.Rc.html
/// [downgrade]: struct.Rc.html#method.downgrade
#[cfg_attr(stage0, unsafe_no_drop_flag)]
#[stable(feature = "rc_weak", since = "1.4.0")]
pub struct Weak<T: ?Sized> {
ptr: Shared<RcBox<T>>,
Expand Down
1 change: 0 additions & 1 deletion src/libcollections/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
#![feature(step_by)]
#![feature(unicode)]
#![feature(unique)]
#![cfg_attr(stage0, feature(unsafe_no_drop_flag))]
#![cfg_attr(test, feature(rand, test))]

#![no_std]
Expand Down
4 changes: 3 additions & 1 deletion src/libcollections/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ macro_rules! vec {
}

/// Use the syntax described in `std::fmt` to create a value of type `String`.
/// See `std::fmt` for more information.
/// See [`std::fmt`][fmt] for more information.
///
/// [fmt]: ../std/fmt/index.html
///
/// # Examples
///
Expand Down
1 change: 0 additions & 1 deletion src/libcollections/vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,6 @@ use super::range::RangeArgument;
/// Vec does not currently guarantee the order in which elements are dropped
/// (the order has changed in the past, and may change again).
///
#[cfg_attr(stage0, unsafe_no_drop_flag)]
#[stable(feature = "rust1", since = "1.0.0")]
pub struct Vec<T> {
buf: RawVec<T>,
Expand Down
4 changes: 2 additions & 2 deletions src/libcompiler_builtins/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

#![cfg_attr(not(stage0), feature(compiler_builtins))]
#![feature(compiler_builtins)]
#![no_std]
#![cfg_attr(not(stage0), compiler_builtins)]
#![compiler_builtins]
#![unstable(feature = "compiler_builtins_lib",
reason = "internal implementation detail of rustc right now",
issue = "0")]
Expand Down
7 changes: 0 additions & 7 deletions src/libcore/clone.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,13 +129,6 @@ pub struct AssertParamIsClone<T: Clone + ?Sized> { _field: ::marker::PhantomData
reason = "deriving hack, should not be public",
issue = "0")]
pub struct AssertParamIsCopy<T: Copy + ?Sized> { _field: ::marker::PhantomData<T> }
#[cfg(stage0)]
#[doc(hidden)]
#[inline(always)]
#[unstable(feature = "derive_clone_copy",
reason = "deriving hack, should not be public",
issue = "0")]
pub fn assert_receiver_is_clone<T: Clone + ?Sized>(_: &T) {}

#[stable(feature = "rust1", since = "1.0.0")]
impl<'a, T: ?Sized> Clone for &'a T {
Expand Down
2 changes: 0 additions & 2 deletions src/libcore/intrinsics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,14 +194,12 @@ extern "rust-intrinsic" {
/// own, or if it does not enable any significant optimizations.
pub fn assume(b: bool);

#[cfg(not(stage0))]
/// Hints to the compiler that branch condition is likely to be true.
/// Returns the value passed to it.
///
/// Any use other than with `if` statements will probably not have an effect.
pub fn likely(b: bool) -> bool;

#[cfg(not(stage0))]
/// Hints to the compiler that branch condition is likely to be false.
/// Returns the value passed to it.
///
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/middle/cstore.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ use ty::{self, Ty, TyCtxt};
use mir::repr::Mir;
use mir::mir_map::MirMap;
use session::Session;
use session::config::PanicStrategy;
use session::search_paths::PathKind;
use util::nodemap::{NodeSet, DefIdMap};
use std::path::PathBuf;
Expand All @@ -46,6 +45,7 @@ use syntax_pos::Span;
use rustc_back::target::Target;
use hir;
use hir::intravisit::Visitor;
use rustc_back::PanicStrategy;

pub use self::NativeLibraryKind::{NativeStatic, NativeFramework, NativeUnknown};

Expand Down
5 changes: 3 additions & 2 deletions src/librustc/middle/dependency_format.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,10 @@
use hir::def_id::CrateNum;

use session;
use session::config::{self, PanicStrategy};
use session::config;
use middle::cstore::LinkagePreference::{self, RequireStatic, RequireDynamic};
use util::nodemap::FnvHashMap;
use rustc_back::PanicStrategy;

/// A list of dependencies for a certain crate type.
///
Expand Down Expand Up @@ -357,7 +358,7 @@ fn verify_ok(sess: &session::Session, list: &[Linkage]) {
// only one, but we perform validation here that all the panic strategy
// compilation modes for the whole DAG are valid.
if let Some((cnum, found_strategy)) = panic_runtime {
let desired_strategy = sess.opts.cg.panic.clone();
let desired_strategy = sess.panic_strategy();

// First up, validate that our selected panic runtime is indeed exactly
// our same strategy.
Expand Down
5 changes: 3 additions & 2 deletions src/librustc/middle/weak_lang_items.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@

//! Validity checking for weak lang items

use session::config::{self, PanicStrategy};
use session::config;
use session::Session;
use middle::lang_items;

use rustc_back::PanicStrategy;
use syntax::ast;
use syntax::parse::token::InternedString;
use syntax_pos::Span;
Expand Down Expand Up @@ -92,7 +93,7 @@ fn verify(sess: &Session, items: &lang_items::LanguageItems) {
// symbols. Other panic runtimes ensure that the relevant symbols are
// available to link things together, but they're never exercised.
let mut whitelisted = HashSet::new();
if sess.opts.cg.panic != PanicStrategy::Unwind {
if sess.panic_strategy() != PanicStrategy::Unwind {
whitelisted.insert(lang_items::EhPersonalityLangItem);
whitelisted.insert(lang_items::EhUnwindResumeLangItem);
}
Expand Down
Loading