Skip to content

Commit 90ed0a8

Browse files
committed
Auto merge of rust-lang#77577 - Mark-Simulacrum:stable-next, r=pietroalbini
[stable] 1.47 release This PR includes backports of: * Fix miscompile in SimplifyBranchSame rust-lang#77549 * Force posix-style quoting on lld, independent of host platform rust-lang#77543 Note that both are still beta-nominated/beta-accepted, as they need to be backported to 1.48 as well (future beta branch).
2 parents d6646f6 + 274413c commit 90ed0a8

File tree

5 files changed

+170
-4
lines changed

5 files changed

+170
-4
lines changed

RELEASES.md

+140-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,141 @@
1+
Version 1.47.0 (2020-10-08)
2+
==========================
3+
4+
Language
5+
--------
6+
- [Closures will now warn when not used.][74869]
7+
8+
Compiler
9+
--------
10+
- [Stabilized the `-C control-flow-guard` codegen option][73893], which enables
11+
[Control Flow Guard][1.47.0-cfg] for Windows platforms, and is ignored on other
12+
platforms.
13+
- [Upgraded to LLVM 11.][73526]
14+
- [Added tier 3\* support for the `thumbv4t-none-eabi` target.][74419]
15+
- [Upgrade the FreeBSD toolchain to version 11.4][75204]
16+
- [`RUST_BACKTRACE`'s output is now more compact.][75048]
17+
18+
\* Refer to Rust's [platform support page][forge-platform-support] for more
19+
information on Rust's tiered platform support.
20+
21+
Libraries
22+
---------
23+
- [`CStr` now implements `Index<RangeFrom<usize>>`.][74021]
24+
- [Traits in `std`/`core` are now implemented for arrays of any length, not just
25+
those of length less than 33.][74060]
26+
- [`ops::RangeFull` and `ops::Range` now implement Default.][73197]
27+
- [`panic::Location` now implements `Copy`, `Clone`, `Eq`, `Hash`, `Ord`,
28+
`PartialEq`, and `PartialOrd`.][73583]
29+
30+
Stabilized APIs
31+
---------------
32+
- [`Ident::new_raw`]
33+
- [`Range::is_empty`]
34+
- [`RangeInclusive::is_empty`]
35+
- [`Result::as_deref`]
36+
- [`Result::as_deref_mut`]
37+
- [`Vec::leak`]
38+
- [`pointer::offset_from`]
39+
- [`f32::TAU`]
40+
- [`f64::TAU`]
41+
42+
The following previously stable APIs have now been made const.
43+
44+
- [The `new` method for all `NonZero` integers.][73858]
45+
- [The `checked_add`,`checked_sub`,`checked_mul`,`checked_neg`, `checked_shl`,
46+
`checked_shr`, `saturating_add`, `saturating_sub`, and `saturating_mul`
47+
methods for all integers.][73858]
48+
- [The `checked_abs`, `saturating_abs`, `saturating_neg`, and `signum` for all
49+
signed integers.][73858]
50+
- [The `is_ascii_alphabetic`, `is_ascii_uppercase`, `is_ascii_lowercase`,
51+
`is_ascii_alphanumeric`, `is_ascii_digit`, `is_ascii_hexdigit`,
52+
`is_ascii_punctuation`, `is_ascii_graphic`, `is_ascii_whitespace`, and
53+
`is_ascii_control` methods for `char` and `u8`.][73858]
54+
55+
Cargo
56+
-----
57+
- [`build-dependencies` are now built with opt-level 0 by default.][cargo/8500]
58+
You can override this by setting the following in your `Cargo.toml`.
59+
```toml
60+
[profile.release.build-override]
61+
opt-level = 3
62+
```
63+
- [`cargo-help` will now display man pages for commands rather just the
64+
`--help` text.][cargo/8456]
65+
- [`cargo-metadata` now emits a `test` field indicating if a target has
66+
tests enabled.][cargo/8478]
67+
- [`workspace.default-members` now respects `workspace.exclude`.][cargo/8485]
68+
- [`cargo-publish` will now use an alternative registry by default if it's the
69+
only registry specified in `package.publish`.][cargo/8571]
70+
71+
Misc
72+
----
73+
- [Added a help button beside Rustdoc's searchbar that explains rustdoc's
74+
type based search.][75366]
75+
- [Added the Ayu theme to rustdoc.][71237]
76+
77+
Compatibility Notes
78+
-------------------
79+
- [Bumped the minimum supported Emscripten version to 1.39.20.][75716]
80+
- [Fixed a regression parsing `{} && false` in tail expressions.][74650]
81+
- [Added changes to how proc-macros are expanded in `macro_rules!` that should
82+
help to preserve more span information.][73084] These changes may cause
83+
compiliation errors if your macro was unhygenic or didn't correctly handle
84+
`Delimiter::None`.
85+
- [Moved support for the CloudABI target to tier 3.][75568]
86+
- [`linux-gnu` targets now require minimum kernel 2.6.32 and glibc 2.11.][74163]
87+
- [We have reports of some proc macros encountering as yet undiagnosed problems in linked C++
88+
code, but the root cause is as yet undiagnosed.][76980]
89+
90+
Internal Only
91+
--------
92+
- [Improved default settings for bootstrapping in `x.py`.][73964] You can read details about this change in the ["Changes to `x.py` defaults"](https://blog.rust-lang.org/inside-rust/2020/08/30/changes-to-x-py-defaults.html) post on the Inside Rust blog.
93+
- [Added the `rustc-docs` component.][75560] This allows you to install
94+
and read the documentation for the compiler internal APIs. (Currently only
95+
available for `x86_64-unknown-linux-gnu`.)
96+
97+
[1.47.0-cfg]: https://docs.microsoft.com/en-us/windows/win32/secbp/control-flow-guard
98+
[76980]: https://github.com/rust-lang/rust/issues/76980
99+
[75048]: https://github.com/rust-lang/rust/pull/75048/
100+
[74163]: https://github.com/rust-lang/rust/pull/74163/
101+
[71237]: https://github.com/rust-lang/rust/pull/71237/
102+
[74869]: https://github.com/rust-lang/rust/pull/74869/
103+
[73858]: https://github.com/rust-lang/rust/pull/73858/
104+
[75716]: https://github.com/rust-lang/rust/pull/75716/
105+
[75908]: https://github.com/rust-lang/rust/pull/75908/
106+
[75516]: https://github.com/rust-lang/rust/pull/75516/
107+
[75560]: https://github.com/rust-lang/rust/pull/75560/
108+
[75568]: https://github.com/rust-lang/rust/pull/75568/
109+
[75366]: https://github.com/rust-lang/rust/pull/75366/
110+
[75204]: https://github.com/rust-lang/rust/pull/75204/
111+
[74650]: https://github.com/rust-lang/rust/pull/74650/
112+
[74419]: https://github.com/rust-lang/rust/pull/74419/
113+
[73964]: https://github.com/rust-lang/rust/pull/73964/
114+
[74021]: https://github.com/rust-lang/rust/pull/74021/
115+
[74060]: https://github.com/rust-lang/rust/pull/74060/
116+
[73893]: https://github.com/rust-lang/rust/pull/73893/
117+
[73526]: https://github.com/rust-lang/rust/pull/73526/
118+
[73583]: https://github.com/rust-lang/rust/pull/73583/
119+
[73084]: https://github.com/rust-lang/rust/pull/73084/
120+
[73197]: https://github.com/rust-lang/rust/pull/73197/
121+
[72488]: https://github.com/rust-lang/rust/pull/72488/
122+
[cargo/8456]: https://github.com/rust-lang/cargo/pull/8456/
123+
[cargo/8478]: https://github.com/rust-lang/cargo/pull/8478/
124+
[cargo/8485]: https://github.com/rust-lang/cargo/pull/8485/
125+
[cargo/8500]: https://github.com/rust-lang/cargo/pull/8500/
126+
[cargo/8571]: https://github.com/rust-lang/cargo/pull/8571/
127+
[`Ident::new_raw`]: https://doc.rust-lang.org/nightly/proc_macro/struct.Ident.html#method.new_raw
128+
[`Range::is_empty`]: https://doc.rust-lang.org/nightly/std/ops/struct.Range.html#method.is_empty
129+
[`RangeInclusive::is_empty`]: https://doc.rust-lang.org/nightly/std/ops/struct.RangeInclusive.html#method.is_empty
130+
[`Result::as_deref_mut`]: https://doc.rust-lang.org/nightly/std/result/enum.Result.html#method.as_deref_mut
131+
[`Result::as_deref`]: https://doc.rust-lang.org/nightly/std/result/enum.Result.html#method.as_deref
132+
[`TypeId::of`]: https://doc.rust-lang.org/nightly/std/any/struct.TypeId.html#method.of
133+
[`Vec::leak`]: https://doc.rust-lang.org/nightly/std/vec/struct.Vec.html#method.leak
134+
[`f32::TAU`]: https://doc.rust-lang.org/nightly/std/f32/consts/constant.TAU.html
135+
[`f64::TAU`]: https://doc.rust-lang.org/nightly/std/f64/consts/constant.TAU.html
136+
[`pointer::offset_from`]: https://doc.rust-lang.org/nightly/std/primitive.pointer.html#method.offset_from
137+
138+
1139
Version 1.46.0 (2020-08-27)
2140
==========================
3141

@@ -10,7 +148,7 @@ Language
10148
function's caller's location information for panic messages.][72445]
11149
- [Recursively indexing into tuples no longer needs parentheses.][71322] E.g.
12150
`x.0.0` over `(x.0).0`.
13-
- [`mem::transmute` can now be used in static and constants.][72920] **Note**
151+
- [`mem::transmute` can now be used in statics and constants.][72920] **Note**
14152
You currently can't use `mem::transmute` in constant functions.
15153

16154
Compiler
@@ -51,7 +189,7 @@ Compatibility Notes
51189
-------------------
52190
- [The target configuration option `abi_blacklist` has been renamed
53191
to `unsupported_abis`.][74150] The old name will still continue to work.
54-
- [Rustc will now warn if you have a C-like enum that implements `Drop`.][72331]
192+
- [Rustc will now warn if you cast a C-like enum that implements `Drop`.][72331]
55193
This was previously accepted but will become a hard error in a future release.
56194
- [Rustc will fail to compile if you have a struct with
57195
`#[repr(i128)]` or `#[repr(u128)]`.][74109] This representation is currently only

src/ci/run.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ fi
6363
#
6464
# FIXME: need a scheme for changing this `nightly` value to `beta` and `stable`
6565
# either automatically or manually.
66-
export RUST_RELEASE_CHANNEL=beta
66+
export RUST_RELEASE_CHANNEL=stable
6767

6868
# Always set the release channel for bootstrap; this is normally not important (i.e., only dist
6969
# builds would seem to matter) but in practice bootstrap wants to know whether we're targeting

src/librustc_codegen_ssa/back/command.rs

+6
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,12 @@ impl Command {
111111
LldFlavor::Link => "link",
112112
LldFlavor::Ld64 => "darwin",
113113
});
114+
if let LldFlavor::Wasm = flavor {
115+
// LLVM expects host-specific formatting for @file
116+
// arguments, but we always generate posix formatted files
117+
// at this time. Indicate as such.
118+
c.arg("--rsp-quoting=posix");
119+
}
114120
c
115121
}
116122
};

