Skip to content

Commit 0baa114

Browse files
committed
Auto merge of #53694 - pietroalbini:beta-backports, r=pietroalbini
[beta] Rollup backports Merged and approved: * #53030: Updated RELEASES.md for 1.29.0 * #53594: Update RELEASES.md to include clippy-preview * #53045: Fix NLL migration mode so that reports region errors when necessary. * #53163: Remove an overly pedantic and wrong assertion r? @ghost
2 parents d600a94 + d1006d8 commit 0baa114

File tree

8 files changed

+149
-11
lines changed

8 files changed

+149
-11
lines changed

RELEASES.md

+78
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,81 @@
1+
Version 1.29.0 (2018-09-13)
2+
==========================
3+
4+
Compiler
5+
--------
6+
- [Bumped minimum LLVM version to 5.0.][51899]
7+
- [Added `powerpc64le-unknown-linux-musl` target.][51619]
8+
- [Added `aarch64-unknown-hermit` and `x86_64-unknown-hermit` targets.][52861]
9+
10+
Libraries
11+
---------
12+
- [`Once::call_once` now no longer requires `Once` to be `'static`.][52239]
13+
- [`BuildHasherDefault` now implements `PartialEq` and `Eq`.][52402]
14+
- [`Box<CStr>`, `Box<OsStr>`, and `Box<Path>` now implement `Clone`.][51912]
15+
- [Implemented `PartialEq<&str>` for `OsString` and `PartialEq<OsString>`
16+
for `&str`.][51178]
17+
- [`Cell<T>` now allows `T` to be unsized.][50494]
18+
- [`SocketAddr` is now stable on Redox.][52656]
19+
20+
Stabilized APIs
21+
---------------
22+
- [`Arc::downcast`]
23+
- [`Iterator::flatten`]
24+
- [`Rc::downcast`]
25+
26+
Cargo
27+
-----
28+
- [Cargo can silently fix some bad lockfiles ][cargo/5831] You can use
29+
`--locked` to disable this behaviour.
30+
- [`cargo-install` will now allow you to cross compile an install
31+
using `--target`][cargo/5614]
32+
- [Added the `cargo-fix` subcommand to automatically move project code from
33+
2015 edition to 2018.][cargo/5723]
34+
35+
Misc
36+
----
37+
- [`rustdoc` now has the `--cap-lints` option which demotes all lints above
38+
the specified level to that level.][52354] For example `--cap-lints warn`
39+
will demote `deny` and `forbid` lints to `warn`.
40+
- [`rustc` and `rustdoc` will now have the exit code of `1` if compilation
41+
fails, and `101` if there is a panic.][52197]
42+
- [A preview of clippy has been made available through rustup.][51122]
43+
You can install the preview with `rustup component add clippy-preview`
44+
45+
Compatibility Notes
46+
-------------------
47+
- [`str::{slice_unchecked, slice_unchecked_mut}` are now deprecated.][51807]
48+
Use `str::get_unchecked(begin..end)` instead.
49+
- [`std::env::home_dir` is now deprecated for its unintuitive behaviour.][51656]
50+
Consider using the `home_dir` function from
51+
https://crates.io/crates/dirs instead.
52+
- [`rustc` will no longer silently ignore invalid data in target spec.][52330]
53+
54+
[52861]: https://github.com/rust-lang/rust/pull/52861/
55+
[52656]: https://github.com/rust-lang/rust/pull/52656/
56+
[52239]: https://github.com/rust-lang/rust/pull/52239/
57+
[52330]: https://github.com/rust-lang/rust/pull/52330/
58+
[52354]: https://github.com/rust-lang/rust/pull/52354/
59+
[52402]: https://github.com/rust-lang/rust/pull/52402/
60+
[52103]: https://github.com/rust-lang/rust/pull/52103/
61+
[52197]: https://github.com/rust-lang/rust/pull/52197/
62+
[51807]: https://github.com/rust-lang/rust/pull/51807/
63+
[51899]: https://github.com/rust-lang/rust/pull/51899/
64+
[51912]: https://github.com/rust-lang/rust/pull/51912/
65+
[51511]: https://github.com/rust-lang/rust/pull/51511/
66+
[51619]: https://github.com/rust-lang/rust/pull/51619/
67+
[51656]: https://github.com/rust-lang/rust/pull/51656/
68+
[51178]: https://github.com/rust-lang/rust/pull/51178/
69+
[51122]: https://github.com/rust-lang/rust/pull/51122
70+
[50494]: https://github.com/rust-lang/rust/pull/50494/
71+
[cargo/5614]: https://github.com/rust-lang/cargo/pull/5614/
72+
[cargo/5723]: https://github.com/rust-lang/cargo/pull/5723/
73+
[cargo/5831]: https://github.com/rust-lang/cargo/pull/5831/
74+
[`Arc::downcast`]: https://doc.rust-lang.org/std/sync/struct.Arc.html#method.downcast
75+
[`Iterator::flatten`]: https://doc.rust-lang.org/std/iter/trait.Iterator.html#method.flatten
76+
[`Rc::downcast`]: https://doc.rust-lang.org/std/rc/struct.Rc.html#method.downcast
77+
78+
179
Version 1.28.0 (2018-08-02)
280
===========================
381

