Skip to content

Commit b68432d

Browse files
committed
Auto merge of #51521 - Mark-Simulacrum:rollup, r=Mark-Simulacrum
Rollup of 3 pull requests Successful merges: - #51261 (Updated RELEASES.md for 1.27.0) - #51502 (Make parse_seq_to_end and parse_path public) - #51510 (Long diagnostic for E0538) Failed merges:
2 parents ef8cb40 + 398e570 commit b68432d

File tree

3 files changed

+188
-3
lines changed

3 files changed

+188
-3
lines changed

RELEASES.md

+156
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,157 @@
1+
Version 1.27.0 (2018-06-21)
2+
==========================
3+
4+
Language
5+
--------
6+
- [Removed 'proc' from the reserved keywords list.][49699] This allows `proc` to
7+
be used as an identifer.
8+
- [The dyn syntax is now available.][49968] This syntax is equivalent to the
9+
bare `Trait` syntax, and should make it clearer when being used in tandem with
10+
`impl Trait`. Since it is equivalent to the following syntax:
11+
`&Trait == &dyn Trait`, `&mut Trait == &mut dyn Trait`, and
12+
`Box<Trait> == Box<dyn Trait>`.
13+
- [Attributes on generic parameters such as types and lifetimes are
14+
now stable.][48851] e.g.
15+
`fn foo<#[lifetime_attr] 'a, #[type_attr] T: 'a>() {}`
16+
- [The `#[must_use]` attribute can now also be used on functions as well as
17+
types.][48925] It provides a lint that by default warns users when the
18+
value returned by a function has not been used.
19+
20+
Compiler
21+
--------
22+
- [Added the `armv5te-unknown-linux-musl` target.][50423]
23+
24+
Libraries
25+
---------
26+
- [SIMD (Single Instruction Multiple Data) on x86/x86_64 is now stable.][49664]
27+
This includes [`arch::x86`] & [`arch::x86_64`] modules which contain
28+
SIMD intrinsics, a new macro called `is_x86_feature_detected!`, the
29+
`#[target_feature(enable="")]` attribute, and adding `target_feature = ""` to
30+
the `cfg` attribute.
31+
- [A lot of methods for `[u8]`, `f32`, and `f64` previously only available in
32+
std are now available in core.][49896]
33+
- [The generic `Rhs` type parameter on `ops::{Shl, ShlAssign, Shr}` now defaults
34+
to `Self`.][49630]
35+
- [`std::str::replace` now has the `#[must_use]` attribute][50177] to clarify
36+
that the operation isn't done in place.
37+
- [`Clone::clone`, `Iterator::collect`, and `ToOwned::to_owned` now have
38+
the `#[must_use]` attribute][49533] to warn about unused potentially
39+
expensive allocations.
40+
41+
Stabilized APIs
42+
---------------
43+
- [`DoubleEndedIterator::rfind`]
44+
- [`DoubleEndedIterator::rfold`]
45+
- [`DoubleEndedIterator::try_rfold`]
46+
- [`Duration::from_micros`]
47+
- [`Duration::from_nanos`]
48+
- [`Duration::subsec_micros`]
49+
- [`Duration::subsec_millis`]
50+
- [`HashMap::remove_entry`]
51+
- [`Iterator::try_fold`]
52+
- [`Iterator::try_for_each`]
53+
- [`NonNull::cast`]
54+
- [`Option::filter`]
55+
- [`String::replace_range`]
56+
- [`Take::set_limit`]
57+
- [`hint::unreachable_unchecked`]
58+
- [`os::unix::process::parent_id`]
59+
- [`process::id`]
60+
- [`ptr::swap_nonoverlapping`]
61+
- [`slice::rsplit_mut`]
62+
- [`slice::rsplit`]
63+
- [`slice::swap_with_slice`]
64+
65+
Cargo
66+
-----
67+
- [`cargo-metadata` now includes `authors`, `categories`, `keywords`,
68+
`readme`, and `repository` fields.][cargo/5386]
69+
- [Added the `--target-dir` optional argument.][cargo/5393] This allows you to specify
70+
a different directory than `target` for placing compilation artifacts.
71+
- [Cargo will be adding automatic target inference for binaries, benchmarks,
72+
examples, and tests in the Rust 2018 edition.][cargo/5335] If your project specifies
73+
specific targets e.g. using `[[bin]]` and have other binaries in locations
74+
where cargo would infer a binary, Cargo will produce a warning. You can
75+
disable this feature ahead of time by setting any of the following `autobins`,
76+
`autobenches`, `autoexamples`, `autotests` to false.
77+
- [Cargo will now cache compiler information.][cargo/5359] This can be disabled by
78+
setting `CARGO_CACHE_RUSTC_INFO=0` in your environment.
79+
80+
Misc
81+
----
82+
- [Added “The Rustc book” into the official documentation.][49707]
83+
[“The Rustc book”] documents and teaches how to use the rustc compiler.
84+
- [All books available on `doc.rust-lang.org` are now searchable.][49623]
85+
86+
Compatibility Notes
87+
-------------------
88+
- [Calling a `CharExt` or `StrExt` method directly on core will no longer
89+
work.][49896] e.g. `::core::prelude::v1::StrExt::is_empty("")` will not
90+
compile, `"".is_empty()` will still compile.
91+
- [`Debug` output on `atomic::{AtomicBool, AtomicIsize, AtomicPtr, AtomicUsize}`
92+
will only print the inner type.][48553] e.g.
93+
`print!("{:?}", AtomicBool::new(true))` will print `true`
94+
not `AtomicBool(true)`.
95+
- [`?` can no longer be a separator in macros.][49719] e.g. the following will
96+
no longer compile.
97+
```rust
98+
macro_rules! barplus {
99+
($(a)?+) => {}
100+
}
101+
```
102+
- [The maximum number for `repr(align(N))` is now 2²⁹.][50378] Previously you
103+
could enter higher numbers but they were not supported by LLVM. Up to 512MB
104+
alignment should cover all use cases.
105+
106+
[48553]: https://github.com/rust-lang/rust/pull/48553/
107+
[48851]: https://github.com/rust-lang/rust/pull/48851/
108+
[48925]: https://github.com/rust-lang/rust/pull/48925/
109+
[49533]: https://github.com/rust-lang/rust/pull/49533/
110+
[49623]: https://github.com/rust-lang/rust/pull/49623/
111+
[49630]: https://github.com/rust-lang/rust/pull/49630/
112+
[49664]: https://github.com/rust-lang/rust/pull/49664/
113+
[49699]: https://github.com/rust-lang/rust/pull/49699/
114+
[49707]: https://github.com/rust-lang/rust/pull/49707/
115+
[49719]: https://github.com/rust-lang/rust/pull/49719/
116+
[49896]: https://github.com/rust-lang/rust/pull/49896/
117+
[49968]: https://github.com/rust-lang/rust/pull/49968/
118+
[50177]: https://github.com/rust-lang/rust/pull/50177/
119+
[50378]: https://github.com/rust-lang/rust/pull/50378/
120+
[50398]: https://github.com/rust-lang/rust/pull/50398/
121+
[50423]: https://github.com/rust-lang/rust/pull/50423/
122+
[cargo/5203]: https://github.com/rust-lang/cargo/pull/5203/
123+
[cargo/5335]: https://github.com/rust-lang/cargo/pull/5335/
124+
[cargo/5359]: https://github.com/rust-lang/cargo/pull/5359/
125+
[cargo/5386]: https://github.com/rust-lang/cargo/pull/5386/
126+
[cargo/5393]: https://github.com/rust-lang/cargo/pull/5393/
127+
[`DoubleEndedIterator::rfind`]: https://doc.rust-lang.org/std/iter/trait.DoubleEndedIterator.html#method.rfind
128+
[`DoubleEndedIterator::rfold`]: https://doc.rust-lang.org/std/iter/trait.DoubleEndedIterator.html#method.rfold
129+
[`DoubleEndedIterator::try_rfold`]: https://doc.rust-lang.org/std/iter/trait.DoubleEndedIterator.html#method.try_rfold
130+
[`Duration::from_micros`]: https://doc.rust-lang.org/std/time/struct.Duration.html#method.from_micros
131+
[`Duration::from_nanos`]: https://doc.rust-lang.org/std/time/struct.Duration.html#method.from_nanos
132+
[`Duration::subsec_micros`]: https://doc.rust-lang.org/std/time/struct.Duration.html#method.subsec_micros
133+
[`Duration::subsec_millis`]: https://doc.rust-lang.org/std/time/struct.Duration.html#method.subsec_millis
134+
[`HashMap::remove_entry`]: https://doc.rust-lang.org/std/collections/struct.HashMap.html#method.remove_entry
135+
[`Iterator::try_fold`]: https://doc.rust-lang.org/std/iter/trait.Iterator.html#method.try_fold
136+
[`Iterator::try_for_each`]: https://doc.rust-lang.org/std/iter/trait.Iterator.html#method.try_for_each
137+
[`NonNull::cast`]: https://doc.rust-lang.org/std/ptr/struct.NonNull.html#method.cast
138+
[`Option::filter`]: https://doc.rust-lang.org/std/option/enum.Option.html#method.filter
139+
[`String::replace_range`]: https://doc.rust-lang.org/std/string/struct.String.html#method.replace_range
140+
[`Take::set_limit`]: https://doc.rust-lang.org/std/io/struct.Take.html#method.set_limit
141+
[`slice::rsplit_mut`]: https://doc.rust-lang.org/std/primitive.slice.html#method.rsplit_mut
142+
[`slice::rsplit`]: https://doc.rust-lang.org/std/primitive.slice.html#method.rsplit
143+
[`slice::swap_with_slice`]: https://doc.rust-lang.org/std/primitive.slice.html#method.swap_with_slice
144+
[`arch::x86_64`]: https://doc.rust-lang.org/std/arch/x86_64/index.html
145+
[`arch::x86`]: https://doc.rust-lang.org/std/arch/x86/index.html
146+
[`fs::read`]:
147+
[`fs::write`]:
148+
[`hint::unreachable_unchecked`]: https://doc.rust-lang.org/std/hint/fn.unreachable_unchecked.html
149+
[`os::unix::process::parent_id`]: https://doc.rust-lang.org/std/os/unix/process/fn.parent_id.html
150+
[`ptr::swap_nonoverlapping`]: https://doc.rust-lang.org/std/ptr/fn.swap_nonoverlapping.html
151+
[`process::id`]: https://doc.rust-lang.org/std/process/fn.id.html
152+
[“The Rustc book”]: https://doc.rust-lang.org/rustc
153+
154+
1155
Version 1.26.2 (2018-06-05)
2156
==========================
3157

