Commit graph

65 commits

Author SHA1 Message Date
he
1db65f6d52 Bump bootstrap for armv7/NetBSD to 1.33.0 (still not successfully tested). 2019-03-04 15:37:54 +00:00
he
bda9ee68ea Bump bootstrap version for NetBSD/powerpc to 1.33.0. 2019-03-04 09:55:34 +00:00
he
6a844c7f82 Bump NetBSD/sparc64 bootstrap kit to (cross-built) 1.33.0. 2019-03-04 07:48:20 +00:00
he
f5fa63357c Bump bootstrap kit for NetBSD/aarch64 to 1.33.0, for NetBSD/aarch64 8.99.34. 2019-03-03 22:23:52 +00:00
he
a6860523f3 Bump NetBSD/i386 bootstrap kit to 1.33.0, natively built on 8.0. 2019-03-03 15:56:02 +00:00
he
ab6520cad4 Hmm, overlooked generating distinfo for patches. 2019-03-03 09:50:46 +00:00
he
b45f71963b Update rust to version 1.33.0.
Pkgsrc changes:
 * Bump required rust version to build to 1.32.0.
 * Adapt patches to changed file locations.
 * Since we now patch some more vendor/ modules, doctor the corresponding
   .cargo-checksum.json files accordingly

Upstream changes:

Version 1.33.0 (2019-02-28)
==========================

Language
--------
- [You can now use the `cfg(target_vendor)` attribute.][57465] E.g.
  `#[cfg(target_vendor="apple")] fn main() { println!("Hello Apple!"); }`
- [Integer patterns such as in a match expression can now be exhaustive.][56362]
  E.g. You can have match statement on a `u8` that covers `0..=255` and
  you would no longer be required to have a `_ => unreachable!()` case.
- [You can now have multiple patterns in `if let` and `while let`
  expressions.][57532] You can do this with the same syntax as a `match`
  expression. E.g.
  ```rust
  enum Creature {
      Crab(String),
      Lobster(String),
      Person(String),
  }

  fn main() {
      let state = Creature::Crab("Ferris");

      if let Creature::Crab(name) | Creature::Person(name) = state {
          println!("This creature's name is: {}", name);
      }
  }
  ```
- [You can now have irrefutable `if let` and `while let` patterns.][57535]
  Using this feature will by default produce a warning as this behaviour
  can be unintuitive. E.g. `if let _ = 5 {}`
- [You can now use `let` bindings, assignments, expression statements,
  and irrefutable pattern destructuring in const functions.][57175]
- [You can now call unsafe const functions.][57067] E.g.
  ```rust
  const unsafe fn foo() -> i32 { 5 }
  const fn bar() -> i32 {
      unsafe { foo() }
  }
  ```
- [You can now specify multiple attributes in a `cfg_attr` attribute.][57332]
  E.g. `#[cfg_attr(all(), must_use, optimize)]`
- [You can now specify a specific alignment with the `#[repr(packed)]`
  attribute.][57049] E.g. `#[repr(packed(2))] struct Foo(i16, i32);` is a
  struct with an alignment of 2 bytes and a size of 6 bytes.
- [You can now import an item from a module as an `_`.][56303] This allows you
  to import a trait's impls, and not have the name in the namespace. E.g.
  ```rust
  use std::io::Read as _;

  // Allowed as there is only one `Read` in the module.
  pub trait Read {}
  ```
- [You may now use `Rc`, `Arc`, and `Pin` as method receivers][56805].

Compiler
--------
- [You can now set a linker flavor for `rustc` with the `-Clinker-flavor`
  command line argument.][56351]
- [The mininum required LLVM version has been bumped to 6.0.][56642]
- [Added support for the PowerPC64 architecture on FreeBSD.][57615]
- [The `x86_64-fortanix-unknown-sgx` target support has been upgraded to
  tier 2 support.][57130] Visit the [platform support][platform-support]
  page for information on Rust's platform support.
- [Added support for the `thumbv7neon-linux-androideabi` and
  `thumbv7neon-unknown-linux-gnueabihf` targets.][56947]
- [Added support for the `x86_64-unknown-uefi` target.][56769]

Libraries
---------
- [The methods `overflowing_{add, sub, mul, shl, shr}` are now `const`
  functions for all numeric types.][57566]
- [The methods `rotate_left`, `rotate_right`, and `wrapping_{add, sub, mul,
  shl, shr}`
  are now `const` functions for all numeric types.][57105]
- [The methods `is_positive` and `is_negative` are now `const` functions for
  all signed numeric types.][57105]
- [The `get` method for all `NonZero` types is now `const`.][57167]
- [The methods `count_ones`, `count_zeros`, `leading_zeros`, `trailing_zeros`,
  `swap_bytes`, `from_be`, `from_le`, `to_be`, `to_le` are now `const` for all
  numeric types.][57234]
- [`Ipv4Addr::new` is now a `const` function][57234]

Stabilized APIs
---------------
- [`unix::FileExt::read_exact_at`]
- [`unix::FileExt::write_all_at`]
- [`Option::transpose`]
- [`Result::transpose`]
- [`convert::identity`]
- [`pin::Pin`]
- [`marker::Unpin`]
- [`marker::PhantomPinned`]
- [`Vec::resize_with`]
- [`VecDeque::resize_with`]
- [`Duration::as_millis`]
- [`Duration::as_micros`]
- [`Duration::as_nanos`]


Cargo
-----
- [Cargo should now rebuild a crate if a file was modified during the initial
  build.][cargo/6484]

Compatibility Notes
-------------------
- The methods `str::{trim_left, trim_right, trim_left_matches,
  trim_right_matches}` are now deprecated in the standard library, and their
  usage will now produce a warning.  Please use the `str::{trim_start,
  trim_end, trim_start_matches, trim_end_matches}` methods instead.
- The `Error::cause` method has been deprecated in favor of `Error::source`
  which supports downcasting.

[55982]: https://github.com/rust-lang/rust/pull/55982/
[56303]: https://github.com/rust-lang/rust/pull/56303/
[56351]: https://github.com/rust-lang/rust/pull/56351/
[56362]: https://github.com/rust-lang/rust/pull/56362
[56642]: https://github.com/rust-lang/rust/pull/56642/
[56769]: https://github.com/rust-lang/rust/pull/56769/
[56805]: https://github.com/rust-lang/rust/pull/56805
[56947]: https://github.com/rust-lang/rust/pull/56947/
[57049]: https://github.com/rust-lang/rust/pull/57049/
[57067]: https://github.com/rust-lang/rust/pull/57067/
[57105]: https://github.com/rust-lang/rust/pull/57105
[57130]: https://github.com/rust-lang/rust/pull/57130/
[57167]: https://github.com/rust-lang/rust/pull/57167/
[57175]: https://github.com/rust-lang/rust/pull/57175/
[57234]: https://github.com/rust-lang/rust/pull/57234/
[57332]: https://github.com/rust-lang/rust/pull/57332/
[57465]: https://github.com/rust-lang/rust/pull/57465/
[57532]: https://github.com/rust-lang/rust/pull/57532/
[57535]: https://github.com/rust-lang/rust/pull/57535/
[57566]: https://github.com/rust-lang/rust/pull/57566/
[57615]: https://github.com/rust-lang/rust/pull/57615/
[cargo/6484]: https://github.com/rust-lang/cargo/pull/6484/
[`unix::FileExt::read_exact_at`]: https://doc.rust-lang.org/std/os/unix/fs/trait.FileExt.html#method.read_exact_at
[`unix::FileExt::write_all_at`]: https://doc.rust-lang.org/std/os/unix/fs/trait.FileExt.html#method.write_all_at
[`Option::transpose`]: https://doc.rust-lang.org/std/option/enum.Option.html#method.transpose
[`Result::transpose`]: https://doc.rust-lang.org/std/result/enum.Result.html#method.transpose
[`convert::identity`]: https://doc.rust-lang.org/std/convert/fn.identity.html
[`pin::Pin`]: https://doc.rust-lang.org/std/pin/struct.Pin.html
[`marker::Unpin`]: https://doc.rust-lang.org/stable/std/marker/trait.Unpin.html
[`marker::PhantomPinned`]: https://doc.rust-lang.org/nightly/std/marker/struct.PhantomPinned.html
[`Vec::resize_with`]: https://doc.rust-lang.org/std/vec/struct.Vec.html#method.resize_with
[`VecDeque::resize_with`]: https://doc.rust-lang.org/std/collections/struct.VecDeque.html#method.resize_with
[`Duration::as_millis`]: https://doc.rust-lang.org/std/time/struct.Duration.html#method.as_millis
[`Duration::as_micros`]: https://doc.rust-lang.org/std/time/struct.Duration.html#method.as_micros
[`Duration::as_nanos`]: https://doc.rust-lang.org/std/time/struct.Duration.html#method.as_nanos
[platform-support]: https://forge.rust-lang.org/platform-support.html
2019-03-03 09:16:21 +00:00
he
74d6139a9e Bump the bootstrap kit for armv7--netbsd-eabihf to 1.32.0.
(This has yet to be successfully tested...)
2019-02-14 16:24:23 +00:00
he
0e6dd8c703 Bump the bootstrap kit for x86_64--netbsd to 1.32.0. 2019-02-14 09:14:06 +00:00
he
4fca215f2b Bump the bootstrap kit for i686--netbsd to 1.32.0, natively built. 2019-02-14 08:57:44 +00:00
he
e6b329f0b0 Bump sparc64--netbsd bootstrap kit to 1.32.0. 2019-02-13 13:33:43 +00:00
he
30b3d25ad6 Various updates and additions:
* Add commented-out settings for cross-building to aarch64--netbsd
 * Add clang wrappers (ultimately I could not complete the target build for
   aarch64/8.0 using clang, due to the build wanting libgcc_s, and its
   non-presence there, and I could not decipher the build logic)
 * I built i386--netbsd version 1.31.1, point to my version, since
   it's not available from ryoon@ and appears to be required to build 1.32.0
 * Bump powerpc--netbsd version to 1.32.0
 * Add pointer to cross-built aarch64--netbsd version 1.32.0,
   targeting 8.99.34, using gcc as the target compiler.  Untested so far.
