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

+151-152
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/bootstrap/dist.rs

+17-2
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

+16-2
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

+6-1
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

+1-1
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

+1-1
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

+6
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

+4-4
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

+5-7
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

-1
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"

src/librustdoc/html/static/main.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@
4242

4343
// On the search screen, so you remain on the last tab you opened.
4444
//
45-
// 0 for "Types/modules"
46-
// 1 for "As parameters"
47-
// 2 for "As return value"
45+
// 0 for "In Names"
46+
// 1 for "In Parameters"
47+
// 2 for "In Return Types"
4848
var currentTab = 0;
4949

5050
function hasClass(elem, className) {
@@ -1196,9 +1196,9 @@
11961196
output = '<h1>Results for ' + escape(query.query) +
11971197
(query.type ? ' (type: ' + escape(query.type) + ')' : '') + '</h1>' +
11981198
'<div id="titles">' +
1199-
makeTabHeader(0, "Types/modules", results['others'].length) +
1200-
makeTabHeader(1, "As parameters", results['in_args'].length) +
1201-
makeTabHeader(2, "As return value", results['returned'].length) +
1199+
makeTabHeader(0, "In Names", results['others'].length) +
1200+
makeTabHeader(1, "In Parameters", results['in_args'].length) +
1201+
makeTabHeader(2, "In Return Types", results['returned'].length) +
12021202
'</div><div id="results">';
12031203

12041204
output += addTab(results['others'], query);

src/test/run-pass/i128.rs

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
// ignore-emscripten i128 doesn't work
1212

13+
// compile-flags: -Z borrowck=compare
14+
1315
#![feature(i128_type, test)]
1416

1517
extern crate test;

src/test/run-pass/issue-46519.rs

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
// compile-flags:--test -O
12+
13+
#[test]
14+
#[should_panic(expected = "creating inhabited type")]
15+
fn test() {
16+
FontLanguageOverride::system_font(SystemFont::new());
17+
}
18+
19+
pub enum FontLanguageOverride {
20+
Normal,
21+
Override(&'static str),
22+
System(SystemFont)
23+
}
24+
25+
pub enum SystemFont {}
26+
27+
impl FontLanguageOverride {
28+
fn system_font(f: SystemFont) -> Self {
29+
FontLanguageOverride::System(f)
30+
}
31+
}
32+
33+
impl SystemFont {
34+
fn new() -> Self {
35+
panic!("creating inhabited type")
36+
}
37+
}

src/test/run-pass/u128.rs

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
// ignore-emscripten u128 not supported
1212

13+
// compile-flags: -Z borrowck=compare
14+
1315
#![feature(i128_type, test)]
1416

1517
extern crate test;

src/tools/build-manifest/src/main.rs

+1
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ static TARGETS: &'static [&'static str] = &[
5555
"arm-unknown-linux-gnueabihf",
5656
"arm-unknown-linux-musleabi",
5757
"arm-unknown-linux-musleabihf",
58+
"armv5te-unknown-linux-gnueabi",
5859
"armv7-apple-ios",
5960
"armv7-linux-androideabi",
6061
"armv7-unknown-linux-gnueabihf",

src/tools/rls

Submodule rls updated from 194f828 to be23ad3

src/tools/rustfmt

src/tools/toolstate.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ miri = "Testing"
2929
clippy = "Testing"
3030

3131
# ping @nrc
32-
rls = "Broken"
32+
rls = "Testing"
3333

3434
# ping @nrc
35-
rustfmt = "Broken"
35+
rustfmt = "Testing"

0 commit comments

Comments
 (0)