Skip to content

Commit 1189706

Browse files
Cherry-pick master's release notes
1 parent 2708486 commit 1189706

File tree

1 file changed

+149
-3
lines changed

1 file changed

+149
-3
lines changed

RELEASES.md

+149-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,152 @@
1+
Version 1.43.0 (2020-04-23)
2+
==========================
3+
4+
Language
5+
--------
6+
- [Fixed using binary operations with `&{number}` (e.g. `&1.0`) not having
7+
the type inferred correctly.][68129]
8+
- [Attributes such as `#[cfg()]` can now be used on `if` expressions.][69201]
9+
10+
**Syntax only changes**
11+
- [Allow `type Foo: Ord` syntactically.][69361]
12+
- [Fuse associated and extern items up to defaultness.][69194]
13+
- [Syntactically allow `self` in all `fn` contexts.][68764]
14+
- [Merge `fn` syntax + cleanup item parsing.][68728]
15+
- [`item` macro fragments can be interpolated into `trait`s, `impl`s, and `extern` blocks.][69366]
16+
For example, you may now write:
17+
```rust
18+
macro_rules! mac_trait {
19+
($i:item) => {
20+
trait T { $i }
21+
}
22+
}
23+
mac_trait! {
24+
fn foo() {}
25+
}
26+
```
27+
28+
These are still rejected *semantically*, so you will likely receive an error but
29+
these changes can be seen and parsed by macros and
30+
conditional compilation.
31+
32+
33+
Compiler
34+
--------
35+
- [You can now pass multiple lint flags to rustc to override the previous
36+
flags.][67885] For example; `rustc -D unused -A unused-variables` denies
37+
everything in the `unused` lint group except `unused-variables` which
38+
is explicitly allowed. However, passing `rustc -A unused-variables -D unused` denies
39+
everything in the `unused` lint group **including** `unused-variables` since
40+
the allow flag is specified before the deny flag (and therefore overridden).
41+
- [rustc will now prefer your system MinGW libraries over its bundled libraries
42+
if they are available on `windows-gnu`.][67429]
43+
- [rustc now buffers errors/warnings printed in JSON.][69227]
44+
45+
Libraries
46+
---------
47+
- [`Arc<[T; N]>`, `Box<[T; N]>`, and `Rc<[T; N]>`, now implement
48+
`TryFrom<Arc<[T]>>`,`TryFrom<Box<[T]>>`, and `TryFrom<Rc<[T]>>`
49+
respectively.][69538] **Note** These conversions are only available when `N`
50+
is `0..=32`.
51+
- [You can now use associated constants on floats and integers directly, rather
52+
than having to import the module.][68952] e.g. You can now write `u32::MAX` or
53+
`f32::NAN` with no imports.
54+
- [`u8::is_ascii` is now `const`.][68984]
55+
- [`String` now implements `AsMut<str>`.][68742]
56+
- [Added the `primitive` module to `std` and `core`.][67637] This module
57+
reexports Rust's primitive types. This is mainly useful in macros
58+
where you want avoid these types being shadowed.
59+
- [Relaxed some of the trait bounds on `HashMap` and `HashSet`.][67642]
60+
- [`string::FromUtf8Error` now implements `Clone + Eq`.][68738]
61+
62+
Stabilized APIs
63+
---------------
64+
- [`Once::is_completed`]
65+
- [`f32::LOG10_2`]
66+
- [`f32::LOG2_10`]
67+
- [`f64::LOG10_2`]
68+
- [`f64::LOG2_10`]
69+
- [`iter::once_with`]
70+
71+
Cargo
72+
-----
73+
- [You can now set config `[profile]`s in your `.cargo/config`, or through
74+
your environment.][cargo/7823]
75+
- [Cargo will now set `CARGO_BIN_EXE_<name>` pointing to a binary's
76+
executable path when running integration tests or benchmarks.][cargo/7697]
77+
`<name>` is the name of your binary as-is e.g. If you wanted the executable
78+
path for a binary named `my-program`you would use `env!("CARGO_BIN_EXE_my-program")`.
79+
80+
Misc
81+
----
82+
- [Certain checks in the `const_err` lint were deemed unrelated to const
83+
evaluation][69185], and have been moved to the `unconditional_panic` and
84+
`arithmetic_overflow` lints.
85+
86+
Compatibility Notes
87+
-------------------
88+
89+
- [Having trailing syntax in the `assert!` macro is now a hard error.][69548] This
90+
has been a warning since 1.36.0.
91+
- [Fixed `Self` not having the correctly inferred type.][69340] This incorrectly
92+
led to some instances being accepted, and now correctly emits a hard error.
93+
94+
[69340]: https://github.com/rust-lang/rust/pull/69340
95+
96+
Internal Only
97+
-------------
98+
These changes provide no direct user facing benefits, but represent significant
99+
improvements to the internals and overall performance of `rustc` and
100+
related tools.
101+
102+
- [All components are now built with `opt-level=3` instead of `2`.][67878]
103+
- [Improved how rustc generates drop code.][67332]
104+
- [Improved performance from `#[inline]`-ing certain hot functions.][69256]
105+
- [traits: preallocate 2 Vecs of known initial size][69022]
106+
- [Avoid exponential behaviour when relating types][68772]
107+
- [Skip `Drop` terminators for enum variants without drop glue][68943]
108+
- [Improve performance of coherence checks][68966]
109+
- [Deduplicate types in the generator witness][68672]
110+
- [Invert control in struct_lint_level.][68725]
111+
112+
[67332]: https://github.com/rust-lang/rust/pull/67332/
113+
[67429]: https://github.com/rust-lang/rust/pull/67429/
114+
[67637]: https://github.com/rust-lang/rust/pull/67637/
115+
[67642]: https://github.com/rust-lang/rust/pull/67642/
116+
[67878]: https://github.com/rust-lang/rust/pull/67878/
117+
[67885]: https://github.com/rust-lang/rust/pull/67885/
118+
[68129]: https://github.com/rust-lang/rust/pull/68129/
119+
[68672]: https://github.com/rust-lang/rust/pull/68672/
120+
[68725]: https://github.com/rust-lang/rust/pull/68725/
121+
[68728]: https://github.com/rust-lang/rust/pull/68728/
122+
[68738]: https://github.com/rust-lang/rust/pull/68738/
123+
[68742]: https://github.com/rust-lang/rust/pull/68742/
124+
[68764]: https://github.com/rust-lang/rust/pull/68764/
125+
[68772]: https://github.com/rust-lang/rust/pull/68772/
126+
[68943]: https://github.com/rust-lang/rust/pull/68943/
127+
[68952]: https://github.com/rust-lang/rust/pull/68952/
128+
[68966]: https://github.com/rust-lang/rust/pull/68966/
129+
[68984]: https://github.com/rust-lang/rust/pull/68984/
130+
[69022]: https://github.com/rust-lang/rust/pull/69022/
131+
[69185]: https://github.com/rust-lang/rust/pull/69185/
132+
[69194]: https://github.com/rust-lang/rust/pull/69194/
133+
[69201]: https://github.com/rust-lang/rust/pull/69201/
134+
[69227]: https://github.com/rust-lang/rust/pull/69227/
135+
[69548]: https://github.com/rust-lang/rust/pull/69548/
136+
[69256]: https://github.com/rust-lang/rust/pull/69256/
137+
[69361]: https://github.com/rust-lang/rust/pull/69361/
138+
[69366]: https://github.com/rust-lang/rust/pull/69366/
139+
[69538]: https://github.com/rust-lang/rust/pull/69538/
140+
[cargo/7823]: https://github.com/rust-lang/cargo/pull/7823
141+
[cargo/7697]: https://github.com/rust-lang/cargo/pull/7697
142+
[`Once::is_completed`]: https://doc.rust-lang.org/std/sync/struct.Once.html#method.is_completed
143+
[`f32::LOG10_2`]: https://doc.rust-lang.org/std/f32/consts/constant.LOG10_2.html
144+
[`f32::LOG2_10`]: https://doc.rust-lang.org/std/f32/consts/constant.LOG2_10.html
145+
[`f64::LOG10_2`]: https://doc.rust-lang.org/std/f64/consts/constant.LOG10_2.html
146+
[`f64::LOG2_10`]: https://doc.rust-lang.org/std/f64/consts/constant.LOG2_10.html
147+
[`iter::once_with`]: https://doc.rust-lang.org/std/iter/fn.once_with.html
148+
149+
1150
Version 1.42.0 (2020-03-12)
2151
==========================
3152