2019-02-13 08:29:52 +00:00
jperkin
c68f8c9626 rust: Put back SunOS fix lost in previous update. 2019-01-22 09:17:15 +00:00
ryoon
f97660dda2 Update to 1.32.0
Changelog:
Version 1.32.0 (2019-01-17)
==========================

Language
--------
#### 2018 edition
- [You can now use the `?` operator in macro definitions.][56245] The `?`
  operator allows you to specify zero or one repetitions similar to the `*` and
  `+` operators.
- [Module paths with no leading keyword like `super`, `self`, or `crate`, will
  now always resolve to the item (`enum`, `struct`, etc.) available in the
  module if present, before resolving to a external crate or an item the prelude.][56759]
  E.g.
  ```rust
  enum Color { Red, Green, Blue }

  use Color::*;
  ```

#### All editions
- [You can now match against `PhantomData<T>` types.][55837]
- [You can now match against literals in macros with the `literal`
  specifier.][56072] This will match against a literal of any type.
  E.g. `1`, `'A'`, `"Hello World"`
- [Self can now be used as a constructor and pattern for unit and tuple structs.][56365] E.g.
  ```rust
  struct Point(i32, i32);

  impl Point {
      pub fn new(x: i32, y: i32) -> Self {
          Self(x, y)
      }

      pub fn is_origin(&self) -> bool {
          match self {
              Self(0, 0) => true,
              _ => false,
          }
      }
  }
  ```
- [Self can also now be used in type definitions.][56366] E.g.
  ```rust
  enum List<T>
  where
      Self: PartialOrd<Self> // can write `Self` instead of `List<T>`
  {
      Nil,
      Cons(T, Box<Self>) // likewise here
  }
  ```
- [You can now mark traits with `#[must_use]`.][55663] This provides a warning if
  a `impl Trait` or `dyn Trait` is returned and unused in the program.

Compiler
--------
- [The default allocator has changed from jemalloc to the default allocator on
  your system.][55238] The compiler itself on Linux & macOS will still use
  jemalloc, but programs compiled with it will use the system allocator.
- [Added the `aarch64-pc-windows-msvc` target.][55702]

Libraries
---------
- [`PathBuf` now implements `FromStr`.][55148]
- [`Box<[T]>` now implements `FromIterator<T>`.][55843]
- [The `dbg!` macro has been stabilized.][56395] This macro enables you to
  easily debug expressions in your rust program. E.g.
  ```rust
  let a = 2;
  let b = dbg!(a * 2) + 1;
  //      ^-- prints: [src/main.rs:4] a * 2 = 4
  assert_eq!(b, 5);
  ```

The following APIs are now `const` functions and can be used in a
`const` context.

- [`Cell::as_ptr`]
- [`UnsafeCell::get`]
- [`char::is_ascii`]
- [`iter::empty`]
- [`ManuallyDrop::new`]
- [`ManuallyDrop::into_inner`]
- [`RangeInclusive::start`]
- [`RangeInclusive::end`]
- [`NonNull::as_ptr`]
- [`slice::as_ptr`]
- [`str::as_ptr`]
- [`Duration::as_secs`]
- [`Duration::subsec_millis`]
- [`Duration::subsec_micros`]
- [`Duration::subsec_nanos`]
- [`CStr::as_ptr`]
- [`Ipv4Addr::is_unspecified`]
- [`Ipv6Addr::new`]
- [`Ipv6Addr::octets`]

Stabilized APIs
---------------
- [`i8::to_be_bytes`]
- [`i8::to_le_bytes`]
- [`i8::to_ne_bytes`]
- [`i8::from_be_bytes`]
- [`i8::from_le_bytes`]
- [`i8::from_ne_bytes`]
- [`i16::to_be_bytes`]
- [`i16::to_le_bytes`]
- [`i16::to_ne_bytes`]
- [`i16::from_be_bytes`]
- [`i16::from_le_bytes`]
- [`i16::from_ne_bytes`]
- [`i32::to_be_bytes`]
- [`i32::to_le_bytes`]
- [`i32::to_ne_bytes`]
- [`i32::from_be_bytes`]
- [`i32::from_le_bytes`]
- [`i32::from_ne_bytes`]
- [`i64::to_be_bytes`]
- [`i64::to_le_bytes`]
- [`i64::to_ne_bytes`]
- [`i64::from_be_bytes`]
- [`i64::from_le_bytes`]
- [`i64::from_ne_bytes`]
- [`i128::to_be_bytes`]
- [`i128::to_le_bytes`]
- [`i128::to_ne_bytes`]
- [`i128::from_be_bytes`]
- [`i128::from_le_bytes`]
- [`i128::from_ne_bytes`]
- [`isize::to_be_bytes`]
- [`isize::to_le_bytes`]
- [`isize::to_ne_bytes`]
- [`isize::from_be_bytes`]
- [`isize::from_le_bytes`]
- [`isize::from_ne_bytes`]
- [`u8::to_be_bytes`]
- [`u8::to_le_bytes`]
- [`u8::to_ne_bytes`]
- [`u8::from_be_bytes`]
- [`u8::from_le_bytes`]
- [`u8::from_ne_bytes`]
- [`u16::to_be_bytes`]
- [`u16::to_le_bytes`]
- [`u16::to_ne_bytes`]
- [`u16::from_be_bytes`]
- [`u16::from_le_bytes`]
- [`u16::from_ne_bytes`]
- [`u32::to_be_bytes`]
- [`u32::to_le_bytes`]
- [`u32::to_ne_bytes`]
- [`u32::from_be_bytes`]
- [`u32::from_le_bytes`]
- [`u32::from_ne_bytes`]
- [`u64::to_be_bytes`]
- [`u64::to_le_bytes`]
- [`u64::to_ne_bytes`]
- [`u64::from_be_bytes`]
- [`u64::from_le_bytes`]
- [`u64::from_ne_bytes`]
- [`u128::to_be_bytes`]
- [`u128::to_le_bytes`]
- [`u128::to_ne_bytes`]
- [`u128::from_be_bytes`]
- [`u128::from_le_bytes`]
- [`u128::from_ne_bytes`]
- [`usize::to_be_bytes`]
- [`usize::to_le_bytes`]
- [`usize::to_ne_bytes`]
- [`usize::from_be_bytes`]
- [`usize::from_le_bytes`]
- [`usize::from_ne_bytes`]

Cargo
-----
- [You can now run `cargo c` as an alias for `cargo check`.][cargo/6218]
- [Usernames are now allowed in alt registry URLs.][cargo/6242]

Misc
----
- [`libproc_macro` has been added to the `rust-src` distribution.][55280]

Compatibility Notes
-------------------
- [The argument types for AVX's
  `_mm256_stream_si256`, `_mm256_stream_pd`, `_mm256_stream_ps`][55610] have
  been changed from `*const` to `*mut` as the previous implementation
  was unsound.


