summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2019-05-14 23:56:05 +0000
committerbors <bors@rust-lang.org>2019-05-14 23:56:05 +0000
commit2bafaaf66556ba153fddb00def6d205abb5beff2 (patch)
tree6896d5193ef80fb3017ef5f8f3a0ca6cbc32dbda
parent1486e1fb4bfa72f5a752c18ebf210de4194e04d0 (diff)
parentc503285f3193f41e88fecc6dcb4ed3cadb099e44 (diff)
downloadrust-2bafaaf66556ba153fddb00def6d205abb5beff2.tar.gz
rust-2bafaaf66556ba153fddb00def6d205abb5beff2.zip
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
-rw-r--r--RELEASES.md100
-rw-r--r--src/libcore/array.rs10
-rw-r--r--src/librustc_save_analysis/dump_visitor.rs10
-rw-r--r--src/libstd/lib.rs3
-rw-r--r--src/test/ui/save-analysis/issue-59134-0.rs12
-rw-r--r--src/test/ui/save-analysis/issue-59134-0.stderr9
-rw-r--r--src/test/ui/save-analysis/issue-59134-1.rs12
-rw-r--r--src/test/ui/save-analysis/issue-59134-1.stderr9
8 files changed, 155 insertions, 10 deletions
diff --git a/RELEASES.md b/RELEASES.md
index 48bd13105bb..4185961187b 100644
--- a/RELEASES.md
+++ b/RELEASES.md
@@ -1,10 +1,108 @@
+Version 1.35.0 (2019-05-23)
+==========================
+
+Language
+--------
+- [`FnOnce`, `FnMut`, and the `Fn` traits are now implemented for `Box<FnOnce>`,
+  `Box<FnMut>`, and `Box<Fn>` respectively.][59500]
+- [You can now coerce closures into unsafe function pointers.][59580] e.g.
+  ```rust
+  unsafe fn call_unsafe(func: unsafe fn()) {
+      func()
+  }
+
+  pub fn main() {
+      unsafe { call_unsafe(|| {}); }
+  }
+  ```
+
+
+Compiler
+--------
+- [Added the `armv6-unknown-freebsd-gnueabihf` and
+  `armv7-unknown-freebsd-gnueabihf` targets.][58080]
+- [Added the `wasm32-unknown-wasi` target.][59464]
+
+
+Libraries
+---------
+- [`Thread` will now show its ID in `Debug` output.][59460]
+- [`StdinLock`, `StdoutLock`, and `StderrLock` now implement `AsRawFd`.][59512]
+- [`alloc::System` now implements `Default`.][59451]
+- [Expanded `Debug` output (`{:#?}`) for structs now has a trailing comma on the
+  last field.][59076]
+- [`char::{ToLowercase, ToUppercase}` now
+  implement `ExactSizeIterator`.][58778]
+- [All `NonZero` numeric types now implement `FromStr`.][58717]
+- [Removed the `Read` trait bounds
+  on the `BufReader::{get_ref, get_mut, into_inner}` methods.][58423]
+- [You can now call the `dbg!` macro without any parameters to print the file
+  and line where it is called.][57847]
+- [In place ASCII case conversions are now up to 4× faster.][59283]
+  e.g. `str::make_ascii_lowercase`
+- [`hash_map::{OccupiedEntry, VacantEntry}` now implement `Sync`
+  and `Send`.][58369]
+
+Stabilized APIs
+---------------
+- [`f32::copysign`]
+- [`f64::copysign`]
+- [`RefCell::replace_with`]
+- [`RefCell::map_split`]
+- [`ptr::hash`]
+- [`Range::contains`]
+- [`RangeFrom::contains`]
+- [`RangeTo::contains`]
+- [`RangeInclusive::contains`]
+- [`RangeToInclusive::contains`]
+- [`Option::copied`]
+
+Cargo
+-----
+- [You can now set `cargo:rustc-cdylib-link-arg` at build time to pass custom
+  linker arguments when building a `cdylib`.][cargo/6298] Its usage is highly
+  platform specific.
+  
+Misc
+----
+- [The Rust toolchain is now available natively for musl based distros.][58575]
+
+[59460]: https://github.com/rust-lang/rust/pull/59460/
+[59464]: https://github.com/rust-lang/rust/pull/59464/
+[59500]: https://github.com/rust-lang/rust/pull/59500/
+[59512]: https://github.com/rust-lang/rust/pull/59512/
+[59580]: https://github.com/rust-lang/rust/pull/59580/
+[59283]: https://github.com/rust-lang/rust/pull/59283/
+[59451]: https://github.com/rust-lang/rust/pull/59451/
+[59076]: https://github.com/rust-lang/rust/pull/59076/
+[58778]: https://github.com/rust-lang/rust/pull/58778/
+[58717]: https://github.com/rust-lang/rust/pull/58717/
+[58369]: https://github.com/rust-lang/rust/pull/58369/
+[58423]: https://github.com/rust-lang/rust/pull/58423/
+[58080]: https://github.com/rust-lang/rust/pull/58080/
+[57847]: https://github.com/rust-lang/rust/pull/57847/
+[58575]: https://github.com/rust-lang/rust/pull/58575
+[cargo/6298]: https://github.com/rust-lang/cargo/pull/6298/
+[`f32::copysign`]: https://doc.rust-lang.org/stable/std/primitive.f32.html#method.copysign
+[`f64::copysign`]: https://doc.rust-lang.org/stable/std/primitive.f64.html#method.copysign
+[`RefCell::replace_with`]: https://doc.rust-lang.org/stable/std/cell/struct.RefCell.html#method.replace_with
+[`RefCell::map_split`]: https://doc.rust-lang.org/stable/std/cell/struct.RefCell.html#method.map_split
+[`ptr::hash`]: https://doc.rust-lang.org/stable/std/ptr/fn.hash.html
+[`Range::contains`]: https://doc.rust-lang.org/std/ops/struct.Range.html#method.contains
+[`RangeFrom::contains`]: https://doc.rust-lang.org/std/ops/struct.RangeFrom.html#method.contains
+[`RangeTo::contains`]: https://doc.rust-lang.org/std/ops/struct.RangeTo.html#method.contains
+[`RangeInclusive::contains`]: https://doc.rust-lang.org/std/ops/struct.RangeInclusive.html#method.contains
+[`RangeToInclusive::contains`]: https://doc.rust-lang.org/std/ops/struct.RangeToInclusive.html#method.contains
+[`Option::copied`]: https://doc.rust-lang.org/std/option/enum.Option.html#method.copied
+
 Version 1.34.2 (2019-05-14)
 ===========================
 
 * [Destabilize the `Error::type_id` function due to a security
-   vulnerability][60785]
+   vulnerability][60785] ([CVE-2019-12083])
 
 [60785]: https://github.com/rust-lang/rust/pull/60785
