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 11 pull requests #55710

Merged
merged 42 commits into from
Nov 6, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
dd68685
resolve: Fix ICE in macro import error recovery
petrochenkov Oct 29, 2018
ff5226c
std: Enable usage of `thread_local!` through imports
alexcrichton Nov 1, 2018
89cf577
Fix tracking issue numbers for some unstable features
petrochenkov Nov 1, 2018
29d2cea
Remove deprecated unstable `#[panic_implementation]`
petrochenkov Nov 1, 2018
e04e5fa
ci: Add Dockerfile for dist-powerpcspe-linux
glaubitz Nov 3, 2018
8277ba2
Make "all possible cases" help message uniform with existing help mes…
varkor Nov 3, 2018
424fecd
Add precision for create_dir function
GuillaumeGomez Nov 2, 2018
1854dde
Correct indentation on documentation comment.
davidtwco Nov 4, 2018
ba09ed5
Update test to force error under NLL.
davidtwco Nov 4, 2018
c905497
miri: binary_op_val -> binary_op_imm
RalfJung Nov 5, 2018
2a1dc1e
Add test
jsirs Nov 5, 2018
4a08333
self.associated_item can return none
jsirs Nov 5, 2018
9fb2e06
update test to include concrete type (i32)
jsirs Nov 5, 2018
87c22f2
add test for i32, fix incorrect location
jsirs Nov 5, 2018
5f524ed
Switch to using revisions in borrowck-lend-flow-loop.rs
pnkfelix Nov 5, 2018
cd52b3c
Make `ui/span/borrowck-borrow-overloaded-auto-deref-mut.rs` robust w.…
pnkfelix Nov 5, 2018
affddf6
Make `ui/issues/issue-17263.rs` robust w.r.t. NLL.
pnkfelix Nov 5, 2018
9f9bf94
Make `ui/borrowck/borrowck-overloaded-index-move-index.rs` robust w.r…
pnkfelix Nov 5, 2018
6c7d82e
Make `ui/borrowck/borrowck-reborrow-from-mut.rs` robust w.r.t. NLL.
pnkfelix Nov 5, 2018
9843a38
Make `ui/borrowck/borrowck-unboxed-closures.rs` robust w.r.t. NLL.
pnkfelix Nov 5, 2018
41a1ee9
Make `ui/unop-move-semantics.rs` robust w.r.t. NLL.
pnkfelix Nov 5, 2018
62a2bb1
Remove `println!`'s from `ui/issues/issue-52126-assign-op-invariance.rs`
pnkfelix Nov 5, 2018
e940801
Make `ui/binop-move-semantics.rs` robust w.r.t. NLL.
pnkfelix Nov 5, 2018
f7ded5d
Removed overlapping_spans.{rs,stderr,nll.stderr}.
pnkfelix Nov 5, 2018
fe29cd0
Add `ui/borrowck/borrowck-closures-mut-of-mut.rs`.
pnkfelix Nov 5, 2018
c25319f
Update `ui/borrowck/borrowck-closures-mut-of-imm.rs` robust w.r.t. NLL.
pnkfelix Nov 5, 2018
cf71582
Use `// revisions` in the dropck-eyepatch tests instead of relying on…
pnkfelix Nov 5, 2018
b75fbbf
Make `ui/borrowck/borrowck-overloaded-call.rs` robust w.r.t. NLL.
pnkfelix Nov 5, 2018
3063977
add call to tcx.sess.delay_span_bug
jsirs Nov 5, 2018
fff9dde
For feature-gate-nll test, turn off testing modes that externally ena…
pnkfelix Nov 5, 2018
034a0eb
This should have been part of PR #54811 (my bad).
pnkfelix Nov 5, 2018
1525b0e
Rollup merge of #55490 - petrochenkov:resolveice, r=eddyb
kennytm Nov 6, 2018
462f63e
Rollup merge of #55597 - alexcrichton:thread-local-inner, r=KodrAus
kennytm Nov 6, 2018
6091696
Rollup merge of #55601 - petrochenkov:featissue, r=pnkfelix
kennytm Nov 6, 2018
082156b
Rollup merge of #55621 - GuillaumeGomez:create-dir, r=QuietMisdreavus
kennytm Nov 6, 2018
225df14
Rollup merge of #55644 - glaubitz:powerpcspe-linux, r=alexcrichton
kennytm Nov 6, 2018
435aca1
Rollup merge of #55664 - varkor:all-possible-cases-message, r=zackmdavis
kennytm Nov 6, 2018
8b3d9e5
Rollup merge of #55689 - RalfJung:miri-immediate, r=oli-obk
kennytm Nov 6, 2018
54bc9c2
Rollup merge of #55694 - jsirs:issue-31076, r=oli-obk
kennytm Nov 6, 2018
1ea1a42
Rollup merge of #55696 - davidtwco:issue-55675, r=pnkfelix
kennytm Nov 6, 2018
6231720
Rollup merge of #55700 - pnkfelix:issue-55533-update-ui-tests-wrt-nll…
kennytm Nov 6, 2018
8589ca0
Rollup merge of #55703 - pnkfelix:update-configure-help-to-reflect-pr…
kennytm Nov 6, 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
2 changes: 1 addition & 1 deletion src/bootstrap/configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def v(*args):
options.append(Option(*args, value=True))


