Skip to content

Commit 4978d58

Browse files
committed
Auto merge of #41899 - brson:backports, r=alexcrichton
[beta] backports - #41666 - #41578 - #41548 - #41529 r? @alexcrichton
2 parents d4e107d + 1fdce3d commit 4978d58

File tree

8 files changed

+344
-6
lines changed

8 files changed

+344
-6
lines changed

RELEASES.md

+258
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,261 @@
1+
Version 1.17.0 (2017-04-27)
2+
===========================
3+
4+
Language
5+
--------
6+
7+
* [The lifetime of statics and consts defaults to `'static`][39265]. [RFC 1623]
8+
* [Fields of structs may be initialized without duplicating the field/variable
9+
names][39761]. [RFC 1682]
10+
* [`Self` may be included in the `where` clause of `impls`][38864]. [RFC 1647]
11+
* [When coercing to an unsized type lifetimes must be equal][40319]. That is,
12+
there is no subtyping between `T` and `U` when `T: Unsize<U>`. For example,
13+
coercing `&mut [&'a X; N]` to `&mut [&'b X]` requires `'a` be equal to
14+
`'b`. Soundness fix.
15+
* [Values passed to the indexing operator, `[]`, automatically coerce][40166]
16+
* [Static variables may contain references to other statics][40027]
17+
18+
Compiler
19+
--------
20+
21+
* [Exit quickly on only `--emit dep-info`][40336]
22+
* [Make `-C relocation-model` more correctly determine whether the linker
23+
creates a position-independent executable][40245]
24+
* [Add `-C overflow-checks` to directly control whether integer overflow
25+
panics][40037]
26+
* [The rustc type checker now checks items on demand instead of in a single
27+
in-order pass][40008]. This is mostly an internal refactoring in support of
28+
future work, including incremental type checking, but also resolves [RFC
29+
1647], allowing `Self` to appear in `impl` `where` clauses.
30+
* [Optimize vtable loads][39995]
31+
* [Turn off vectorization for Emscripten targets][39990]
32+
* [Provide suggestions for unknown macros imported with `use`][39953]
33+
* [Fix ICEs in path resolution][39939]
34+
* [Strip exception handling code on Emscripten when `panic=abort`][39193]
35+
* [Add clearer error message using `&str + &str`][39116]
36+
37+
Stabilized APIs
38+
---------------
39+
40+
* [`Arc::into_raw`]
41+
* [`Arc::from_raw`]
42+
* [`Arc::ptr_eq`]
43+
* [`Rc::into_raw`]
44+
* [`Rc::from_raw`]
45+
* [`Rc::ptr_eq`]
46+
* [`Ordering::then`]
47+
* [`Ordering::then_with`]
48+
* [`BTreeMap::range`]
49+
* [`BTreeMap::range_mut`]
50+
* [`collections::Bound`]
51+
* [`process::abort`]
52+
* [`ptr::read_unaligned`]
53+
* [`ptr::write_unaligned`]
54+
* [`Result::expect_err`]
55+
* [`Cell::swap`]
56+
* [`Cell::replace`]
57+
* [`Cell::into_inner`]
58+
* [`Cell::take`]
59+
60+
Libraries
61+
---------
62+
63+
* [`BTreeMap` and `BTreeSet` can iterate over ranges][27787]
64+
* [`Cell` can store non-`Copy` types][39793]. [RFC 1651]
65+
* [`String` implements `FromIterator<&char>`][40028]
66+
* `Box` [implements][40009] a number of new conversions:
67+
`From<Box<str>> for String`,
68+
`From<Box<[T]>> for Vec<T>`,
69+
`From<Box<CStr>> for CString`,
70+
`From<Box<OsStr>> for OsString`,
71+
`From<Box<Path>> for PathBuf`,
72+
`Into<Box<str>> for String`,
73+
`Into<Box<[T]>> for Vec<T>`,
74+
`Into<Box<CStr>> for CString`,
75+
`Into<Box<OsStr>> for OsString`,
76+
`Into<Box<Path>> for PathBuf`,
77+
`Default for Box<str>`,
78+
`Default for Box<CStr>`,
79+
`Default for Box<OsStr>`,
80+
`From<&CStr> for Box<CStr>`,
81+
`From<&OsStr> for Box<OsStr>`,
82+
`From<&Path> for Box<Path>`
83+
* [`ffi::FromBytesWithNulError` implements `Error` and `Display`][39960]
84+
* [Specialize `PartialOrd<A> for [A] where A: Ord`][39642]
85+
* [Slightly optimize `slice::sort`][39538]
86+
* [Add `ToString` trait specialization for `Cow<'a, str>` and `String`][39440]
87+
* [`Box<[T]>` implements `From<&[T]> where T: Copy`,
88+
`Box<str>` implements `From<&str>`][39438]
89+
* [`IpAddr` implements `From` for various arrays. `SocketAddr` implements
90+
`From<(I, u16)> where I: Into<IpAddr>`][39372]
91+
* [`format!` estimates the needed capacity before writing a string][39356]
92+
* [Support unprivileged symlink creation in Windows][38921]
93+
* [`PathBuf` implements `Default`][38764]
94+
* [Implement `PartialEq<[A]>` for `VecDeque<A>`][38661]
95+
* [`HashMap` resizes adaptively][38368] to guard against DOS attacks
96+
and poor hash functions.
97+
98+
Cargo
99+
-----
100+
101+
* [Add `cargo check --all`][cargo/3731]
102+
* [Add an option to ignore SSL revocation checking][cargo/3699]
103+
* [Add `cargo run --package`][cargo/3691]
104+
* [Add `required_features`][cargo/3667]
105+
* [Assume `build.rs` is a build script][cargo/3664]
106+
* [Find workspace via `workspace_root` link in containing member][cargo/3562]
107+
108+
Misc
109+
----
110+
111+
* [Documentation is rendered with mdbook instead of the obsolete, in-tree
112+
`rustbook`][39633]
113+
* [The "Unstable Book" documents nightly-only features][ubook]
114+
* [Improve the style of the sidebar in rustdoc output][40265]
115+
* [Configure build correctly on 64-bit CPU's with the armhf ABI][40261]
116+
* [Fix MSP430 breakage due to `i128`][40257]
117+
* [Preliminary Solaris/SPARCv9 support][39903]
118+
* [`rustc` is linked statically on Windows MSVC targets][39837], allowing it to
119+
run without installing the MSVC runtime.
120+
* [`rustdoc --test` includes file names in test names][39788]
121+
* This release includes builds of `std` for `sparc64-unknown-linux-gnu`,
122+
`aarch64-unknown-linux-fuchsia`, and `x86_64-unknown-linux-fuchsia`.
123+
* [Initial support for `aarch64-unknown-freebsd`][39491]
124+
* [Initial support for `i686-unknown-netbsd`][39426]
125+
* [This release no longer includes the old makefile build system][39431]. Rust
126+
is built with a custom build system, written in Rust, and with Cargo.
127+
* [Add Debug implementations for libcollection structs][39002]
128+
* [`TypeId` implements `PartialOrd` and `Ord`][38981]
129+
* [`--test-threads=0` produces an error][38945]
130+
* [`rustup` installs documentation by default][40526]
131+
* [The Rust source includes NatVis visualizations][39843]. These can be used by
132+
WinDbg and Visual Studio to improve the debugging experience.
133+
134+
Compatibility Notes
135+
-------------------
136+
137+
* [Rust 1.17 does not correctly detect the MSVC 2017 linker][38584]. As a
138+
workaround, either use MSVC 2015 or run vcvars.bat.
139+
* [When coercing to an unsized type lifetimes must be equal][40319]. That is,
140+
disallow subtyping between `T` and `U` when `T: Unsize<U>`, e.g. coercing
141+
`&mut [&'a X; N]` to `&mut [&'b X]` requires `'a` be equal to `'b`. Soundness
142+
fix.
143+
* [`format!` and `Display::to_string` panic if an underlying formatting
144+
implementation returns an error][40117]. Previously the error was silently
145+
ignored. It is incorrect for `write_fmt` to return an error when writing
146+
to a string.
147+
* [In-tree crates are verified to be unstable][39851]. Previously, some minor
148+
crates were marked stable and could be accessed from the stable toolchain.
149+
* [Rust git source no longer includes vendored crates][39728]. Those that need
150+
to build with vendored crates should build from release tarballs.
151+
* [Fix inert attributes from `proc_macro_derives`][39572]
152+
* [During crate resolution, rustc prefers a crate in the sysroot if two crates
153+
are otherwise identical][39518]. Unlikely to be encountered outside the Rust
154+
build system.
155+
* [Fixed bugs around how type inference interacts with dead-code][39485]. The
156+
existing code generally ignores the type of dead-code unless a type-hint is
157+
provided; this can cause surprising inference interactions particularly around
158+
defaulting. The new code uniformly ignores the result type of dead-code.
159+
* [Tuple-struct constructors with private fields are no longer visible][38932]
160+
* [Lifetime parameters that do not appear in the arguments are now considered
161+
early-bound][38897], resolving a soundness bug (#[32330]). The
162+
`hr_lifetime_in_assoc_type` future-compatibility lint has been in effect since
163+
April of 2016.
164+
* [rustdoc: fix doctests with non-feature crate attributes][38161]
165+
* [Make transmuting from fn item types to pointer-sized types a hard
166+
error][34198]
167+
168+
[27787]: https://github.com/rust-lang/rust/issues/27787
169+
[32330]: https://github.com/rust-lang/rust/issues/32330
170+
[34198]: https://github.com/rust-lang/rust/pull/34198
171+
[38161]: https://github.com/rust-lang/rust/pull/38161
172+
[38368]: https://github.com/rust-lang/rust/pull/38368
173+
[38584]: https://github.com/rust-lang/rust/issues/38584
174+
[38661]: https://github.com/rust-lang/rust/pull/38661
175+
[38764]: https://github.com/rust-lang/rust/pull/38764
176+
[38864]: https://github.com/rust-lang/rust/issues/38864
177+
[38897]: https://github.com/rust-lang/rust/pull/38897
178+
[38921]: https://github.com/rust-lang/rust/pull/38921
179+
[38932]: https://github.com/rust-lang/rust/pull/38932
180+
[38945]: https://github.com/rust-lang/rust/pull/38945
181+
[38981]: https://github.com/rust-lang/rust/pull/38981
182+
[39002]: https://github.com/rust-lang/rust/pull/39002
183+
[39116]: https://github.com/rust-lang/rust/pull/39116
184+
[39193]: https://github.com/rust-lang/rust/pull/39193
185+
[39265]: https://github.com/rust-lang/rust/pull/39265
186+
[39356]: https://github.com/rust-lang/rust/pull/39356
187+
[39372]: https://github.com/rust-lang/rust/pull/39372
188+
[39426]: https://github.com/rust-lang/rust/pull/39426
189+
[39431]: https://github.com/rust-lang/rust/pull/39431
190+
[39438]: https://github.com/rust-lang/rust/pull/39438
191+
[39440]: https://github.com/rust-lang/rust/pull/39440
192+
[39485]: https://github.com/rust-lang/rust/pull/39485
193+
[39491]: https://github.com/rust-lang/rust/pull/39491
194+
[39518]: https://github.com/rust-lang/rust/pull/39518
195+
[39538]: https://github.com/rust-lang/rust/pull/39538
196+
[39572]: https://github.com/rust-lang/rust/pull/39572
197+
[39633]: https://github.com/rust-lang/rust/pull/39633
198+
[39642]: https://github.com/rust-lang/rust/pull/39642
199+
[39728]: https://github.com/rust-lang/rust/pull/39728
200+
[39761]: https://github.com/rust-lang/rust/pull/39761
201+
[39788]: https://github.com/rust-lang/rust/pull/39788
202+
[39793]: https://github.com/rust-lang/rust/pull/39793
203+
[39837]: https://github.com/rust-lang/rust/pull/39837
204+
[39843]: https://github.com/rust-lang/rust/pull/39843
205+
[39851]: https://github.com/rust-lang/rust/pull/39851
206+
[39903]: https://github.com/rust-lang/rust/pull/39903
207+
[39939]: https://github.com/rust-lang/rust/pull/39939
208+
[39953]: https://github.com/rust-lang/rust/pull/39953
209+
[39960]: https://github.com/rust-lang/rust/pull/39960
210+
[39990]: https://github.com/rust-lang/rust/pull/39990
211+
[39995]: https://github.com/rust-lang/rust/pull/39995
212+
[40008]: https://github.com/rust-lang/rust/pull/40008
213+
[40009]: https://github.com/rust-lang/rust/pull/40009
214+
[40027]: https://github.com/rust-lang/rust/pull/40027
215+
[40028]: https://github.com/rust-lang/rust/pull/40028
216+
[40037]: https://github.com/rust-lang/rust/pull/40037
217+
[40117]: https://github.com/rust-lang/rust/pull/40117
218+
[40166]: https://github.com/rust-lang/rust/pull/40166
219+
[40245]: https://github.com/rust-lang/rust/pull/40245
220+
[40257]: https://github.com/rust-lang/rust/pull/40257
221+
[40261]: https://github.com/rust-lang/rust/pull/40261
222+
[40265]: https://github.com/rust-lang/rust/pull/40265
223+
[40319]: https://github.com/rust-lang/rust/pull/40319
224+
[40336]: https://github.com/rust-lang/rust/pull/40336
225+
[40526]: https://github.com/rust-lang/rust/pull/40526
226+
[RFC 1623]: https://github.com/rust-lang/rfcs/blob/master/text/1623-static.md
227+
[RFC 1647]: https://github.com/rust-lang/rfcs/blob/master/text/1647-allow-self-in-where-clauses.md
228+
[RFC 1651]: https://github.com/rust-lang/rfcs/blob/master/text/1651-movecell.md
229+
[RFC 1682]: https://github.com/rust-lang/rfcs/blob/master/text/1682-field-init-shorthand.md
230+
[`Arc::from_raw`]: https://doc.rust-lang.org/std/sync/struct.Arc.html#method.from_raw
231+
[`Arc::into_raw`]: https://doc.rust-lang.org/std/sync/struct.Arc.html#method.into_raw
232+
[`Arc::ptr_eq`]: https://doc.rust-lang.org/std/sync/struct.Arc.html#method.ptr_eq
233+
[`BTreeMap::range_mut`]: https://doc.rust-lang.org/std/collections/btree_map/struct.BTreeMap.html#method.range_mut
234+
[`BTreeMap::range`]: https://doc.rust-lang.org/std/collections/btree_map/struct.BTreeMap.html#method.range
235+
[`Cell::into_inner`]: https://doc.rust-lang.org/std/cell/struct.Cell.html#method.into_inner
236+
[`Cell::replace`]: https://doc.rust-lang.org/std/cell/struct.Cell.html#method.replace
237+
[`Cell::swap`]: https://doc.rust-lang.org/std/cell/struct.Cell.html#method.swap
238+
[`Cell::take`]: https://doc.rust-lang.org/std/cell/struct.Cell.html#method.take
239+
[`Ordering::then_with`]: https://doc.rust-lang.org/std/cmp/enum.Ordering.html#method.then_with
240+
[`Ordering::then`]: https://doc.rust-lang.org/std/cmp/enum.Ordering.html#method.then
241+
[`Rc::from_raw`]: https://doc.rust-lang.org/std/rc/struct.Rc.html#method.from_raw
242+
[`Rc::into_raw`]: https://doc.rust-lang.org/std/rc/struct.Rc.html#method.into_raw
243+
[`Rc::ptr_eq`]: https://doc.rust-lang.org/std/rc/struct.Rc.html#method.ptr_eq
244+
[`Result::expect_err`]: https://doc.rust-lang.org/std/result/enum.Result.html#method.expect_err
245+
[`collections::Bound`]: https://doc.rust-lang.org/std/collections/enum.Bound.html
246+
[`process::abort`]: https://doc.rust-lang.org/std/process/fn.abort.html
247+
[`ptr::read_unaligned`]: https://doc.rust-lang.org/std/ptr/fn.read_unaligned.html
248+
[`ptr::write_unaligned`]: https://doc.rust-lang.org/std/ptr/fn.write_unaligned.html
249+
[cargo/3562]: https://github.com/rust-lang/cargo/pull/3562
250+
[cargo/3664]: https://github.com/rust-lang/cargo/pull/3664
251+
[cargo/3667]: https://github.com/rust-lang/cargo/pull/3667
252+
[cargo/3691]: https://github.com/rust-lang/cargo/pull/3691
253+
[cargo/3699]: https://github.com/rust-lang/cargo/pull/3699
254+
[cargo/3731]: https://github.com/rust-lang/cargo/pull/3731
255+
[mdbook]: https://crates.io/crates/mdbook
256+
[ubook]: https://doc.rust-lang.org/unstable-book/
257+
258+
1259
Version 1.16.0 (2017-03-16)
2260
===========================
3261

src/librustc/middle/mem_categorization.rs

+9-2
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,10 @@ impl<'a, 'gcx, 'tcx> MemCategorizationContext<'a, 'gcx, 'tcx> {
451451
// So peel off one-level, turning the &T into T.
452452
match base_ty.builtin_deref(false, ty::NoPreference) {
453453
Some(t) => t.ty,
454-
None => { return Err(()); }
454+
None => {
455+
debug!("By-ref binding of non-derefable type {:?}", base_ty);
456+
return Err(());
457+
}
455458
}
456459
}
457460
_ => base_ty,
@@ -1039,6 +1042,7 @@ impl<'a, 'gcx, 'tcx> MemCategorizationContext<'a, 'gcx, 'tcx> {
10391042
match base_cmt.ty.builtin_index() {
10401043
Some(ty) => (ty, ElementKind::VecElement),
10411044
None => {
1045+
debug!("Explicit index of non-indexable type {:?}", base_cmt);
10421046
return Err(());
10431047
}
10441048
}
@@ -1154,7 +1158,10 @@ impl<'a, 'gcx, 'tcx> MemCategorizationContext<'a, 'gcx, 'tcx> {
11541158
PatKind::TupleStruct(hir::QPath::Resolved(_, ref path), ..) |
11551159
PatKind::Struct(hir::QPath::Resolved(_, ref path), ..) => {
11561160
match path.def {
1157-
Def::Err => return Err(()),
1161+
Def::Err => {
1162+
debug!("access to unresolvable pattern {:?}", pat);
1163+
return Err(())
1164+
}
11581165
Def::Variant(variant_did) |
11591166
Def::VariantCtor(variant_did, ..) => {
11601167
// univariant enums do not need downcasts

src/librustc_errors/lib.rs

+3
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,9 @@ impl Handler {
375375
panic!(ExplicitBug);
376376
}
377377
pub fn delay_span_bug<S: Into<MultiSpan>>(&self, sp: S, msg: &str) {
378+
if self.treat_err_as_bug {
379+
self.span_bug(sp, msg);
380+
}
378381
let mut delayed = self.delayed_span_bug.borrow_mut();
379382
*delayed = Some((sp.into(), msg.to_string()));
380383
}

src/librustc_metadata/index.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ impl Index {
5858
let pos = buf.position();
5959

6060
// First we write the length of the lower range ...
61-
buf.write_all(words_to_bytes(&[self.positions[0].len() as u32])).unwrap();
61+
buf.write_all(words_to_bytes(&[(self.positions[0].len() as u32).to_le()])).unwrap();
6262
// ... then the values in the lower range ...
6363
buf.write_all(words_to_bytes(&self.positions[0][..])).unwrap();
6464
// ... then the values in the higher range.

src/librustc_trans/mir/operand.rs

+18-3
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,15 @@ impl<'a, 'tcx> OperandRef<'tcx> {
8585
assert!(common::type_is_zero_size(ccx, ty));
8686
let llty = type_of::type_of(ccx, ty);
8787
let val = if common::type_is_imm_pair(ccx, ty) {
88+
let layout = ccx.layout_of(ty);
89+
let (ix0, ix1) = if let Layout::Univariant { ref variant, .. } = *layout {
90+
(adt::struct_llfields_index(variant, 0),
91+
adt::struct_llfields_index(variant, 1))
92+
} else {
93+
(0, 1)
94+
};
8895
let fields = llty.field_types();
89-
OperandValue::Pair(C_null(fields[0]), C_null(fields[1]))
96+
OperandValue::Pair(C_null(fields[ix0]), C_null(fields[ix1]))
9097
} else {
9198
OperandValue::Immediate(C_null(llty))
9299
};
@@ -156,8 +163,16 @@ impl<'a, 'tcx> OperandRef<'tcx> {
156163
if common::type_is_imm_pair(bcx.ccx, self.ty) {
157164
debug!("Operand::unpack_if_pair: unpacking {:?}", self);
158165

159-
let mut a = bcx.extract_value(llval, 0);
160-
let mut b = bcx.extract_value(llval, 1);
166+
let layout = bcx.ccx.layout_of(self.ty);
167+
let (ix0, ix1) = if let Layout::Univariant { ref variant, .. } = *layout {
168+
(adt::struct_llfields_index(variant, 0),
169+
adt::struct_llfields_index(variant, 1))
170+
} else {
171+
(0, 1)
172+
};
173+
174+
let mut a = bcx.extract_value(llval, ix0);
175+
let mut b = bcx.extract_value(llval, ix1);
161176

162177
let pair_fields = common::type_pair_fields(bcx.ccx, self.ty);
163178
if let Some([a_ty, b_ty]) = pair_fields {

src/librustc_typeck/check/method/confirm.rs

+11
Original file line numberDiff line numberDiff line change
@@ -516,6 +516,8 @@ impl<'a, 'gcx, 'tcx> ConfirmContext<'a, 'gcx, 'tcx> {
516516
};
517517

518518
let index_expr_ty = self.node_ty(index_expr.id);
519+
let adjusted_base_ty = self.resolve_type_vars_if_possible(&adjusted_base_ty);
520+
let index_expr_ty = self.resolve_type_vars_if_possible(&index_expr_ty);
519521

520522
let result = self.try_index_step(ty::MethodCall::expr(expr.id),
521523
expr,
@@ -531,6 +533,15 @@ impl<'a, 'gcx, 'tcx> ConfirmContext<'a, 'gcx, 'tcx> {
531533

532534
let expr_ty = self.node_ty(expr.id);
533535
self.demand_suptype(expr.span, expr_ty, return_ty);
536+
} else {
537+
// We could not perform a mutable index. Re-apply the
538+
// immutable index adjustments - borrowck will detect
539+
// this as an error.
540+
if let Some(adjustment) = adjustment {
541+
self.apply_adjustment(expr.id, adjustment);
542+
}
543+
self.tcx.sess.delay_span_bug(
544+
expr.span, "convert_lvalue_derefs_to_mutable failed");
534545
}
535546
}
536547
hir::ExprUnary(hir::UnDeref, ref base_expr) => {

src/test/run-pass/issue-41479.rs

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
fn split<A, B>(pair: (A, B)) {
12+
let _a = pair.0;
13+
let _b = pair.1;
14+
}
15+
16+
fn main() {
17+
split(((), ((), ())));
18+
}

0 commit comments

Comments
 (0)