Skip to content

Commit 2bafaaf

Browse files
committed
Auto merge of #60838 - pietroalbini:beta-rollup, r=pietroalbini
[beta] Rollup backports Rolled up: * #60806: [beta] save-analysis: Fix ICE when processing associated constant Cherry-picked: * #60837: Update release notes for 1.35.0 * #60657: Stabilize and re-export core::array in std r? @ghost
2 parents 1486e1f + c503285 commit 2bafaaf

File tree

8 files changed

+155
-10
lines changed

8 files changed

+155
-10
lines changed

RELEASES.md

+99-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,108 @@
1+
Version 1.35.0 (2019-05-23)
2+
==========================
3+
4+
Language
5+
--------
6+
- [`FnOnce`, `FnMut`, and the `Fn` traits are now implemented for `Box<FnOnce>`,
7+
`Box<FnMut>`, and `Box<Fn>` respectively.][59500]
8+
- [You can now coerce closures into unsafe function pointers.][59580] e.g.
9+
```rust
10+
unsafe fn call_unsafe(func: unsafe fn()) {
11+
func()
12+
}
13+
14+
pub fn main() {
15+
unsafe { call_unsafe(|| {}); }
16+
}
17+
```
18+
19+
20+
Compiler
21+
--------
22+
- [Added the `armv6-unknown-freebsd-gnueabihf` and
23+
`armv7-unknown-freebsd-gnueabihf` targets.][58080]
24+
- [Added the `wasm32-unknown-wasi` target.][59464]
25+
26+
27+
Libraries
28+
---------
29+
- [`Thread` will now show its ID in `Debug` output.][59460]
30+
- [`StdinLock`, `StdoutLock`, and `StderrLock` now implement `AsRawFd`.][59512]
31+
- [`alloc::System` now implements `Default`.][59451]
32+
- [Expanded `Debug` output (`{:#?}`) for structs now has a trailing comma on the
33+
last field.][59076]
34+
- [`char::{ToLowercase, ToUppercase}` now
35+
implement `ExactSizeIterator`.][58778]
36+
- [All `NonZero` numeric types now implement `FromStr`.][58717]
37+
- [Removed the `Read` trait bounds
38+
on the `BufReader::{get_ref, get_mut, into_inner}` methods.][58423]
39+
- [You can now call the `dbg!` macro without any parameters to print the file
40+
and line where it is called.][57847]
41+
- [In place ASCII case conversions are now up to 4× faster.][59283]
42+
e.g. `str::make_ascii_lowercase`
43+
- [`hash_map::{OccupiedEntry, VacantEntry}` now implement `Sync`
44+
and `Send`.][58369]
45+
46+
Stabilized APIs
47+
---------------
48+
- [`f32::copysign`]
49+
- [`f64::copysign`]
50+
- [`RefCell::replace_with`]
51+
- [`RefCell::map_split`]
52+
- [`ptr::hash`]
53+
- [`Range::contains`]
54+
- [`RangeFrom::contains`]
55+
- [`RangeTo::contains`]
56+
- [`RangeInclusive::contains`]
57+
- [`RangeToInclusive::contains`]
58+
- [`Option::copied`]
59+
60+
Cargo
61+
-----
62+
- [You can now set `cargo:rustc-cdylib-link-arg` at build time to pass custom
63+
linker arguments when building a `cdylib`.][cargo/6298] Its usage is highly
64+
platform specific.
65+
66+
Misc
67+
----
68+
- [The Rust toolchain is now available natively for musl based distros.][58575]
69+
70+
[59460]: https://github.com/rust-lang/rust/pull/59460/
71+
[59464]: https://github.com/rust-lang/rust/pull/59464/
72+
[59500]: https://github.com/rust-lang/rust/pull/59500/
73+
[59512]: https://github.com/rust-lang/rust/pull/59512/
74+
[59580]: https://github.com/rust-lang/rust/pull/59580/
75+
[59283]: https://github.com/rust-lang/rust/pull/59283/
76+
[59451]: https://github.com/rust-lang/rust/pull/59451/
77+
[59076]: https://github.com/rust-lang/rust/pull/59076/
78+
[58778]: https://github.com/rust-lang/rust/pull/58778/
79+
[58717]: https://github.com/rust-lang/rust/pull/58717/
80+
[58369]: https://github.com/rust-lang/rust/pull/58369/
81+
[58423]: https://github.com/rust-lang/rust/pull/58423/
82+
[58080]: https://github.com/rust-lang/rust/pull/58080/
83+
[57847]: https://github.com/rust-lang/rust/pull/57847/
84+
[58575]: https://github.com/rust-lang/rust/pull/58575
85+
[cargo/6298]: https://github.com/rust-lang/cargo/pull/6298/
86+
[`f32::copysign`]: https://doc.rust-lang.org/stable/std/primitive.f32.html#method.copysign
87+
[`f64::copysign`]: https://doc.rust-lang.org/stable/std/primitive.f64.html#method.copysign
88+
[`RefCell::replace_with`]: https://doc.rust-lang.org/stable/std/cell/struct.RefCell.html#method.replace_with
89+
[`RefCell::map_split`]: https://doc.rust-lang.org/stable/std/cell/struct.RefCell.html#method.map_split
90+
[`ptr::hash`]: https://doc.rust-lang.org/stable/std/ptr/fn.hash.html
91+
[`Range::contains`]: https://doc.rust-lang.org/std/ops/struct.Range.html#method.contains
92+
[`RangeFrom::contains`]: https://doc.rust-lang.org/std/ops/struct.RangeFrom.html#method.contains
93+
[`RangeTo::contains`]: https://doc.rust-lang.org/std/ops/struct.RangeTo.html#method.contains
94+
[`RangeInclusive::contains`]: https://doc.rust-lang.org/std/ops/struct.RangeInclusive.html#method.contains
95+
[`RangeToInclusive::contains`]: https://doc.rust-lang.org/std/ops/struct.RangeToInclusive.html#method.contains
96+
[`Option::copied`]: https://doc.rust-lang.org/std/option/enum.Option.html#method.copied
97+
198
Version 1.34.2 (2019-05-14)
299
===========================
3100

