Skip to content

Commit a792b6c

Browse files
committed
Merge remote-tracking branch 'origin/master' into miri
2 parents 9cb6499 + a62910b commit a792b6c

File tree

19 files changed

+260
-182
lines changed

19 files changed

+260
-182
lines changed

src/Cargo.lock

Lines changed: 151 additions & 152 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/bootstrap/dist.rs

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ use build_helper::output;
2828

2929
use {Build, Compiler, Mode};
3030
use channel;
31-
use util::{cp_r, libdir, is_dylib, cp_filtered, copy};
31+
use util::{cp_r, libdir, is_dylib, cp_filtered, copy, replace_in_file};
3232
use builder::{Builder, RunConfig, ShouldRun, Step};
3333
use compile;
3434
use tool::{self, Tool};
@@ -434,7 +434,22 @@ impl Step for Rustc {
434434

435435
// Man pages
436436
t!(fs::create_dir_all(image.join("share/man/man1")));
437-
cp_r(&build.src.join("src/doc/man"), &image.join("share/man/man1"));
437+
let man_src = build.src.join("src/doc/man");
438+
let man_dst = image.join("share/man/man1");
439+
let date_output = output(Command::new("date").arg("+%B %Y"));
440+
let month_year = date_output.trim();
441+
// don't use our `bootstrap::util::{copy, cp_r}`, because those try
442+
// to hardlink, and we don't want to edit the source templates
443+
for entry_result in t!(fs::read_dir(man_src)) {
444+
let file_entry = t!(entry_result);
445+
let page_src = file_entry.path();
446+
let page_dst = man_dst.join(file_entry.file_name());
447+
t!(fs::copy(&page_src, &page_dst));
448+
// template in month/year and version number
449+
replace_in_file(&page_dst,
450+
&[("<INSERT DATE HERE>", month_year),
451+
("<INSERT VERSION HERE>", channel::CFG_RELEASE_NUM)]);
452+
}
438453

439454
// Debugger scripts
440455
builder.ensure(DebuggerScripts {

src/bootstrap/util.rs

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
1616
use std::env;
1717
use std::str;
18-
use std::fs::{self, File};
19-
use std::io::{self, Read, Write};
18+
use std::fs::{self, File, OpenOptions};
19+
use std::io::{self, Read, Write, Seek, SeekFrom};
2020
use std::path::{Path, PathBuf};
2121
use std::process::Command;
2222
use std::time::{SystemTime, Instant};
@@ -51,6 +51,20 @@ pub fn copy(src: &Path, dst: &Path) {
5151
t!(filetime::set_file_times(dst, atime, mtime));
5252
}
5353

54+
/// Search-and-replaces within a file. (Not maximally efficiently: allocates a
55+
/// new string for each replacement.)
56+
pub fn replace_in_file(path: &Path, replacements: &[(&str, &str)]) {
57+
let mut contents = String::new();
58+
let mut file = t!(OpenOptions::new().read(true).write(true).open(path));
59+
t!(file.read_to_string(&mut contents));
60+
for &(target, replacement) in replacements {
61+
contents = contents.replace(target, replacement);
62+
}
63+
t!(file.seek(SeekFrom::Start(0)));
64+
t!(file.set_len(0));
65+
t!(file.write_all(contents.as_bytes()));
66+
}
67+
5468
pub fn read_stamp_file(stamp: &Path) -> Vec<PathBuf> {
5569
let mut paths = Vec::new();
5670
let mut contents = Vec::new();

src/ci/docker/dist-various-1/Dockerfile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,20 @@ ENV TARGETS=$TARGETS,mips-unknown-linux-musl
4646
ENV TARGETS=$TARGETS,mipsel-unknown-linux-musl
4747
ENV TARGETS=$TARGETS,arm-unknown-linux-musleabi
4848
ENV TARGETS=$TARGETS,arm-unknown-linux-musleabihf
49+
ENV TARGETS=$TARGETS,armv5te-unknown-linux-gnueabi
4950
ENV TARGETS=$TARGETS,armv7-unknown-linux-musleabihf
5051
ENV TARGETS=$TARGETS,aarch64-unknown-linux-musl
5152
ENV TARGETS=$TARGETS,sparc64-unknown-linux-gnu
5253
ENV TARGETS=$TARGETS,x86_64-unknown-redox
5354

55+
# FIXME: remove armv5te vars after https://github.com/alexcrichton/cc-rs/issues/271
56+
# get fixed and cc update
5457
ENV CC_mipsel_unknown_linux_musl=mipsel-openwrt-linux-gcc \
5558
CC_mips_unknown_linux_musl=mips-openwrt-linux-gcc \
5659
CC_sparc64_unknown_linux_gnu=sparc64-linux-gnu-gcc \
57-
CC_x86_64_unknown_redox=x86_64-unknown-redox-gcc
60+
CC_x86_64_unknown_redox=x86_64-unknown-redox-gcc \
61+
CC_armv5te_unknown_linux_gnueabi=arm-linux-gnueabi-gcc \
62+
CFLAGS_armv5te_unknown_linux_gnueabi="-march=armv5te -mfloat-abi=soft"
5863

5964
# Suppress some warnings in the openwrt toolchains we downloaded
6065
ENV STAGING_DIR=/tmp

src/doc/man/rustc.1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.TH RUSTC "1" "September 2016" "rustc 1.13.0" "User Commands"
1+
.TH RUSTC "1" "<INSERT DATE HERE>" "rustc <INSERT VERSION HERE>" "User Commands"
22
.SH NAME
33
rustc \- The Rust compiler
44
.SH SYNOPSIS

src/doc/man/rustdoc.1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.TH RUSTDOC "1" "May 2017" "rustdoc 1.19.0" "User Commands"
1+
.TH RUSTDOC "1" "<INSERT DATE HERE>" "rustdoc <INSERT VERSION HERE>" "User Commands"
22
.SH NAME
33
rustdoc \- generate documentation from Rust source code
44
.SH SYNOPSIS

src/librustc/mir/mod.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1348,6 +1348,12 @@ impl<'tcx> Operand<'tcx> {
13481348
})
13491349
}
13501350

1351+
pub fn to_copy(&self) -> Self {
1352+
match *self {
1353+
Operand::Copy(_) | Operand::Constant(_) => self.clone(),
1354+
Operand::Move(ref place) => Operand::Copy(place.clone())
1355+
}
1356+
}
13511357
}
13521358

13531359
///////////////////////////////////////////////////////////////////////////

src/librustc_mir/build/expr/as_rvalue.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
8787
let is_min = this.temp(bool_ty, expr_span);
8888

8989
this.cfg.push_assign(block, source_info, &is_min,
90-
Rvalue::BinaryOp(BinOp::Eq, arg.clone(), minval));
90+
Rvalue::BinaryOp(BinOp::Eq, arg.to_copy(), minval));
9191