[55148]: https://github.com/rust-lang/rust/pull/55148/
[55238]: https://github.com/rust-lang/rust/pull/55238/
[55280]: https://github.com/rust-lang/rust/pull/55280/
[55610]: https://github.com/rust-lang/rust/pull/55610/
[55663]: https://github.com/rust-lang/rust/pull/55663/
[55702]: https://github.com/rust-lag/rust/pull/55702/
[55837]: https://github.com/rust-lang/rust/pull/55837/
[55843]: https://github.com/rust-lang/rust/pull/55843/
[56072]: https://github.com/rust-lang/rust/pull/56072/
[56245]: https://github.com/rust-lang/rust/pull/56245/
[56365]: https:/ttps://github.com/rust-lang/rust/pull/56395/
[56759]: https://github.com/rust-lang/rust/pull/56759/
[cargo/6218]: https://github.com/rust-lang/cargo/pull/6218/
[cargo/6242]: https://github.com/rust-lang/cargo/pull/6242/
[`CStr::as_ptr`]: https://doc.rust-`Duration::as_secs`]: https://doc.rust-lang.org/std/time/struct.Duration.html#method.as_secs
[`Duration::subsec_micros`]: https://doc.rust-lang.org/std/time/struct.Duration.html#method.subsec_micros
[`Duration::subsec_millis`]: https://doc.rust-lang.org/sct.Duration.html#method.subsec_nanos
[`Ipv4Addr::is_unspecified`]: https://doc.rust-lang.org/std/net/struct.Ipv4Addr.html#method.is_unspecified
[`Ipv6Addr::new`]: https://doc.rust-lang.org/std/net/struct.Ipv6Addr.html#method.new
[`Ipv6Addr::octets`]: httpw`]: https://doc.rust-lang.org/std/mem/struct.ManuallyDrop.html#method.new
[`NonNull::as_ptr`]: https://doc.rust-lang.org/std/ptr/struct.NonNull.html#method.as_ptr
[`RangeInclusive::end`]: https://doc.rust-lang.org/std/ops/struct.RangeInclusive.html#method.end
[`RangeInclusive::start`]: https://doc.rust-lang.org/std/ops/struct.RangeInclusive.html#method.start
[`UnsafeCell::get`]: https://doc.rust-lang.org/std/cell/struct.UnsafeCell.html#method.get
[`slice::as_ptr`]: https://doc.rust-lang.org/std/primitive.slice.html#method.as_ptr
[`char::is_ascii`]: https://doc.rust-lang.org/std/primitive.char.html#method.is_ascii
[`i128::from_be_bytes`]: https://doc.rust-lang.org/stable/std/primitive.i128.html#method.from_be_bytes
[`i128::from_le_bytes`]: https://doc.rust-lang.org/stable/std/primitive.i128.html#method.from_le_bytes
[`i128::from_ne_bytes`]: https://doc.rust-lang.org/stable/std/primitive.i128.html#method.from_ne_bytes
[`i128::to_be_bytes`]: https://doc.rust-lang.org/stable/std/primitive.i128.html#method.to_be_bytes
[`i128::to_le_bytes`]: https://doc.rust-lang.org/stable/std/primitive.i128.html#method.to_le_bytes
[`i128::to_ne_bytes`]: https://doc.rust-lang.org/stable/std/primitive.i128.html#method.to_ne_bytes
[`i16::from_be_bytes`]: https://doc.rust-lang.org/stable/std/primitive.i16.html#method.from_be_bytes
[`i16::from_le_bytes`]: https://doc.rust-lang.org/stable/std/primitive.i16.html#method.from_le_bytes
[`i16::from_ne_bytes`]: https://doc.rust-lang.org/stable/std/primitive.i16.html#method.from_ne_bytes
[`i16::to_be_bytes`]: https://doc.rust-lang.org/stable/std/primitive.i16.html#method.to_be_bytes
[`i16::to_le_bytes`]: https://doc.rust-lang.org/stable/std/primitive.i16.html#method.to_le_bytes
[`i16::to_ne_bytes`]: https://doc.rust-lang.org/stable/std/primitive.i16.html#method.to_ne_bytes
[`i32::from_be_bytes`]: https://doc.rust-lang.org/stable/std/primitive.i32.html#method.from_be_bytes
[`i32::from_le_bytes`]: https://doc.rust-lang.org/stable/std/primitive.i32.html#method.from_le_bytes
[`i32::from_ne_bytes`]: https://doc.rust-lang.org/stable/std/primitive.i32.html#method.from_ne_bytes
[`i32::to_be_bytes`]: https://doc.rust-lang.org/stable/std/primitive.i32.html#method.to_be_bytes
[`i32::to_le_bytes`]: https://doc.rust-lang.org/stable/std/primitive.i32.html#method.to_le_bytes
[`i32::to_ne_bytes`]: https://doc.rust-lang.org/stable/std/primitive.i32.html#method.to_ne_bytes
[`i64::from_be_bytes`]: https://doc.rust-lang.org/stable/std/primitive.i64.html#method.from_be_bytes
[`i64::from_le_bytes`]: https://doc.rust-lang.org/stable/std/primitive.i64.html#method.from_le_bytes
[`i64::from_ne_bytes`]: https://doc.rust-lang.org/stable/std/primitive.i64.html#method.from_ne_bytes
[`i64::to_be_bytes`]: https://doc.rust-lang.org/stable/std/primitive.i64.html#method.to_be_bytes
[`i64::to_le_bytes`]: https://doc.rust-lang.org/stable/std/primitive.i64.html#method.to_le_bytes
[`i64::to_ne_bytes`]: https://doc.rust-lang.org/stable/std/primitive.i64.html#method.to_ne_bytes
[`i8::from_be_bytes`]: https://doc.rust-lang.org/stable/std/primitive.i8.html#method.from_be_bytes
[`i8::from_le_bytes`]: https://doc.rust-lang.org/stable/std/primitive.i8.html#method.from_le_bytes
[`i8::from_ne_bytes`]: https://doc.rust-lang.org/stable/std/primitive.i8.html#method.from_ne_bytes
[`i8::to_be_bytes`]: https://doc.rust-lang.org/stable/std/primitive.i8.html#method.to_be_bytes
[`i8::to_le_bytes`]: https://doc.rust-lang.org/stable/std/primitive.i8.html#method.to_le_bytes
[`i8::to_ne_bytes`]: https://doc.rust-lang.org/stable/std/primitive.i8.html#method.to_ne_bytes
[`isize::from_be_bytes`]: https://doc.rust-lang.org/stable/std/primitive.isize.html#method.from_be_bytes
[`isize::from_le_bytes`]: https://doc.rust-lang.org/stable/std/primitive.isize.html#method.from_le_bytes
[`isize::from_ne_bytes`]: https://doc.rust-lang.org/stable/std/primitive.isize.html#method.from_ne_bytes
[`isize::to_be_bytes`]: https://doc.rust-lang.org/stable/std/primitive.isize.html#method.to_be_bytes
[`isize::to_le_bytes`]: https://doc.rust-lang.org/stable/std/primitive.isize.html#method.to_le_bytes
[`isize::to_ne_bytes`]: https://doc.rust-lang.org/stable/std/primitive.isize.html#method.to_ne_bytes
[`iter::empty`]: https://doc.rust-lang.org/std/iter/fn.empty.html
[`str::as_ptr`]: https://doc.rust-lang.org/std/primitive.str.html#method.as_ptr
[`u128::from_be_bytes`]: https://doc.rust-lang.org/stable/std/primitive.u128.html#method.from_be_bytes
[`u128::from_le_bytes`]: https://doc.rust-lang.org/stable/std/primitive.u128.html#method.from_le_bytes
[`u128::from_ne_bytes`]: https://doc.rust-lang.org/stable/std/primitive.u128.html#method.from_ne_bytes
[`u128::to_be_bytes`]: https://doc.rust-lang.org/stable/std/primitive.u128.html#method.to_be_bytes
[`u128::to_le_bytes`]: https://doc.rust-lang.org/stable/std/primitive.u128.html#method.to_le_bytes
[`u128::to_ne_bytes`]: https://doc.rust-lang.org/stable/std/primitive.u128.html#method.to_ne_bytes
[`u16::from_be_bytes`]: https://doc.rust-lang.org/stable/std/primitive.u16.html#method.from_be_bytes
[`u16::from_le_bytes`]: https://doc.rust-lang.org/stable/std/primitive.u16.html#method.from_le_bytes
[`u16::from_ne_bytes`]: https://doc.rust-lang.org/stable/std/primitive.u16.html#method.from_ne_bytes
[`u16::to_be_bytes`]: https://doc.rust-lang.org/stable/std/primitive.u16.html#method.to_be_bytes
[`u16::to_le_bytes`]: https://doc.rust-lang.org/stable/std/primitive.u16.html#method.to_le_bytes
[`u16::to_ne_bytes`]: https://doc.rust-lang.org/stable/std/primitive.u16.html#method.to_ne_bytes
[`u32::from_be_bytes`]: https://doc.rust-lang.org/stable/std/primitive.u32.html#method.from_be_bytes
[`u32::from_le_bytes`]: https://doc.rust-lang.org/stable/std/primitive.u32.html#method.from_le_bytes
[`u32::from_ne_bytes`]: https://doc.rust-lang.org/stable/std/primitive.u32.html#method.from_ne_bytes
[`u32::to_be_bytes`]: https://doc.rust-lang.org/stable/std/primitive.u32.html#method.to_be_bytes
[`u32::to_le_bytes`]: https://doc.rust-lang.org/stable/std/primitive.u32.html#method.to_le_bytes
[`u32::to_ne_bytes`]: https://doc.rust-lang.org/stable/std/primitive.u32.html#method.to_ne_bytes
[`u64::from_be_bytes`]: https://doc.rust-lang.org/stable/std/primitive.u64.html#method.from_be_bytes
[`u64::from_le_bytes`]: https://doc.rust-lang.org/stable/std/primitive.u64.html#method.from_le_bytes
[`u64::from_ne_bytes`]: https://doc.rust-lang.org/stable/std/primitive.u64.html#method.from_ne_bytes
[`u64::to_be_bytes`]: https://doc.rust-lang.org/stable/std/primitive.u64.html#method.to_be_bytes
[`u64::to_le_bytes`]: https://doc.rust-lang.org/stable/std/primitive.u64.html#method.to_le_bytes
[`u64::to_ne_bytes`]: https://doc.rust-lang.org/stable/std/primitive.u64.html#method.to_ne_bytes
[`u8::from_be_bytes`]: https://doc.rust-lang.org/stable/std/primitive.u8.html#method.from_be_bytes
[`u8::from_le_bytes`]: https://doc.rust-lang.org/stable/std/primitive.u8.html#method.from_le_bytes
[`u8::from_ne_bytes`]: https://doc.rust-lang.org/stable/std/primitive.u8.html#method.from_ne_bytes
[`u8::to_be_bytes`]: https://doc.rust-lang.org/stable/std/primitive.u8.html#method.to_be_bytes
[`u8::to_le_bytes`]: https://doc.rust-lang.org/stable/std/primitive.u8.html#method.to_le_bytes
[`u8::to_ne_bytes`]: https://doc.rust-lang.org/stable/std/primitive.u8.html#method.to_ne_bytes
[`usize::from_be_bytes`]: https://doc.rust-lang.org/stable/std/primitive.usize.html#method.from_be_bytes
[`usize::from_le_bytes`]: https://doc.rust-lang.org/stable/std/primitive.usize.html#method.from_le_bytes
[`usize::from_ne_bytes`]: https://doc.rust-lang.org/stable/std/primitive.usize.html#method.from_ne_bytes
[`usize::to_be_bytes`]: https://doc.rust-lang.org/stable/std/primitive.usize.html#method.to_be_bytes
[`usize::to_le_bytes`]: https://doc.rust-lang.org/stable/std/primitive.usize.html#method.to_le_bytes
[`usize::to_ne_bytes`]: https://doc.rust-lang.org/stable/std/primitive.usize.html#method.to_ne_bytes
2019-01-19 12:44:08 +00:00
tnn
d3f4529f8e rust: add some kludges to better support NetBSD HEAD-llvm
1) bootstrap rustc adds -lgcc_s when linking
-> Dropped with a BUILDLINK_TRANSFORM

2) bootstrap rustc has shared linkage to libgcc_s.so.1
-> Until upstream changes this to static linkage, we look for
   libgcc_s.so.1 in ${FILESDIR} where the user must place it manually.

3) newly built rustc adds -lstdc++ instead of -lc++ when linking llvm
-> fixed with patch-src_librustc__llvm_build.rs

4) newly built rustc adds -lgcc_s when linking
-> fixed with patch-src_libunwind_build.rs
2019-01-05 23:29:40 +00:00
he
80337c9066 Upgrade rust to version 1.31.1.
Pkgsrc changes:
 * Sadly, I had to reinstate the "make tar files" rust code to make
   it possible to build cross-compiled bootstrap kits.
 * Add an adjustable "BUILD_TARGET", "dist" for cross-building
   a bootstrap kit, "build" for a normal native build.
 * New bootstrap kits built for NetBSD/powerpc, NetBSD/earmv7hf,
   and NetBSD/sparc64 version 1.31.1.
 * gcc-wrap script amended to also drop -Wl,--enable-new-dtags
   (so it could be used outside pkgsrc)
 * Worked around use of AtomicU64 in release build tool (ugly band-aid patch).
   Some platforms lack support for that type and associated operations.

Upstream changes:
 - [Fix Rust failing to build on `powerpc-unknown-netbsd`][56562]
 - [Fix broken go-to-definition in RLS][rls/1171]
 - [Fix infinite loop on hover in RLS][rls/1170]

[56562]: https://github.com/rust-lang/rust/pull/56562
[rls/1171]: https://github.com/rust-lang/rls/issues/1171
[rls/1170]: https://github.com/rust-lang/rls/pull/1170
2018-12-21 23:12:34 +00:00
jperkin
450576ecf6 rust: Restore SunOS support. 2018-12-15 12:41:43 +00:00
ryoon
d8413c2e9d Update to 1.31.0
Changelog:
Version 1.31.0 (2018-12-06)
Language

    This version marks the release of the 2018 edition of Rust.
    New lifetime elision rules now allow for eliding lifetimes in functions and impl headers. E.g. impl<'a> Reader for BufReader<'a> {} can now be impl Reader for BufReader<'_> {}. Lifetimes are still required to be defined in structs.
    You can now define and use const functions. These are currently a strict minimal subset of the const fn RFC. Refer to the language reference for what exactly is available.
    You can now use tool lints, which allow you to scope lints from external tools using attributes. E.g. #[allow(clippy::filter_map)].
    #[no_mangle] and #[export_name] attributes can now be located anywhere in a crate, not just in exported functions.
    You can now use parentheses in pattern matches.

Compiler

    Updated musl to 1.1.20

Libraries

    You can now convert num::NonZero* types to their raw equivalvents using the From trait. E.g. u8 now implements From<NonZeroU8>.
    You can now convert a &Option<T> into Option<&T> and &mut Option<T> into Option<&mut T> using the From trait.
    You can now multiply (*) a time::Duration by a u32.

Stabilized APIs

    slice::align_to
    sl

    ice::align_to_mut
    slice::chunks_exact
    slice::chunks_exact_mut
    slice::rchunks
    slice::rchunks_mut
    slice::rchunks_exact
    slice::rchunks_exact_mut
    Option::replace

Cargo

    Cargo will now download crates in parallel using HTTP/2.
    You can now rename packages in your Cargo.toml We have a guide on how to use the package key in your dependencies.
2018-12-08 07:24:54 +00:00
adam
7d3481ecc9 rust: speed-up building; clean-ups
- use 'build' target for building, not 'dist'
- set jobs also for install target
- do not generate tarballs; we don't need them, but they take a lot of disk-space
- do not install 'src'
- do not generate 'install.log' nor 'uninstall.sh'
- on Darwin, use headerpad_max_install_names to be able to fix all dylibs
- make optimized bootstrap
- pkglint fixes
- get ready to depend on lang/llvm and devel/jemalloc
2018-11-27 15:45:23 +00:00
ryoon
aa76975884 Update to 1.30.1
Changelog:
Version 1.30.1 (2018-11-08)

    Fixed overflow ICE in rustdoc
    Cap Cargo progress bar width at 60 in MSYS terminals
2018-11-18 07:03:01 +00:00
martin
7f1d7facf4 Add patch from jakllsch (not merged upstream yet) to fix some pthread/
mutex types for some NetBSD architectures.
2018-10-31 16:30:44 +00:00
jperkin
03ef6d20af lang/rust: Various fixes.
SunOS now needs -D_POSIX_PTHREAD_SEMANTICS and a patch to the rand module
to work around getrandom() system call failures.

Add -j argument to x.py for the number of make jobs.
2018-10-31 15:53:17 +00:00
he
cdf2cbcc2a Upgrade rust to version 1.30.0.
Upstream changes:

Language
 * Procedural macros are now available. These kinds of macros allow
   for more powerful code generation. There is a new chapter available
   in the Rust Programming Language book that goes further in depth.
 * You can now use keywords as identifiers using the raw identifiers
   syntax (r#), e.g. let r#for = true;
 * Using anonymous parameters in traits is now deprecated with a
   warning and will be a hard error in the 2018 edition.
 * You can now use crate in paths. This allows you to refer to the
   crate root in the path, e.g. use crate::foo; refers to foo in
   src/lib.rs.
 * Using a external crate no longer requires being prefixed with
   ::. Previously, using a external crate in a module without a
   use statement required let json = ::serde_json::from_str(foo);
   but can now be written as let json = serde_json::from_str(foo);.
 * You can now apply the #[used] attribute to static items to
   prevent the compiler from optimising them away, even if they
   appear to be unused, e.g. #[used] static FOO: u32 = 1;
 * You can now import and reexport macros from other crates with
   the use syntax. Macros exported with #[macro_export] are now
   placed into the root module of the crate. If your macro relies
   on calling other local macros, it is recommended to export with
   the #[macro_export(local_inner_macros)] attribute so users won't
   have to import those macros.
 * You can now catch visibility keywords (e.g. pub, pub(crate)) in
   macros using the vis specifier.
 * Non-macro attributes now allow all forms of literals, not just
   strings. Previously, you would write #[attr("true")], and you
   can now write #[attr(true)].
 * You can now specify a function to handle a panic in the Rust
   runtime with the #[panic_handler] attribute.

Compiler
 * Added the riscv32imc-unknown-none-elf target.
 * Added the aarch64-unknown-netbsd target

Libraries
 * ManuallyDrop now allows the inner type to be unsized.

Stabilized APIs
 * Ipv4Addr::BROADCAST
 * Ipv4Addr::LOCALHOST
 * Ipv4Addr::UNSPECIFIED
 * Ipv6Addr::LOCALHOST
 * Ipv6Addr::UNSPECIFIED
 * Iterator::find_map
 * The following methods are replacement methods for trim_left,
   trim_right, trim_left_matches, and trim_right_matches, which
   will be deprecated in 1.33.0:
 * str::trim_end_matches
 * str::trim_end
 * str::trim_start_matches
 * str::trim_start

Cargo
 * cargo run doesn't require specifying a package in workspaces.
 * cargo doc now supports --message-format=json. This is equivalent
   to calling rustdoc --error-format=json.
 * Cargo will now provide a progress bar for builds.

Misc
 * rustdoc allows you to specify what edition to treat your code
   as with the --edition option.
 * rustdoc now has the --color (specify whether to output color)
   and --error-format (specify error format, e.g. json) options.
 * We now distribute a rust-gdbgui script that invokes gdbgui with
   Rust debug symbols.
 * Attributes from Rust tools such as rustfmt or clippy are now
   available, e.g. #[rustfmt::skip] will skip formatting the next
   item.


Pkgsrc changest:
 * Explicitly list bootstrap kit version number for each kit we carry,
   so that one entry's version doesn't "bleed into" following kits.
 * Tweak for handling "earmv7hf" CPU type for NetBSD in the bootstrap.py
   script
 * Add two patches from Debian for sparc64; rust would generate code
   generating unaligned accesses, causing SIGBUS on sparc64
 * Update most of the bootstrap kits to version 1.29.2; need minimum
   1.29.0 to build 1.30.0.
 * Rust regrettably doesn't build for powerpc or earmv7hf in this version,
   most probably due to "char" being "unsigned char" on these platforms.
   Ref. https://github.com/rust-lang/rust/issues/55465
2018-10-29 22:24:11 +00:00
he
4e501e7afe Upgrade rust to version 1.29.2.
Upstream changes:
 * Workaround for an aliasing-related LLVM bug, which caused miscompilation.
 * The rls-preview component on the windows-gnu targets has been restored.

Pkgsrc changes:
 * More commented-out settings for cross builds on NetBSD.
 * Bump bootstrap kit versions to 1.29.2 for powerpc, sparc64
   and earm7hf.  Anyone up for testing for earm7hf?
 * Because the built-in versions of libgit2, libssh2 and curl
   can no longer be built with the pkgsrc-provided headers for
   those packages (due to version skew; the built-in versions
   have been updated to un-released newer code), the buildlink3.mk
   files for those packages have been commented out.
 * Similarly, to avoid using the native pkgsrc host's headers when cross-
   building, the gcc-wrap script has been adjusted to also re-point
   /usr/pkg/include into the destination's root (where those above pacakges
   are not to be installed).
 * Also have the gcc-wrap script deal with "-I dir" style directives,
   and re-point these also into the destination's root.
 * One patch has been integrated upstream, so removed here.
2018-10-28 13:21:36 +00:00
he
583f8ca70a Add pointers to (so far untested) bootstrap kits for sparc64 and earmv7hf.
Prepare wrapper script handling for use of clang (not yet fully verified).

Adjust the cross-compiler wrapper script to improve the handling
when used as the linker:
 * Insert "linker tweaks" before first -L or -l
 * Handle "-L arg" style as well as "-Larg"
 * Add "-Wl,-rpath-link" to the linker tweaks just to be sure...

Bump PKGREVISION.
2018-10-15 11:22:23 +00:00
he
5b1797db7d Add the bits required to build rust on NetBSD/powerpc ports, and
point to the bootstrap kit for NetBSD/powerpc I'm hosting at the
moment.

Also add the bits I used when cross-building the NetBSD/powerpc
rust on amd64, commented out, as well as the gcc / c++ wrapper
script I used in the process.

The changes affecting other ports are:
 * We now add LD_LIBRARY_PATH in the make environment, so that
   if the bootstrap kit binaries and shared libraries don't have
   the $ORIGIN-style RPATH entries, it will still work
 * The bootstrap.py script has been changed to turn off the
   generation of debuginfo in "RUSTFLAGS"; for some so far unknown
   reason, the NetBSD/powerpc rust will not build if you ask for
   debug info.  This could perhaps have been made OS-variant dependent,
   but isn't at the moment.

So .. bump PKGREVISION.
2018-10-13 10:03:36 +00:00
minskim
83f368e43d lang/rust: Fix distfile checksum of Darwin-i386
Noted by jperkin@.
2018-09-30 17:46:24 +00:00
minskim
7ffa718709 rust-bin: Update to 1.29.1
The standard library's str::repeat function contained an out of bounds
write caused by an integer overflow. This has been fixed by
deterministically panicking when an overflow happens.
2018-09-30 16:19:54 +00:00
minskim
d6cee94406 lang/rust: Make llvm build on Darwin
Patch from lang/llvm.
2018-09-24 03:42:42 +00:00
jperkin
f2a8d533f2 rust: Update to 1.29.0.
Version 1.29.0 (2018-09-13)
==========================

Compiler
--------
- [Bumped minimum LLVM version to 5.0.][51899]
- [Added `powerpc64le-unknown-linux-musl` target.][51619]
- [Added `aarch64-unknown-hermit` and `x86_64-unknown-hermit` targets.][52861]

Libraries
---------
- [`Once::call_once` now no longer requires `Once` to be `'static`.][52239]
- [`BuildHasherDefault` now implements `PartialEq` and `Eq`.][52402]
- [`Box<CStr>`, `Box<OsStr>`, and `Box<Path>` now implement `Clone`.][51912]
- [Implemented `PartialEq<&str>` for `OsString` and `PartialEq<OsString>`
  for `&str`.][51178]
