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 8 pull requests #59695

Merged
merged 22 commits into from
Apr 4, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
f48a5dc
Document std::fs::File close behavior ignoring errors
czipperz Mar 27, 2019
d8a6b63
update stdsimd
RalfJung Mar 30, 2019
d3d3049
Forward formatter settings to bounds of `Range<T>` in `fmt::Debug` impl
LukasKalbertodt Apr 1, 2019
b6ebe1b
Document using `sync_all`
czipperz Apr 2, 2019
76e82d6
Link to sync_all
czipperz Apr 3, 2019
5e3b1fc
update miri
RalfJung Mar 30, 2019
087999e
try to fix rand feature flags
RalfJung Mar 31, 2019
c75a5a2
update miri
RalfJung Apr 3, 2019
555309d
make StringReader fields private
matklad Apr 3, 2019
1763aea
make StringReader methods private
matklad Apr 3, 2019
c2e0d7f
Never return uninhabited values at all
cuviper Apr 3, 2019
a969d40
File: Add documentation about dropping to sync_all
czipperz Apr 4, 2019
4c9c2cf
Add description for -Os and -Oz in rustc.1
tesuji Apr 4, 2019
42d652e
Disable stack probing for gnux32.
crlf0710 Apr 4, 2019
886456d
Rollup merge of #59470 - czipperz:document-fs-file-close, r=dtolnay
Centril Apr 4, 2019
2074c96
Rollup merge of #59555 - RalfJung:miri, r=oli-obk
Centril Apr 4, 2019
9f8f891
Rollup merge of #59556 - RalfJung:stdsimd, r=gnzlbg
Centril Apr 4, 2019
56328a5
Rollup merge of #59596 - LukasKalbertodt:fix-range-fmt, r=Kimundi
Centril Apr 4, 2019
05c31ba
Rollup merge of #59639 - cuviper:ignore-uninhabited, r=eddyb
Centril Apr 4, 2019
c18c194
Rollup merge of #59671 - matklad:lexer, r=eddyb
Centril Apr 4, 2019
4954cae
Rollup merge of #59685 - lzutao:patch-1, r=GuillaumeGomez
Centril Apr 4, 2019
31c2f5d
Rollup merge of #59686 - crlf0710:disable_gnux32_stackprobe, r=luqmana
Centril Apr 4, 2019
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
24 changes: 1 addition & 23 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2054,18 +2054,6 @@ dependencies = [
"winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
]

[[package]]
name = "rand"
version = "0.5.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
"fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.51 (registry+https://github.com/rust-lang/crates.io-index)",
"rand_core 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
]

[[package]]
name = "rand"
version = "0.6.1"
Expand Down Expand Up @@ -2093,14 +2081,6 @@ dependencies = [
"rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
]

[[package]]
name = "rand_core"
version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
]