src/librustc_mir/transform/simplify_try.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,8 @@ impl<'a, 'tcx> SimplifyBranchSameOptimizationFinder<'a, 'tcx> {
613613
// All successor basic blocks must be equal or contain statements that are pairwise considered equal.
614614
for ((bb_l_idx,bb_l), (bb_r_idx,bb_r)) in iter_bbs_reachable.tuple_windows() {
615615
let trivial_checks = bb_l.is_cleanup == bb_r.is_cleanup
616-
&& bb_l.terminator().kind == bb_r.terminator().kind;
616+
&& bb_l.terminator().kind == bb_r.terminator().kind
617+
&& bb_l.statements.len() == bb_r.statements.len();
617618
let statement_check = || {
618619
bb_l.statements.iter().zip(&bb_r.statements).try_fold(StatementEquality::TrivialEqual, |acc,(l,r)| {
619620
let stmt_equality = self.statement_equality(*adt_matched_on, &l, bb_l_idx, &r, bb_r_idx, self.tcx.sess.opts.debugging_opts.mir_opt_level);
+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// Regression test for SimplifyBranchSame miscompilation.
2+
// run-pass
3+
4+
macro_rules! m {
5+
($a:expr, $b:expr, $c:block) => {
6+
match $a {
7+
Lto::Fat | Lto::Thin => { $b; (); $c }
8+
Lto::No => { $b; () }
9+
}
10+
}
11+
}
12+
13+
pub enum Lto { No, Thin, Fat }
14+
15+
fn f(mut cookie: u32, lto: Lto) -> u32 {
16+
let mut _a = false;
17+
m!(lto, _a = true, {cookie = 0});
18+
cookie
19+
}
20+
21+
fn main() { assert_eq!(f(42, Lto::Thin), 0) }

0 commit comments

Comments
 (0)