Skip to content

Commit ed97493

Browse files
committed
Auto merge of rust-lang#105622 - matthiaskrgr:rollup-a6i81q7, r=matthiaskrgr
Rollup of 8 pull requests Successful merges: - rust-lang#104405 (1.66.0 release notes) - rust-lang#105561 (Normalize receiver substs and erase the regions) - rust-lang#105593 (Fix typo in comment: length_limit) - rust-lang#105597 (Correct typos in `core::sync::Exclusive::get_{pin_mut, mut}`) - rust-lang#105614 (delete mentions of type ascription from lint descriptions) - rust-lang#105615 (Fixup method doc that mentions removed param) - rust-lang#105616 (Add a "the" to proc_macro documentation) - rust-lang#105619 (rustdoc: remove no-op CSS `.source pre { overflow: auto }`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2 parents 37d7de3 + ab29c04 commit ed97493

File tree

9 files changed

+180
-24
lines changed

9 files changed

+180
-24
lines changed

RELEASES.md

+91
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,94 @@
1+
Version 1.66.0 (2022-12-15)
2+
==========================
3+
4+
Language
5+
--------
6+
- [Permit specifying explicit discriminants on all `repr(Int)` enums](https://github.com/rust-lang/rust/pull/95710/)
7+
```rust
8+
#[repr(u8)]
9+
enum Foo {
10+
A(u8) = 0,
11+
B(i8) = 1,
12+
C(bool) = 42,
13+
}
14+
```
15+
- [Allow transmutes between the same type differing only in lifetimes](https://github.com/rust-lang/rust/pull/101520/)
16+
- [Change constant evaluation errors from a deny-by-default lint to a hard error](https://github.com/rust-lang/rust/pull/102091/)
17+
- [Trigger `must_use` on `impl Trait` for supertraits](https://github.com/rust-lang/rust/pull/102287/)
18+
This makes `impl ExactSizeIterator` respect the existing `#[must_use]` annotation on `Iterator`.
19+
- [Allow `..X` and `..=X` in patterns](https://github.com/rust-lang/rust/pull/102275/)
20+
- [Uplift `clippy::for_loops_over_fallibles` lint into rustc](https://github.com/rust-lang/rust/pull/99696/)
21+
- [Stabilize `sym` operands in inline assembly](https://github.com/rust-lang/rust/pull/103168/)
22+
- [Update to Unicode 15](https://github.com/rust-lang/rust/pull/101912/)
23+
- [Opaque types no longer imply lifetime bounds](https://github.com/rust-lang/rust/pull/95474/)
24+
This is a soundness fix which may break code that was erroneously relying on this behavior.
25+
26+
Compiler
27+
--------
28+
- [Add armv5te-none-eabi and thumbv5te-none-eabi tier 3 targets](https://github.com/rust-lang/rust/pull/101329/)
29+
- Refer to Rust's [platform support page][platform-support-doc] for more
30+
information on Rust's tiered platform support.
31+
- [Add support for linking against macOS universal libraries](https://github.com/rust-lang/rust/pull/98736)
32+
33+
Libraries
34+
---------
35+
- [Fix `#[derive(Default)]` on a generic `#[default]` enum adding unnecessary `Default` bounds](https://github.com/rust-lang/rust/pull/101040/)
36+
- [Update to Unicode 15](https://github.com/rust-lang/rust/pull/101821/)
37+
38+
Stabilized APIs
39+
---------------
40+
41+
- [`proc_macro::Span::source_text`](https://doc.rust-lang.org/stable/proc_macro/struct.Span.html#method.source_text)
42+
- [`uX::{checked_add_signed, overflowing_add_signed, saturating_add_signed, wrapping_add_signed}`](https://doc.rust-lang.org/stable/std/primitive.u8.html#method.checked_add_signed)
43+
- [`iX::{checked_add_unsigned, overflowing_add_unsigned, saturating_add_unsigned, wrapping_add_unsigned}`](https://doc.rust-lang.org/stable/std/primitive.i8.html#method.checked_add_unsigned)
44+
- [`iX::{checked_sub_unsigned, overflowing_sub_unsigned, saturating_sub_unsigned, wrapping_sub_unsigned}`](https://doc.rust-lang.org/stable/std/primitive.i8.html#method.checked_sub_unsigned)
45+
- [`BTreeSet::{first, last, pop_first, pop_last}`](https://doc.rust-lang.org/stable/std/collections/struct.BTreeSet.html#method.first)
46+
- [`BTreeMap::{first_key_value, last_key_value, first_entry, last_entry, pop_first, pop_last}`](https://doc.rust-lang.org/stable/std/collections/struct.BTreeMap.html#method.first_key_value)
47+
- [Add `AsFd` implementations for stdio lock types on WASI.](https://github.com/rust-lang/rust/pull/101768/)
48+
- [`impl TryFrom<Vec<T>> for Box<[T; N]>`](https://doc.rust-lang.org/stable/std/boxed/struct.Box.html#impl-TryFrom%3CVec%3CT%2C%20Global%3E%3E-for-Box%3C%5BT%3B%20N%5D%2C%20Global%3E)
49+
- [`core::hint::black_box`](https://doc.rust-lang.org/stable/std/hint/fn.black_box.html)
50+
- [`Duration::try_from_secs_{f32,f64}`](https://doc.rust-lang.org/stable/std/time/struct.Duration.html#method.try_from_secs_f32)
51+
- [`Option::unzip`](https://doc.rust-lang.org/stable/std/option/enum.Option.html#method.unzip)
52+
- [`std::os::fd`](https://doc.rust-lang.org/stable/std/os/fd/index.html)
53+
54+
55+
Rustdoc
56+
-------
57+
58+
- [Add Rustdoc warning for invalid HTML tags in the documentation](https://github.com/rust-lang/rust/pull/101720/)
59+
60+
Cargo
61+
-----
62+
63+
- [Added `cargo remove` to remove dependencies from Cargo.toml](https://doc.rust-lang.org/nightly/cargo/commands/cargo-remove.html)
64+
- [`cargo publish` now waits for the new version to be downloadable before exiting](https://github.com/rust-lang/cargo/pull/11062)
65+
66+
See [detailed release notes](https://github.com/rust-lang/cargo/blob/master/CHANGELOG.md#cargo-166-2022-12-15) for more.
67+
68+
Compatibility Notes
69+
-------------------
70+
71+
- [Only apply `ProceduralMasquerade` hack to older versions of `rental`](https://github.com/rust-lang/rust/pull/94063/)
72+
- [Don't export `__heap_base` and `__data_end` on wasm32-wasi.](https://github.com/rust-lang/rust/pull/102385/)
73+
- [Don't export `__wasm_init_memory` on WebAssembly.](https://github.com/rust-lang/rust/pull/102426/)
74+
- [Only export `__tls_*` on wasm32-unknown-unknown.](https://github.com/rust-lang/rust/pull/102440/)
75+
- [Don't link to `libresolv` in libstd on Darwin](https://github.com/rust-lang/rust/pull/102766/)
76+
- [Update libstd's libc to 0.2.135 (to make `libstd` no longer pull in `libiconv.dylib` on Darwin)](https://github.com/rust-lang/rust/pull/103277/)
77+
- [Opaque types no longer imply lifetime bounds](https://github.com/rust-lang/rust/pull/95474/)
78+
This is a soundness fix which may break code that was erroneously relying on this behavior.
79+
- [Make `order_dependent_trait_objects` show up in future-breakage reports](https://github.com/rust-lang/rust/pull/102635/)
80+
- [Change std::process::Command spawning to default to inheriting the parent's signal mask](https://github.com/rust-lang/rust/pull/101077/)
81+
82+
Internal Changes
83+
----------------
84+
85+
These changes do not affect any public interfaces of Rust, but they represent
86+
significant improvements to the performance or internals of rustc and related
87+
tools.
88+
89+
- [Enable BOLT for LLVM compilation](https://github.com/rust-lang/rust/pull/94381/)
90+
- [Enable LTO for rustc_driver.so](https://github.com/rust-lang/rust/pull/101403/)
91+
192
Version 1.65.0 (2022-11-03)
293
==========================
394

compiler/rustc_lint_defs/src/builtin.rs

+17-14
Original file line numberDiff line numberDiff line change
@@ -911,8 +911,7 @@ declare_lint! {
911911

912912
declare_lint! {
913913
/// The `trivial_casts` lint detects trivial casts which could be replaced
914-
/// with coercion, which may require [type ascription] or a temporary
915-
/// variable.
914+
/// with coercion, which may require a temporary variable.
916915
///
917916
/// ### Example
918917
///
@@ -934,12 +933,14 @@ declare_lint! {
934933
/// with FFI interfaces or complex type aliases, where it triggers
935934
/// incorrectly, or in situations where it will be more difficult to
936935
/// clearly express the intent. It may be possible that this will become a
937-
/// warning in the future, possibly with [type ascription] providing a
938-
/// convenient way to work around the current issues. See [RFC 401] for
939-
/// historical context.
940-
///
941-
/// [type ascription]: https://github.com/rust-lang/rust/issues/23416
942-
/// [RFC 401]: https://github.com/rust-lang/rfcs/blob/master/text/0401-coercions.md
936+
/// warning in the future, possibly with an explicit syntax for coercions
937+
/// providing a convenient way to work around the current issues.
938+
/// See [RFC 401 (coercions)][rfc-401], [RFC 803 (type ascription)][rfc-803] and
939+
/// [RFC 3307 (remove type ascription)][rfc-3307] for historical context.
940+
///
941+
/// [rfc-401]: https://github.com/rust-lang/rfcs/blob/master/text/0401-coercions.md
942+
/// [rfc-803]: https://github.com/rust-lang/rfcs/blob/master/text/0803-type-ascription.md
943+
/// [rfc-3307]: https://github.com/rust-lang/rfcs/blob/master/text/3307-de-rfc-type-ascription.md
943944
pub TRIVIAL_CASTS,
944945
Allow,
945946
"detects trivial casts which could be removed"
@@ -967,12 +968,14 @@ declare_lint! {
967968
/// with FFI interfaces or complex type aliases, where it triggers
968969
/// incorrectly, or in situations where it will be more difficult to
969970
/// clearly express the intent. It may be possible that this will become a
970-
/// warning in the future, possibly with [type ascription] providing a
971-
/// convenient way to work around the current issues. See [RFC 401] for
972-
/// historical context.
973-
///
974-
/// [type ascription]: https://github.com/rust-lang/rust/issues/23416
975-
/// [RFC 401]: https://github.com/rust-lang/rfcs/blob/master/text/0401-coercions.md
971+
/// warning in the future, possibly with an explicit syntax for coercions
972+
/// providing a convenient way to work around the current issues.
973+
/// See [RFC 401 (coercions)][rfc-401], [RFC 803 (type ascription)][rfc-803] and
974+
/// [RFC 3307 (remove type ascription)][rfc-3307] for historical context.
975+
///
976+
/// [rfc-401]: https://github.com/rust-lang/rfcs/blob/master/text/0401-coercions.md
977+
/// [rfc-803]: https://github.com/rust-lang/rfcs/blob/master/text/0803-type-ascription.md
978+
/// [rfc-3307]: https://github.com/rust-lang/rfcs/blob/master/text/3307-de-rfc-type-ascription.md
976979
pub TRIVIAL_NUMERIC_CASTS,
977980
Allow,
978981
"detects trivial casts of numeric types which could be removed"

compiler/rustc_middle/src/ty/error.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1010,7 +1010,7 @@ fn foo(&self) -> Self::T { String::new() }
10101010
}
10111011
let mut short;
10121012
loop {
1013-
// Look for the longest properly trimmed path that still fits in lenght_limit.
1013+
// Look for the longest properly trimmed path that still fits in length_limit.
10141014
short = with_forced_trimmed_paths!(
10151015
FmtPrinter::new_with_limit(
10161016
self,

compiler/rustc_mir_build/src/build/expr/stmt.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,8 @@ use rustc_middle::thir::*;
66

77
impl<'a, 'tcx> Builder<'a, 'tcx> {
88
/// Builds a block of MIR statements to evaluate the THIR `expr`.
9-
/// If the original expression was an AST statement,
10-
/// (e.g., `some().code(&here());`) then `opt_stmt_span` is the
11-
/// span of that statement (including its semicolon, if any).
12-
/// The scope is used if a statement temporary must be dropped.
9+
///
10+
/// The `statement_scope` is used if a statement temporary must be dropped.
1311
pub(crate) fn stmt_expr(
1412
&mut self,
1513
mut block: BasicBlock,

compiler/rustc_ty_utils/src/instance.rs

+7-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,13 @@ fn inner_resolve_instance<'tcx>(
4444

4545
let result = if let Some(trait_def_id) = tcx.trait_of_item(def.did) {
4646
debug!(" => associated item, attempting to find impl in param_env {:#?}", param_env);
47-
resolve_associated_item(tcx, def.did, param_env, trait_def_id, substs)
47+
resolve_associated_item(
48+
tcx,
49+
def.did,
50+
param_env,
51+
trait_def_id,
52+
tcx.normalize_erasing_regions(param_env, substs),
53+
)
4854
} else {
4955
let ty = tcx.type_of(def.def_id_for_type_of());
5056
let item_type = tcx.subst_and_normalize_erasing_regions(substs, param_env, ty);

library/core/src/sync/exclusive.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ impl<T: ?Sized> Exclusive<T> {
138138
unsafe { Pin::new_unchecked(&mut self.get_unchecked_mut().inner) }
139139
}
140140

141-
/// Build a _mutable_ references to an `Exclusive<T>` from
141+
/// Build a _mutable_ reference to an `Exclusive<T>` from
142142
/// a _mutable_ reference to a `T`. This allows you to skip
143143
/// building an `Exclusive` with [`Exclusive::new`].
144144
#[unstable(feature = "exclusive_wrapper", issue = "98407")]
@@ -149,7 +149,7 @@ impl<T: ?Sized> Exclusive<T> {
149149
unsafe { &mut *(r as *mut T as *mut Exclusive<T>) }
150150
}
151151

152-
/// Build a _pinned mutable_ references to an `Exclusive<T>` from
152+
/// Build a _pinned mutable_ reference to an `Exclusive<T>` from
153153
/// a _pinned mutable_ reference to a `T`. This allows you to skip
154154
/// building an `Exclusive` with [`Exclusive::new`].
155155
#[unstable(feature = "exclusive_wrapper", issue = "98407")]

library/proc_macro/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1493,7 +1493,7 @@ pub mod tracked_env {
14931493
use std::ffi::OsStr;
14941494

14951495
/// Retrieve an environment variable and add it to build dependency info.
1496-
/// Build system executing the compiler will know that the variable was accessed during
1496+
/// The build system executing the compiler will know that the variable was accessed during
14971497
/// compilation, and will be able to rerun the build when the value of that variable changes.
14981498
/// Besides the dependency tracking this function should be equivalent to `env::var` from the
14991499
/// standard library, except that the argument must be UTF-8.

src/librustdoc/html/static/css/rustdoc.css

-1
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,6 @@ ul.block, .block li {
523523
}
524524

525525
.source .content pre.rust {
526-
overflow: auto;
527526
padding-left: 0;
528527
}
529528

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
// check-pass
2+
// compile-flags: -C debug_assertions=yes -Zunstable-options
3+
4+
#[allow(dead_code)]
5+
fn problematic_function<Space>()
6+
where
7+
DefaultAlloc: FinAllok<R1, Space>,
8+
{
9+
let e = Edge2dElement;
10+
let _ = Into::<Point>::into(e.map_reference_coords());
11+
}
12+
impl<N> Allocator<N, R0> for DefaultAlloc {
13+
type Buffer = MStorage;
14+
}
15+
impl<N> Allocator<N, R1> for DefaultAlloc {
16+
type Buffer = MStorage;
17+
}
18+
impl<N, D> From<VectorN<N, D>> for Point
19+
where
20+
DefaultAlloc: Allocator<N, D>,
21+
{
22+
fn from(_: VectorN<N, D>) -> Self {
23+
unimplemented!()
24+
}
25+
}
26+
impl<GeometryDim, NodalDim> FinAllok<GeometryDim, NodalDim> for DefaultAlloc
27+
where
28+
DefaultAlloc: Allocator<Ure, GeometryDim>,
29+
DefaultAlloc: Allocator<Ure, NodalDim>
30+
{
31+
}
32+
impl FiniteElement<R1> for Edge2dElement {
33+
fn map_reference_coords(&self) -> VectorN<Ure, R1> {
34+
unimplemented!()
35+
}
36+
}
37+
type VectorN<N, R> = (N, R, <DefaultAlloc as Allocator<N, R>>::Buffer);
38+
struct DefaultAlloc;
39+
struct R0;
40+
struct R1;
41+
struct MStorage;
42+
struct Point;
43+
struct Edge2dElement;
44+
struct Ure;
45+
trait Allocator<N, R> {
46+
type Buffer;
47+
}
48+
trait FinAllok<GeometryDim, NodalDim>:
49+
Allocator<Ure, GeometryDim> +
50+
Allocator<Ure, NodalDim> +
51+
{
52+
}
53+
trait FiniteElement<Rau>
54+
where
55+
DefaultAlloc: FinAllok<Rau, Rau>,
56+
{
57+
fn map_reference_coords(&self) -> VectorN<Ure, Rau>;
58+
}
59+
fn main() {}

0 commit comments

Comments
 (0)