+[CVE-2019-12083]: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-12083
 
 Version 1.34.1 (2019-04-25)
 ===========================
diff --git a/src/libcore/array.rs b/src/libcore/array.rs
index dcd9ce6dad7..96cb2c5ade2 100644
--- a/src/libcore/array.rs
+++ b/src/libcore/array.rs
@@ -4,10 +4,7 @@
 //!
 //! *[See also the array primitive type](../../std/primitive.array.html).*
 
-#![unstable(feature = "fixed_size_array",
-            reason = "traits and impls are better expressed through generic \
-                      integer constants",
-            issue = "27778")]
+#![stable(feature = "core_array", since = "1.36.0")]
 
 use borrow::{Borrow, BorrowMut};
 use cmp::Ordering;
@@ -30,13 +27,17 @@ use slice::{Iter, IterMut};
 /// Note that the traits AsRef and AsMut provide similar methods for types that
 /// may not be fixed-size arrays. Implementors should prefer those traits
 /// instead.
+#[unstable(feature = "fixed_size_array", issue = "27778")]
 pub unsafe trait FixedSizeArray<T> {
     /// Converts the array to immutable slice
+    #[unstable(feature = "fixed_size_array", issue = "27778")]
     fn as_slice(&self) -> &[T];
     /// Converts the array to mutable slice
+    #[unstable(feature = "fixed_size_array", issue = "27778")]
     fn as_mut_slice(&mut self) -> &mut [T];
 }
 
