Skip to content

Commit 91f34c0

Browse files
authored
Auto merge of #36818 - jonathandturner:rollup, r=jonathandturner
Rollup of 12 pull requests - Successful merges: #35286, #35892, #36460, #36704, #36741, #36760, #36787, #36789, #36794, #36803, #36811, #36813 - Failed merges:
2 parents eee2d04 + f12f950 commit 91f34c0

File tree

65 files changed

+694
-808
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+694
-808
lines changed

configure

-4
Original file line numberDiff line numberDiff line change
@@ -645,7 +645,6 @@ valopt datadir "${CFG_PREFIX}/share" "install data"
645645
valopt infodir "${CFG_PREFIX}/share/info" "install additional info"
646646
valopt llvm-root "" "set LLVM root"
647647
valopt python "" "set path to python"
648-
valopt nodejs "" "set path to nodejs"
649648
valopt jemalloc-root "" "set directory where libjemalloc_pic.a is located"
650649
valopt build "${DEFAULT_BUILD}" "GNUs ./configure syntax LLVM build triple"
651650
valopt android-cross-path "" "Android NDK standalone path (deprecated)"
@@ -762,9 +761,6 @@ if [ $(echo $python_version | grep -c '^Python 2\.7') -ne 1 ]; then
762761
err "Found $python_version, but Python 2.7 is required"
763762
fi
764763

765-
# Checking for node, but not required
766-
probe CFG_NODEJS nodejs node
767-
768764
# If we have no git directory then we are probably a tarball distribution
769765
# and shouldn't attempt to load submodules
770766
if [ ! -e ${CFG_SRC_DIR}.git ]

src/bootstrap/bin/rustc.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,7 @@ fn main() {
104104
let is_panic_abort = args.windows(2).any(|a| {
105105
&*a[0] == "--crate-name" && &*a[1] == "panic_abort"
106106
});
107-
// FIXME(stage0): remove this `stage != "0"` condition
108-
if is_panic_abort && stage != "0" {
107+
if is_panic_abort {
109108
cmd.arg("-C").arg("panic=abort");
110109
}
111110

src/bootstrap/compile.rs

+1-15
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ use std::process::Command;
2525
use build_helper::output;
2626
use filetime::FileTime;
2727

28-
use util::{exe, staticlib, libdir, mtime, is_dylib, copy};
28+
use util::{exe, libdir, mtime, is_dylib, copy};
2929
use {Build, Compiler, Mode};
3030

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

5844
// Some platforms have startup objects that may be required to produce the
5945
// libstd dynamic library, for example.

src/bootstrap/config.rs

-3
Original file line numberDiff line numberDiff line change
@@ -396,9 +396,6 @@ impl Config {
396396
self.rustc = Some(PathBuf::from(value).join("bin/rustc"));
397397
self.cargo = Some(PathBuf::from(value).join("bin/cargo"));
398398
}
399-
"CFG_NODEJS" if value.len() > 0 => {
400-
self.nodejs = Some(PathBuf::from(value));
401-
}
402399
_ => {}
403400
}
404401
}

src/bootstrap/sanity.rs