9292
let err = ConstMathErr::Overflow(Op::Neg);
9393
block = this.assert(block, Operand::Move(is_min), false,
@@ -346,7 +346,7 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
346346
let is_zero = self.temp(bool_ty, span);
347347
let zero = self.zero_literal(span, ty);
348348
self.cfg.push_assign(block, source_info, &is_zero,
349-
Rvalue::BinaryOp(BinOp::Eq, rhs.clone(), zero));
349+
Rvalue::BinaryOp(BinOp::Eq, rhs.to_copy(), zero));
350350

351351
block = self.assert(block, Operand::Move(is_zero), false,
352352
AssertMessage::Math(zero_err), span);
@@ -364,9 +364,9 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
364364
// this does (rhs == -1) & (lhs == MIN). It could short-circuit instead
365365

366366
self.cfg.push_assign(block, source_info, &is_neg_1,
367-
Rvalue::BinaryOp(BinOp::Eq, rhs.clone(), neg_1));
367+
Rvalue::BinaryOp(BinOp::Eq, rhs.to_copy(), neg_1));
368368
self.cfg.push_assign(block, source_info, &is_min,
369-
Rvalue::BinaryOp(BinOp::Eq, lhs.clone(), min));
369+
Rvalue::BinaryOp(BinOp::Eq, lhs.to_copy(), min));
370370

371371
let is_neg_1 = Operand::Move(is_neg_1);
372372
let is_min = Operand::Move(is_min);

src/librustc_trans/mir/place.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -359,14 +359,12 @@ impl<'a, 'tcx> PlaceRef<'tcx> {
359359
/// Set the discriminant for a new value of the given case of the given
360360
/// representation.
361361
pub fn trans_set_discr(&self, bcx: &Builder<'a, 'tcx>, variant_index: usize) {
362-
match self.layout.variants {
362+
if self.layout.for_variant(bcx.ccx, variant_index).abi == layout::Abi::Uninhabited {
363+
return;
364+
}
365+
match self.layout.variants {
363366
layout::Variants::Single { index } => {
364-
if index != variant_index {
365-
// If the layout of an enum is `Single`, all
366-
// other variants are necessarily uninhabited.
367-
assert_eq!(self.layout.for_variant(bcx.ccx, variant_index).abi,
368-
layout::Abi::Uninhabited);
369-
}
367+
assert_eq!(index, variant_index);
370368
}
371369
layout::Variants::Tagged { .. } => {
372370
let ptr = self.project_field(bcx, 0);

src/librustdoc/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ path = "lib.rs"
1111
doctest = false
1212

1313
[dependencies]
14-
log = "0.3"
1514
pulldown-cmark = { version = "0.1.0", default-features = false }
1615
html-diff = "0.0.5"
1716
tempdir = "0.3"

0 commit comments

Comments
 (0)