[[package]]
name = "rand_core"
version = "0.3.0"
Expand Down Expand Up @@ -2560,7 +2540,7 @@ version = "1.0.0"
dependencies = [
"byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
"parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
"scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.82 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_json 1.0.33 (registry+https://github.com/rust-lang/crates.io-index)",
Expand Down Expand Up @@ -4206,10 +4186,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
"checksum quote 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)" = "53fa22a1994bd0f9372d7a816207d8a2677ad0325b073f5c5332760f0fb62b5c"
"checksum racer 2.1.21 (registry+https://github.com/rust-lang/crates.io-index)" = "37c88638777cc178684cf648ca0e1dad56646ce105b8593dfe665c436300adc3"
"checksum rand 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8356f47b32624fef5b3301c1be97e5944ecdd595409cc5da11d05f211db6cfbd"
"checksum rand 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)" = "e464cd887e869cddcae8792a4ee31d23c7edd516700695608f5b98c67ee0131c"
"checksum rand 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ae9d223d52ae411a33cf7e54ec6034ec165df296ccd23533d671a28252b6f66a"
"checksum rand_chacha 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "771b009e3a508cb67e8823dda454aaa5368c7bc1c16829fb77d3e980440dd34a"
"checksum rand_core 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1961a422c4d189dfb50ffa9320bf1f2a9bd54ecb92792fb9477f99a1045f3372"
"checksum rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0905b6b7079ec73b314d4c748701f6931eb79fd97c668caa3f1899b22b32c6db"
"checksum rand_hc 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7b40677c7be09ae76218dc623efbf7b18e34bced3f38883af07bb75630a21bc4"
"checksum rand_isaac 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ded997c9d5f13925be2a6fd7e66bf1872597f759fd9dd93513dd7e92e5a5ee08"
Expand Down
2 changes: 1 addition & 1 deletion src/doc/man/rustc.1
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ full debug info with variable and type information.
.RE
.TP
\fBopt\-level\fR=\fIVAL\fR
Optimize with possible levels 0\[en]3
Optimize with possible levels 0\[en]3, s (optimize for size), or z (for minimal size)

.SH ENVIRONMENT

Expand Down
22 changes: 17 additions & 5 deletions src/libcore/ops/range.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,10 @@ pub struct Range<Idx> {
#[stable(feature = "rust1", since = "1.0.0")]
impl<Idx: fmt::Debug> fmt::Debug for Range<Idx> {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
write!(fmt, "{:?}..{:?}", self.start, self.end)
self.start.fmt(fmt)?;
write!(fmt, "..")?;
self.end.fmt(fmt)?;
Ok(())
}
}

Expand Down Expand Up @@ -184,7 +187,9 @@ pub struct RangeFrom<Idx> {
#[stable(feature = "rust1", since = "1.0.0")]
impl<Idx: fmt::Debug> fmt::Debug for RangeFrom<Idx> {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
write!(fmt, "{:?}..", self.start)
self.start.fmt(fmt)?;
write!(fmt, "..")?;
Ok(())
}
}

Expand Down Expand Up @@ -266,7 +271,9 @@ pub struct RangeTo<Idx> {
#[stable(feature = "rust1", since = "1.0.0")]
impl<Idx: fmt::Debug> fmt::Debug for RangeTo<Idx> {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
write!(fmt, "..{:?}", self.end)
write!(fmt, "..")?;
self.end.fmt(fmt)?;
Ok(())
}
}

Expand Down Expand Up @@ -467,7 +474,10 @@ impl<Idx> RangeInclusive<Idx> {
#[stable(feature = "inclusive_range", since = "1.26.0")]
impl<Idx: fmt::Debug> fmt::Debug for RangeInclusive<Idx> {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
write!(fmt, "{:?}..={:?}", self.start, self.end)
self.start.fmt(fmt)?;
write!(fmt, "..=")?;
self.end.fmt(fmt)?;
Ok(())
}
}

Expand Down Expand Up @@ -602,7 +612,9 @@ pub struct RangeToInclusive<Idx> {
#[stable(feature = "inclusive_range", since = "1.26.0")]
impl<Idx: fmt::Debug> fmt::Debug for RangeToInclusive<Idx> {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
write!(fmt, "..={:?}", self.end)
write!(fmt, "..=")?;
self.end.fmt(fmt)?;
Ok(())
}
}

Expand Down
7 changes: 7 additions & 0 deletions src/librustc_codegen_ssa/mir/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,13 @@ impl<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
}
}
}
if self.fn_ty.ret.layout.abi.is_uninhabited() {
// Functions with uninhabited return values are marked `noreturn`,
// so we should make sure that we never actually do.
bx.abort();
bx.unreachable();
return;
}
let llval = match self.fn_ty.ret.mode {
PassMode::Ignore(IgnoreMode::Zst) | PassMode::Indirect(..) => {
bx.ret_void();
Expand Down
3 changes: 2 additions & 1 deletion src/librustc_target/spec/x86_64_unknown_linux_gnux32.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ pub fn target() -> TargetResult {
base.cpu = "x86-64".to_string();
base.max_atomic_width = Some(64);
base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-mx32".to_string());
base.stack_probes = true;
// BUG: temporarily workaround #59674
base.stack_probes = false;
base.has_elf_tls = false;
// BUG(GabrielMajeri): disabling the PLT on x86_64 Linux with x32 ABI
// breaks code gen. See LLVM bug 36743
Expand Down
11 changes: 9 additions & 2 deletions src/libstd/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ use crate::time::SystemTime;
/// it was opened with. Files also implement [`Seek`] to alter the logical cursor
/// that the file contains internally.
///
/// Files are automatically closed when they go out of scope.
/// Files are automatically closed when they go out of scope. Errors detected
/// on closing are ignored by the implementation of `Drop`. Use the method
/// [`sync_all`] if these errors must be manually handled.
///
/// # Examples
///
Expand Down Expand Up @@ -84,6 +86,7 @@ use crate::time::SystemTime;
/// [`Read`]: ../io/trait.Read.html
/// [`Write`]: ../io/trait.Write.html
/// [`BufReader<R>`]: ../io/struct.BufReader.html
/// [`sync_all`]: struct.File.html#method.sync_all
#[stable(feature = "rust1", since = "1.0.0")]
pub struct File {
inner: fs_imp::File,
Expand Down Expand Up @@ -391,9 +394,13 @@ impl File {

/// Attempts to sync all OS-internal metadata to disk.
///
/// This function will attempt to ensure that all in-core data reaches the
/// This function will attempt to ensure that all in-memory data reaches the
/// filesystem before returning.
///
/// This can be used to handle errors that would otherwise only be caught
/// when the `File` is closed. Dropping a file will ignore errors in
/// synchronizing this in-memory data.
///
/// # Examples
///
/// ```no_run
Expand Down
16 changes: 8 additions & 8 deletions src/libsyntax/parse/lexer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,16 @@ pub struct UnmatchedBrace {
}

pub struct StringReader<'a> {
pub sess: &'a ParseSess,
crate sess: &'a ParseSess,
/// The absolute offset within the source_map of the next character to read
pub next_pos: BytePos,
crate next_pos: BytePos,
/// The absolute offset within the source_map of the current character
pub pos: BytePos,
crate pos: BytePos,
/// The current character (which has been read from self.pos)
pub ch: Option<char>,
pub source_file: Lrc<syntax_pos::SourceFile>,
crate ch: Option<char>,
crate source_file: Lrc<syntax_pos::SourceFile>,
/// Stop reading src at this index.
pub end_src_index: usize,
crate end_src_index: usize,
// cached:
peek_tok: token::Token,
peek_span: Span,
Expand Down Expand Up @@ -126,7 +126,7 @@ impl<'a> StringReader<'a> {
}

/// Immutably extract string if found at current position with given delimiters
pub fn peek_delimited(&self, from_ch: char, to_ch: char) -> Option<String> {
fn peek_delimited(&self, from_ch: char, to_ch: char) -> Option<String> {
let mut pos = self.pos;
let mut idx = self.src_index(pos);
let mut ch = char_at(&self.src, idx);
Expand Down Expand Up @@ -191,7 +191,7 @@ impl<'a> StringReader<'a> {
self.fatal_span(self.peek_span, m)
}

pub fn emit_fatal_errors(&mut self) {
crate fn emit_fatal_errors(&mut self) {
for err in &mut self.fatal_errs {
err.emit();
}
Expand Down
2 changes: 1 addition & 1 deletion src/stdsimd
32 changes: 32 additions & 0 deletions src/test/codegen/noreturn-uninhabited.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// compile-flags: -g -C no-prepopulate-passes
// ignore-tidy-linelength

#![crate_type = "lib"]

#[derive(Clone, Copy)]
pub enum EmptyEnum {}

#[no_mangle]
pub fn empty(x: &EmptyEnum) -> EmptyEnum {
// CHECK: @empty({{.*}}) unnamed_addr #0
// CHECK-NOT: ret void
// CHECK: call void @llvm.trap()
// CHECK: unreachable
*x
}

pub struct Foo(String, EmptyEnum);

#[no_mangle]
pub fn foo(x: String, y: &EmptyEnum) -> Foo {
// CHECK: @foo({{.*}}) unnamed_addr #0
// CHECK-NOT: ret %Foo
// CHECK: call void @llvm.trap()
// CHECK: unreachable
Foo(x, *y)
}

// CHECK: attributes #0 = {{{.*}} noreturn {{.*}}}

// CHECK: DISubprogram(name: "empty", {{.*}} DIFlagNoReturn
// CHECK: DISubprogram(name: "foo", {{.*}} DIFlagNoReturn
2 changes: 1 addition & 1 deletion src/tools/miri
2 changes: 1 addition & 1 deletion src/tools/rustc-workspace-hack/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ features = [
[dependencies]
curl-sys = { version = "0.4.13", features = ["http2", "libnghttp2-sys"], optional = true }
parking_lot = { version = "0.7", features = ['nightly'] }
rand = { version = "0.5.5", features = ["i128_support"] }
rand = { version = "0.6.1", features = ["i128_support"] }
serde = { version = "1.0.82", features = ['derive'] }
serde_json = { version = "1.0.31", features = ["raw_value"] }
smallvec = { version = "0.6", features = ['union', 'may_dangle'] }
Expand Down