@@ -8,6 +162,7 @@ Compatibility Notes
8162

9163
[51117]: https://github.com/rust-lang/rust/issues/51117
10164

165+
11166
Version 1.26.1 (2018-05-29)
12167
==========================
13168

@@ -17,6 +172,7 @@ Tools
17172
- [RLS now works on Windows][50646]
18173
- [Rustfmt stopped badly formatting text in some cases][rustfmt/2695]
19174

175+
20176
Compatibility Notes
21177
--------
22178

src/libsyntax/diagnostic_list.rs

+30-1
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,36 @@ For more information about the cfg attribute, read:
9393
https://doc.rust-lang.org/reference.html#conditional-compilation
9494
"##,
9595

96+
E0538: r##"
97+
Attribute contains same meta item more than once.
98+
99+
Erroneous code example:
100+
101+
```compile_fail,E0538
102+
#[deprecated(
103+
since="1.0.0",
104+
note="First deprecation note.",
105+
note="Second deprecation note." // error: multiple same meta item
106+
)]
107+
fn deprecated_function() {}
108+
```
109+
110+
Meta items are the key-value pairs inside of an attribute. Each key may only be
111+
used once in each attribute.
112+
113+
To fix the problem, remove all but one of the meta items with the same key.
114+
115+
Example:
116+
117+
```
118+
#[deprecated(
119+
since="1.0.0",
120+
note="First deprecation note."
121+
)]
122+
fn deprecated_function() {}
123+
```
124+
"##,
125+
96126
E0541: r##"
97127
An unknown meta item was used.
98128
@@ -347,7 +377,6 @@ and likely to change in the future.
347377
}
348378