o("debug", "rust.debug", "debug mode; disables optimization unless `--enable-optimize` given")
o("debug", "rust.debug", "enables debugging environment; does not affect optimization of bootstrapped code (use `--disable-optimize` for that)")
o("docs", "build.docs", "build standard library documentation")
o("compiler-docs", "build.compiler-docs", "build compiler documentation")
o("optimize-tests", "rust.optimize-tests", "build tests with optimizations")
Expand Down
26 changes: 26 additions & 0 deletions src/ci/docker/disabled/dist-powerpcspe-linux/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
FROM ubuntu:16.04

RUN apt-get update && apt-get install -y --no-install-recommends \
g++ \
make \
file \
curl \
ca-certificates \
python2.7 \
git \
cmake \
sudo \
gdb \
xz-utils \
g++-powerpc-linux-gnuspe \
libssl-dev \
pkg-config


COPY scripts/sccache.sh /scripts/
RUN sh /scripts/sccache.sh

ENV HOSTS=powerpc-unknown-linux-gnuspe

ENV RUST_CONFIGURE_ARGS --enable-extended --disable-docs
ENV SCRIPT python2.7 ../x.py dist --host $HOSTS --target $HOSTS
6 changes: 2 additions & 4 deletions src/librustc/middle/dead.rs
Original file line number Diff line number Diff line change
Expand Up @@ -291,10 +291,8 @@ fn has_allow_dead_code_or_lang_attr(tcx: TyCtxt<'_, '_, '_>,
return true;
}