4101
* [Destabilize the `Error::type_id` function due to a security
5-
vulnerability][60785]
102+
vulnerability][60785] ([CVE-2019-12083])
6103

7104
[60785]: https://github.com/rust-lang/rust/pull/60785
105+
[CVE-2019-12083]: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-12083
8106

9107
Version 1.34.1 (2019-04-25)
10108
===========================

src/libcore/array.rs

+6-4
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,7 @@
44
//!
55
//! *[See also the array primitive type](../../std/primitive.array.html).*
66
7-
#![unstable(feature = "fixed_size_array",
8-
reason = "traits and impls are better expressed through generic \
9-
integer constants",
10-
issue = "27778")]
7+
#![stable(feature = "core_array", since = "1.36.0")]
118

129
use borrow::{Borrow, BorrowMut};
1310
use cmp::Ordering;
@@ -30,13 +27,17 @@ use slice::{Iter, IterMut};
3027
/// Note that the traits AsRef and AsMut provide similar methods for types that
3128
/// may not be fixed-size arrays. Implementors should prefer those traits
3229
/// instead.
30+
#[unstable(feature = "fixed_size_array", issue = "27778")]
3331
pub unsafe trait FixedSizeArray<T> {
3432
/// Converts the array to immutable slice
33+
#[unstable(feature = "fixed_size_array", issue = "27778")]
3534
fn as_slice(&self) -> &[T];
3635
/// Converts the array to mutable slice
36+
#[unstable(feature = "fixed_size_array", issue = "27778")]
3737
fn as_mut_slice(&mut self) -> &mut [T];
3838
}
3939

40+
#[unstable(feature = "fixed_size_array", issue = "27778")]
4041
unsafe impl<T, A: Unsize<[T]>> FixedSizeArray<T> for A {
4142
#[inline]
4243
fn as_slice(&self) -> &[T] {
@@ -53,6 +54,7 @@ unsafe impl<T, A: Unsize<[T]>> FixedSizeArray<T> for A {
5354
#[derive(Debug, Copy, Clone)]
5455
pub struct TryFromSliceError(());
5556

57+
#[stable(feature = "core_array", since = "1.36.0")]
5658
impl fmt::Display for TryFromSliceError {
5759
#[inline]
5860
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {

src/librustc_save_analysis/dump_visitor.rs

+6-4
Original file line numberDiff line numberDiff line change
@@ -463,10 +463,12 @@ impl<'l, 'tcx: 'l, 'll, O: DumpOutput + 'll> DumpVisitor<'l, 'tcx, 'll, O> {
463463
}
464464

465465
// walk type and init value
466-
self.visit_ty(typ);
467-
if let Some(expr) = expr {
468-
self.visit_expr(expr);
469-
}
466+
self.nest_tables(id, |v| {
467+
v.visit_ty(typ);
468+
if let Some(expr) = expr {
469+
v.visit_expr(expr);
470+
}
471+
});
470472
}
471473

472474
// FIXME tuple structs should generate tuple-specific data.

src/libstd/lib.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,6 @@
260260
#![feature(exact_size_is_empty)]
261261
#![feature(exhaustive_patterns)]
262262
#![feature(external_doc)]
263-
#![feature(fixed_size_array)]
264263
#![feature(fn_traits)]
265264
#![feature(fnbox)]
266265
#![feature(futures_api)]
@@ -436,6 +435,8 @@ pub use core::char;
436435
pub use core::u128;
437436
#[stable(feature = "core_hint", since = "1.27.0")]
438437
pub use core::hint;
438+
#[stable(feature = "core_array", since = "1.36.0")]
439+
pub use core::array;
439440

440441
pub mod f32;
441442
pub mod f64;
+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// compile-flags: -Zsave-analysis
2+
3+
// Check that this doesn't ICE when processing associated const (field expr).
4+
5+
pub fn f() {
6+
trait Trait {}
7+
impl Trait {
8+
const FLAG: u32 = bogus.field; //~ ERROR cannot find value `bogus`
9+
}
10+
}
11+
12+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
error[E0425]: cannot find value `bogus` in this scope
2+
--> $DIR/issue-59134-0.rs:8:27
3+
|
4+
LL | const FLAG: u32 = bogus.field;
5+
| ^^^^^ not found in this scope
6+
7+
error: aborting due to previous error
8+
9+
For more information about this error, try `rustc --explain E0425`.
+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// compile-flags: -Zsave-analysis
2+
3+
// Check that this doesn't ICE when processing associated const (type).
4+
5+
fn func() {
6+
trait Trait {
7+
type MyType;
8+
const CONST: Self::MyType = bogus.field; //~ ERROR cannot find value `bogus`
9+
}
10+
}
11+
12+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
error[E0425]: cannot find value `bogus` in this scope
2+
--> $DIR/issue-59134-1.rs:8:37
3+
|
4+
LL | const CONST: Self::MyType = bogus.field;
5+
| ^^^^^ not found in this scope
6+
7+
error: aborting due to previous error
8+
9+
For more information about this error, try `rustc --explain E0425`.

0 commit comments

Comments
 (0)