- [`Cell<T>` now allows `T` to be unsized.][50494]
- [`SocketAddr` is now stable on Redox.][52656]

Stabilized APIs
---------------
- [`Arc::downcast`]
- [`Iterator::flatten`]
- [`Rc::downcast`]

Cargo
-----
- [Cargo can silently fix some bad lockfiles ][cargo/5831] You can use
  `--locked` to disable this behaviour.
- [`cargo-install` will now allow you to cross compile an install
  using `--target`][cargo/5614]
- [Added the `cargo-fix` subcommand to automatically move project code from
  2015 edition to 2018.][cargo/5723]

Misc
----
- [`rustdoc` now has the `--cap-lints` option which demotes all lints above
  the specified level to that level.][52354] For example `--cap-lints warn`
  will demote `deny` and `forbid` lints to `warn`.
- [`rustc` and `rustdoc` will now have the exit code of `1` if compilation
  fails, and `101` if there is a panic.][52197]
- [A preview of clippy has been made available through rustup.][51122]
  You can install the preview with `rustup component add clippy-preview`

Compatibility Notes
-------------------
- [`str::{slice_unchecked, slice_unchecked_mut}` are now deprecated.][51807]
  Use `str::get_unchecked(begin..end)` instead.
- [`std::env::home_dir` is now deprecated for its unintuitive behaviour.][51656]
  Consider using the `home_dir` function from
  https://crates.io/crates/dirs instead.