349379
register_diagnostics! {
350-
E0538, // multiple [same] items
351380
E0539, // incorrect meta item
352381
E0540, // multiple rustc_deprecated attributes
353382
E0542, // missing 'since'

src/libsyntax/parse/parser.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1022,7 +1022,7 @@ impl<'a> Parser<'a> {
10221022
/// Parse a sequence, including the closing delimiter. The function
10231023
/// f must consume tokens until reaching the next separator or
10241024
/// closing bracket.
1025-
crate fn parse_seq_to_end<T, F>(&mut self,
1025+
pub fn parse_seq_to_end<T, F>(&mut self,
10261026
ket: &token::Token,
10271027
sep: SeqSep,
10281028
f: F)
@@ -1886,7 +1886,7 @@ impl<'a> Parser<'a> {
18861886
/// `a::b::C::<D>` (with disambiguator)
18871887
/// `Fn(Args)` (without disambiguator)
18881888
/// `Fn::(Args)` (with disambiguator)
1889-
crate fn parse_path(&mut self, style: PathStyle) -> PResult<'a, ast::Path> {
1889+
pub fn parse_path(&mut self, style: PathStyle) -> PResult<'a, ast::Path> {
18901890
self.parse_path_common(style, true)
18911891
}
18921892

0 commit comments

Comments
 (0)