Skip to content

Commit cfbc6d4

Browse files
committed
Auto merge of #75722 - Mark-Simulacrum:beta-next, r=Mark-Simulacrum
[beta] backports * Fix regionck failure when converting Index to IndexMut #74960 * Update RELEASES.md for 1.46.0 #74744 * allow escaping bound vars when normalizing `ty::Opaque` #75443 r? @ghost
2 parents 32c481e + 68d6e56 commit cfbc6d4

23 files changed

+393
-116
lines changed

RELEASES.md

+136-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,128 @@
1+
Version 1.46.0 (2020-08-27)
2+
==========================
3+
4+
Language
5+
--------
6+
- [`if`, `match`, and `loop` expressions can now be used in const functions.][72437]
7+
- [Additionally you are now also able to coerce and cast to slices (`&[T]`) in
8+
const functions.][73862]
9+
- [The `#[track_caller]` attribute can now be added to functions to use the
10+
function's caller's location information for panic messages.][72445]
11+
- [Recursively indexing into tuples no longer needs parentheses.][71322] E.g.
12+
`x.0.0` over `(x.0).0`.
13+
- [`mem::transmute` can now be used in static and constants.][72920] **Note**
14+
You currently can't use `mem::transmute` in constant functions.
15+
16+
Compiler
17+
--------
18+
- [You can now use the `cdylib` target on Apple iOS and tvOS platforms.][73516]
19+
- [Enabled static "Position Independent Executables" by default
20+
for `x86_64-unknown-linux-musl`.][70740]
21+
22+
Libraries
23+
---------
24+
- [`mem::forget` is now a `const fn`.][73887]
25+
- [`String` now implements `From<char>`.][73466]
26+
- [The `leading_ones`, and `trailing_ones` methods have been stabilised for all
27+
integer types.][73032]
28+
- [`vec::IntoIter<T>` now implements `AsRef<[T]>`.][72583]
29+
- [All non-zero integer types (`NonZeroU8`) now implement `TryFrom` for their
30+
zero-able equivalent (e.g. `TryFrom<u8>`).][72717]
31+
- [`&[T]` and `&mut [T]` now implement `PartialEq<Vec<T>>`.][71660]
32+
- [`(String, u16)` now implements `ToSocketAddrs`.][73007]
33+
- [`vec::Drain<'_, T>` now implements `AsRef<[T]>`.][72584]
34+
35+
Stabilized APIs
36+
---------------
37+
- [`Option::zip`]
38+
- [`vec::Drain::as_slice`]
39+
40+
Cargo
41+
-----
42+
Added a number of new environment variables that are now available when
43+
compiling your crate.
44+
45+
- [`CARGO_BIN_NAME` and `CARGO_CRATE_NAME`][cargo/8270] Providing the name of
46+
the specific binary being compiled and the name of the crate.
47+
- [`CARGO_PKG_LICENSE`][cargo/8325] The license from the manifest of the package.
48+
- [`CARGO_PKG_LICENSE_FILE`][cargo/8387] The path to the license file.
49+
50+
Compatibility Notes
51+
-------------------
52+
- [The target configuration option `abi_blacklist` has been renamed
53+
to `unsupported_abis`.][74150] The old name will still continue to work.
54+
- [Rustc will now warn if you have a C-like enum that implements `Drop`.][72331]
55+
This was previously accepted but will become a hard error in a future release.
56+
- [Rustc will fail to compile if you have a struct with
57+
`#[repr(i128)]` or `#[repr(u128)]`.][74109] This representation is currently only
58+
allowed on `enum`s.
59+
- [Tokens passed to `macro_rules!` are now always captured.][73293] This helps
60+
ensure that spans have the correct information, and may cause breakage if you
61+
were relying on receiving spans with dummy information.
62+
- [The InnoSetup installer for Windows is no longer available.][72569] This was
63+
a legacy installer that was replaced by a MSI installer a few years ago but
64+
was still being built.
65+
- [`{f32, f64}::asinh` now returns the correct values for negative numbers.][72486]
66+
- [Rustc will no longer accept overlapping trait implementations that only
67+
differ in how the lifetime was bound.][72493]
68+
- [Rustc now correctly relates the lifetime of an existential associated
69+
type.][71896] This fixes some edge cases where `rustc` would erroneously allow
70+
you to pass a shorter lifetime than expected.
71+
72+
[74109]: https://github.com/rust-lang/rust/pull/74109/
73+
[74150]: https://github.com/rust-lang/rust/pull/74150/
74+
[73862]: https://github.com/rust-lang/rust/pull/73862/
75+
[73887]: https://github.com/rust-lang/rust/pull/73887/
76+
[73466]: https://github.com/rust-lang/rust/pull/73466/
77+
[73516]: https://github.com/rust-lang/rust/pull/73516/
78+
[73293]: https://github.com/rust-lang/rust/pull/73293/
79+
[73007]: https://github.com/rust-lang/rust/pull/73007/
80+
[73032]: https://github.com/rust-lang/rust/pull/73032/
81+
[72920]: https://github.com/rust-lang/rust/pull/72920/
82+
[72569]: https://github.com/rust-lang/rust/pull/72569/
83+
[72583]: https://github.com/rust-lang/rust/pull/72583/
84+
[72584]: https://github.com/rust-lang/rust/pull/72584/
85+
[72717]: https://github.com/rust-lang/rust/pull/72717/
86+
[72437]: https://github.com/rust-lang/rust/pull/72437/
87+
[72445]: https://github.com/rust-lang/rust/pull/72445/
88+
[72486]: https://github.com/rust-lang/rust/pull/72486/
89+
[72493]: https://github.com/rust-lang/rust/pull/72493/
90+
[72331]: https://github.com/rust-lang/rust/pull/72331/
91+
[71896]: https://github.com/rust-lang/rust/pull/71896/
92+
[71660]: https://github.com/rust-lang/rust/pull/71660/
93+
[71322]: https://github.com/rust-lang/rust/pull/71322/
94+
[70740]: https://github.com/rust-lang/rust/pull/70740/
95+
[cargo/8270]: https://github.com/rust-lang/cargo/pull/8270/
96+
[cargo/8325]: https://github.com/rust-lang/cargo/pull/8325/
97+
[cargo/8387]: https://github.com/rust-lang/cargo/pull/8387/
98+
[`Option::zip`]: https://doc.rust-lang.org/stable/std/option/enum.Option.html#method.zip
99+
[`vec::Drain::as_slice`]: https://doc.rust-lang.org/stable/std/vec/struct.Drain.html#method.as_slice
100+
101+
102+
Version 1.45.2 (2020-08-03)
103+
==========================
104+
105+
* [Fix bindings in tuple struct patterns][74954]
106+
* [Fix track_caller integration with trait objects][74784]
107+
108+
[74954]: https://github.com/rust-lang/rust/issues/74954
109+
[74784]: https://github.com/rust-lang/rust/issues/74784
110+
111+
112+
Version 1.45.1 (2020-07-30)
113+
==========================
114+
115+
* [Fix const propagation with references.][73613]
116+
* [rustfmt accepts rustfmt_skip in cfg_attr again.][73078]
117+
* [Avoid spurious implicit region bound.][74509]
118+
* [Install clippy on x.py install][74457]
119+
120+
[73613]: https://github.com/rust-lang/rust/pull/73613
121+
[73078]: https://github.com/rust-lang/rust/issues/73078
122+
[74509]: https://github.com/rust-lang/rust/pull/74509
123+
[74457]: https://github.com/rust-lang/rust/pull/74457
124+
125+
1126
Version 1.45.0 (2020-07-16)
2127
==========================
3128