- [`rustc` will no longer silently ignore invalid data in target spec.][52330]

[52861]: https://github.com/rust-lang/rust/pull/52861/
[52656]: https://github.com/rust-lang/rust/pull/52656/
[52239]: https://github.com/rust-lang/rust/pull/52239/
[52330]: https://github.com/rust-lang/rust/pull/52330/
[52354]: https://github.com/rust-lang/rust/pull/52354/
[52402]: https://github.com/rust-lang/rust/pull/52402/
[52103]: https://github.com/rust-lang/rust/pull/52103/
[52197]: https://github.com/rust-lang/rust/pull/52197/
[51807]: https://github.com/rust-lang/rust/pull/51807/
[51899]: https://github.com/rust-lang/rust/pull/51899/
[51912]: https://github.com/rust-lang/rust/pull/51912/
[51511]: https://github.com/rust-lang/rust/pull/51511/
[51619]: https://github.com/rust-lang/rust/pull/51619/
[51656]: https://github.com/rust-lang/rust/pull/51656/
[51178]: https://github.com/rust-lang/rust/pull/51178/
[51122]: https://github.com/rust-lang/rust/pull/51122
[50494]: https://github.com/rust-lang/rust/pull/50494/
[cargo/5614]: https://github.com/rust-lang/cargo/pull/5614/
[cargo/5723]: https://github.com/rust-lang/cargo/pull/5723/
[cargo/5831]: https://github.com/rust-lang/cargo/pull/5831/
[`Arc::downcast`]: https://doc.rust-lang.org/std/sync/struct.Arc.html#method.downcast
[`Iterator::flatten`]: https://doc.rust-lang.org/std/iter/trait.Iterator.html#method.flatten
[`Rc::downcast`]: https://doc.rust-lang.org/std/rc/struct.Rc.html#method.downcast
2018-09-14 10:04:43 +00:00
ryoon
a0ad6ad0c3 Restore maybe accidental comment-out in NetBSD/i386 conditional.
And do not use 1.28.0 bootstrap for FreeBSD.