// (To be) stable attribute for #[lang = "panic_impl"]
if attr::contains_name(attrs, "panic_implementation") ||
attr::contains_name(attrs, "panic_handler")
{
// Stable attribute for #[lang = "panic_impl"]
if attr::contains_name(attrs, "panic_handler") {
return true;
}

Expand Down
4 changes: 1 addition & 3 deletions src/librustc/middle/lang_items.rs
Original file line number Diff line number Diff line change
Expand Up @@ -204,9 +204,7 @@ pub fn extract(attrs: &[ast::Attribute]) -> Option<(Symbol, Span)> {
if let Some(value) = attribute.value_str() {
return Some((value, attribute.span));
}
} else if attribute.check_name("panic_implementation") ||
attribute.check_name("panic_handler")
{
} else if attribute.check_name("panic_handler") {
return Some((Symbol::intern("panic_impl"), attribute.span))
} else if attribute.check_name("alloc_error_handler") {
return Some((Symbol::intern("oom"), attribute.span))
Expand Down
20 changes: 10 additions & 10 deletions src/librustc/mir/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -506,25 +506,25 @@ pub enum BorrowKind {
/// implicit closure bindings. It is needed when the closure is
/// borrowing or mutating a mutable referent, e.g.:
///
/// let x: &mut isize = ...;
/// let y = || *x += 5;
/// let x: &mut isize = ...;
/// let y = || *x += 5;
///
/// If we were to try to translate this closure into a more explicit
/// form, we'd encounter an error with the code as written:
///
/// struct Env { x: & &mut isize }
/// let x: &mut isize = ...;
/// let y = (&mut Env { &x }, fn_ptr); // Closure is pair of env and fn
/// fn fn_ptr(env: &mut Env) { **env.x += 5; }
/// struct Env { x: & &mut isize }
/// let x: &mut isize = ...;
/// let y = (&mut Env { &x }, fn_ptr); // Closure is pair of env and fn
/// fn fn_ptr(env: &mut Env) { **env.x += 5; }
///
/// This is then illegal because you cannot mutate an `&mut` found
/// in an aliasable location. To solve, you'd have to translate with
/// an `&mut` borrow:
///
/// struct Env { x: & &mut isize }
/// let x: &mut isize = ...;
/// let y = (&mut Env { &mut x }, fn_ptr); // changed from &x to &mut x
/// fn fn_ptr(env: &mut Env) { **env.x += 5; }
/// struct Env { x: & &mut isize }
/// let x: &mut isize = ...;
/// let y = (&mut Env { &mut x }, fn_ptr); // changed from &x to &mut x
/// fn fn_ptr(env: &mut Env) { **env.x += 5; }
///
/// Now the assignment to `**env.x` is legal, but creating a
/// mutable pointer to `x` is not because `x` is not mutable. We
Expand Down
4 changes: 2 additions & 2 deletions src/librustc_mir/hair/pattern/check_match.rs
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,8 @@ impl<'a, 'tcx> MatchVisitor<'a, 'tcx> {
is non-empty",
pat_ty));
span_help!(&mut err, scrut.span,
"Please ensure that all possible cases are being handled; \
possibly adding wildcards or more match arms.");
"ensure that all possible cases are being handled, \
possibly by adding wildcards or more match arms");
err.emit();
}
// If the type *is* uninhabited, it's vacuously exhaustive
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_mir/interpret/intrinsics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ impl<'a, 'mir, 'tcx, M: Machine<'a, 'mir, 'tcx>> EvalContext<'a, 'mir, 'tcx, M>
"unchecked_shr" => BinOp::Shr,
_ => bug!("Already checked for int ops")
};
let (val, overflowed) = self.binary_op_val(bin_op, l, r)?;
let (val, overflowed) = self.binary_op_imm(bin_op, l, r)?;
if overflowed {
let layout = self.layout_of(substs.type_at(0))?;
let r_val = r.to_scalar()?.to_bits(layout.size)?;
Expand Down
8 changes: 4 additions & 4 deletions src/librustc_mir/interpret/operator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ impl<'a, 'mir, 'tcx, M: Machine<'a, 'mir, 'tcx>> EvalContext<'a, 'mir, 'tcx, M>
right: ImmTy<'tcx, M::PointerTag>,
dest: PlaceTy<'tcx, M::PointerTag>,
) -> EvalResult<'tcx> {
let (val, overflowed) = self.binary_op_val(op, left, right)?;
let (val, overflowed) = self.binary_op_imm(op, left, right)?;
let val = Immediate::ScalarPair(val.into(), Scalar::from_bool(overflowed).into());
self.write_immediate(val, dest)
}
Expand All @@ -42,7 +42,7 @@ impl<'a, 'mir, 'tcx, M: Machine<'a, 'mir, 'tcx>> EvalContext<'a, 'mir, 'tcx, M>
right: ImmTy<'tcx, M::PointerTag>,
dest: PlaceTy<'tcx, M::PointerTag>,
) -> EvalResult<'tcx> {
let (val, _overflowed) = self.binary_op_val(op, left, right)?;
let (val, _overflowed) = self.binary_op_imm(op, left, right)?;
self.write_scalar(val, dest)
}
}
Expand Down Expand Up @@ -283,9 +283,9 @@ impl<'a, 'mir, 'tcx, M: Machine<'a, 'mir, 'tcx>> EvalContext<'a, 'mir, 'tcx, M>
}

/// Convenience wrapper that's useful when keeping the layout together with the
/// value.
/// immediate value.
#[inline]
pub fn binary_op_val(
pub fn binary_op_imm(
&self,
bin_op: mir::BinOp,
left: ImmTy<'tcx, M::PointerTag>,
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_mir/monomorphize/partitioning.rs
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ fn mono_item_visibility(
//
// * First is weak lang items. These are basically mechanisms for
// libcore to forward-reference symbols defined later in crates like
// the standard library or `#[panic_implementation]` definitions. The
// the standard library or `#[panic_handler]` definitions. The
// definition of these weak lang items needs to be referenceable by
// libcore, so we're no longer a candidate for internalization.
// Removal of these functions can't be done by LLVM but rather must be
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_mir/transform/const_prop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ impl<'a, 'mir, 'tcx> ConstPropagator<'a, 'mir, 'tcx> {
})?;
trace!("const evaluating {:?} for {:?} and {:?}", op, left, right);
let (val, overflow) = self.use_ecx(source_info, |this| {
this.ecx.binary_op_val(op, l, r)
this.ecx.binary_op_imm(op, l, r)
})?;
let val = if let Rvalue::CheckedBinaryOp(..) = *rvalue {
Immediate::ScalarPair(
Expand Down
3 changes: 3 additions & 0 deletions src/librustc_resolve/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,9 @@ impl<'a, 'cl> Resolver<'a, 'cl> {
return Err(Determinacy::Determined);
}
}
Def::Err => {
return Err(Determinacy::Determined);
}
_ => panic!("expected `Def::Macro` or `Def::NonMacroAttr`"),
}

Expand Down
10 changes: 8 additions & 2 deletions src/librustc_typeck/check/method/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -289,8 +289,14 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
// Trait must have a method named `m_name` and it should not have
// type parameters or early-bound regions.
let tcx = self.tcx;
let method_item =
self.associated_item(trait_def_id, m_name, Namespace::Value).unwrap();
let method_item = match self.associated_item(trait_def_id, m_name, Namespace::Value) {
Some(method_item) => method_item,
None => {
tcx.sess.delay_span_bug(span,
"operator trait does not have corresponding operator method");
return None;
}
};
let def_id = method_item.def_id;
let generics = tcx.generics_of(def_id);
assert_eq!(generics.params.len(), 0);
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_typeck/check/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1167,7 +1167,7 @@ fn check_fn<'a, 'gcx, 'tcx>(inherited: &'a Inherited<'a, 'gcx, 'tcx>,
}
}

// Check that a function marked as `#[panic_implementation]` has signature `fn(&PanicInfo) -> !`
// Check that a function marked as `#[panic_handler]` has signature `fn(&PanicInfo) -> !`
if let Some(panic_impl_did) = fcx.tcx.lang_items().panic_impl() {
if panic_impl_did == fcx.tcx.hir.local_def_id(fn_id) {
if let Some(panic_info_did) = fcx.tcx.lang_items().panic_info() {
Expand Down
7 changes: 7 additions & 0 deletions src/libstd/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1755,12 +1755,19 @@ pub fn canonicalize<P: AsRef<Path>>(path: P) -> io::Result<PathBuf> {
///
/// [changes]: ../io/index.html#platform-specific-behavior
///
/// **NOTE**: If a parent of the given path doesn't exist, this function will
/// return an error. To create a directory and all its missing parents at the
/// same time, use the [`create_dir_all`] function.
///
/// # Errors
///
/// This function will return an error in the following situations, but is not
/// limited to just these cases:
///
/// * User lacks permissions to create directory at `path`.
/// * A parent of the given path doesn't exist. (To create a directory and all
/// its missing parents at the same time, use the [`create_dir_all`]
/// function.)
/// * `path` already exists.
///
/// # Examples
Expand Down
8 changes: 4 additions & 4 deletions src/libstd/thread/local.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,13 +146,13 @@ macro_rules! thread_local {

// process multiple declarations
($(#[$attr:meta])* $vis:vis static $name:ident: $t:ty = $init:expr; $($rest:tt)*) => (
__thread_local_inner!($(#[$attr])* $vis $name, $t, $init);
thread_local!($($rest)*);
$crate::__thread_local_inner!($(#[$attr])* $vis $name, $t, $init);
$crate::thread_local!($($rest)*);
);

// handle a single declaration
($(#[$attr:meta])* $vis:vis static $name:ident: $t:ty = $init:expr) => (
__thread_local_inner!($(#[$attr])* $vis $name, $t, $init);
$crate::__thread_local_inner!($(#[$attr])* $vis $name, $t, $init);
);
}

Expand Down Expand Up @@ -202,7 +202,7 @@ macro_rules! __thread_local_inner {
};
($(#[$attr:meta])* $vis:vis $name:ident, $t:ty, $init:expr) => {
$(#[$attr])* $vis const $name: $crate::thread::LocalKey<$t> =
__thread_local_inner!(@key $(#[$attr])* $vis $name, $t, $init);
$crate::__thread_local_inner!(@key $(#[$attr])* $vis $name, $t, $init);
}
}

Expand Down
27 changes: 8 additions & 19 deletions src/libsyntax/feature_gate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ declare_features! (
(active, abi_thiscall, "1.19.0", None, None),

// Allows a test to fail without failing the whole suite
(active, allow_fail, "1.19.0", Some(42219), None),
(active, allow_fail, "1.19.0", Some(46488), None),

// Allows unsized tuple coercion.
(active, unsized_tuple_coercion, "1.20.0", Some(42877), None),
Expand All @@ -376,7 +376,7 @@ declare_features! (
(active, non_exhaustive, "1.22.0", Some(44109), None),

// `crate` as visibility modifier, synonymous to `pub(crate)`
(active, crate_visibility_modifier, "1.23.0", Some(45388), None),
(active, crate_visibility_modifier, "1.23.0", Some(53120), None),

// extern types
(active, extern_types, "1.23.0", Some(43467), None),
Expand All @@ -391,13 +391,13 @@ declare_features! (
(active, generic_associated_types, "1.23.0", Some(44265), None),

// `extern` in paths
(active, extern_in_paths, "1.23.0", Some(44660), None),
(active, extern_in_paths, "1.23.0", Some(55600), None),

// Use `?` as the Kleene "at most one" operator
(active, macro_at_most_once_rep, "1.25.0", Some(48075), None),

// Infer static outlives requirements; RFC 2093
(active, infer_static_outlives_requirements, "1.26.0", Some(44493), None),
(active, infer_static_outlives_requirements, "1.26.0", Some(54185), None),

// Multiple patterns with `|` in `if let` and `while let`
(active, if_while_or_patterns, "1.26.0", Some(48215), None),
Expand Down Expand Up @@ -448,9 +448,6 @@ declare_features! (
// Integer match exhaustiveness checking
(active, exhaustive_integer_patterns, "1.30.0", Some(50907), None),

// RFC 2070: #[panic_implementation] / #[panic_handler]
(active, panic_implementation, "1.28.0", Some(44489), None),

// #[doc(keyword = "...")]
(active, doc_keyword, "1.28.0", Some(51315), None),

Expand All @@ -466,7 +463,7 @@ declare_features! (
(active, test_2018_feature, "1.31.0", Some(0), Some(Edition::Edition2018)),

// Support for arbitrary delimited token streams in non-macro attributes
(active, unrestricted_attribute_tokens, "1.30.0", Some(44690), None),
(active, unrestricted_attribute_tokens, "1.30.0", Some(55208), None),

// Allows `use x::y;` to resolve through `self::x`, not just `::x`
(active, uniform_paths, "1.30.0", Some(53130), None),
Expand Down Expand Up @@ -503,7 +500,7 @@ declare_features! (
(active, underscore_const_names, "1.31.0", Some(54912), None),

// `extern crate foo as bar;` puts `bar` into extern prelude.
(active, extern_crate_item_prelude, "1.31.0", Some(54658), None),
(active, extern_crate_item_prelude, "1.31.0", Some(55599), None),

// `reason = ` in lint attributes and `expect` lint attribute
(active, lint_reasons, "1.31.0", Some(54503), None),
Expand Down Expand Up @@ -541,6 +538,8 @@ declare_features! (
Some("subsumed by `#![feature(proc_macro_hygiene)]`")),
(removed, proc_macro_gen, "1.27.0", Some(54727), None,
Some("subsumed by `#![feature(proc_macro_hygiene)]`")),
(removed, panic_implementation, "1.28.0", Some(44489), None,
Some("subsumed by `#[panic_handler]`")),
);

declare_features! (
Expand Down Expand Up @@ -1160,16 +1159,6 @@ pub const BUILTIN_ATTRIBUTES: &'static [(&'static str, AttributeType, AttributeG
"infer 'static lifetime requirements",
cfg_fn!(infer_static_outlives_requirements))),

// RFC 2070 (deprecated attribute name)
("panic_implementation",
Normal,
Gated(Stability::Deprecated("https://github.com/rust-lang/rust/issues/44489\
#issuecomment-415140224",
Some("replace this attribute with `#[panic_handler]`")),
"panic_implementation",
"this attribute was renamed to `panic_handler`",
cfg_fn!(panic_implementation))),

// RFC 2070
("panic_handler", Normal, Ungated),

Expand Down
4 changes: 1 addition & 3 deletions src/test/run-make/wasm-symbols-not-imported/foo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
// except according to those terms.

#![crate_type = "cdylib"]

#![feature(panic_implementation)]
#![no_std]

use core::panic::PanicInfo;
Expand All @@ -20,7 +18,7 @@ pub extern fn foo() {
panic!()
}

#[panic_implementation]
#[panic_handler]
fn panic(_info: &PanicInfo) -> ! {
loop {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,11 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

// compile-flags:-C panic=abort

#![deny(deprecated)]
#![feature(panic_implementation)]
#![no_std]

use core::panic::PanicInfo;
extern crate std;

#[panic_implementation]
fn panic(info: &PanicInfo) -> ! {
loop {}
}
std::thread_local!(static A: usize = 30);

fn main() {}
fn main() {
}
Loading