Skip to content

Commit 52980d0

Browse files
committed
Auto merge of #59695 - Centril:rollup-88qffc2, r=Centril
Rollup of 8 pull requests Successful merges: - #59470 (Document std::fs::File close behavior ignoring errors) - #59555 (update miri) - #59556 (update stdsimd) - #59596 (Forward formatter settings to bounds of `Range<T>` in `fmt::Debug` impl) - #59639 (Never return uninhabited values at all) - #59671 (Make some of lexer's API private) - #59685 (Add description for -Os and -Oz in rustc.1) - #59686 (Temporarily disable stack probing for gnux32.) Failed merges: r? @ghost
2 parents 2d06571 + 31c2f5d commit 52980d0

File tree

11 files changed

+80
-43
lines changed

11 files changed

+80
-43
lines changed

Cargo.lock

+1-23
Original file line numberDiff line numberDiff line change
@@ -2054,18 +2054,6 @@ dependencies = [
20542054
"winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
20552055
]
20562056

2057-
[[package]]
2058-
name = "rand"
2059-
version = "0.5.5"
2060-
source = "registry+https://github.com/rust-lang/crates.io-index"
2061-
dependencies = [
2062-
"cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
2063-
"fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
2064-
"libc 0.2.51 (registry+https://github.com/rust-lang/crates.io-index)",
2065-
"rand_core 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
2066-
"winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
2067-
]
2068-
20692057
[[package]]
20702058
name = "rand"
20712059
version = "0.6.1"
@@ -2093,14 +2081,6 @@ dependencies = [
20932081
"rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
20942082
]
20952083