@@ -47,7 +172,7 @@ Libraries
47172
// Prints "abcdefghijklmnopqrstuvwxyz"
48173
```
49174
- [`OsString` now implements `FromStr`.][71662]
50-
- [The `saturating_neg` method as been added to all signed integer primitive
175+
- [The `saturating_neg` method has been added to all signed integer primitive
51176
types, and the `saturating_abs` method has been added for all integer
52177
primitive types.][71886]
53178
- [`Arc<T>`, `Rc<T>` now implement `From<Cow<'_, T>>`, and `Box` now
@@ -82,6 +207,9 @@ Stabilized APIs
82207
Cargo
83208
-----
84209

210+
- [Cargo uses the `embed-bitcode` flag to optimize disk usage and build
211+
time.][cargo/8066]
212+
85213
Misc
86214
----
87215
- [Rustdoc now supports strikethrough text in Markdown.][71928] E.g.
@@ -97,12 +225,18 @@ Compatibility Notes
97225
- [Rustdoc's CLI's extra error exit codes have been removed.][71900] These were
98226
previously undocumented and not intended for public use. Rustdoc still provides
99227
a non-zero exit code on errors.
228+
- [Rustc's `lto` flag is incompatible with the new `embed-bitcode=no`.][71848]
229+
This may cause issues if LTO is enabled through `RUSTFLAGS` or `cargo rustc`
230+
flags while cargo is adding `embed-bitcode` itself. The recommended way to
231+
control LTO is with Cargo profiles, either in `Cargo.toml` or `.cargo/config`,
232+
or by setting `CARGO_PROFILE_<name>_LTO` in the environment.
100233

101234
Internals Only
102235
--------------
103236
- [Make clippy a git subtree instead of a git submodule][70655]
104237
- [Unify the undo log of all snapshot types][69464]
105238

239+
[71848]: https://github.com/rust-lang/rust/issues/71848/
106240
[73420]: https://github.com/rust-lang/rust/issues/73420/
107241
[72324]: https://github.com/rust-lang/rust/pull/72324/
108242
[71843]: https://github.com/rust-lang/rust/pull/71843/
@@ -129,6 +263,7 @@ Internals Only
129263
[69813]: https://github.com/rust-lang/rust/pull/69813/
130264
[69464]: https://github.com/rust-lang/rust/pull/69464/
131265
[68717]: https://github.com/rust-lang/rust/pull/68717/
266+
[cargo/8066]: https://github.com/rust-lang/cargo/pull/8066
132267
[`Arc::as_ptr`]: https://doc.rust-lang.org/stable/std/sync/struct.Arc.html#method.as_ptr
133268
[`BTreeMap::remove_entry`]: https://doc.rust-lang.org/stable/std/collections/struct.BTreeMap.html#method.remove_entry
134269
[`Rc::as_ptr`]: https://doc.rust-lang.org/stable/std/rc/struct.Rc.html#method.as_ptr

src/ci/docker/host-x86_64/dist-various-2/build-x86_64-fortanix-unknown-sgx-toolchain.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ target="x86_64-fortanix-unknown-sgx"
77

88
install_prereq() {
99
curl https://apt.llvm.org/llvm-snapshot.gpg.key|apt-key add -
10-
add-apt-repository -y 'deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic main'
10+
add-apt-repository -y 'deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-11 main'
1111
apt-get update
1212
apt-get install -y --no-install-recommends \
1313
build-essential \

src/librustc_trait_selection/traits/auto_trait.rs

+8-4
Original file line numberDiff line numberDiff line change
@@ -729,7 +729,7 @@ impl AutoTraitFinder<'tcx> {
729729
// and turn them into an explicit negative impl for our type.
730730
debug!("Projecting and unifying projection predicate {:?}", predicate);
731731

732-
match poly_project_and_unify_type(select, &obligation.with(p)) {
732+
match project::poly_project_and_unify_type(select, &obligation.with(p)) {
733733
Err(e) => {
734734
debug!(
735735
"evaluate_nested_obligations: Unable to unify predicate \
@@ -738,7 +738,11 @@ impl AutoTraitFinder<'tcx> {
738738
);
739739
return false;
740740
}
741-
Ok(Some(v)) => {
741+
Ok(Err(project::InProgress)) => {
742+
debug!("evaluate_nested_obligations: recursive projection predicate");
743+
return false;
744+
}
745+
Ok(Ok(Some(v))) => {
742746
// We only care about sub-obligations
743747
// when we started out trying to unify
744748
// some inference variables. See the comment above
@@ -757,8 +761,8 @@ impl AutoTraitFinder<'tcx> {
757761
}
758762
}
759763
}
760-
Ok(None) => {
761-
// It's ok not to make progress when hvave no inference variables -
764+
Ok(Ok(None)) => {
765+
// It's ok not to make progress when have no inference variables -
762766
// in that case, we were only performing unifcation to check if an
763767
// error occurred (which would indicate that it's impossible for our
764768
// type to implement the auto trait).

src/librustc_trait_selection/traits/fulfill.rs

+11-5
Original file line numberDiff line numberDiff line change
@@ -426,14 +426,20 @@ impl<'a, 'b, 'tcx> ObligationProcessor for FulfillProcessor<'a, 'b, 'tcx> {
426426

427427
ty::PredicateKind::Projection(ref data) => {
428428
let project_obligation = obligation.with(*data);
429+
let tcx = self.selcx.tcx();
429430
match project::poly_project_and_unify_type(self.selcx, &project_obligation) {
430-
Ok(None) => {
431-
let tcx = self.selcx.tcx();
432-
pending_obligation.stalled_on =
433-
trait_ref_infer_vars(self.selcx, data.to_poly_trait_ref(tcx));
431+
Ok(Ok(Some(os))) => ProcessResult::Changed(mk_pending(os)),
432+
Ok(Ok(None)) => {
433+
pending_obligation.stalled_on = trait_ref_infer_vars(
434+
self.selcx,
435+
project_obligation.predicate.to_poly_trait_ref(tcx),
436+
);
434437
ProcessResult::Unchanged
435438
}
436-
Ok(Some(os)) => ProcessResult::Changed(mk_pending(os)),
439+
// Let the caller handle the recursion
440+
Ok(Err(project::InProgress)) => ProcessResult::Changed(mk_pending(vec![
441+
pending_obligation.obligation.clone(),
442+
])),
437443
Err(e) => ProcessResult::Error(CodeProjectionError(e)),
438444
}
439445
}

src/librustc_trait_selection/traits/mod.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,7 @@ pub use self::object_safety::is_vtable_safe_method;
5151
pub use self::object_safety::MethodViolationCode;
5252
pub use self::object_safety::ObjectSafetyViolation;
5353
pub use self::on_unimplemented::{OnUnimplementedDirective, OnUnimplementedNote};
54-
pub use self::project::{
55-
normalize, normalize_projection_type, normalize_to, poly_project_and_unify_type,
56-
};
54+
pub use self::project::{normalize, normalize_projection_type, normalize_to};
5755
pub use self::select::{EvaluationCache, SelectionCache, SelectionContext};
5856
pub use self::select::{EvaluationResult, IntercrateAmbiguityCause, OverflowError};
5957
pub use self::specialize::specialization_graph::FutureCompatOverlapError;

0 commit comments

Comments
 (0)