@@ -4838,7 +4987,6 @@ Version 1.11.0 (2016-08-18)
48384987
Language
48394988
--------
48404989

4841-
* [`cfg_attr` works on `path` attributes](https://github.com/rust-lang/rust/pull/34546)
48424990
* [Support nested `cfg_attr` attributes](https://github.com/rust-lang/rust/pull/34216)
48434991
* [Allow statement-generating braced macro invocations at the end of blocks](https://github.com/rust-lang/rust/pull/34436)
48444992
* [Macros can be expanded inside of trait definitions](https://github.com/rust-lang/rust/pull/34213)
@@ -4957,8 +5105,6 @@ Version 1.10.0 (2016-07-07)
49575105
Language
49585106
--------
49595107

4960-
* [Allow `concat_idents!` in type positions as well as in expression
4961-
positions](https://github.com/rust-lang/rust/pull/33735).
49625108
* [`Copy` types are required to have a trivial implementation of `Clone`](https://github.com/rust-lang/rust/pull/33420).
49635109
[RFC 1521](https://github.com/rust-lang/rfcs/blob/master/text/1521-copy-clone-semantics.md).
49645110
* [Single-variant enums support the `#[repr(..)]` attribute](https://github.com/rust-lang/rust/pull/33355).

0 commit comments

Comments
 (0)