This will fix the problem from gdt@.
2018-09-03 16:56:24 +00:00
jperkin
a5b0220d32 rust: Switch to the 1.28.0 bootstrap for SunOS too.
It looks like I accidentally built the 1.27.2 bootstrap without the stack clash
fix required for newer illumos platforms, so just use 1.28.0 which was built
correctly for now.
2018-08-13 13:09:38 +00:00
ryoon
6b4b60b465 Enable NetBSD/i386 support and fix NetBSD build
* 1.27.2 bootstrap kit has a serious bug and does not work under NetBSD.
  So use 1.28.0 instead.
2018-08-09 19:10:06 +00:00
jperkin
d70218ab66 rust: Update to version 1.28.0.
NetBSD/i386 is temporarily disabled due to missing binary bootstraps.

Version 1.28.0 (2018-08-02)
===========================

Language
--------
- [The `#[repr(transparent)]` attribute is now stable.][51562] This attribute
  allows a Rust newtype wrapper (`struct NewType<T>(T);`) to be represented as
  the inner type across Foreign Function Interface (FFI) boundaries.
- [The keywords `pure`, `sizeof`, `alignof`, and `offsetof` have been unreserved
  and can now be used as identifiers.][51196]
- [The `GlobalAlloc` trait and `#[global_allocator]` attribute are now
  stable.][51241] This will allow users to specify a global allocator for
  their program.
- [Unit test functions marked with the `#[test]` attribute can now return
  `Result<(), E: Debug>` in addition to `()`.][51298]
- [The `lifetime` specifier for `macro_rules!` is now stable.][50385] This
  allows macros to easily target lifetimes.

Compiler
--------
- [The `s` and `z` optimisation levels are now stable.][50265] These optimisations
  prioritise making smaller binary sizes. `z` is the same as `s` with the
  exception that it does not vectorise loops, which typically results in an even
  smaller binary.
- [The short error format is now stable.][49546] Specified with
  `--error-format=short` this option will provide a more compressed output of
  rust error messages.
- [Added a lint warning when you have duplicated `macro_export`s.][50143]
- [Reduced the number of allocations in the macro parser.][50855] This can
  improve compile times of macro heavy crates on average by 5%.

Libraries
---------
- [Implemented `Default` for `&mut str`.][51306]
- [Implemented `From<bool>` for all integer and unsigned number types.][50554]
- [Implemented `Extend` for `()`.][50234]
- [The `Debug` implementation of `time::Duration` should now be more easily
  human readable.][50364] Previously a `Duration` of one second would printed as
  `Duration { secs: 1, nanos: 0 }` and will now be printed as `1s`.
- [Implemented `From<&String>` for `Cow<str>`, `From<&Vec<T>>` for `Cow<[T]>`,
  `From<Cow<CStr>>` for `CString`, `From<CString>, From<CStr>, From<&CString>`
  for `Cow<CStr>`, `From<OsString>, From<OsStr>, From<&OsString>` for
  `Cow<OsStr>`, `From<&PathBuf>` for `Cow<Path>`, and `From<Cow<Path>>`
  for `PathBuf`.][50170]
- [Implemented `Shl` and `Shr` for `Wrapping<u128>`
  and `Wrapping<i128>`.][50465]
- [`DirEntry::metadata` now uses `fstatat` instead of `lstat` when
  possible.][51050] This can provide up to a 40% speed increase.
- [Improved error messages when using `format!`.][50610]

Stabilized APIs
---------------
- [`Iterator::step_by`]
- [`Path::ancestors`]
- [`SystemTime::UNIX_EPOCH`]
- [`alloc::GlobalAlloc`]
- [`alloc::Layout`]
- [`alloc::LayoutErr`]
- [`alloc::System`]
- [`alloc::alloc`]
- [`alloc::alloc_zeroed`]
- [`alloc::dealloc`]
- [`alloc::realloc`]
- [`alloc::handle_alloc_error`]
- [`btree_map::Entry::or_default`]
- [`fmt::Alignment`]
- [`hash_map::Entry::or_default`]
- [`iter::repeat_with`]
- [`num::NonZeroUsize`]
- [`num::NonZeroU128`]
- [`num::NonZeroU16`]
- [`num::NonZeroU32`]
- [`num::NonZeroU64`]
- [`num::NonZeroU8`]
- [`ops::RangeBounds`]
- [`slice::SliceIndex`]
- [`slice::from_mut`]
- [`slice::from_ref`]
- [`{Any + Send + Sync}::downcast_mut`]
- [`{Any + Send + Sync}::downcast_ref`]
- [`{Any + Send + Sync}::is`]

Cargo
-----
- [Cargo will now no longer allow you to publish crates with build scripts that
  modify the `src` directory.][cargo/5584] The `src` directory in a crate should be
  considered to be immutable.

Misc
----
- [The `suggestion_applicability` field in `rustc`'s json output is now
  stable.][50486] This will allow dev tools to check whether a code suggestion
  would apply to them.

Compatibility Notes
-------------------
- [Rust will no longer consider trait objects with duplicated constraints to
  have implementations.][51276] For example the below code will now fail
  to compile.
  ```rust
  trait Trait {}

  impl Trait + Send {
      fn test(&self) { println!("one"); } //~ ERROR duplicate definitions with name `test`
  }

  impl Trait + Send + Send {
      fn test(&self) { println!("two"); }
  }
  ```
2018-08-09 17:04:03 +00:00
ryoon
ad812759d7 Regen for NetBSD/i386 bootstrap kit
I have accidentally removed old kit. It seems that ftp.NetBSD.org does not
mirror it.
2018-07-30 19:32:01 +00:00
ryoon
479c9ef2cf Update to 1.27.2
Changelog:
Version 1.27.2 (2018-07-20)

Compatibility Notes

 * The borrow checker was fixed to avoid potential unsoundness when using
   match ergonomics: #52213.

Version 1.27.1 (2018-07-10)

Security Notes

 * rustdoc would execute plugins in the /tmp/rustdoc/plugins directory when
   running, which enabled executing code as some other user on a given
   machine. This release fixes that vulnerability; you can read more about
   this on the blog.

   Thank you to Red Hat for responsibily disclosing this vulnerability to us.

Compatibility Notes

 * The borrow checker was fixed to avoid an additional potential unsoundness
   when using match ergonomics: #51415, #49534.
2018-07-22 08:02:27 +00:00
ryoon
5e6ef96577 Update to 1.27.1
Changelog:
Version 1.27.1 (2018-07-10)
Security Notes
    rustdoc would execute plugins in the /tmp/rustdoc/plugins directory when running, which enabled executing code as some other user on a given machine. This release fixes that vulnerability; you can read more about this on the blog.

    Thank you to Red Hat for responsibily disclosing this vulnerability to us.

Compatibility Notes
    The borrow checker was fixed to avoid an additional potential unsoundness when using match ergonomics: #51415, #49534
2018-07-16 01:58:58 +00:00
ryoon
ba5a4c2061 Add missing patch to fix build on NetBSD 2018-06-25 13:31:11 +00:00
ryoon
cb24e70d0f Update to 1.27.0
* SunOS parts are from jperkin@.

Changelog:
Version 1.27.0 (2018-06-21)
Language

    Removed 'proc' from the reserved keywords list. This allows proc to be used as an identifer.
    The dyn syntax is now available. This syntax is equivalent to the bare Trait syntax, and should make it clearer when being used in tandem with impl Trait. Since it is equivalent to the following syntax: &Trait == &dyn Trait, &mut Trait == &mut dyn Trait, and Box<Trait> == Box<dyn Trait>.
    Attributes on generic parameters such as types and lifetimes are now stable. e.g. fn foo<#[lifetime_attr] 'a, #[type_attr] T: 'a>() {}
    The #[must_use] attribute can now also be used on functions as well as types. It provides a lint that by default warns users when the value returned by a function has not been used.

Compiler

    Added the armv5te-unknown-linux-musl target.

Libraries

    SIMD (Single Instruction Multiple Data) on x86/x86_64 is now stable. This includes arch::x86 & arch::x86_64 modules which contain SIMD intrinsics, a new macro called is_x86_feature_detected!, the #[target_feature(enable="")] attribute, and adding target_feature = "" to the cfg attribute.
    A lot of methods for [u8], f32, and f64 previously only available in std are now available in core.
    The generic Rhs type parameter on ops::{Shl, ShlAssign, Shr} now defaults to Self.
    std::str::replace now has the #[must_use] attribute to clarify that the operation isn't done in place.
    Clone::clone, Iterator::collect, and ToOwned::to_owned now have the #[must_use] attribute to warn about unused potentially expensive allocations.

Stabilized APIs

    DoubleEndedIterator::rfind
    DoubleEndedIterator::rfold
    DoubleEndedIterator::try_rfold
    Duration::from_micros
    Duration::from_nanos
    Duration::subsec_micros
    Duration::subsec_millis
    HashMap::remove_entry
    Iterator::try_fold
    Iterator::try_for_each
    NonNull::cast
    Option::filter
    String::replace_range
    Take::set_limit
    hint::unreachable_unchecked
    os::unix::process::parent_id
    process::id
    ptr::swap_nonoverlapping
    slice::rsplit_mut
    slice::rsplit
    slice::swap_with_slice

Cargo

    cargo-metadata now includes authors, categories, keywords, readme, and repository fields.
    Added the --target-dir optional argument. This allows you to specify a different directory than target for placing compilation artifacts.
    Cargo will be adding automatic target inference for binaries, benchmarks, examples, and tests in the Rust 2018 edition. If your project specifies specific targets e.g. using [[bin]] and have other binaries in locations where cargo would infer a binary, Cargo will produce a warning. You can disable this feature ahead of time by setting any of the following autobins, autobenches, autoexamples, autotests to false.
    Cargo will now cache compiler information. This can be disabled by setting CARGO_CACHE_RUSTC_INFO=0 in your environment.

Misc

    Added "The Rustc book" into the official documentation. "The Rustc book" documents and teaches how to use the rustc compiler.
    All books available on doc.rust-lang.org are now searchable.

Compatibility Notes

    Calling a CharExt or StrExt method directly on core will no longer work. e.g. ::core::prelude::v1::StrExt::is_empty("") will not compile, "".is_empty() will still compile.
    Debug output on atomic::{AtomicBool, AtomicIsize, AtomicPtr, AtomicUsize} will only print the inner type. e.g. print!("{:?}", AtomicBool::new(true)) will print true not AtomicBool(true).
    The maximum number for repr(align(N)) is now 2^29. Previously you could enter higher numbers but they were not supported by LLVM. Up to 512MB alignment should cover all use cases.
2018-06-24 08:05:25 +00:00
jperkin
3228ea0b64 rust: Restore SunOS support. 2018-06-21 17:13:13 +00:00
ryoon
b6191cc4b1 Update to 1.26.2
Changelog:
Version 1.26.2 (2018-06-05)
Compatibility Notes

 The borrow checker was fixed to avoid unsoundness when using match ergonomics
2018-06-19 13:23:25 +00:00
ryoon
02299dc4db Update to 1.26.1
Changelog:
Version 1.26.1 (2018-05-29)
Tools

    RLS now works on Windows
    Rustfmt stopped badly formatting text in some cases

Compatibility Notes

    fn main() -> impl Trait no longer works for non-Termination trait This
      reverts an accidental stabilization.
    NaN > NaN no longer returns true in const-fn contexts
    Prohibit using turbofish for impl Trait in method arguments
2018-06-01 23:42:09 +00:00
ryoon
5bd5f22e6f Update to 1.26.0
Changelog:
Version 1.26.0 (2018-05-10)
Language

    Closures now implement Copy and/or Clone if all captured variables implement either or both traits.
    The inclusive range syntax e.g. for x in 0..=10 is now stable.
    Stablise '_. The underscore lifetime can be used anywhere where a lifetime can be elided.
    impl Trait is now stable allowing you to have abstract types in returns or in function parameters. e.g. fn foo() -> impl Iterator<Item=u8> or fn open(path: impl AsRef<Path>).
    Pattern matching will now automatically apply dereferences.
    128-bit integers in the form of u128 and i128 are now stable.
    main can now return Result<(), E: Debug> in addition to ().
    A lot of operations are now available in a const context. E.g. You can now index into constant arrays, reference and dereference into constants, and use Tuple struct constructors.
    Fixed entry slice patterns are now stable. e.g.

    let points = [1, 2, 3, 4];
    match points {
        [1, 2, 3, 4] => println!("All points were sequential."),
        _ => println!("Not all points were sequential."),
    }

Compiler

    LLD is now used as the default linker for wasm32-unknown-unknown.
    Fixed exponential projection complexity on nested types. This can provide up to a ~12% reduction in compile times for certain crates.
    Added the --remap-path-prefix option to rustc. Allowing you to remap path prefixes outputted by the compiler.
    Added powerpc-unknown-netbsd target.

Libraries

    Implemented From<u16> for usize & From<{u8, i16}> for isize.
    Added hexadecimal formatting for integers with fmt::Debug e.g. assert!(format!("{:02x?}", b"Foo\0") == "[46, 6f, 6f, 00]")
    Implemented Default, Hash for cmp::Reverse.
    Optimized str::repeat being 8x faster in large cases.
    ascii::escape_default is now available in libcore.
    Trailing commas are now supported in std and core macros.
    Implemented Copy, Clone for cmp::Reverse
    Implemented Clone for char::{ToLowercase, ToUppercase}.

Stabilized APIs

    *const T::add
    *const T::copy_to_nonoverlapping
    *const T::copy_to
    *const T::read_unaligned
    *const T::read_volatile
    *const T::read
    *const T::sub
    *const T::wrapping_add
    *const T::wrapping_sub
    *mut T::add
    *mut T::copy_to_nonoverlapping
    *mut T::copy_to
    *mut T::read_unaligned
    *mut T::read_volatile
    *mut T::read
    *mut T::replace
    *mut T::sub
    *mut T::swap
    *mut T::wrapping_add
    *mut T::wrapping_sub
    *mut T::write_bytes
    *mut T::write_unaligned
    *mut T::write_volatile
    *mut T::write
    Box::leak
    FromUtf8Error::as_bytes
    LocalKey::try_with
    Option::cloned
    btree_map::Entry::and_modify
    fs::read_to_string
    fs::read
    fs::write
    hash_map::Entry::and_modify
    iter::FusedIterator
    ops::RangeInclusive
    ops::RangeToInclusive
    process::id
    slice::rotate_left
    slice::rotate_right
    String::retain

Cargo

    Cargo will now output path to custom commands when -v is passed with --list
    The Cargo binary version is now the same as the Rust version
    Cargo.lock files are now included in published crates.

Misc

    The second edition of "The Rust Programming Language" book is now recommended over the first.

Compatibility Notes

    aliasing a Fn trait as dyn no longer works. E.g. the following syntax is now invalid.

    use std::ops::Fn as dyn;
    fn g(_: Box<dyn(std::fmt::Debug)>) {}

    The result of dereferences are no longer promoted to 'static. e.g.

    fn main() {
        const PAIR: &(i32, i32) = &(0, 1);
        let _reversed_pair: &'static _ = &(PAIR.1, PAIR.0); // Doesn't work
    }

    Deprecate AsciiExt trait in favor of inherent methods.
    ".e0" will now no longer parse as 0.0 and will instead cause an error.
    Removed hoedown from rustdoc.
    Bounds on higher-kinded lifetimes a hard error.
2018-05-18 12:45:52 +00:00
jperkin
997321e719 rust: Re-enable SunOS support. 2018-04-04 22:38:27 +00:00
ryoon
d5296f822f Update to 1.25.0
Changelog:
Version 1.25.0 (2018-03-29)
Language

    Stabilised #[repr(align(x))]. RFC 1358
    You can now use nested groups of imports. e.g. use std::{fs::File, io::Read, path::{Path, PathBuf}};
    You can now have | at the start of a match arm. e.g.

enum Foo { A, B, C }

fn main() {
    let x = Foo::A;
    match x {
        | Foo::A
        | Foo::B => println!("AB"),
        | Foo::C => println!("C"),
    }
}

Compiler

    Upgraded to LLVM 6.
    Added -C lto=val option.
    Added i586-unknown-linux-musl target

Libraries

    Impl Send for process::Command on Unix.
    Impl PartialEq and Eq for ParseCharError.
    UnsafeCell::into_inner is now safe.
    Implement libstd for CloudABI.
    Float::{from_bits, to_bits} is now available in libcore.
    Implement AsRef<Path> for Component
    Implemented Write for Cursor<&mut Vec<u8>>
    Moved Duration to libcore.

Stabilized APIs

    Location::column
    ptr::NonNull

The following functions can now be used in a constant expression. eg. static MINUTE: Duration = Duration::from_secs(60);

    Duration::new
    Duration::from_secs
    Duration::from_millis

Cargo

    cargo new no longer removes rust or rs prefixs/suffixs.
    cargo new now defaults to creating a binary crate, instead of a library crate.

Misc

    Rust by example is now shipped with new releases

Compatibility Notes

    Deprecated net::lookup_host.
    rustdoc has switched to pulldown as the default markdown renderer.
    The borrow checker was sometimes incorrectly permitting overlapping borrows around indexing operations (see #47349). This has been fixed (which also enabled some correct code that used to cause errors (e.g. #33903 and #46095).
    Removed deprecated unstable attribute #[simd].
2018-04-04 12:16:46 +00:00
ryoon
ab803a6bb2 Update to 1.24.1
Changelog:
    Do not abort when unwinding through FFI (this reverts behavior added
      in 1.24.0)
    Emit UTF-16 files for linker arguments on Windows
    Make the error index generator work again
    Cargo will warn on Windows 7 if an update is needed.
2018-03-03 22:11:26 +00:00
triaxx
862e6d4a6d Enable FreeBSD support 2018-03-02 05:59:18 +00:00
ryoon
a325dccc60 Update to 1.24.0
* Disable SunOS support for a while

Changelog:
Version 1.24.0 (2018-02-15)
Language
    External sysv64 ffi is now available. eg. extern "sysv64" fn foo () {}

Compiler
    rustc now uses 16 codegen units by default for release builds. For
      the fastest builds, utilize codegen-units=1.
    Added armv4t-unknown-linux-gnueabi target.
    Add aarch64-unknown-openbsd support

Libraries
    str::find::<char> now uses memchr. This should lead to a 10x improvement
      in performance in the majority of cases.
    OsStr's Debug implementation is now lossless and consistent with Windows.
    time::{SystemTime, Instant} now implement Hash.
    impl From<bool> for AtomicBool
    impl From<{CString, &CStr}> for {Arc<CStr>, Rc<CStr>}
    impl From<{OsString, &OsStr}> for {Arc<OsStr>, Rc<OsStr>}
    impl From<{PathBuf, &Path}> for {Arc<Path>, Rc<Path>}
    float::from_bits now just uses transmute. This provides some optimisations
      from LLVM.
    Copied AsciiExt methods onto char
    Remove T: Sized requirement on ptr::is_null()
    impl From<RecvError> for {TryRecvError, RecvTimeoutError}
    Optimised f32::{min, max} to generate more efficent x86 assembly
    [u8]::contains now uses memchr which provides a 3x speed improvement

Stabilized APIs
    RefCell::replace
    RefCell::swap
    atomic::spin_loop_hint

The following functions can now be used in a constant expression.
eg. let buffer: [u8; size_of::<usize>()];, static COUNTER: AtomicUsize =
AtomicUsize::new(1);

    AtomicBool::new
    AtomicUsize::new
    AtomicIsize::new
    AtomicPtr::new
    Cell::new
    {integer}::min_value
    {integer}::max_value
    mem::size_of
    mem::align_of
    ptr::null
    ptr::null_mut
    RefCell::new
    UnsafeCell::new

Cargo
    Added a workspace.default-members config that overrides implied --all
      in virtual workspaces.
    Enable incremental by default on development builds. Also added
      configuration keys to Cargo.toml and .cargo/config to disable on
      a per-project or global basis respectively.

Misc
Compatibility Notes
    Floating point types Debug impl now always prints a decimal point.
    Ipv6Addr now rejects superfluous ::'s in IPv6 addresses This is in
      accordance with IETF RFC 4291 Sec. 2.2.
    Unwinding will no longer go past FFI boundaries, and will instead abort.
    Formatter::flags method is now deprecated. The sign_plus, sign_minus,
      alternate, and sign_aware_zero_pad should be used instead.
    Leading zeros in tuple struct members is now an error
    column!() macro is one-based instead of zero-based
    fmt::Arguments can no longer be shared across threads
    Access to #[repr(packed)] struct fields is now unsafe
    Cargo sets a different working directory for the compiler
2018-02-18 12:12:54 +00:00
ryoon
a4a642f3e3 Enable SunOS/Solaris support
However SunOS build fails with internal libtool.
2018-01-09 11:47:33 +00:00
ryoon
f166e97b4c Update to 1.23.0
* Disable Solaris/SunOS suppprt for a while

Changelog:
# What's in 1.23.0 stable

New year, new Rust! For our first improvement today, we now avoid
some unnecessary copies in certain situations. We've seen memory
usage of using rustc to drop 5-10% with this change; it may be
different with your programs.

The documentation team has been on a long journey to move rustdoc
to use CommonMark. Previously, rustdoc never guaranteed which
markdown rendering engine it used, but we're finally committing to
CommonMark. As part of this release, we render the documentation
with our previous renderer, Hoedown, but also render it with a
CommonMark compliant renderer, and warn if there are any differences.
There should be a way for you to modify the syntax you use to render
correctly under both; we're not aware of any situations where this
is impossible. Docs team member Guillaume Gomez has written a blog
post showing some common differences and how to solve them. In a
future release, we will switch to using the CommonMark renderer by
default. This warning landed in nightly in May of last year, and
has been on by default since October of last year, so many crates
have already fixed any issues that they've found.

In other documentation news, historically, Cargo's docs have been
a bit strange. Rather than being on doc.rust-lang.org, they've been
at doc.crates.io. With this release, that's changing. You can now
find Cargo's docs at doc.rust-lang.org/cargo. Additionally, they've
been converted to the same format as our other long-form documentation.
We'll be adding a redirect from doc.crates.io to this page, and
you can expect to see more improvements and updates to Cargo's docs
throughout the year.

See the detailed release notes for more.

## Library stabilizations

As of Rust 1.0, a trait named AsciiExt existed to provide ASCII
related functionality on u8, char, [u8], and str. To use it, you'd
write code like this:

use std::ascii::AsciiExt;

let ascii = 'a';
let non_ascii = '❤';
let int_ascii = 97;

assert!(ascii.is_ascii());
assert!(!non_ascii.is_ascii());
assert!(int_ascii.is_ascii());

In Rust 1.23, these methods are now defined directly on those types,
and so you no longer need to import the trait. Thanks to our
stability guarantees, this trait still exists, so if you'd like to
still support Rust versions before Rust 1.23, you can do this:

#[allow(unused_imports)]
use std::ascii::AsciiExt;

...to suppress the related warning. Once you drop support for older
Rusts, you can remove both lines, and everything will continue to
work.

Additionally, a few new APIs were stabilized this release:

    The various std::sync::atomic types now implement From their
    non-atomic types. For example, let x = AtomicBool::from(true);.
    () now implements FromIterator<()>; check the PR for a neat
    use-case.  RwLock<T> has had its Send restriction lifted

See the detailed release notes for more.

## Cargo features

cargo check can now check your unit tests.

cargo uninstall can now uninstall more than one package in one
command.
2018-01-08 09:33:58 +00:00