@@ -4,34 +4,31 @@ Version 1.30.0 (2018-10-25)
4
4
Language
5
5
--------
6
6
- [ Procedural macros are now available.] [ 52081 ] These kinds of macros allow for
7
- more powerful code generation, there is a [ new chapter available] [ proc-macros ]
8
- in Rust Programming Language book that goes further in depth.
7
+ more powerful code generation. There is a [ new chapter available] [ proc-macros ]
8
+ in the Rust Programming Language book that goes further in depth.
9
9
- [ You can now use keywords as identifiers using the raw identifiers
10
- syntax (` r# ` ). ] [ 53236 ] e.g. ` let r#for = true; `
10
+ syntax (` r# ` ), ] [ 53236 ] e.g. ` let r#for = true; `
11
11
- [ Using anonymous parameters in traits is now deprecated with a warning and
12
12
will be a hard error in the 2018 edition.] [ 53272 ]
13
13
- [ You can now use ` crate ` in paths.] [ 54404 ] This allows you to refer to the
14
- crate root in the path. e.g. ` use crate::foo; ` refers to ` foo ` in ` src/lib.rs ` .
15
- - [ Using a external crate now no longer requires being prefixed with ` :: ` .] [ 54404 ]
16
- e.g. previously using a external crate in a module without a use statement
17
- required ` let json = ::serde_json::from_str(foo); ` can now be written
14
+ crate root in the path, e.g. ` use crate::foo; ` refers to ` foo ` in ` src/lib.rs ` .
15
+ - [ Using a external crate no longer requires being prefixed with ` :: ` .] [ 54404 ]
16
+ Previously, using a external crate in a module without a use statement
17
+ required ` let json = ::serde_json::from_str(foo); ` but can now be written
18
18
as ` let json = serde_json::from_str(foo); ` .
19
19
- [ You can now apply the ` #[used] ` attribute to static items to prevent the
20
- compiler from optimising them away even if they appear to be unused. ] [ 51363 ]
20
+ compiler from optimising them away, even if they appear to be unused, ] [ 51363 ]
21
21
e.g. ` #[used] static FOO: u32 = 1; `
22
22
- [ You can now import and reexport macros from other crates with the ` use `
23
23
syntax.] [ 50911 ] Macros exported with ` #[macro_export] ` are now placed into
24
24
the root module of the crate. If your macro relies on calling other local
25
- macros it is recommended to export with the
26
- ` #[macro_export(local_inner_macros)] ` attribute so that users won't have to
27
- import those macros.
28
- - [ ` mod.rs ` files are now optional.] [ 54146 ] Previously if you had a ` foo ` module
29
- with a ` bar ` submodule, you would have ` src/foo/mod.rs ` and ` src/foo/bar.rs ` .
30
- Now you can have ` src/foo.rs ` and ` src/foo/bar.rs ` to achieve the same effect.
25
+ macros, it is recommended to export with the
26
+ ` #[macro_export(local_inner_macros)] ` attribute so users won't have to import
27
+ those macros.
31
28
- [ You can now catch visibility keywords (e.g. ` pub ` , ` pub(crate) ` ) in macros
32
29
using the ` vis ` specifier.] [ 53370 ]
33
- - [ Non-macro attributes now allow all forms of literals not just
34
- strings.] [ 53044 ] e.g. Previously you would write ` #[attr("true")] ` you can now
30
+ - [ Non-macro attributes now allow all forms of literals, not just
31
+ strings.] [ 53044 ] Previously, you would write ` #[attr("true")] ` , and you can now
35
32
write ` #[attr(true)] ` .
36
33
- [ You can now specify a function to handle a panic in the Rust runtime with the
37
34
` #[panic_handler] ` attribute.] [ 51366 ]
@@ -54,9 +51,9 @@ Stabilized APIs
54
51
- [ ` Ipv6Addr::UNSPECIFIED ` ]
55
52
- [ ` Iterator::find_map ` ]
56
53
57
- The following methods are a replacement methods for ` trim_left ` , ` trim_right ` ,
58
- ` trim_left_matches ` , and ` trim_right_matches ` . Which will be deprecated
59
- in 1.33.0.
54
+ The following methods are replacement methods for ` trim_left ` , ` trim_right ` ,
55
+ ` trim_left_matches ` , and ` trim_right_matches ` , which will be deprecated
56
+ in 1.33.0:
60
57
- [ ` str::trim_end_matches ` ]
61
58
- [ ` str::trim_end ` ]
62
59
- [ ` str::trim_start_matches ` ]
76
73
----
77
74
- [ ` rustdoc ` allows you to specify what edition to treat your code as with the
78
75
` --edition ` option.] [ 54057 ]
79
- - [ ` rustdoc ` now has the ` --color ` (Specify whether to output color) and
80
- ` --error-format ` (Specify error format e.g. ` json ` ) options.] [ 53003 ]
76
+ - [ ` rustdoc ` now has the ` --color ` (specify whether to output color) and
77
+ ` --error-format ` (specify error format, e.g. ` json ` ) options.] [ 53003 ]
81
78
- [ We now distribute a ` rust-gdbgui ` script that invokes ` gdbgui ` with Rust
82
79
debug symbols.] [ 53774 ]
83
80
- [ Attributes from Rust tools such as ` rustfmt ` or ` clippy ` are now
84
- available. ] [ 53459 ] e.g. ` #[rustfmt::skip] ` will skip formatting the next item.
81
+ available, ] [ 53459 ] e.g. ` #[rustfmt::skip] ` will skip formatting the next item.
85
82
86
83
[ 50911 ] : https://github.com/rust-lang/rust/pull/50911/
87
84
[ 51363 ] : https://github.com/rust-lang/rust/pull/51363/
@@ -153,7 +150,7 @@ Compiler
153
150
154
151
Libraries
155
152
---------
156
- - [ ` Once::call_once ` now no longer requires ` Once ` to be ` 'static ` .] [ 52239 ]
153
+ - [ ` Once::call_once ` no longer requires ` Once ` to be ` 'static ` .] [ 52239 ]
157
154
- [ ` BuildHasherDefault ` now implements ` PartialEq ` and ` Eq ` .] [ 52402 ]
158
155
- [ ` Box<CStr> ` , ` Box<OsStr> ` , and ` Box<Path> ` now implement ` Clone ` .] [ 51912 ]
159
156
- [ Implemented ` PartialEq<&str> ` for ` OsString ` and ` PartialEq<OsString> `
@@ -169,10 +166,10 @@ Stabilized APIs
169
166
170
167
Cargo
171
168
-----
172
- - [ Cargo can silently fix some bad lockfiles ] [ cargo/5831 ] You can use
173
- ` --locked ` to disable this behaviour .
169
+ - [ Cargo can silently fix some bad lockfiles. ] [ cargo/5831 ] You can use
170
+ ` --locked ` to disable this behavior .
174
171
- [ ` cargo-install ` will now allow you to cross compile an install
175
- using ` --target ` ] [ cargo/5614 ]
172
+ using ` --target ` . ] [ cargo/5614 ]
176
173
- [ Added the ` cargo-fix ` subcommand to automatically move project code from
177
174
2015 edition to 2018.] [ cargo/5723 ]
178
175
- [ ` cargo doc ` can now optionally document private types using the
@@ -184,15 +181,15 @@ Misc
184
181
the specified level to that level.] [ 52354 ] For example ` --cap-lints warn `
185
182
will demote ` deny ` and ` forbid ` lints to ` warn ` .
186
183
- [ ` rustc ` and ` rustdoc ` will now have the exit code of ` 1 ` if compilation
187
- fails, and ` 101 ` if there is a panic.] [ 52197 ]
184
+ fails and ` 101 ` if there is a panic.] [ 52197 ]
188
185
- [ A preview of clippy has been made available through rustup.] [ 51122 ]
189
- You can install the preview with ` rustup component add clippy-preview `
186
+ You can install the preview with ` rustup component add clippy-preview ` .
190
187
191
188
Compatibility Notes
192
189
-------------------
193
190
- [ ` str::{slice_unchecked, slice_unchecked_mut} ` are now deprecated.] [ 51807 ]
194
191
Use ` str::get_unchecked(begin..end) ` instead.
195
- - [ ` std::env::home_dir ` is now deprecated for its unintuitive behaviour .] [ 51656 ]
192
+ - [ ` std::env::home_dir ` is now deprecated for its unintuitive behavior .] [ 51656 ]
196
193
Consider using the ` home_dir ` function from
197
194
https://crates.io/crates/dirs instead.
198
195
- [ ` rustc ` will no longer silently ignore invalid data in target spec.] [ 52330 ]
@@ -432,7 +429,7 @@ Language
432
429
be used as an identifier.
433
430
- [ The dyn syntax is now available.] [ 49968 ] This syntax is equivalent to the
434
431
bare ` Trait ` syntax, and should make it clearer when being used in tandem with
435
- ` impl Trait ` . Since it is equivalent to the following syntax:
432
+ ` impl Trait ` because it is equivalent to the following syntax:
436
433
` &Trait == &dyn Trait ` , ` &mut Trait == &mut dyn Trait ` , and
437
434
` Box<Trait> == Box<dyn Trait> ` .
438
435
- [ Attributes on generic parameters such as types and lifetimes are
@@ -495,10 +492,10 @@ Cargo
495
492
a different directory than ` target ` for placing compilation artifacts.
496
493
- [ Cargo will be adding automatic target inference for binaries, benchmarks,
497
494
examples, and tests in the Rust 2018 edition.] [ cargo/5335 ] If your project specifies
498
- specific targets e.g. using ` [[bin]] ` and have other binaries in locations
495
+ specific targets, e.g. using ` [[bin]] ` , and have other binaries in locations
499
496
where cargo would infer a binary, Cargo will produce a warning. You can
500
- disable this feature ahead of time by setting any of the following ` autobins ` ,
501
- ` autobenches ` , ` autoexamples ` , ` autotests ` to false .
497
+ disable this feature ahead of time by setting any of the following to false:
498
+ ` autobins ` , ` autobenches ` , ` autoexamples ` , ` autotests ` .
502
499
- [ Cargo will now cache compiler information.] [ cargo/5359 ] This can be disabled by
503
500
setting ` CARGO_CACHE_RUSTC_INFO=0 ` in your environment.
504
501
@@ -514,8 +511,8 @@ Compatibility Notes
514
511
work.] [ 49896 ] e.g. ` ::core::prelude::v1::StrExt::is_empty("") ` will not
515
512
compile, ` "".is_empty() ` will still compile.
516
513
- [ ` Debug ` output on ` atomic::{AtomicBool, AtomicIsize, AtomicPtr, AtomicUsize} `
517
- will only print the inner type.] [ 48553 ] e .g.
518
- ` print!("{:?}", AtomicBool::new(true)) ` will print ` true `
514
+ will only print the inner type.] [ 48553 ] E .g.
515
+ ` print!("{:?}", AtomicBool::new(true)) ` will print ` true ` ,
519
516
not ` AtomicBool(true) ` .
520
517
- [ The maximum number for ` repr(align(N)) ` is now 2²⁹.] [ 50378 ] Previously you
521
518
could enter higher numbers but they were not supported by LLVM. Up to 512MB
@@ -578,7 +575,7 @@ Version 1.26.2 (2018-06-05)
578
575
Compatibility Notes
579
576
-------------------
580
577
581
- - [ The borrow checker was fixed to avoid unsoundness when using match ergonomics] [ 51117 ]
578
+ - [ The borrow checker was fixed to avoid unsoundness when using match ergonomics. ] [ 51117 ]
582
579
583
580
[ 51117 ] : https://github.com/rust-lang/rust/issues/51117
584
581
@@ -589,18 +586,18 @@ Version 1.26.1 (2018-05-29)
589
586
Tools
590
587
-----
591
588
592
- - [ RLS now works on Windows] [ 50646 ]
593
- - [ Rustfmt stopped badly formatting text in some cases] [ rustfmt/2695 ]
589
+ - [ RLS now works on Windows. ] [ 50646 ]
590
+ - [ Rustfmt stopped badly formatting text in some cases. ] [ rustfmt/2695 ]
594
591
595
592
596
593
Compatibility Notes
597
594
--------
598
595
599
596
- [ ` fn main() -> impl Trait ` no longer works for non-Termination
600
- trait] [ 50656 ]
597
+ trait. ] [ 50656 ]
601
598
This reverts an accidental stabilization.
602
- - [ ` NaN > NaN ` no longer returns true in const-fn contexts] [ 50812 ]
603
- - [ Prohibit using turbofish for ` impl Trait ` in method arguments] [ 50950 ]
599
+ - [ ` NaN > NaN ` no longer returns true in const-fn contexts. ] [ 50812 ]
600
+ - [ Prohibit using turbofish for ` impl Trait ` in method arguments. ] [ 50950 ]
604
601
605
602
[ 50646 ] : https://github.com/rust-lang/rust/issues/50646
606
603
[ 50656 ] : https://github.com/rust-lang/rust/pull/50656
@@ -616,18 +613,18 @@ Language
616
613
- [ Closures now implement ` Copy ` and/or ` Clone ` if all captured variables
617
614
implement either or both traits.] [ 49299 ]
618
615
- [ The inclusive range syntax e.g. ` for x in 0..=10 ` is now stable.] [ 47813 ]
619
- - [ The ` '_ ` lifetime is now stable. The underscore lifetime can be used anywhere where a
616
+ - [ The ` '_ ` lifetime is now stable. The underscore lifetime can be used anywhere a
620
617
lifetime can be elided.] [ 49458 ]
621
618
- [ ` impl Trait ` is now stable allowing you to have abstract types in returns
622
- or in function parameters.] [ 49255 ] e .g. ` fn foo() -> impl Iterator<Item=u8> ` or
619
+ or in function parameters.] [ 49255 ] E .g. ` fn foo() -> impl Iterator<Item=u8> ` or
623
620
` fn open(path: impl AsRef<Path>) ` .
624
621
- [ Pattern matching will now automatically apply dereferences.] [ 49394 ]
625
622
- [ 128-bit integers in the form of ` u128 ` and ` i128 ` are now stable.] [ 49101 ]
626
623
- [ ` main ` can now return ` Result<(), E: Debug> ` ] [ 49162 ] in addition to ` () ` .
627
624
- [ A lot of operations are now available in a const context.] [ 46882 ] E.g. You
628
625
can now index into constant arrays, reference and dereference into constants,
629
- and use Tuple struct constructors.
630
- - [ Fixed entry slice patterns are now stable.] [ 48516 ] e .g.
626
+ and use tuple struct constructors.
627
+ - [ Fixed entry slice patterns are now stable.] [ 48516 ] E .g.
631
628
``` rust
632
629
let points = [1 , 2 , 3 , 4 ];
633
630
match points {
@@ -1052,7 +1049,7 @@ Language
1052
1049
Compiler
1053
1050
--------
1054
1051
- [ Enabled ` TrapUnreachable ` in LLVM which should mitigate the impact of
1055
- undefined behaviour .] [ 45920 ]
1052
+ undefined behavior .] [ 45920 ]
1056
1053
- [ rustc now suggests renaming import if names clash.] [ 45660 ]
1057
1054
- [ Display errors/warnings correctly when there are zero-width or
1058
1055
wide characters.] [ 45711 ]
0 commit comments