2096-
[[package]]
2097-
name = "rand_core"
2098-
version = "0.2.2"
2099-
source = "registry+https://github.com/rust-lang/crates.io-index"
2100-
dependencies = [
2101-
"rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
2102-
]
2103-
21042084
[[package]]
21052085
name = "rand_core"
21062086
version = "0.3.0"
@@ -2560,7 +2540,7 @@ version = "1.0.0"
25602540
dependencies = [
25612541
"byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
25622542
"parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
2563-
"rand 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)",
2543+
"rand 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
25642544
"scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
25652545
"serde 1.0.82 (registry+https://github.com/rust-lang/crates.io-index)",
25662546
"serde_json 1.0.33 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -4206,10 +4186,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
42064186
"checksum quote 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)" = "53fa22a1994bd0f9372d7a816207d8a2677ad0325b073f5c5332760f0fb62b5c"
42074187
"checksum racer 2.1.21 (registry+https://github.com/rust-lang/crates.io-index)" = "37c88638777cc178684cf648ca0e1dad56646ce105b8593dfe665c436300adc3"
42084188
"checksum rand 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8356f47b32624fef5b3301c1be97e5944ecdd595409cc5da11d05f211db6cfbd"
4209-
"checksum rand 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)" = "e464cd887e869cddcae8792a4ee31d23c7edd516700695608f5b98c67ee0131c"
42104189
"checksum rand 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ae9d223d52ae411a33cf7e54ec6034ec165df296ccd23533d671a28252b6f66a"
42114190
"checksum rand_chacha 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "771b009e3a508cb67e8823dda454aaa5368c7bc1c16829fb77d3e980440dd34a"
4212-
"checksum rand_core 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1961a422c4d189dfb50ffa9320bf1f2a9bd54ecb92792fb9477f99a1045f3372"
42134191
"checksum rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0905b6b7079ec73b314d4c748701f6931eb79fd97c668caa3f1899b22b32c6db"
42144192
"checksum rand_hc 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7b40677c7be09ae76218dc623efbf7b18e34bced3f38883af07bb75630a21bc4"
42154193
"checksum rand_isaac 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ded997c9d5f13925be2a6fd7e66bf1872597f759fd9dd93513dd7e92e5a5ee08"

src/doc/man/rustc.1

+1-1
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ full debug info with variable and type information.
261261
.RE
262262
.TP
263263
\fBopt\-level\fR=\fIVAL\fR
264-
Optimize with possible levels 0\[en]3
264+
Optimize with possible levels 0\[en]3, s (optimize for size), or z (for minimal size)
265265

266266
.SH ENVIRONMENT
267267

src/libcore/ops/range.rs

+17-5
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,10 @@ pub struct Range<Idx> {
8585
#[stable(feature = "rust1", since = "1.0.0")]
8686
impl<Idx: fmt::Debug> fmt::Debug for Range<Idx> {
8787
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
88-
write!(fmt, "{:?}..{:?}", self.start, self.end)
88+
self.start.fmt(fmt)?;
89+
write!(fmt, "..")?;
90+
self.end.fmt(fmt)?;
91+
Ok(())
8992
}
9093
}
9194

@@ -184,7 +187,9 @@ pub struct RangeFrom<Idx> {
184187
#[stable(feature = "rust1", since = "1.0.0")]
185188
impl<Idx: fmt::Debug> fmt::Debug for RangeFrom<Idx> {
186189
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
187-
write!(fmt, "{:?}..", self.start)
190+
self.start.fmt(fmt)?;
191+
write!(fmt, "..")?;
192+
Ok(())
188193
}
189194
}
190195

@@ -266,7 +271,9 @@ pub struct RangeTo<Idx> {
266271
#[stable(feature = "rust1", since = "1.0.0")]
267272
impl<Idx: fmt::Debug> fmt::Debug for RangeTo<Idx> {
268273
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
269-
write!(fmt, "..{:?}", self.end)
274+
write!(fmt, "..")?;
275+
self.end.fmt(fmt)?;
276+
Ok(())
270277
}
271278
}
272279

@@ -467,7 +474,10 @@ impl<Idx> RangeInclusive<Idx> {
467474
#[stable(feature = "inclusive_range", since = "1.26.0")]
468475
impl<Idx: fmt::Debug> fmt::Debug for RangeInclusive<Idx> {
469476
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
470-
write!(fmt, "{:?}..={:?}", self.start, self.end)
477+
self.start.fmt(fmt)?;
478+
write!(fmt, "..=")?;
479+
self.end.fmt(fmt)?;
480+
Ok(())
471481
}
472482
}
473483

@@ -602,7 +612,9 @@ pub struct RangeToInclusive<Idx> {
602612
#[stable(feature = "inclusive_range", since = "1.26.0")]
603613
impl<Idx: fmt::Debug> fmt::Debug for RangeToInclusive<Idx> {
604614
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
605-
write!(fmt, "..={:?}", self.end)
615+
write!(fmt, "..=")?;
616+
self.end.fmt(fmt)?;
617+
Ok(())
606618
}
607619
}
608620

src/librustc_codegen_ssa/mir/block.rs

+7
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,13 @@ impl<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
238238
}
239239
}
240240
}
241+
if self.fn_ty.ret.layout.abi.is_uninhabited() {
242+
// Functions with uninhabited return values are marked `noreturn`,
243+
// so we should make sure that we never actually do.
244+
bx.abort();
245+
bx.unreachable();
246+
return;
247+
}
241248
let llval = match self.fn_ty.ret.mode {
242249
PassMode::Ignore(IgnoreMode::Zst) | PassMode::Indirect(..) => {
243250
bx.ret_void();

src/librustc_target/spec/x86_64_unknown_linux_gnux32.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ pub fn target() -> TargetResult {
55
base.cpu = "x86-64".to_string();
66
base.max_atomic_width = Some(64);
77
base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-mx32".to_string());
8-
base.stack_probes = true;
8+
// BUG: temporarily workaround #59674
9+
base.stack_probes = false;
910
base.has_elf_tls = false;
1011
// BUG(GabrielMajeri): disabling the PLT on x86_64 Linux with x32 ABI
1112
// breaks code gen. See LLVM bug 36743

src/libstd/fs.rs

+9-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ use crate::time::SystemTime;
2121
/// it was opened with. Files also implement [`Seek`] to alter the logical cursor
2222
/// that the file contains internally.
2323
///
24-
/// Files are automatically closed when they go out of scope.
24+
/// Files are automatically closed when they go out of scope. Errors detected
25+
/// on closing are ignored by the implementation of `Drop`. Use the method
26+
/// [`sync_all`] if these errors must be manually handled.
2527
///
2628
/// # Examples
2729
///
@@ -84,6 +86,7 @@ use crate::time::SystemTime;
8486
/// [`Read`]: ../io/trait.Read.html
8587
/// [`Write`]: ../io/trait.Write.html
8688
/// [`BufReader<R>`]: ../io/struct.BufReader.html
89+
/// [`sync_all`]: struct.File.html#method.sync_all
8790
#[stable(feature = "rust1", since = "1.0.0")]
8891
pub struct File {
8992
inner: fs_imp::File,
@@ -391,9 +394,13 @@ impl File {
391394

392395
/// Attempts to sync all OS-internal metadata to disk.
393396
///
394-
/// This function will attempt to ensure that all in-core data reaches the
397+
/// This function will attempt to ensure that all in-memory data reaches the
395398
/// filesystem before returning.
396399
///
400+
/// This can be used to handle errors that would otherwise only be caught
401+
/// when the `File` is closed. Dropping a file will ignore errors in
402+
/// synchronizing this in-memory data.
403+
///
397404
/// # Examples
398405
///
399406
/// ```no_run

src/libsyntax/parse/lexer/mod.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,16 @@ pub struct UnmatchedBrace {
4343
}
4444

4545
pub struct StringReader<'a> {
46-
pub sess: &'a ParseSess,
46+
crate sess: &'a ParseSess,
4747
/// The absolute offset within the source_map of the next character to read
48-
pub next_pos: BytePos,
48+
crate next_pos: BytePos,
4949
/// The absolute offset within the source_map of the current character
50-
pub pos: BytePos,
50+
crate pos: BytePos,
5151
/// The current character (which has been read from self.pos)
52-
pub ch: Option<char>,
53-
pub source_file: Lrc<syntax_pos::SourceFile>,
52+
crate ch: Option<char>,
53+
crate source_file: Lrc<syntax_pos::SourceFile>,
5454
/// Stop reading src at this index.
55-
pub end_src_index: usize,
55+
crate end_src_index: usize,
5656
// cached:
5757
peek_tok: token::Token,
5858
peek_span: Span,
@@ -126,7 +126,7 @@ impl<'a> StringReader<'a> {
126126
}
127127

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

194-
pub fn emit_fatal_errors(&mut self) {
194+
crate fn emit_fatal_errors(&mut self) {
195195
for err in &mut self.fatal_errs {
196196
err.emit();
197197
}

src/stdsimd

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// compile-flags: -g -C no-prepopulate-passes
2+
// ignore-tidy-linelength
3+
4+
#![crate_type = "lib"]
5+
6+
#[derive(Clone, Copy)]
7+
pub enum EmptyEnum {}
8+
9+
#[no_mangle]
10+
pub fn empty(x: &EmptyEnum) -> EmptyEnum {
11+
// CHECK: @empty({{.*}}) unnamed_addr #0
12+
// CHECK-NOT: ret void
13+
// CHECK: call void @llvm.trap()
14+
// CHECK: unreachable
15+
*x
16+
}
17+
18+
pub struct Foo(String, EmptyEnum);
19+
20+
#[no_mangle]
21+
pub fn foo(x: String, y: &EmptyEnum) -> Foo {
22+
// CHECK: @foo({{.*}}) unnamed_addr #0
23+
// CHECK-NOT: ret %Foo
24+
// CHECK: call void @llvm.trap()
25+
// CHECK: unreachable
26+
Foo(x, *y)
27+
}
28+
29+
// CHECK: attributes #0 = {{{.*}} noreturn {{.*}}}
30+
31+
// CHECK: DISubprogram(name: "empty", {{.*}} DIFlagNoReturn
32+
// CHECK: DISubprogram(name: "foo", {{.*}} DIFlagNoReturn

src/tools/rustc-workspace-hack/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ features = [
5757
[dependencies]
5858
curl-sys = { version = "0.4.13", features = ["http2", "libnghttp2-sys"], optional = true }
5959
parking_lot = { version = "0.7", features = ['nightly'] }
60-
rand = { version = "0.5.5", features = ["i128_support"] }
60+
rand = { version = "0.6.1", features = ["i128_support"] }
6161
serde = { version = "1.0.82", features = ['derive'] }
6262
serde_json = { version = "1.0.31", features = ["raw_value"] }
6363
smallvec = { version = "0.6", features = ['union', 'may_dangle'] }

0 commit comments

Comments
 (0)