Auto merge of #110413 - pietroalbini:pa-1.69.0-stable, r=pietroalbini
[stable] Prepare Rust 1.69.0 Last minute backports: * #109643 * #110135 * #109938 * #109937 * #109266 This PR also bumps the channel to stable, and backports the release notes from master. r? `@ghost` cc `@rust-lang/release`
This commit is contained in:
commit
84c898d65a
19 changed files with 365 additions and 200 deletions
229
RELEASES.md
229
RELEASES.md
|
|
@ -1,3 +1,225 @@
|
|||
Version 1.69.0 (2023-04-20)
|
||||
==========================
|
||||
|
||||
<a id="1.69.0-Language"></a>
|
||||
|
||||
Language
|
||||
--------
|
||||
|
||||
- [Deriving built-in traits on packed structs works with `Copy` fields.](https://github.com/rust-lang/rust/pull/104429/)
|
||||
- [Stabilize the `cmpxchg16b` target feature on x86 and x86_64.](https://github.com/rust-lang/rust/pull/106774/)
|
||||
- [Improve analysis of trait bounds for associated types.](https://github.com/rust-lang/rust/pull/103695/)
|
||||
- [Allow associated types to be used as union fields.](https://github.com/rust-lang/rust/pull/106938/)
|
||||
- [Allow `Self: Autotrait` bounds on dyn-safe trait methods.](https://github.com/rust-lang/rust/pull/107082/)
|
||||
- [Treat `str` as containing `[u8]` for auto trait purposes.](https://github.com/rust-lang/rust/pull/107941/)
|
||||
|
||||
<a id="1.69.0-Compiler"></a>
|
||||
|
||||
Compiler
|
||||
--------
|
||||
|
||||
- [Upgrade `*-pc-windows-gnu` on CI to mingw-w64 v10 and GCC 12.2.](https://github.com/rust-lang/rust/pull/100178/)
|
||||
- [Rework min_choice algorithm of member constraints.](https://github.com/rust-lang/rust/pull/105300/)
|
||||
- [Support `true` and `false` as boolean flags in compiler arguments.](https://github.com/rust-lang/rust/pull/107043/)
|
||||
- [Default `repr(C)` enums to `c_int` size.](https://github.com/rust-lang/rust/pull/107592/)
|
||||
|
||||
<a id="1.69.0-Libraries"></a>
|
||||
|
||||
Libraries
|
||||
---------
|
||||
|
||||
- [Implement the unstable `DispatchFromDyn` for cell types, allowing downstream experimentation with custom method receivers.](https://github.com/rust-lang/rust/pull/97373/)
|
||||
- [Document that `fmt::Arguments::as_str()` may return `Some(_)` in more cases after optimization, subject to change.](https://github.com/rust-lang/rust/pull/106823/)
|
||||
- [Implement `AsFd` and `AsRawFd` for `Rc`.](https://github.com/rust-lang/rust/pull/107317/)
|
||||
|
||||
<a id="1.69.0-Stabilized-APIs"></a>
|
||||
|
||||
Stabilized APIs
|
||||
---------------
|
||||
|
||||
- [`CStr::from_bytes_until_nul`](https://doc.rust-lang.org/stable/core/ffi/struct.CStr.html#method.from_bytes_until_nul)
|
||||
- [`core::ffi::FromBytesUntilNulError`](https://doc.rust-lang.org/stable/core/ffi/struct.FromBytesUntilNulError.html)
|
||||
|
||||
These APIs are now stable in const contexts:
|
||||
|
||||
- [`SocketAddr::new`](https://doc.rust-lang.org/stable/std/net/enum.SocketAddr.html#method.new)
|
||||
- [`SocketAddr::ip`](https://doc.rust-lang.org/stable/std/net/enum.SocketAddr.html#method.ip)
|
||||
- [`SocketAddr::port`](https://doc.rust-lang.org/stable/std/net/enum.SocketAddr.html#method.port)
|
||||
- [`SocketAddr::is_ipv4`](https://doc.rust-lang.org/stable/std/net/enum.SocketAddr.html#method.is_ipv4)
|
||||
- [`SocketAddr::is_ipv6`](https://doc.rust-lang.org/stable/std/net/enum.SocketAddr.html#method.is_ipv6)
|
||||
- [`SocketAddrV4::new`](https://doc.rust-lang.org/stable/std/net/struct.SocketAddrV4.html#method.new)
|
||||
- [`SocketAddrV4::ip`](https://doc.rust-lang.org/stable/std/net/struct.SocketAddrV4.html#method.ip)
|
||||
- [`SocketAddrV4::port`](https://doc.rust-lang.org/stable/std/net/struct.SocketAddrV4.html#method.port)
|
||||
- [`SocketAddrV6::new`](https://doc.rust-lang.org/stable/std/net/struct.SocketAddrV6.html#method.new)
|
||||
- [`SocketAddrV6::ip`](https://doc.rust-lang.org/stable/std/net/struct.SocketAddrV6.html#method.ip)
|
||||
- [`SocketAddrV6::port`](https://doc.rust-lang.org/stable/std/net/struct.SocketAddrV6.html#method.port)
|
||||
- [`SocketAddrV6::flowinfo`](https://doc.rust-lang.org/stable/std/net/struct.SocketAddrV6.html#method.flowinfo)
|
||||
- [`SocketAddrV6::scope_id`](https://doc.rust-lang.org/stable/std/net/struct.SocketAddrV6.html#method.scope_id)
|
||||
|
||||
<a id="1.69.0-Cargo"></a>
|
||||
|
||||
Cargo
|
||||
-----
|
||||
|
||||
- [Cargo now suggests `cargo fix` or `cargo clippy --fix` when compilation warnings are auto-fixable.](https://github.com/rust-lang/cargo/pull/11558/)
|
||||
- [Cargo now suggests `cargo add` if you try to install a library crate.](https://github.com/rust-lang/cargo/pull/11410/)
|
||||
- [Cargo now sets the `CARGO_BIN_NAME` environment variable also for binary examples.](https://github.com/rust-lang/cargo/pull/11705/)
|
||||
|
||||
<a id="1.69.0-Rustdoc"></a>
|
||||
|
||||
Rustdoc
|
||||
-----
|
||||
|
||||
- [Vertically compact trait bound formatting.](https://github.com/rust-lang/rust/pull/102842/)
|
||||
- [Only include stable lints in `rustdoc::all` group.](https://github.com/rust-lang/rust/pull/106316/)
|
||||
- [Compute maximum Levenshtein distance based on the query.](https://github.com/rust-lang/rust/pull/107141/)
|
||||
- [Remove inconsistently-present sidebar tooltips.](https://github.com/rust-lang/rust/pull/107490/)
|
||||
- [Search by macro when query ends with `!`.](https://github.com/rust-lang/rust/pull/108143/)
|
||||
|
||||
<a id="1.69.0-Compatibility-Notes"></a>
|
||||
|
||||
Compatibility Notes
|
||||
-------------------
|
||||
|
||||
- [The `rust-analysis` component from `rustup` now only contains a warning placeholder.](https://github.com/rust-lang/rust/pull/101841/) This was primarily intended for RLS, and the corresponding `-Zsave-analysis` flag has been removed from the compiler as well.
|
||||
- [Unaligned references to packed fields are now a hard error.](https://github.com/rust-lang/rust/pull/102513/) This has been a warning since 1.53, and denied by default with a future-compatibility warning since 1.62.
|
||||
- [Update the minimum external LLVM to 14.](https://github.com/rust-lang/rust/pull/107573/)
|
||||
- [Cargo now emits errors on invalid characters in a registry token.](https://github.com/rust-lang/cargo/pull/11600/)
|
||||
- [When `default-features` is set to false of a workspace dependency, and an inherited dependency of a member has `default-features = true`, Cargo will enable default features of that dependency.](https://github.com/rust-lang/cargo/pull/11409/)
|
||||
- [Cargo denies `CARGO_HOME` in the `[env]` configuration table. Cargo itself doesn't pick up this value, but recursive calls to cargo would, which was not intended.](https://github.com/rust-lang/cargo/pull/11644/)
|
||||
- [Debuginfo for build dependencies is now off if not explicitly set. This is expected to improve the overall build time.](https://github.com/rust-lang/cargo/pull/11252/)
|
||||
|
||||
<a id="1.69.0-Internal-Changes"></a>
|
||||
|
||||
Internal Changes
|
||||
----------------
|
||||
|
||||
These changes do not affect any public interfaces of Rust, but they represent
|
||||
significant improvements to the performance or internals of rustc and related
|
||||
tools.
|
||||
|
||||
- [Move `format_args!()` into AST (and expand it during AST lowering)](https://github.com/rust-lang/rust/pull/106745/)
|
||||
|
||||
Version 1.68.2 (2023-03-28)
|
||||
===========================
|
||||
|
||||
- [Update the GitHub RSA host key bundled within Cargo](https://github.com/rust-lang/cargo/pull/11883).
|
||||
The key was [rotated by GitHub](https://github.blog/2023-03-23-we-updated-our-rsa-ssh-host-key/)
|
||||
on 2023-03-24 after the old one leaked.
|
||||
- [Mark the old GitHub RSA host key as revoked](https://github.com/rust-lang/cargo/pull/11889).
|
||||
This will prevent Cargo from accepting the leaked key even when trusted by
|
||||
the system.
|
||||
- [Add support for `@revoked` and a better error message for `@cert-authority` in Cargo's SSH host key verification](https://github.com/rust-lang/cargo/pull/11635)
|
||||
|
||||
Version 1.68.1 (2023-03-23)
|
||||
===========================
|
||||
|
||||
- [Fix miscompilation in produced Windows MSVC artifacts](https://github.com/rust-lang/rust/pull/109094)
|
||||
This was introduced by enabling ThinLTO for the distributed rustc which led
|
||||
to miscompilations in the resulting binary. Currently this is believed to be
|
||||
limited to the -Zdylib-lto flag used for rustc compilation, rather than a
|
||||
general bug in ThinLTO, so only rustc artifacts should be affected.
|
||||
- [Fix --enable-local-rust builds](https://github.com/rust-lang/rust/pull/109111/)
|
||||
- [Treat `$prefix-clang` as `clang` in linker detection code](https://github.com/rust-lang/rust/pull/109156)
|
||||
- [Fix panic in compiler code](https://github.com/rust-lang/rust/pull/108162)
|
||||
|
||||
Version 1.68.0 (2023-03-09)
|
||||
==========================
|
||||
|
||||
<a id="1.68.0-Language"></a>
|
||||
|
||||
Language
|
||||
--------
|
||||
|
||||
- [Stabilize default_alloc_error_handler](https://github.com/rust-lang/rust/pull/102318/)
|
||||
This allows usage of `alloc` on stable without requiring the
|
||||
definition of a handler for allocation failure. Defining custom handlers is still unstable.
|
||||
- [Stabilize `efiapi` calling convention.](https://github.com/rust-lang/rust/pull/105795/)
|
||||
- [Remove implicit promotion for types with drop glue](https://github.com/rust-lang/rust/pull/105085/)
|
||||
|
||||
<a id="1.68.0-Compiler"></a>
|
||||
|
||||
Compiler
|
||||
--------
|
||||
|
||||
- [Change `bindings_with_variant_name` to deny-by-default](https://github.com/rust-lang/rust/pull/104154/)
|
||||
- [Allow .. to be parsed as let initializer](https://github.com/rust-lang/rust/pull/105701/)
|
||||
- [Add `armv7-sony-vita-newlibeabihf` as a tier 3 target](https://github.com/rust-lang/rust/pull/105712/)
|
||||
- [Always check alignment during compile-time const evaluation](https://github.com/rust-lang/rust/pull/104616/)
|
||||
- [Disable "split dwarf inlining" by default.](https://github.com/rust-lang/rust/pull/106709/)
|
||||
- [Add vendor to Fuchsia's target triple](https://github.com/rust-lang/rust/pull/106429/)
|
||||
- [Enable sanitizers for s390x-linux](https://github.com/rust-lang/rust/pull/107127/)
|
||||
|
||||
<a id="1.68.0-Libraries"></a>
|
||||
|
||||
Libraries
|
||||
---------
|
||||
|
||||
- [Loosen the bound on the Debug implementation of Weak.](https://github.com/rust-lang/rust/pull/90291/)
|
||||
- [Make `std::task::Context` !Send and !Sync](https://github.com/rust-lang/rust/pull/95985/)
|
||||
- [PhantomData layout guarantees](https://github.com/rust-lang/rust/pull/104081/)
|
||||
- [Don't derive Debug for `OnceWith` & `RepeatWith`](https://github.com/rust-lang/rust/pull/104163/)
|
||||
- [Implement DerefMut for PathBuf](https://github.com/rust-lang/rust/pull/105018/)
|
||||
- [Add O(1) `Vec -> VecDeque` conversion guarantee](https://github.com/rust-lang/rust/pull/105128/)
|
||||
- [Leak amplification for peek_mut() to ensure BinaryHeap's invariant is always met](https://github.com/rust-lang/rust/pull/105851/)
|
||||
|
||||
<a id="1.68.0-Stabilized-APIs"></a>
|
||||
|
||||
Stabilized APIs
|
||||
---------------
|
||||
|
||||
- [`{core,std}::pin::pin!`](https://doc.rust-lang.org/stable/std/pin/macro.pin.html)
|
||||
- [`impl From<bool> for {f32,f64}`](https://doc.rust-lang.org/stable/std/primitive.f32.html#impl-From%3Cbool%3E-for-f32)
|
||||
- [`std::path::MAIN_SEPARATOR_STR`](https://doc.rust-lang.org/stable/std/path/constant.MAIN_SEPARATOR_STR.html)
|
||||
- [`impl DerefMut for PathBuf`](https://doc.rust-lang.org/stable/std/path/struct.PathBuf.html#impl-DerefMut-for-PathBuf)
|
||||
|
||||
These APIs are now stable in const contexts:
|
||||
|
||||
- [`VecDeque::new`](https://doc.rust-lang.org/stable/std/collections/struct.VecDeque.html#method.new)
|
||||
|
||||
<a id="1.68.0-Cargo"></a>
|
||||
|
||||
Cargo
|
||||
-----
|
||||
|
||||
- [Stabilize sparse registry support for crates.io](https://github.com/rust-lang/cargo/pull/11224/)
|
||||
- [`cargo build --verbose` tells you more about why it recompiles.](https://github.com/rust-lang/cargo/pull/11407/)
|
||||
- [Show progress of crates.io index update even `net.git-fetch-with-cli` option enabled](https://github.com/rust-lang/cargo/pull/11579/)
|
||||
|
||||
<a id="1.68.0-Misc"></a>
|
||||
|
||||
Misc
|
||||
----
|
||||
|
||||
<a id="1.68.0-Compatibility-Notes"></a>
|
||||
|
||||
Compatibility Notes
|
||||
-------------------
|
||||
|
||||
- [Only support Android NDK 25 or newer](https://blog.rust-lang.org/2023/01/09/android-ndk-update-r25.html)
|
||||
- [Add `SEMICOLON_IN_EXPRESSIONS_FROM_MACROS` to future-incompat report](https://github.com/rust-lang/rust/pull/103418/)
|
||||
- [Only specify `--target` by default for `-Zgcc-ld=lld` on wasm](https://github.com/rust-lang/rust/pull/101792/)
|
||||
- [Bump `IMPLIED_BOUNDS_ENTAILMENT` to Deny + ReportNow](https://github.com/rust-lang/rust/pull/106465/)
|
||||
- [`std::task::Context` no longer implements Send and Sync](https://github.com/rust-lang/rust/pull/95985)
|
||||
|
||||
<a id="1.68.0-Internal-Changes"></a>
|
||||
|
||||
Internal Changes
|
||||
----------------
|
||||
|
||||
These changes do not affect any public interfaces of Rust, but they represent
|
||||
significant improvements to the performance or internals of rustc and related
|
||||
tools.
|
||||
|
||||
- [Encode spans relative to the enclosing item](https://github.com/rust-lang/rust/pull/84762/)
|
||||
- [Don't normalize in AstConv](https://github.com/rust-lang/rust/pull/101947/)
|
||||
- [Find the right lower bound region in the scenario of partial order relations](https://github.com/rust-lang/rust/pull/104765/)
|
||||
- [Fix impl block in const expr](https://github.com/rust-lang/rust/pull/104889/)
|
||||
- [Check ADT fields for copy implementations considering regions](https://github.com/rust-lang/rust/pull/105102/)
|
||||
- [rustdoc: simplify JS search routine by not messing with lev distance](https://github.com/rust-lang/rust/pull/105796/)
|
||||
- [Enable ThinLTO for rustc on `x86_64-pc-windows-msvc`](https://github.com/rust-lang/rust/pull/103591/)
|
||||
- [Enable ThinLTO for rustc on `x86_64-apple-darwin`](https://github.com/rust-lang/rust/pull/103647/)
|
||||
|
||||
Version 1.67.1 (2023-02-09)
|
||||
===========================
|
||||
|
||||
|
|
@ -29,12 +251,13 @@ Compiler
|
|||
- [Optimize field ordering by grouping m\*2^n-sized fields with equivalently aligned ones.](https://github.com/rust-lang/rust/pull/102750/)
|
||||
- [Stabilize native library modifier `verbatim`.](https://github.com/rust-lang/rust/pull/104360/)
|
||||
|
||||
Added and removed targets:
|
||||
Added, updated, and removed targets:
|
||||
|
||||
- [Add a tier 3 target for PowerPC on AIX](https://github.com/rust-lang/rust/pull/102293/), `powerpc64-ibm-aix`.
|
||||
- [Add a tier 3 target for the Sony PlayStation 1](https://github.com/rust-lang/rust/pull/102689/), `mipsel-sony-psx`.
|
||||
- [Add tier 3 `no_std` targets for the QNX Neutrino RTOS](https://github.com/rust-lang/rust/pull/102701/),
|
||||
`aarch64-unknown-nto-qnx710` and `x86_64-pc-nto-qnx710`.
|
||||
- [Promote UEFI targets to tier 2](https://github.com/rust-lang/rust/pull/103933/), `aarch64-unknown-uefi`, `i686-unknown-uefi`, and `x86_64-unknown-uefi`.
|
||||
- [Remove tier 3 `linuxkernel` targets](https://github.com/rust-lang/rust/pull/104015/) (not used by the actual kernel).
|
||||
|
||||
Refer to Rust's [platform support page][platform-support-doc]
|
||||
|
|
@ -3765,6 +3988,8 @@ Version 1.41.1 (2020-02-27)
|
|||
* [Always check types of static items][69145]
|
||||
* [Always check lifetime bounds of `Copy` impls][69145]
|
||||
* [Fix miscompilation in callers of `Layout::repeat`][69225]
|
||||
* [Rust 1.41.0 was announced as the last Rust release with tier 1 or tier 2 support for 32-bit Apple targets][apple-32bit-drop].
|
||||
That announcement did not expect a patch release. 1.41.1 also includes release binaries for these targets.
|
||||
|
||||
[69225]: https://github.com/rust-lang/rust/issues/69225
|
||||
[69145]: https://github.com/rust-lang/rust/pull/69145
|
||||
|
|
@ -3857,7 +4082,7 @@ Misc
|
|||
Compatibility Notes
|
||||
-------------------
|
||||
|
||||
- [As previously announced 1.41.0 will be the last tier 1 release for 32-bit
|
||||
- [As previously announced 1.41 will be the last tier 1 release for 32-bit
|
||||
Apple targets.][apple-32bit-drop] This means that the source code is still
|
||||
available to build, but the targets are no longer being tested and release
|
||||
binaries for those platforms will no longer be distributed by the Rust project.
|
||||
|
|
|
|||
|
|
@ -612,14 +612,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
|
|||
span: Option<Span>,
|
||||
layout: Option<TyAndLayout<'tcx>>,
|
||||
) -> InterpResult<'tcx, OpTy<'tcx, M::Provenance>> {
|
||||
// FIXME(const_prop): normalization needed b/c const prop lint in
|
||||
// `mir_drops_elaborated_and_const_checked`, which happens before
|
||||
// optimized MIR. Only after optimizing the MIR can we guarantee
|
||||
// that the `RevealAll` pass has happened and that the body's consts
|
||||
// are normalized, so any call to resolve before that needs to be
|
||||
// manually normalized.
|
||||
let val = self.tcx.normalize_erasing_regions(self.param_env, *val);
|
||||
match val {
|
||||
match *val {
|
||||
mir::ConstantKind::Ty(ct) => {
|
||||
let ty = ct.ty();
|
||||
let valtree = self.eval_ty_constant(ct, span)?;
|
||||
|
|
|
|||
|
|
@ -473,8 +473,6 @@ pub enum StashKey {
|
|||
/// When an invalid lifetime e.g. `'2` should be reinterpreted
|
||||
/// as a char literal in the parser
|
||||
LifetimeIsChar,
|
||||
/// When an invalid lifetime e.g. `'🐱` contains emoji.
|
||||
LifetimeContainsEmoji,
|
||||
/// Maybe there was a typo where a comma was forgotten before
|
||||
/// FRU syntax
|
||||
MaybeFruTypo,
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ pub enum TokenKind {
|
|||
Literal { kind: LiteralKind, suffix_start: u32 },
|
||||
|
||||
/// "'a"
|
||||
Lifetime { starts_with_number: bool, contains_emoji: bool },
|
||||
Lifetime { starts_with_number: bool },
|
||||
|
||||
// One-char tokens:
|
||||
/// ";"
|
||||
|
|
@ -632,13 +632,7 @@ impl Cursor<'_> {
|
|||
// If the first symbol is valid for identifier, it can be a lifetime.
|
||||
// Also check if it's a number for a better error reporting (so '0 will
|
||||
// be reported as invalid lifetime and not as unterminated char literal).
|
||||
// We also have to account for potential `'🐱` emojis to avoid reporting
|
||||
// it as an unterminated char literal.
|
||||
is_id_start(self.first())
|
||||
|| self.first().is_digit(10)
|
||||
// FIXME(#108019): `unic-emoji-char` seems to have data tables only up to Unicode
|
||||
// 5.0, but Unicode is already newer than this.
|
||||
|| unic_emoji_char::is_emoji(self.first())
|
||||
is_id_start(self.first()) || self.first().is_digit(10)
|
||||
};
|
||||
|
||||
if !can_be_a_lifetime {
|
||||
|
|
@ -651,33 +645,16 @@ impl Cursor<'_> {
|
|||
return Literal { kind, suffix_start };
|
||||
}
|
||||
|
||||
// Either a lifetime or a character literal.
|
||||
// Either a lifetime or a character literal with
|
||||
// length greater than 1.
|
||||
|
||||
let starts_with_number = self.first().is_digit(10);
|
||||
let mut contains_emoji = false;
|
||||
|
||||
// FIXME(#108019): `unic-emoji-char` seems to have data tables only up to Unicode
|
||||
// 5.0, but Unicode is already newer than this.
|
||||
if unic_emoji_char::is_emoji(self.first()) {
|
||||
contains_emoji = true;
|
||||
} else {
|
||||
// Skip the literal contents.
|
||||
// First symbol can be a number (which isn't a valid identifier start),
|
||||
// so skip it without any checks.
|
||||
self.bump();
|
||||
}
|
||||
self.eat_while(|c| {
|
||||
if is_id_continue(c) {
|
||||
true
|
||||
// FIXME(#108019): `unic-emoji-char` seems to have data tables only up to Unicode
|
||||
// 5.0, but Unicode is already newer than this.
|
||||
} else if unic_emoji_char::is_emoji(c) {
|
||||
contains_emoji = true;
|
||||
true
|
||||
} else {
|
||||
false
|
||||
}
|
||||
});
|
||||
// Skip the literal contents.
|
||||
// First symbol can be a number (which isn't a valid identifier start),
|
||||
// so skip it without any checks.
|
||||
self.bump();
|
||||
self.eat_while(is_id_continue);
|
||||
|
||||
// Check if after skipping literal contents we've met a closing
|
||||
// single quote (which means that user attempted to create a
|
||||
|
|
@ -687,7 +664,7 @@ impl Cursor<'_> {
|
|||
let kind = Char { terminated: true };
|
||||
Literal { kind, suffix_start: self.pos_within_token() }
|
||||
} else {
|
||||
Lifetime { starts_with_number, contains_emoji }
|
||||
Lifetime { starts_with_number }
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -235,7 +235,7 @@ fn lifetime() {
|
|||
check_lexing(
|
||||
"'abc",
|
||||
expect![[r#"
|
||||
Token { kind: Lifetime { starts_with_number: false, contains_emoji: false }, len: 4 }
|
||||
Token { kind: Lifetime { starts_with_number: false }, len: 4 }
|
||||
"#]],
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -193,9 +193,9 @@ impl<'tcx> NormalizeAfterErasingRegionsFolder<'tcx> {
|
|||
let arg = self.param_env.and(arg);
|
||||
|
||||
self.tcx.try_normalize_generic_arg_after_erasing_regions(arg).unwrap_or_else(|_| bug!(
|
||||
"Failed to normalize {:?}, maybe try to call `try_normalize_erasing_regions` instead",
|
||||
arg.value
|
||||
))
|
||||
"Failed to normalize {:?}, maybe try to call `try_normalize_erasing_regions` instead",
|
||||
arg.value
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -298,7 +298,15 @@ impl<'mir, 'tcx> ConstPropagator<'mir, 'tcx> {
|
|||
return None;
|
||||
}
|
||||
|
||||
self.use_ecx(source_info, |this| this.ecx.eval_mir_constant(&c.literal, Some(c.span), None))
|
||||
// Normalization needed b/c const prop lint runs in
|
||||
// `mir_drops_elaborated_and_const_checked`, which happens before
|
||||
// optimized MIR. Only after optimizing the MIR can we guarantee
|
||||
// that the `RevealAll` pass has happened and that the body's consts
|
||||
// are normalized, so any call to resolve before that needs to be
|
||||
// manually normalized.
|
||||
let val = self.tcx.try_normalize_erasing_regions(self.param_env, c.literal).ok()?;
|
||||
|
||||
self.use_ecx(source_info, |this| this.ecx.eval_mir_constant(&val, Some(c.span), None))
|
||||
}
|
||||
|
||||
/// Returns the value, if any, of evaluating `place`.
|
||||
|
|
|
|||
|
|
@ -223,21 +223,16 @@ impl<'a> StringReader<'a> {
|
|||
};
|
||||
token::Literal(token::Lit { kind, symbol, suffix })
|
||||
}
|
||||
rustc_lexer::TokenKind::Lifetime { starts_with_number, contains_emoji } => {
|
||||
rustc_lexer::TokenKind::Lifetime { starts_with_number } => {
|
||||
// Include the leading `'` in the real identifier, for macro
|
||||
// expansion purposes. See #12512 for the gory details of why
|
||||
// this is necessary.
|
||||
let lifetime_name = self.str_from(start);
|
||||
if starts_with_number {
|
||||
let span = self.mk_sp(start, self.pos);
|
||||
let mut diag = self.sess.struct_err("lifetimes or labels cannot start with a number");
|
||||
let mut diag = self.sess.struct_err("lifetimes cannot start with a number");
|
||||
diag.set_span(span);
|
||||
diag.stash(span, StashKey::LifetimeIsChar);
|
||||
} else if contains_emoji {
|
||||
let span = self.mk_sp(start, self.pos);
|
||||
let mut diag = self.sess.struct_err("lifetimes or labels cannot contain emojis");
|
||||
diag.set_span(span);
|
||||
diag.stash(span, StashKey::LifetimeContainsEmoji);
|
||||
}
|
||||
let ident = Symbol::intern(lifetime_name);
|
||||
token::Lifetime(ident)
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
beta
|
||||
stable
|
||||
|
|
|
|||
|
|
@ -59,6 +59,14 @@ RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --enable-locked-deps"
|
|||
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --enable-cargo-native-static"
|
||||
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --set rust.codegen-units-std=1"
|
||||
|
||||
# When building for mingw, limit the number of parallel linker jobs during
|
||||
# the LLVM build, as not to run out of memory.
|
||||
# This is an attempt to fix the spurious build error tracked by
|
||||
# https://github.com/rust-lang/rust/issues/108227.
|
||||
if isWindows && [[ ${CUSTOM_MINGW-0} -eq 1 ]]; then
|
||||
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --set llvm.link-jobs=1"
|
||||
fi
|
||||
|
||||
# Only produce xz tarballs on CI. gz tarballs will be generated by the release
|
||||
# process by recompressing the existing xz ones. This decreases the storage
|
||||
# space required for CI artifacts.
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@ use std::hash::Hash;
|
|||
use std::mem;
|
||||
use thin_vec::ThinVec;
|
||||
|
||||
use crate::clean::inline::merge_attrs;
|
||||
use crate::core::{self, DocContext, ImplTraitParam};
|
||||
use crate::formats::item_type::ItemType;
|
||||
use crate::visit_ast::Module as DocModule;
|
||||
|
|
@ -2349,21 +2350,22 @@ fn clean_maybe_renamed_item<'tcx>(
|
|||
_ => unreachable!("not yet converted"),
|
||||
};
|
||||
|
||||
let mut extra_attrs = Vec::new();
|
||||
let mut import_attrs = Vec::new();
|
||||
let mut target_attrs = Vec::new();
|
||||
if let Some(import_id) = import_id &&
|
||||
let Some(hir::Node::Item(use_node)) = cx.tcx.hir().find_by_def_id(import_id)
|
||||
{
|
||||
let is_inline = inline::load_attrs(cx, import_id.to_def_id()).lists(sym::doc).get_word_attr(sym::inline).is_some();
|
||||
// Then we get all the various imports' attributes.
|
||||
get_all_import_attributes(use_node, cx.tcx, item.owner_id.def_id, &mut extra_attrs, is_inline);
|
||||
add_without_unwanted_attributes(&mut extra_attrs, inline::load_attrs(cx, def_id), is_inline);
|
||||
get_all_import_attributes(use_node, cx.tcx, item.owner_id.def_id, &mut import_attrs, is_inline);
|
||||
add_without_unwanted_attributes(&mut target_attrs, inline::load_attrs(cx, def_id), is_inline);
|
||||
} else {
|
||||
// We only keep the item's attributes.
|
||||
extra_attrs.extend_from_slice(inline::load_attrs(cx, def_id));
|
||||
target_attrs.extend_from_slice(inline::load_attrs(cx, def_id));
|
||||
}
|
||||
|
||||
let attrs = Attributes::from_ast(&extra_attrs);
|
||||
let cfg = extra_attrs.cfg(cx.tcx, &cx.cache.hidden_cfg);
|
||||
let import_parent = import_id.map(|import_id| cx.tcx.local_parent(import_id).to_def_id());
|
||||
let (attrs, cfg) = merge_attrs(cx, import_parent, &target_attrs, Some(&import_attrs));
|
||||
|
||||
let mut item =
|
||||
Item::from_def_id_and_attrs_and_parts(def_id, Some(name), kind, Box::new(attrs), cfg);
|
||||
|
|
|
|||
|
|
@ -398,12 +398,20 @@ impl<'a, 'tcx> RustdocVisitor<'a, 'tcx> {
|
|||
| hir::ItemKind::Struct(..)
|
||||
| hir::ItemKind::Union(..)
|
||||
| hir::ItemKind::TyAlias(..)
|
||||
| hir::ItemKind::OpaqueTy(..)
|
||||
| hir::ItemKind::OpaqueTy(hir::OpaqueTy {
|
||||
origin: hir::OpaqueTyOrigin::TyAlias, ..
|
||||
})
|
||||
| hir::ItemKind::Static(..)
|
||||
| hir::ItemKind::Trait(..)
|
||||
| hir::ItemKind::TraitAlias(..) => {
|
||||
self.add_to_current_mod(item, renamed, import_id);
|
||||
}
|
||||
hir::ItemKind::OpaqueTy(hir::OpaqueTy {
|
||||
origin: hir::OpaqueTyOrigin::AsyncFn(_) | hir::OpaqueTyOrigin::FnReturn(_),
|
||||
..
|
||||
}) => {
|
||||
// return-position impl traits are never nameable, and should never be documented.
|
||||
}
|
||||
hir::ItemKind::Const(..) => {
|
||||
// Underscore constants do not correspond to a nameable item and
|
||||
// so are never useful in documentation.
|
||||
|
|
|
|||
16
tests/rustdoc-ui/intra-doc/import-inline-merge.rs
Normal file
16
tests/rustdoc-ui/intra-doc/import-inline-merge.rs
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
// Import for `A` is inlined and doc comments on the import and `A` itself are merged.
|
||||
// After the merge they still have correct parent scopes to resolve both `[A]` and `[B]`.
|
||||
|
||||
// check-pass
|
||||
|
||||
#![allow(rustdoc::private_intra_doc_links)]
|
||||
|
||||
mod m {
|
||||
/// [B]
|
||||
pub struct A {}
|
||||
|
||||
pub struct B {}
|
||||
}
|
||||
|
||||
/// [A]
|
||||
pub use m::A;
|
||||
15
tests/rustdoc/async-fn-opaque-item.rs
Normal file
15
tests/rustdoc/async-fn-opaque-item.rs
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
// compile-flags: --document-private-items --crate-type=lib
|
||||
// edition: 2021
|
||||
|
||||
// Issue 109931 -- test against accidentally documenting the `impl Future`
|
||||
// that comes from an async fn desugaring.
|
||||
|
||||
// Check that we don't document an unnamed opaque type
|
||||
// @!has async_fn_opaque_item/opaque..html
|
||||
|
||||
// Checking there is only a "Functions" header and no "Opaque types".
|
||||
// @has async_fn_opaque_item/index.html
|
||||
// @count - '//*[@class="small-section-header"]' 1
|
||||
// @has - '//*[@class="small-section-header"]' 'Functions'
|
||||
|
||||
pub async fn test() {}
|
||||
|
|
@ -1,45 +0,0 @@
|
|||
#![allow(unused_labels)]
|
||||
|
||||
// FIXME(#108019): outdated Unicode table
|
||||
// fn foo() {
|
||||
// '🥺 loop {
|
||||
// break
|
||||
// }
|
||||
// }
|
||||
|
||||
fn bar() {
|
||||
'🐱 loop {
|
||||
//~^ ERROR labeled expression must be followed by `:`
|
||||
//~| ERROR lifetimes or labels cannot contain emojis
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
fn qux() {
|
||||
'a🐱 loop {
|
||||
//~^ ERROR labeled expression must be followed by `:`
|
||||
//~| ERROR lifetimes or labels cannot contain emojis
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
fn quux() {
|
||||
'1🐱 loop {
|
||||
//~^ ERROR labeled expression must be followed by `:`
|
||||
//~| ERROR lifetimes or labels cannot start with a number
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
fn x<'🐱>() -> &'🐱 () {
|
||||
//~^ ERROR lifetimes or labels cannot contain emojis
|
||||
//~| ERROR lifetimes or labels cannot contain emojis
|
||||
&()
|
||||
}
|
||||
|
||||
fn y() {
|
||||
'a🐱: loop {}
|
||||
//~^ ERROR lifetimes or labels cannot contain emojis
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
|
|
@ -1,86 +0,0 @@
|
|||
error: labeled expression must be followed by `:`
|
||||
--> $DIR/issue-108019-bad-emoji-recovery.rs:11:5
|
||||
|
|
||||
LL | '🐱 loop {
|
||||
| ^--- help: add `:` after the label
|
||||
| |
|
||||
| _____the label
|
||||
| |
|
||||
LL | |
|
||||
LL | |
|
||||
LL | | break
|
||||
LL | | }
|
||||
| |_____^
|
||||
|
|
||||
= note: labels are used before loops and blocks, allowing e.g., `break 'label` to them
|
||||
|
||||
error: labeled expression must be followed by `:`
|
||||
--> $DIR/issue-108019-bad-emoji-recovery.rs:19:5
|
||||
|
|
||||
LL | 'a🐱 loop {
|
||||
| ^---- help: add `:` after the label
|
||||
| |
|
||||
| _____the label
|
||||
| |
|
||||
LL | |
|
||||
LL | |
|
||||
LL | | break
|
||||
LL | | }
|
||||
| |_____^
|
||||
|
|
||||
= note: labels are used before loops and blocks, allowing e.g., `break 'label` to them
|
||||
|
||||
error: labeled expression must be followed by `:`
|
||||
--> $DIR/issue-108019-bad-emoji-recovery.rs:27:5
|
||||
|
|
||||
LL | '1🐱 loop {
|
||||
| ^---- help: add `:` after the label
|
||||
| |
|
||||
| _____the label
|
||||
| |
|
||||
LL | |
|
||||
LL | |
|
||||
LL | | break
|
||||
LL | | }
|
||||
| |_____^
|
||||
|
|
||||
= note: labels are used before loops and blocks, allowing e.g., `break 'label` to them
|
||||
|
||||
error: lifetimes or labels cannot contain emojis
|
||||
--> $DIR/issue-108019-bad-emoji-recovery.rs:11:5
|
||||
|
|
||||
LL | '🐱 loop {
|
||||
| ^^^
|
||||
|
||||
error: lifetimes or labels cannot contain emojis
|
||||
--> $DIR/issue-108019-bad-emoji-recovery.rs:19:5
|
||||
|
|
||||
LL | 'a🐱 loop {
|
||||
| ^^^^
|
||||
|
||||
error: lifetimes or labels cannot start with a number
|
||||
--> $DIR/issue-108019-bad-emoji-recovery.rs:27:5
|
||||
|
|
||||
LL | '1🐱 loop {
|
||||
| ^^^^
|
||||
|
||||
error: lifetimes or labels cannot contain emojis
|
||||
--> $DIR/issue-108019-bad-emoji-recovery.rs:34:6
|
||||
|
|
||||
LL | fn x<'🐱>() -> &'🐱 () {
|
||||
| ^^^
|
||||
|
||||
error: lifetimes or labels cannot contain emojis
|
||||
--> $DIR/issue-108019-bad-emoji-recovery.rs:34:16
|
||||
|
|
||||
LL | fn x<'🐱>() -> &'🐱 () {
|
||||
| ^^^
|
||||
|
||||
error: lifetimes or labels cannot contain emojis
|
||||
--> $DIR/issue-108019-bad-emoji-recovery.rs:41:5
|
||||
|
|
||||
LL | 'a🐱: loop {}
|
||||
| ^^^^
|
||||
|
||||
error: aborting due to 9 previous errors
|
||||
|
||||
51
tests/ui/mir/issue-109743.rs
Normal file
51
tests/ui/mir/issue-109743.rs
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
// build-pass
|
||||
// compile-flags: --crate-type=lib
|
||||
|
||||
use std::marker::PhantomData;
|
||||
|
||||
pub trait StreamOnce {
|
||||
type Token;
|
||||
}
|
||||
|
||||
impl StreamOnce for &str {
|
||||
type Token = ();
|
||||
}
|
||||
|
||||
pub trait Parser<Input: StreamOnce> {
|
||||
type PartialState: Default;
|
||||
fn parse_mode(&self, _state: &Self::PartialState) {}
|
||||
fn parse_mode_impl() {}
|
||||
}
|
||||
|
||||
pub fn parse_bool<'a>() -> impl Parser<&'a str> {
|
||||
pub struct TokensCmp<C, Input>
|
||||
where
|
||||
Input: StreamOnce,
|
||||
{
|
||||
_cmp: C,
|
||||
_marker: PhantomData<Input>,
|
||||
}
|
||||
|
||||
impl<Input, C> Parser<Input> for TokensCmp<C, Input>
|
||||
where
|
||||
C: FnMut(Input::Token),
|
||||
Input: StreamOnce,
|
||||
{
|
||||
type PartialState = ();
|
||||
}
|
||||
|
||||
TokensCmp { _cmp: |_| (), _marker: PhantomData }
|
||||
}
|
||||
|
||||
pub struct ParseBool;
|
||||
|
||||
impl<'a> Parser<&'a str> for ParseBool
|
||||
where
|
||||
&'a str: StreamOnce,
|
||||
{
|
||||
type PartialState = ();
|
||||
|
||||
fn parse_mode_impl() {
|
||||
parse_bool().parse_mode(&Default::default())
|
||||
}
|
||||
}
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
struct S<'1> { s: &'1 usize }
|
||||
//~^ ERROR lifetimes or labels cannot start with a number
|
||||
//~| ERROR lifetimes or labels cannot start with a number
|
||||
//~^ ERROR lifetimes cannot start with a number
|
||||
//~| ERROR lifetimes cannot start with a number
|
||||
fn main() {
|
||||
// verify that the parse error doesn't stop type checking
|
||||
let x: usize = "";
|
||||
|
|
|
|||
|
|
@ -6,13 +6,13 @@ LL | let x: usize = "";
|
|||
| |
|
||||
| expected due to this
|
||||
|
||||
error: lifetimes or labels cannot start with a number
|
||||
error: lifetimes cannot start with a number
|
||||
--> $DIR/numeric-lifetime.rs:1:10
|
||||
|
|
||||
LL | struct S<'1> { s: &'1 usize }
|
||||
| ^^
|
||||
|
||||
error: lifetimes or labels cannot start with a number
|
||||
error: lifetimes cannot start with a number
|
||||
--> $DIR/numeric-lifetime.rs:1:20
|
||||
|
|
||||
LL | struct S<'1> { s: &'1 usize }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue