Skip to content

Commit f90aab7

Browse files
committed
Auto merge of #55710 - kennytm:rollup, r=kennytm
Rollup of 11 pull requests Successful merges: - #55490 (resolve: Fix ICE in macro import error recovery) - #55597 (std: Enable usage of `thread_local!` through imports) - #55601 (Fix tracking issue numbers for some unstable features) - #55621 (Add precision for create_dir function) - #55644 (ci: Add Dockerfile for dist-powerpcspe-linux) - #55664 (Make "all possible cases" help message uniform with existing help messages) - #55689 (miri: binary_op_val -> binary_op_imm) - #55694 (Fixes #31076) - #55696 (NLL Diagnostic Review 3: Missing errors for borrows of union fields) - #55700 (Update ui tests with respect to NLL) - #55703 (Update `configure --help` (via configure.py) to reflect decoupling of debug+optimize)
2 parents 24e66c2 + 8589ca0 commit f90aab7

File tree

79 files changed

+775
-410
lines changed

Some content is hidden

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

79 files changed

+775
-410
lines changed

src/bootstrap/configure.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def v(*args):
4040
options.append(Option(*args, value=True))
4141

4242

43-
o("debug", "rust.debug", "debug mode; disables optimization unless `--enable-optimize` given")
43+
o("debug", "rust.debug", "enables debugging environment; does not affect optimization of bootstrapped code (use `--disable-optimize` for that)")
4444
o("docs", "build.docs", "build standard library documentation")
4545
o("compiler-docs", "build.compiler-docs", "build compiler documentation")
4646
o("optimize-tests", "rust.optimize-tests", "build tests with optimizations")
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
FROM ubuntu:16.04
2+
3+
RUN apt-get update && apt-get install -y --no-install-recommends \
4+
g++ \
5+
make \
6+
file \
7+
curl \
8+
ca-certificates \
9+
python2.7 \
10+
git \
11+
cmake \
12+
sudo \
13+
gdb \
14+
xz-utils \
15+
g++-powerpc-linux-gnuspe \
16+
libssl-dev \
17+
pkg-config
18+
19+
20+
COPY scripts/sccache.sh /scripts/
21+
RUN sh /scripts/sccache.sh
22+
23+
ENV HOSTS=powerpc-unknown-linux-gnuspe
24+
25+
ENV RUST_CONFIGURE_ARGS --enable-extended --disable-docs
26+
ENV SCRIPT python2.7 ../x.py dist --host $HOSTS --target $HOSTS

src/librustc/middle/dead.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -291,10 +291,8 @@ fn has_allow_dead_code_or_lang_attr(tcx: TyCtxt<'_, '_, '_>,
291291
return true;
292292
}
293293

