Skip to content

Commit 94dca9a

Browse files
committed
Auto merge of #40401 - brson:beta-next, r=alexcrichton
Beta next - #40285 - #40272 - #40064 - #39835 - #40398 r? @alexcrichton
2 parents 92e7b9b + a0a352d commit 94dca9a

File tree

15 files changed

+391
-49
lines changed

15 files changed

+391
-49
lines changed

RELEASES.md

+191
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,194 @@
1+
Version 1.16.0 (2017-03-16)
2+
===========================
3+
4+
Language
5+
--------
6+
7+
* Lifetimes in statics and consts default to `'static`. [RFC 1623]
8+
* [The compiler's `dead_code` lint now accounts for type aliases][38051].
9+
* [Uninhabitable enums (those without any variants) no longer permit wildcard
10+
match patterns][38069]
11+
* [Clean up semantics of `self` in an import list][38313]
12+
* [`Self` may appear in `impl` headers][38920]
13+
* [`Self` may appear in struct expressions][39282]
14+
15+
Compiler
16+
--------
17+
18+
* [`rustc` now supports `--emit=metadata`, which causes rustc to emit
19+
a `.rmeta` file containing only crate metadata][38571]. This can be
20+
used by tools like the Rust Language Service to perform
21+
metadata-only builds.
22+
* [Levenshtein based typo suggestions now work in most places, while
23+
previously they worked only for fields and sometimes for local
24+
variables][38927]. Together with the overhaul of "no
25+
resolution"/"unexpected resolution" errors (#[38154]) they result in
26+
large and systematic improvement in resolution diagnostics.
27+
* [Fix `transmute::<T, U>` where `T` requires a bigger alignment than
28+
`U`][38670]
29+
* [rustc: use -Xlinker when specifying an rpath with ',' in it][38798]
30+
* [`rustc` no longer attempts to provide "consider using an explicit
31+
lifetime" suggestions][37057]. They were inaccurate.
32+
33+
Stabilized APIs
34+
---------------
35+
36+
* [`VecDeque::truncate`]
37+
* [`VecDeque::resize`]
38+
* [`String::insert_str`]
39+
* [`Duration::checked_add`]
40+
* [`Duration::checked_sub`]
41+
* [`Duration::checked_div`]
42+
* [`Duration::checked_mul`]
43+
* [`str::replacen`]
44+
* [`str::repeat`]
45+
* [`SocketAddr::is_ipv4`]
46+
* [`SocketAddr::is_ipv6`]
47+
* [`IpAddr::is_ipv4`]
48+
* [`IpAddr::is_ipv6`]
49+
* [`Vec::dedup_by`]
50+
* [`Vec::dedup_by_key`]
51+
* [`Result::unwrap_or_default`]
52+
* [`<*const T>::wrapping_offset`]
53+
* [`<*mut T>::wrapping_offset`]
54+
* `CommandExt::creation_flags`
55+
* [`File::set_permissions`]
56+
* [`String::split_off`]
57+
58+
Libraries
59+
---------
60+
61+
* [`[T]::binary_search` and `[T]::binary_search_by_key` now take
62+
their argument by `Borrow` parameter][37761]
63+
* [All public types in std implement `Debug`][38006]
64+
* [`IpAddr` implements `From<Ipv4Addr>` and `From<Ipv6Addr>`][38327]
65+
* [`Ipv6Addr` implements `From<[u16; 8]>`][38131]
66+
* [Ctrl-Z returns from `Stdin.read()` when reading from the console on
67+
Windows][38274]
68+
* [std: Fix partial writes in `LineWriter`][38062]
69+
* [std: Clamp max read/write sizes on Unix][38062]
70+
* [Use more specific panic message for `&str` slicing errors][38066]
71+
* [`TcpListener::set_only_v6` is deprecated][38304]. This
72+
functionality cannot be achieved in std currently.
73+
* [`writeln!`, like `println!`, now accepts a form with no string
74+
or formatting arguments, to just print a newline][38469]
75+
* [Implement `iter::Sum` and `iter::Product` for `Result`][38580]
76+
* [Reduce the size of static data in `std_unicode::tables`][38781]
77+
* [`char::EscapeDebug`, `EscapeDefault`, `EscapeUnicode`,
78+
`CaseMappingIter`, `ToLowercase`, `ToUppercase`, implement
79+
`Display`][38909]
80+
* [`Duration` implements `Sum`][38712]
81+
* [`String` implements `ToSocketAddrs`][39048]
82+
83+
Cargo
84+
-----
85+
86+
* [The `cargo check` command does a type check of a project without
87+
building it][cargo/3296]
88+
* [crates.io will display CI badges from Travis and AppVeyor, if
89+
specified in Cargo.toml][cargo/3546]
90+
* [crates.io will display categories listed in Cargo.toml][cargo/3301]
91+
* [Compilation profiles accept integer values for `debug`, in addition
92+
to `true` and `false`. These are passed to `rustc` as the value to
93+
`-C debuginfo`][cargo/3534]
94+
* [Implement `cargo --version --verbose`][cargo/3604]
95+
* [All builds now output 'dep-info' build dependencies compatible with
96+
make and ninja][cargo/3557]
97+
* [Build all workspace members with `build --all`][cargo/3511]
98+
* [Document all workspace members with `doc --all`][cargo/3515]
99+
* [Path deps outside workspace are not members][cargo/3443]
100+
101+
Misc
102+
----
103+
104+
* [`rustdoc` has a `--sysroot` argument that, like `rustc`, specifies
105+
the path to the Rust implementation][38589]
106+
* [The `armv7-linux-androideabi` target no longer enables NEON
107+
extensions, per Google's ABI guide][38413]
108+
* [The stock standard library can be compiled for Redox OS][38401]
109+
* [Rust has initial SPARC support][38726]. Tier 3. No builds
110+
available.
111+
* [Rust has experimental support for Nvidia PTX][38559]. Tier 3. No
112+
builds available.
113+
* [Fix backtraces on i686-pc-windows-gnu by disabling FPO][39379]
114+
115+
Compatibility Notes
116+
-------------------
117+
118+
* [Uninhabitable enums (those without any variants) no longer permit wildcard
119+
match patterns][38069]
120+
* In this release, references to uninhabited types can not be
121+
pattern-matched. This was accidentally allowed in 1.15.
122+
* [The compiler's `dead_code` lint now accounts for type aliases][38051].
123+
* [Ctrl-Z returns from `Stdin.read()` when reading from the console on
124+
Windows][38274]
125+
* [Clean up semantics of `self` in an import list][38313]
126+
127+
[37057]: https://github.com/rust-lang/rust/pull/37057
128+
[37761]: https://github.com/rust-lang/rust/pull/37761
129+
[38006]: https://github.com/rust-lang/rust/pull/38006
130+
[38051]: https://github.com/rust-lang/rust/pull/38051
131+
[38062]: https://github.com/rust-lang/rust/pull/38062
132+
[38062]: https://github.com/rust-lang/rust/pull/38622
133+
[38066]: https://github.com/rust-lang/rust/pull/38066
134+
[38069]: https://github.com/rust-lang/rust/pull/38069
135+
[38131]: https://github.com/rust-lang/rust/pull/38131
136+
[38154]: https://github.com/rust-lang/rust/pull/38154
137+
[38274]: https://github.com/rust-lang/rust/pull/38274
138+
[38304]: https://github.com/rust-lang/rust/pull/38304
139+
[38313]: https://github.com/rust-lang/rust/pull/38313
140+
[38314]: https://github.com/rust-lang/rust/pull/38314
141+
[38327]: https://github.com/rust-lang/rust/pull/38327
142+
[38401]: https://github.com/rust-lang/rust/pull/38401
143+
[38413]: https://github.com/rust-lang/rust/pull/38413
144+
[38469]: https://github.com/rust-lang/rust/pull/38469
145+
[38559]: https://github.com/rust-lang/rust/pull/38559
146+
[38571]: https://github.com/rust-lang/rust/pull/38571
147+
[38580]: https://github.com/rust-lang/rust/pull/38580
148+
[38589]: https://github.com/rust-lang/rust/pull/38589
149+
[38670]: https://github.com/rust-lang/rust/pull/38670
150+
[38712]: https://github.com/rust-lang/rust/pull/38712
151+
[38726]: https://github.com/rust-lang/rust/pull/38726
152+
[38781]: https://github.com/rust-lang/rust/pull/38781
153+
[38798]: https://github.com/rust-lang/rust/pull/38798
154+
[38909]: https://github.com/rust-lang/rust/pull/38909
155+
[38920]: https://github.com/rust-lang/rust/pull/38920
156+
[38927]: https://github.com/rust-lang/rust/pull/38927
157+
[39048]: https://github.com/rust-lang/rust/pull/39048
158+
[39282]: https://github.com/rust-lang/rust/pull/39282
159+
[39379]: https://github.com/rust-lang/rust/pull/39379
160+
[`<*const T>::wrapping_offset`]: https://doc.rust-lang.org/std/primitive.pointer.html#method.wrapping_offset
161+
[`<*mut T>::wrapping_offset`]: https://doc.rust-lang.org/std/primitive.pointer.html#method.wrapping_offset
162+
[`Duration::checked_add`]: https://doc.rust-lang.org/std/time/struct.Duration.html#method.checked_add
163+
[`Duration::checked_div`]: https://doc.rust-lang.org/std/time/struct.Duration.html#method.checked_div
164+
[`Duration::checked_mul`]: https://doc.rust-lang.org/std/time/struct.Duration.html#method.checked_mul
165+
[`Duration::checked_sub`]: https://doc.rust-lang.org/std/time/struct.Duration.html#method.checked_sub
166+
[`File::set_permissions`]: https://doc.rust-lang.org/std/fs/struct.File.html#method.set_permissions
167+
[`IpAddr::is_ipv4`]: https://doc.rust-lang.org/std/net/enum.IpAddr.html#method.is_ipv4
168+
[`IpAddr::is_ipv6`]: https://doc.rust-lang.org/std/net/enum.IpAddr.html#method.is_ipv6
169+
[`Result::unwrap_or_default`]: https://doc.rust-lang.org/std/result/enum.Result.html#method.unwrap_or_default
170+
[`SocketAddr::is_ipv4`]: https://doc.rust-lang.org/std/net/enum.SocketAddr.html#method.is_ipv4
171+
[`SocketAddr::is_ipv6`]: https://doc.rust-lang.org/std/net/enum.SocketAddr.html#method.is_ipv6
172+
[`String::insert_str`]: https://doc.rust-lang.org/std/string/struct.String.html#method.insert_str
173+
[`String::split_off`]: https://doc.rust-lang.org/std/string/struct.String.html#method.split_off
174+
[`Vec::dedup_by_key`]: https://doc.rust-lang.org/std/vec/struct.Vec.html#method.dedup_by_key
175+
[`Vec::dedup_by`]: https://doc.rust-lang.org/std/vec/struct.Vec.html#method.dedup_by
176+
[`VecDeque::resize`]: https://doc.rust-lang.org/std/collections/vec_deque/struct.VecDeque.html#method.resize
177+
[`VecDeque::truncate`]: https://doc.rust-lang.org/std/collections/vec_deque/struct.VecDeque.html#method.truncate
178+
[`str::repeat`]: https://doc.rust-lang.org/std/primitive.str.html#method.repeat
179+
[`str::replacen`]: https://doc.rust-lang.org/std/primitive.str.html#method.replacen
180+
[cargo/3296]: https://github.com/rust-lang/cargo/pull/3296
181+
[cargo/3301]: https://github.com/rust-lang/cargo/pull/3301
182+
[cargo/3443]: https://github.com/rust-lang/cargo/pull/3443
183+
[cargo/3511]: https://github.com/rust-lang/cargo/pull/3511
184+
[cargo/3515]: https://github.com/rust-lang/cargo/pull/3515
185+
[cargo/3534]: https://github.com/rust-lang/cargo/pull/3534
186+
[cargo/3546]: https://github.com/rust-lang/cargo/pull/3546
187+
[cargo/3557]: https://github.com/rust-lang/cargo/pull/3557
188+
[cargo/3604]: https://github.com/rust-lang/cargo/pull/3604
189+
[RFC 1623]: https://github.com/rust-lang/rfcs/blob/master/text/1623-static.md
190+
191+
1192
Version 1.15.1 (2017-02-09)
2193
===========================
3194

mk/main.mk

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ CFG_RELEASE_NUM=1.16.0
1818
# An optional number to put after the label, e.g. '.2' -> '-beta.2'
1919
# NB Make sure it starts with a dot to conform to semver pre-release
2020
# versions (section 9)
21-
CFG_PRERELEASE_VERSION=.3
21+
CFG_PRERELEASE_VERSION=.4
2222

2323
ifeq ($(CFG_RELEASE_CHANNEL),stable)
2424
# This is the normal semver version string, e.g. "0.12.0", "0.12.0-nightly"

src/librustc/hir/map/def_collector.rs

+11-10
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ pub struct DefCollector<'a> {
2626
pub struct MacroInvocationData {
2727
pub mark: Mark,
2828
pub def_index: DefIndex,
29-
pub const_integer: bool,
29+
pub const_expr: bool,
3030
}
3131

3232
impl<'a> DefCollector<'a> {
@@ -65,10 +65,10 @@ impl<'a> DefCollector<'a> {
6565
self.parent_def = parent;
6666
}
6767

68-
pub fn visit_ast_const_integer(&mut self, expr: &Expr) {
68+
pub fn visit_const_expr(&mut self, expr: &Expr) {
6969
match expr.node {
7070
// Find the node which will be used after lowering.
71-
ExprKind::Paren(ref inner) => return self.visit_ast_const_integer(inner),
71+
ExprKind::Paren(ref inner) => return self.visit_const_expr(inner),
7272
ExprKind::Mac(..) => return self.visit_macro_invoc(expr.id, true),
7373
// FIXME(eddyb) Closures should have separate
7474
// function definition IDs and expression IDs.
@@ -79,11 +79,11 @@ impl<'a> DefCollector<'a> {
7979
self.create_def(expr.id, DefPathData::Initializer);
8080
}
8181

82-
fn visit_macro_invoc(&mut self, id: NodeId, const_integer: bool) {
82+
fn visit_macro_invoc(&mut self, id: NodeId, const_expr: bool) {
8383
if let Some(ref mut visit) = self.visit_macro_invoc {
8484
visit(MacroInvocationData {
8585
mark: Mark::from_placeholder_id(id),
86-
const_integer: const_integer,
86+
const_expr: const_expr,
8787
def_index: self.parent_def.unwrap(),
8888
})
8989
}
@@ -142,7 +142,7 @@ impl<'a> visit::Visitor<'a> for DefCollector<'a> {
142142
}
143143

144144
if let Some(ref expr) = v.node.disr_expr {
145-
this.visit_ast_const_integer(expr);
145+
this.visit_const_expr(expr);
146146
}
147147
});
148148
}
@@ -194,7 +194,7 @@ impl<'a> visit::Visitor<'a> for DefCollector<'a> {
194194
let def = self.create_def(ti.id, def_data);
195195
self.with_parent(def, |this| {
196196
if let TraitItemKind::Const(_, Some(ref expr)) = ti.node {
197-
this.create_def(expr.id, DefPathData::Initializer);
197+
this.visit_const_expr(expr);
198198
}
199199

200200
visit::walk_trait_item(this, ti);
@@ -212,7 +212,7 @@ impl<'a> visit::Visitor<'a> for DefCollector<'a> {
212212
let def = self.create_def(ii.id, def_data);
213213
self.with_parent(def, |this| {
214214
if let ImplItemKind::Const(_, ref expr) = ii.node {
215-
this.create_def(expr.id, DefPathData::Initializer);
215+
this.visit_const_expr(expr);
216216
}
217217

218218
visit::walk_impl_item(this, ii);
@@ -240,7 +240,7 @@ impl<'a> visit::Visitor<'a> for DefCollector<'a> {
240240

241241
match expr.node {
242242
ExprKind::Mac(..) => return self.visit_macro_invoc(expr.id, false),
243-
ExprKind::Repeat(_, ref count) => self.visit_ast_const_integer(count),
243+
ExprKind::Repeat(_, ref count) => self.visit_const_expr(count),
244244
ExprKind::Closure(..) => {
245245
let def = self.create_def(expr.id, DefPathData::ClosureExpr);
246246
self.parent_def = Some(def);
@@ -255,10 +255,11 @@ impl<'a> visit::Visitor<'a> for DefCollector<'a> {
255255
fn visit_ty(&mut self, ty: &'a Ty) {
256256
match ty.node {
257257
TyKind::Mac(..) => return self.visit_macro_invoc(ty.id, false),
258-
TyKind::Array(_, ref length) => self.visit_ast_const_integer(length),
258+
TyKind::Array(_, ref length) => self.visit_const_expr(length),
259259
TyKind::ImplTrait(..) => {
260260
self.create_def(ty.id, DefPathData::ImplTrait);
261261
}
262+
TyKind::Typeof(ref expr) => self.visit_const_expr(expr),
262263
_ => {}
263264
}
264265
visit::walk_ty(self, ty);

src/librustc_const_eval/pattern.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,11 @@ impl<'tcx> fmt::Display for Pattern<'tcx> {
152152
Some(&adt_def.variants[variant_index])
153153
}
154154
_ => if let ty::TyAdt(adt, _) = self.ty.sty {
155-
Some(adt.struct_variant())
155+
if adt.is_univariant() {
156+
Some(&adt.variants[0])
157+
} else {
158+
None
159+
}
156160
} else {
157161
None
158162
}

src/librustc_resolve/build_reduced_graph.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,7 @@ impl<'a> Resolver<'a> {
498498
let invocation = self.arenas.alloc_invocation_data(InvocationData {
499499
module: Cell::new(self.get_extern_crate_root(def_id.krate)),
500500
def_index: CRATE_DEF_INDEX,
501-
const_integer: false,
501+
const_expr: false,
502502
legacy_scope: Cell::new(LegacyScope::Empty),
503503
expansion: Cell::new(LegacyScope::Empty),
504504
});

src/librustc_resolve/macros.rs

+9-9
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ use syntax_pos::{Span, DUMMY_SP};
3939
pub struct InvocationData<'a> {
4040
pub module: Cell<Module<'a>>,
4141
pub def_index: DefIndex,
42-
// True if this expansion is in a `const_integer` position, for example `[u32; m!()]`.
43-
// c.f. `DefCollector::visit_ast_const_integer`.
44-
pub const_integer: bool,
42+
// True if this expansion is in a `const_expr` position, for example `[u32; m!()]`.
43+
// c.f. `DefCollector::visit_const_expr`.
44+
pub const_expr: bool,
4545
// The scope in which the invocation path is resolved.
4646
pub legacy_scope: Cell<LegacyScope<'a>>,
4747
// The smallest scope that includes this invocation's expansion,
@@ -54,7 +54,7 @@ impl<'a> InvocationData<'a> {
5454
InvocationData {
5555
module: Cell::new(graph_root),
5656
def_index: CRATE_DEF_INDEX,
57-
const_integer: false,
57+
const_expr: false,
5858
legacy_scope: Cell::new(LegacyScope::Empty),
5959
expansion: Cell::new(LegacyScope::Empty),
6060
}
@@ -92,7 +92,7 @@ impl<'a> base::Resolver for Resolver<'a> {
9292
self.invocations.insert(mark, self.arenas.alloc_invocation_data(InvocationData {
9393
module: Cell::new(module),
9494
def_index: module.def_id().unwrap().index,
95-
const_integer: false,
95+
const_expr: false,
9696
legacy_scope: Cell::new(LegacyScope::Empty),
9797
expansion: Cell::new(LegacyScope::Empty),
9898
}));
@@ -413,13 +413,13 @@ impl<'a> Resolver<'a> {
413413

414414
fn collect_def_ids(&mut self, invocation: &'a InvocationData<'a>, expansion: &Expansion) {
415415
let Resolver { ref mut invocations, arenas, graph_root, .. } = *self;
416-
let InvocationData { def_index, const_integer, .. } = *invocation;
416+
let InvocationData { def_index, const_expr, .. } = *invocation;
417417

418418
let visit_macro_invoc = &mut |invoc: map::MacroInvocationData| {
419419
invocations.entry(invoc.mark).or_insert_with(|| {
420420
arenas.alloc_invocation_data(InvocationData {
421421
def_index: invoc.def_index,
422-
const_integer: invoc.const_integer,
422+
const_expr: invoc.const_expr,
423423
module: Cell::new(graph_root),
424424
expansion: Cell::new(LegacyScope::Empty),
425425
legacy_scope: Cell::new(LegacyScope::Empty),
@@ -430,9 +430,9 @@ impl<'a> Resolver<'a> {
430430
let mut def_collector = DefCollector::new(&mut self.definitions);
431431
def_collector.visit_macro_invoc = Some(visit_macro_invoc);
432432
def_collector.with_parent(def_index, |def_collector| {
433-
if const_integer {
433+
if const_expr {
434434
if let Expansion::Expr(ref expr) = *expansion {
435-
def_collector.visit_ast_const_integer(expr);
435+
def_collector.visit_const_expr(expr);
436436
}
437437
}
438438
expansion.visit_with(def_collector)

0 commit comments

Comments
 (0)