+#[unstable(feature = "fixed_size_array", issue = "27778")]
 unsafe impl<T, A: Unsize<[T]>> FixedSizeArray<T> for A {
     #[inline]
     fn as_slice(&self) -> &[T] {
@@ -53,6 +54,7 @@ unsafe impl<T, A: Unsize<[T]>> FixedSizeArray<T> for A {
 #[derive(Debug, Copy, Clone)]
 pub struct TryFromSliceError(());
 
+#[stable(feature = "core_array", since = "1.36.0")]
 impl fmt::Display for TryFromSliceError {
     #[inline]
     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
diff --git a/src/librustc_save_analysis/dump_visitor.rs b/src/librustc_save_analysis/dump_visitor.rs
index 7d400252594..3e86eff5498 100644
--- a/src/librustc_save_analysis/dump_visitor.rs
+++ b/src/librustc_save_analysis/dump_visitor.rs
@@ -463,10 +463,12 @@ impl<'l, 'tcx: 'l, 'll, O: DumpOutput + 'll> DumpVisitor<'l, 'tcx, 'll, O> {
         }
 
         // walk type and init value
-        self.visit_ty(typ);
-        if let Some(expr) = expr {
-            self.visit_expr(expr);
-        }
+        self.nest_tables(id, |v| {
+            v.visit_ty(typ);
+            if let Some(expr) = expr {
+                v.visit_expr(expr);
+            }
+        });
     }
 
     // FIXME tuple structs should generate tuple-specific data.
diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs
index d11dee8fc97..8935245b34e 100644
--- a/src/libstd/lib.rs
+++ b/src/libstd/lib.rs
@@ -260,7 +260,6 @@
 #![feature(exact_size_is_empty)]
 #![feature(exhaustive_patterns)]
 #![feature(external_doc)]
-#![feature(fixed_size_array)]
 #![feature(fn_traits)]
 #![feature(fnbox)]
 #![feature(futures_api)]
@@ -436,6 +435,8 @@ pub use core::char;
 pub use core::u128;
 #[stable(feature = "core_hint", since = "1.27.0")]
 pub use core::hint;
+#[stable(feature = "core_array", since = "1.36.0")]
+pub use core::array;
 
 pub mod f32;
 pub mod f64;
diff --git a/src/test/ui/save-analysis/issue-59134-0.rs b/src/test/ui/save-analysis/issue-59134-0.rs
new file mode 100644
index 00000000000..3158328b3ff
--- /dev/null
+++ b/src/test/ui/save-analysis/issue-59134-0.rs
@@ -0,0 +1,12 @@
+// compile-flags: -Zsave-analysis
+
+// Check that this doesn't ICE when processing associated const (field expr).
+
+pub fn f() {
+    trait Trait {}
+    impl Trait {
+        const FLAG: u32 = bogus.field; //~ ERROR cannot find value `bogus`
+    }
+}
+
+fn main() {}
diff --git a/src/test/ui/save-analysis/issue-59134-0.stderr b/src/test/ui/save-analysis/issue-59134-0.stderr
new file mode 100644
index 00000000000..4e9b2e6fdeb
--- /dev/null
+++ b/src/test/ui/save-analysis/issue-59134-0.stderr
@@ -0,0 +1,9 @@
+error[E0425]: cannot find value `bogus` in this scope
+  --> $DIR/issue-59134-0.rs:8:27
+   |
+LL |         const FLAG: u32 = bogus.field;
+   |                           ^^^^^ not found in this scope
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0425`.
diff --git a/src/test/ui/save-analysis/issue-59134-1.rs b/src/test/ui/save-analysis/issue-59134-1.rs
new file mode 100644
index 00000000000..3cb629777a4
--- /dev/null
+++ b/src/test/ui/save-analysis/issue-59134-1.rs
@@ -0,0 +1,12 @@
+// compile-flags: -Zsave-analysis
+
+// Check that this doesn't ICE when processing associated const (type).
+
+fn func() {
+    trait Trait {
+        type MyType;
+        const CONST: Self::MyType = bogus.field; //~ ERROR cannot find value `bogus`
+    }
+}
+
+fn main() {}
diff --git a/src/test/ui/save-analysis/issue-59134-1.stderr b/src/test/ui/save-analysis/issue-59134-1.stderr
new file mode 100644
index 00000000000..bdc335eaac0
--- /dev/null
+++ b/src/test/ui/save-analysis/issue-59134-1.stderr
@@ -0,0 +1,9 @@
+error[E0425]: cannot find value `bogus` in this scope
+  --> $DIR/issue-59134-1.rs:8:37
+   |
+LL |         const CONST: Self::MyType = bogus.field;
+   |                                     ^^^^^ not found in this scope
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0425`.