294-
// (To be) stable attribute for #[lang = "panic_impl"]
295-
if attr::contains_name(attrs, "panic_implementation") ||
296-
attr::contains_name(attrs, "panic_handler")
297-
{
294+
// Stable attribute for #[lang = "panic_impl"]
295+
if attr::contains_name(attrs, "panic_handler") {
298296
return true;
299297
}
300298

src/librustc/middle/lang_items.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -204,9 +204,7 @@ pub fn extract(attrs: &[ast::Attribute]) -> Option<(Symbol, Span)> {
204204
if let Some(value) = attribute.value_str() {
205205
return Some((value, attribute.span));
206206
}
207-
} else if attribute.check_name("panic_implementation") ||
208-
attribute.check_name("panic_handler")
209-
{
207+
} else if attribute.check_name("panic_handler") {
210208
return Some((Symbol::intern("panic_impl"), attribute.span))
211209
} else if attribute.check_name("alloc_error_handler") {
212210
return Some((Symbol::intern("oom"), attribute.span))

src/librustc/mir/mod.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -506,25 +506,25 @@ pub enum BorrowKind {
506506
/// implicit closure bindings. It is needed when the closure is
507507
/// borrowing or mutating a mutable referent, e.g.:
508508
///
509-
/// let x: &mut isize = ...;
510-
/// let y = || *x += 5;
509+
/// let x: &mut isize = ...;
510+
/// let y = || *x += 5;
511511
///
512512
/// If we were to try to translate this closure into a more explicit
513513
/// form, we'd encounter an error with the code as written:
514514
///
515-
/// struct Env { x: & &mut isize }
516-
/// let x: &mut isize = ...;
517-
/// let y = (&mut Env { &x }, fn_ptr); // Closure is pair of env and fn
518-
/// fn fn_ptr(env: &mut Env) { **env.x += 5; }
515+
/// struct Env { x: & &mut isize }
516+
/// let x: &mut isize = ...;
517+
/// let y = (&mut Env { &x }, fn_ptr); // Closure is pair of env and fn
518+
/// fn fn_ptr(env: &mut Env) { **env.x += 5; }
519519
///
520520
/// This is then illegal because you cannot mutate an `&mut` found
521521
/// in an aliasable location. To solve, you'd have to translate with
522522
/// an `&mut` borrow:
523523
///
524-
/// struct Env { x: & &mut isize }
525-
/// let x: &mut isize = ...;
526-
/// let y = (&mut Env { &mut x }, fn_ptr); // changed from &x to &mut x
527-
/// fn fn_ptr(env: &mut Env) { **env.x += 5; }
524+
/// struct Env { x: & &mut isize }
525+
/// let x: &mut isize = ...;
526+
/// let y = (&mut Env { &mut x }, fn_ptr); // changed from &x to &mut x
527+
/// fn fn_ptr(env: &mut Env) { **env.x += 5; }
528528
///
529529
/// Now the assignment to `**env.x` is legal, but creating a
530530
/// mutable pointer to `x` is not because `x` is not mutable. We

src/librustc_mir/hair/pattern/check_match.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,8 +238,8 @@ impl<'a, 'tcx> MatchVisitor<'a, 'tcx> {
238238
is non-empty",
239239
pat_ty));
240240
span_help!(&mut err, scrut.span,
241-
"Please ensure that all possible cases are being handled; \
242-
possibly adding wildcards or more match arms.");
241+
"ensure that all possible cases are being handled, \
242+
possibly by adding wildcards or more match arms");
243243
err.emit();
244244
}
245245
// If the type *is* uninhabited, it's vacuously exhaustive

src/librustc_mir/interpret/intrinsics.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ impl<'a, 'mir, 'tcx, M: Machine<'a, 'mir, 'tcx>> EvalContext<'a, 'mir, 'tcx, M>
140140
"unchecked_shr" => BinOp::Shr,
141141
_ => bug!("Already checked for int ops")
142142
};
143-
let (val, overflowed) = self.binary_op_val(bin_op, l, r)?;
143+
let (val, overflowed) = self.binary_op_imm(bin_op, l, r)?;
144144
if overflowed {
145145
let layout = self.layout_of(substs.type_at(0))?;
146146
let r_val = r.to_scalar()?.to_bits(layout.size)?;

src/librustc_mir/interpret/operator.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ impl<'a, 'mir, 'tcx, M: Machine<'a, 'mir, 'tcx>> EvalContext<'a, 'mir, 'tcx, M>
2828
right: ImmTy<'tcx, M::PointerTag>,
2929
dest: PlaceTy<'tcx, M::PointerTag>,
3030
) -> EvalResult<'tcx> {
31-
let (val, overflowed) = self.binary_op_val(op, left, right)?;
31+
let (val, overflowed) = self.binary_op_imm(op, left, right)?;
3232
let val = Immediate::ScalarPair(val.into(), Scalar::from_bool(overflowed).into());
3333
self.write_immediate(val, dest)
3434
}
@@ -42,7 +42,7 @@ impl<'a, 'mir, 'tcx, M: Machine<'a, 'mir, 'tcx>> EvalContext<'a, 'mir, 'tcx, M>
4242
right: ImmTy<'tcx, M::PointerTag>,
4343
dest: PlaceTy<'tcx, M::PointerTag>,
4444
) -> EvalResult<'tcx> {
45-
let (val, _overflowed) = self.binary_op_val(op, left, right)?;
45+
let (val, _overflowed) = self.binary_op_imm(op, left, right)?;
4646
self.write_scalar(val, dest)
4747
}
4848
}
@@ -283,9 +283,9 @@ impl<'a, 'mir, 'tcx, M: Machine<'a, 'mir, 'tcx>> EvalContext<'a, 'mir, 'tcx, M>
283283
}
284284

285285
/// Convenience wrapper that's useful when keeping the layout together with the
286-
/// value.
286+
/// immediate value.
287287
#[inline]
288-
pub fn binary_op_val(
288+
pub fn binary_op_imm(
289289
&self,
290290
bin_op: mir::BinOp,
291291
left: ImmTy<'tcx, M::PointerTag>,

src/librustc_mir/monomorphize/partitioning.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,7 @@ fn mono_item_visibility(
511511
//
512512
// * First is weak lang items. These are basically mechanisms for
513513
// libcore to forward-reference symbols defined later in crates like
514-
// the standard library or `#[panic_implementation]` definitions. The
514+
// the standard library or `#[panic_handler]` definitions. The
515515
// definition of these weak lang items needs to be referenceable by
516516
// libcore, so we're no longer a candidate for internalization.
517517
// Removal of these functions can't be done by LLVM but rather must be

src/librustc_mir/transform/const_prop.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ impl<'a, 'mir, 'tcx> ConstPropagator<'a, 'mir, 'tcx> {
455455
})?;
456456
trace!("const evaluating {:?} for {:?} and {:?}", op, left, right);
457457
let (val, overflow) = self.use_ecx(source_info, |this| {
458-
this.ecx.binary_op_val(op, l, r)
458+
this.ecx.binary_op_imm(op, l, r)
459459
})?;
460460
let val = if let Rvalue::CheckedBinaryOp(..) = *rvalue {
461461
Immediate::ScalarPair(

0 commit comments

Comments
 (0)