+19-8
Original file line numberDiff line numberDiff line change
@@ -40,17 +40,23 @@ pub fn check(build: &mut Build) {
4040
panic!("PATH contains invalid character '\"'");
4141
}
4242
}
43-
let mut need_cmd = |cmd: &OsStr| {
44-
if !checked.insert(cmd.to_owned()) {
45-
return
46-
}
43+
let have_cmd = |cmd: &OsStr| {
4744
for path in env::split_paths(&path).map(|p| p.join(cmd)) {
4845
if fs::metadata(&path).is_ok() ||
4946
fs::metadata(path.with_extension("exe")).is_ok() {
50-
return
47+
return Some(path);
5148
}
5249
}
53-
panic!("\n\ncouldn't find required command: {:?}\n\n", cmd);
50+
return None;
51+
};
52+
53+
let mut need_cmd = |cmd: &OsStr| {
54+
if !checked.insert(cmd.to_owned()) {
55+
return
56+
}
57+
if have_cmd(cmd).is_none() {
58+
panic!("\n\ncouldn't find required command: {:?}\n\n", cmd);
59+
}
5460
};
5561

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

7682
need_cmd("python".as_ref());
7783

78-
// If a manual nodejs was added to the config,
79-
// of if a nodejs install is detected through config, use it.
84+
// Look for the nodejs command, needed for emscripten testing
85+
if let Some(node) = have_cmd("node".as_ref()) {
86+
build.config.nodejs = Some(node);
87+
} else if let Some(node) = have_cmd("nodejs".as_ref()) {
88+
build.config.nodejs = Some(node);
89+
}
90+
8091
if let Some(ref s) = build.config.nodejs {
8192
need_cmd(s.as_ref());
8293
}

src/doc/book/syntax-index.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@
6161
* `-` (`- expr`): arithmetic negation. Overloadable (`Neg`).
6262
* `-=` (`var -= expr`): arithmetic subtraction & assignment. Overloadable (`SubAssign`).
6363
* `->` (`fn(…) -> type`, `|…| -> type`): function and closure return type. See [Functions], [Closures].
64-
* `-> !` (`fn(…) -> !`, `|…| -> !`): diverging function or closure. See [Diverging Functions].
6564
* `.` (`expr.ident`): member access. See [Structs], [Method Syntax].
6665
* `..` (`..`, `expr..`, `..expr`, `expr..expr`): right-exclusive range literal.
6766
* `..` (`..expr`): struct literal update syntax. See [Structs (Update syntax)].
@@ -159,6 +158,10 @@
159158
* `/*!…*/`: inner block doc comment. See [Comments].
160159
* `/**…*/`: outer block doc comment. See [Comments].
161160

161+
<!-- Special types -->
162+
163+
* `!`: always empty Never type. See [Diverging Functions].
164+
162165
<!-- Various things involving parens and tuples -->
163166

164167
* `()`: empty tuple (*a.k.a.* unit), both literal and type.

src/doc/grammar.md

+7
Original file line numberDiff line numberDiff line change
@@ -764,6 +764,13 @@ bound-list := bound | bound '+' bound-list
764764
bound := path | lifetime
765765
```
766766

767+
### Never type
768+
An empty type
769+
770+
```antlr
771+
never_type : "!" ;
772+
```
773+
767774
### Object types
768775

769776
**FIXME:** grammar?

src/liballoc/arc.rs

-2
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@ const MAX_REFCOUNT: usize = (isize::MAX) as usize;
127127
/// }
128128
/// ```
129129
130-
#[cfg_attr(stage0, unsafe_no_drop_flag)]
131130
#[stable(feature = "rust1", since = "1.0.0")]
132131
pub struct Arc<T: ?Sized> {
133132
ptr: Shared<ArcInner<T>>,
@@ -153,7 +152,6 @@ impl<T: ?Sized + Unsize<U>, U: ?Sized> CoerceUnsized<Arc<U>> for Arc<T> {}
153152
/// nodes behind strong `Arc<T>` pointers, and then storing the parent pointers
154153
/// as `Weak<T>` pointers.
155154
156-
#[cfg_attr(stage0, unsafe_no_drop_flag)]
157155
#[stable(feature = "arc_weak", since = "1.4.0")]
158156
pub struct Weak<T: ?Sized> {
159157
ptr: Shared<ArcInner<T>>,

src/liballoc/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@
8888
#![feature(staged_api)]
8989
#![feature(unboxed_closures)]
9090
#![feature(unique)]
91-
#![cfg_attr(stage0, feature(unsafe_no_drop_flag))]
9291
#![feature(unsize)]
9392

9493
#![cfg_attr(not(test), feature(fused, fn_traits, placement_new_protocol))]

src/liballoc/raw_vec.rs

-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ use core::cmp;
4444
/// `shrink_to_fit`, and `from_box` will actually set RawVec's private capacity
4545
/// field. This allows zero-sized types to not be special-cased by consumers of
4646
/// this type.
47-
#[cfg_attr(stage0, unsafe_no_drop_flag)]
4847
pub struct RawVec<T> {
4948
ptr: Unique<T>,
5049
cap: usize,

src/liballoc/rc.rs

-2
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,6 @@ struct RcBox<T: ?Sized> {
252252
/// that you have to call them as e.g. `Rc::get_mut(&value)` instead of
253253
/// `value.get_mut()`. This avoids conflicts with methods of the inner
254254
/// type `T`.
255-
#[cfg_attr(stage0, unsafe_no_drop_flag)]
256255
#[stable(feature = "rust1", since = "1.0.0")]
257256
pub struct Rc<T: ?Sized> {
258257
ptr: Shared<RcBox<T>>,
@@ -873,7 +872,6 @@ impl<T> From<T> for Rc<T> {
873872
///
874873
/// [rc]: struct.Rc.html
875874
/// [downgrade]: struct.Rc.html#method.downgrade
876-
#[cfg_attr(stage0, unsafe_no_drop_flag)]
877875
#[stable(feature = "rc_weak", since = "1.4.0")]
878876
pub struct Weak<T: ?Sized> {
879877
ptr: Shared<RcBox<T>>,

src/libcollections/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@
5252
#![feature(step_by)]
5353
#![feature(unicode)]
5454
#![feature(unique)]
55-
#![cfg_attr(stage0, feature(unsafe_no_drop_flag))]
5655
#![cfg_attr(test, feature(rand, test))]
5756

5857
#![no_std]

src/libcollections/macros.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,9 @@ macro_rules! vec {
6868
}
6969

7070
/// Use the syntax described in `std::fmt` to create a value of type `String`.
71-
/// See `std::fmt` for more information.
71+
/// See [`std::fmt`][fmt] for more information.
72+
///
73+
/// [fmt]: ../std/fmt/index.html
7274
///
7375
/// # Examples
7476
///

src/libcollections/vec.rs

-1
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,6 @@ use super::range::RangeArgument;
268268
/// Vec does not currently guarantee the order in which elements are dropped
269269
/// (the order has changed in the past, and may change again).
270270
///
271-
#[cfg_attr(stage0, unsafe_no_drop_flag)]
272271
#[stable(feature = "rust1", since = "1.0.0")]
273272
pub struct Vec<T> {
274273
buf: RawVec<T>,

src/libcompiler_builtins/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#![cfg_attr(not(stage0), feature(compiler_builtins))]
11+
#![feature(compiler_builtins)]
1212
#![no_std]
13-
#![cfg_attr(not(stage0), compiler_builtins)]
13+
#![compiler_builtins]
1414
#![unstable(feature = "compiler_builtins_lib",
1515
reason = "internal implementation detail of rustc right now",
1616
issue = "0")]

src/libcore/clone.rs

-7
Original file line numberDiff line numberDiff line change
@@ -129,13 +129,6 @@ pub struct AssertParamIsClone<T: Clone + ?Sized> { _field: ::marker::PhantomData
129129
reason = "deriving hack, should not be public",
130130
issue = "0")]
131131
pub struct AssertParamIsCopy<T: Copy + ?Sized> { _field: ::marker::PhantomData<T> }
132-
#[cfg(stage0)]
133-
#[doc(hidden)]
134-
#[inline(always)]
135-
#[unstable(feature = "derive_clone_copy",
136-
reason = "deriving hack, should not be public",
137-
issue = "0")]
138-
pub fn assert_receiver_is_clone<T: Clone + ?Sized>(_: &T) {}
139132

140133
#[stable(feature = "rust1", since = "1.0.0")]
141134
impl<'a, T: ?Sized> Clone for &'a T {

src/libcore/intrinsics.rs

-2
Original file line numberDiff line numberDiff line change
@@ -194,14 +194,12 @@ extern "rust-intrinsic" {
194194
/// own, or if it does not enable any significant optimizations.
195195
pub fn assume(b: bool);
196196

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

204-
#[cfg(not(stage0))]
205203
/// Hints to the compiler that branch condition is likely to be false.
206204
/// Returns the value passed to it.
207205
///

src/librustc/middle/cstore.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ use ty::{self, Ty, TyCtxt};
3232
use mir::repr::Mir;
3333
use mir::mir_map::MirMap;
3434
use session::Session;
35-
use session::config::PanicStrategy;
3635
use session::search_paths::PathKind;
3736
use util::nodemap::{NodeSet, DefIdMap};
3837
use std::path::PathBuf;
@@ -46,6 +45,7 @@ use syntax_pos::Span;
4645
use rustc_back::target::Target;
4746
use hir;
4847
use hir::intravisit::Visitor;
48+
use rustc_back::PanicStrategy;
4949

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

src/librustc/middle/dependency_format.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,10 @@
6464
use hir::def_id::CrateNum;
6565

6666
use session;
67-
use session::config::{self, PanicStrategy};
67+
use session::config;
6868
use middle::cstore::LinkagePreference::{self, RequireStatic, RequireDynamic};
6969
use util::nodemap::FnvHashMap;
70+
use rustc_back::PanicStrategy;
7071

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

362363
// First up, validate that our selected panic runtime is indeed exactly
363364
// our same strategy.

src/librustc/middle/weak_lang_items.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,11 @@
1010

1111
//! Validity checking for weak lang items
1212
13-
use session::config::{self, PanicStrategy};
13+
use session::config;
1414
use session::Session;
1515
use middle::lang_items;
1616

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

0 commit comments

Comments
 (0)