src/librustc/infer/error_reporting/mod.rs

+8-1
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,14 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
303303
) {
304304
debug!("report_region_errors(): {} errors to start", errors.len());
305305

306-
if will_later_be_reported_by_nll && self.tcx.use_mir_borrowck() {
306+
if will_later_be_reported_by_nll &&
307+
// FIXME: `use_mir_borrowck` seems wrong here...
308+
self.tcx.use_mir_borrowck() &&
309+
// ... this is a band-aid; may be better to explicitly
310+
// match on every borrowck_mode variant to guide decision
311+
// here.
312+
!self.tcx.migrate_borrowck() {
313+
307314
// With `#![feature(nll)]`, we want to present a nice user
308315
// experience, so don't even mention the errors from the
309316
// AST checker.

src/librustc_mir/transform/const_prop.rs

-5
Original file line numberDiff line numberDiff line change
@@ -333,11 +333,6 @@ impl<'b, 'a, 'tcx:'b> ConstPropagator<'b, 'a, 'tcx> {
333333
) -> Option<Const<'tcx>> {
334334
let span = source_info.span;
335335
match *rvalue {
336-
// This branch exists for the sanity type check
337-
Rvalue::Use(Operand::Constant(ref c)) => {
338-
assert_eq!(c.ty, place_layout.ty);
339-
self.eval_constant(c, source_info)
340-
},
341336
Rvalue::Use(ref op) => {
342337
self.eval_operand(op, source_info)
343338
},

src/test/ui/borrowck/issue-45983.stderr renamed to src/test/ui/borrowck/issue-45983.ast.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: borrowed data cannot be stored outside of its closure
2-
--> $DIR/issue-45983.rs:17:27
2+
--> $DIR/issue-45983.rs:36:27
33
|
44
LL | let x = None;
55
| - borrowed data cannot be stored into here...
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
error: borrowed data cannot be stored outside of its closure
2+
--> $DIR/issue-45983.rs:36:27
3+
|
4+
LL | let x = None;
5+
| - borrowed data cannot be stored into here...
6+
LL | give_any(|y| x = Some(y));
7+
| --- ^ cannot be stored outside of its closure
8+
| |
9+
| ...because it cannot outlive this closure
10+
11+
error: aborting due to previous error
12+

src/test/ui/borrowck/issue-45983.nll.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
warning: not reporting region error due to nll
2-
--> $DIR/issue-45983.rs:17:27
2+
--> $DIR/issue-45983.rs:36:27
33
|
44
LL | give_any(|y| x = Some(y));
55
| ^
66

77
error: borrowed data escapes outside of closure
8-
--> $DIR/issue-45983.rs:17:18
8+
--> $DIR/issue-45983.rs:36:18
99
|
1010
LL | let x = None;
1111
| - `x` is declared here, outside of the closure body
@@ -15,7 +15,7 @@ LL | give_any(|y| x = Some(y));
1515
| `y` is a reference that is only valid in the closure body
1616

1717
error[E0594]: cannot assign to `x`, as it is not declared as mutable
18-
--> $DIR/issue-45983.rs:17:18
18+
--> $DIR/issue-45983.rs:36:18
1919
|
2020
LL | let x = None;
2121
| - help: consider changing this to be mutable: `mut x`

src/test/ui/borrowck/issue-45983.rs

+24-1
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,35 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
// As documented in Issue #45983, this test is evaluating the quality
12+
// of our diagnostics on erroneous code using higher-ranked closures.
13+
//
14+
// However, as documented on Issue #53026, this test also became a
15+
// prime example of our need to test the NLL migration mode
16+
// *separately* from the existing test suites that focus solely on
17+
// AST-borrwock and NLL.
18+
19+
// revisions: ast migrate nll
20+
21+
// Since we are testing nll (and migration) explicitly as a separate
22+
// revisions, dont worry about the --compare-mode=nll on this test.
23+
24+
// ignore-compare-mode-nll
25+
26+
//[ast]compile-flags: -Z borrowck=ast
27+
//[migrate]compile-flags: -Z borrowck=migrate -Z two-phase-borrows
28+
//[nll]compile-flags: -Z borrowck=mir -Z two-phase-borrows
29+
1130
fn give_any<F: for<'r> FnOnce(&'r ())>(f: F) {
1231
f(&());
1332
}
1433

1534
fn main() {
1635
let x = None;
1736
give_any(|y| x = Some(y));
18-
//~^ ERROR borrowed data cannot be stored outside of its closure
37+
//[ast]~^ ERROR borrowed data cannot be stored outside of its closure
38+
//[migrate]~^^ ERROR borrowed data cannot be stored outside of its closure
39+
//[nll]~^^^ WARN not reporting region error due to nll
40+
//[nll]~| ERROR borrowed data escapes outside of closure
41+
//[nll]~| ERROR cannot assign to `x`, as it is not declared as mutable
1942
}

src/test/ui/const-eval/issue-53157.rs

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// Copyright 2018 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-pass
12+
13+
macro_rules! m {
14+
() => {{
15+
fn f(_: impl Sized) {}
16+
f
17+
}}
18+
}
19+
20+
fn main() {
21+
fn f() -> impl Sized {};
22+
m!()(f());
23+
}

0 commit comments

Comments
 (0)