Skip to content

Commit bddcba7

Browse files
authored
Merge branch 'main' into fix/hidden-attr-docs
2 parents 7c54229 + 88ad3d4 commit bddcba7

416 files changed

Lines changed: 4204 additions & 2268 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Cargo.lock

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1670,9 +1670,12 @@ dependencies = [
16701670

16711671
[[package]]
16721672
name = "hashbrown"
1673-
version = "0.16.0"
1673+
version = "0.16.1"
16741674
source = "registry+https://github.com/rust-lang/crates.io-index"
1675-
checksum = "5419bdc4f6a9207fbeba6d11b604d481addf78ecd10c11ad51e76c2f6482748d"
1675+
checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100"
1676+
dependencies = [
1677+
"foldhash 0.2.0",
1678+
]
16761679

16771680
[[package]]
16781681
name = "heck"
@@ -1950,12 +1953,12 @@ checksum = "964de6e86d545b246d84badc0fef527924ace5134f30641c203ef52ba83f58d5"
19501953

19511954
[[package]]
19521955
name = "indexmap"
1953-
version = "2.12.0"
1956+
version = "2.13.0"
19541957
source = "registry+https://github.com/rust-lang/crates.io-index"
1955-
checksum = "6717a8d2a5a929a1a2eb43a12812498ed141a0bcfb7e8f7844fbdbe4303bba9f"
1958+
checksum = "7714e70437a7dc3ac8eb7e6f8df75fd8eb422675fc7678aff7364301092b1017"
19561959
dependencies = [
19571960
"equivalent",
1958-
"hashbrown 0.16.0",
1961+
"hashbrown 0.16.1",
19591962
"serde",
19601963
"serde_core",
19611964
]
@@ -3334,6 +3337,7 @@ dependencies = [
33343337
"rustdoc-json-types",
33353338
"serde_json",
33363339
"similar",
3340+
"tempfile",
33373341
"wasmparser 0.236.1",
33383342
]
33393343

@@ -3730,7 +3734,7 @@ dependencies = [
37303734
"either",
37313735
"elsa",
37323736
"ena",
3733-
"hashbrown 0.15.5",
3737+
"hashbrown 0.16.1",
37343738
"indexmap",
37353739
"jobserver",
37363740
"libc",
@@ -3767,6 +3771,7 @@ dependencies = [
37673771
name = "rustc_driver_impl"
37683772
version = "0.0.0"
37693773
dependencies = [
3774+
"anstyle",
37703775
"ctrlc",
37713776
"jiff",
37723777
"libc",
@@ -3792,6 +3797,7 @@ dependencies = [
37923797
"rustc_index",
37933798
"rustc_infer",
37943799
"rustc_interface",
3800+
"rustc_lexer",
37953801
"rustc_lint",
37963802
"rustc_log",
37973803
"rustc_macros",
@@ -4348,7 +4354,7 @@ name = "rustc_mir_transform"
43484354
version = "0.0.0"
43494355
dependencies = [
43504356
"either",
4351-
"hashbrown 0.15.5",
4357+
"hashbrown 0.16.1",
43524358
"itertools",
43534359
"rustc_abi",
43544360
"rustc_arena",
@@ -4559,7 +4565,7 @@ dependencies = [
45594565
name = "rustc_query_system"
45604566
version = "0.0.0"
45614567
dependencies = [
4562-
"hashbrown 0.15.5",
4568+
"hashbrown 0.16.1",
45634569
"parking_lot",
45644570
"rustc_abi",
45654571
"rustc_ast",

RELEASES.md

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,114 @@
1+
Version 1.93.0 (2026-01-22)
2+
==========================
3+
4+
<a id="1.93.0-Language"></a>
5+
6+
Language
7+
--------
8+
- [Stabilize several s390x `vector`-related target features and the `is_s390x_feature_detected!` macro](https://github.com/rust-lang/rust/pull/145656)
9+
- [Stabilize declaration of C-style variadic functions for the `system` ABI](https://github.com/rust-lang/rust/pull/145954)
10+
- [Emit error when using some keyword as a `cfg` predicate](https://github.com/rust-lang/rust/pull/146978)
11+
- [Stabilize `asm_cfg`](https://github.com/rust-lang/rust/pull/147736)
12+
- [During const-evaluation, support copying pointers byte-by-byte](https://github.com/rust-lang/rust/pull/148259)
13+
- [LUB coercions now correctly handle function item types, and functions with differing safeties](https://github.com/rust-lang/rust/pull/148602)
14+
- [Allow `const` items that contain mutable references to `static` (which is *very* unsafe, but not *always* UB)](https://github.com/rust-lang/rust/pull/148746)
15+
- [Add warn-by-default `const_item_interior_mutations` lint to warn against calls which mutate interior mutable `const` items](https://github.com/rust-lang/rust/pull/148407)
16+
- [Add warn-by-default `function_casts_as_integer` lint](https://github.com/rust-lang/rust/pull/141470)
17+
18+
19+
<a id="1.93.0-Compiler"></a>
20+
21+
Compiler
22+
--------
23+
- [Stabilize `-Cjump-tables=bool`](https://github.com/rust-lang/rust/pull/145974). The flag was previously called `-Zno-jump-tables`.
24+
25+
<a id="1.93.0-Platform-Support"></a>
26+
27+
Platform Support
28+
----------------
29+
30+
- [Promote `riscv64a23-unknown-linux-gnu` to Tier 2 (without host tools)](https://github.com/rust-lang/rust/pull/148435)
31+
32+
Refer to Rust's [platform support page][platform-support-doc]
33+
for more information on Rust's tiered platform support.
34+
35+
[platform-support-doc]: https://doc.rust-lang.org/rustc/platform-support.html
36+
37+
<a id="1.93.0-Libraries"></a>
38+
39+
Libraries
40+
---------
41+
- [Stop internally using `specialization` on the `Copy` trait as it is unsound in the presence of lifetime dependent `Copy` implementations. This may result in some performance regressions as some standard library APIs may now call `Clone::clone` instead of performing bitwise copies](https://github.com/rust-lang/rust/pull/135634)
42+
- [Allow the global allocator to use thread-local storage and `std::thread::current()`](https://github.com/rust-lang/rust/pull/144465)
43+
- [Make `BTree::append` not update existing keys when appending an entry which already exists](https://github.com/rust-lang/rust/pull/145628)
44+
- [Don't require `T: RefUnwindSafe` for `vec::IntoIter<T>: UnwindSafe`](https://github.com/rust-lang/rust/pull/145665)
45+
46+
47+
<a id="1.93.0-Stabilized-APIs"></a>
48+
49+
Stabilized APIs
50+
---------------
51+
52+
- [`<[MaybeUninit<T>]>::assume_init_drop`](https://doc.rust-lang.org/stable/core/primitive.slice.html#method.assume_init_drop)
53+
- [`<[MaybeUninit<T>]>::assume_init_ref`](https://doc.rust-lang.org/stable/core/primitive.slice.html#method.assume_init_ref)
54+
- [`<[MaybeUninit<T>]>::assume_init_mut`](https://doc.rust-lang.org/stable/core/primitive.slice.html#method.assume_init_mut)
55+
- [`<[MaybeUninit<T>]>::write_copy_of_slice`](https://doc.rust-lang.org/stable/std/primitive.slice.html#method.write_copy_of_slice)
56+
- [`<[MaybeUninit<T>]>::write_clone_of_slice`](https://doc.rust-lang.org/stable/std/primitive.slice.html#method.write_clone_of_slice)
57+
- [`String::into_raw_parts`](https://doc.rust-lang.org/stable/std/string/struct.String.html#method.into_raw_parts)
58+
- [`Vec::into_raw_parts`](https://doc.rust-lang.org/stable/std/vec/struct.Vec.html#method.into_raw_parts)
59+
- [`<iN>::unchecked_neg`](https://doc.rust-lang.org/stable/std/primitive.isize.html#method.unchecked_neg)
60+
- [`<iN>::unchecked_shl`](https://doc.rust-lang.org/stable/std/primitive.isize.html#method.unchecked_shl)
61+
- [`<iN>::unchecked_shr`](https://doc.rust-lang.org/stable/std/primitive.isize.html#method.unchecked_shr)
62+
- [`<uN>::unchecked_shl`](https://doc.rust-lang.org/stable/std/primitive.usize.html#method.unchecked_shl)
63+
- [`<uN>::unchecked_shr`](https://doc.rust-lang.org/stable/std/primitive.usize.html#method.unchecked_shr)
64+
- [`<[T]>::as_array`](https://doc.rust-lang.org/stable/std/primitive.slice.html#method.as_array)
65+
- [`<[T]>::as_array_mut`](https://doc.rust-lang.org/stable/std/primitive.slice.html#method.as_mut_array)
66+
- [`<*const [T]>::as_array`](https://doc.rust-lang.org/stable/std/primitive.pointer.html#method.as_array)
67+
- [`<*mut [T]>::as_array_mut`](https://doc.rust-lang.org/stable/std/primitive.pointer.html#method.as_mut_array)
68+
- [`VecDeque::pop_front_if`](https://doc.rust-lang.org/stable/std/collections/struct.VecDeque.html#method.pop_front_if)
69+
- [`VecDeque::pop_back_if`](https://doc.rust-lang.org/stable/std/collections/struct.VecDeque.html#method.pop_back_if)
70+
- [`Duration::from_nanos_u128`](https://doc.rust-lang.org/stable/std/time/struct.Duration.html#method.from_nanos_u128)
71+
- [`char::MAX_LEN_UTF8`](https://doc.rust-lang.org/stable/std/primitive.char.html#associatedconstant.MAX_LEN_UTF8)
72+
- [`char::MAX_LEN_UTF16`](https://doc.rust-lang.org/stable/std/primitive.char.html#associatedconstant.MAX_LEN_UTF16)
73+
- [`std::fmt::from_fn`](https://doc.rust-lang.org/stable/std/fmt/fn.from_fn.html)
74+
- [`std::fmt::FromFn`](https://doc.rust-lang.org/stable/std/fmt/struct.FromFn.html)
75+
76+
77+
<a id="1.93.0-Cargo"></a>
78+
79+
Cargo
80+
-----
81+
- [Enable CARGO_CFG_DEBUG_ASSERTIONS in build scripts based on profile](https://github.com/rust-lang/cargo/pull/16160/)
82+
- [In `cargo tree`, support long forms for `--format` variables](https://github.com/rust-lang/cargo/pull/16204/)
83+
- [Add `--workspace` to `cargo clean`](https://github.com/rust-lang/cargo/pull/16263/)
84+
85+
<a id="1.93.0-Rustdoc"></a>
86+
87+
Rustdoc
88+
-----
89+
- [Remove `#![doc(document_private_items)]`](https://github.com/rust-lang/rust/pull/146495)
90+
- [Include attribute and derive macros in search filters for "macros"](https://github.com/rust-lang/rust/pull/148176)
91+
- [Include extern crates in search filters for `import`](https://github.com/rust-lang/rust/pull/148301)
92+
- [Validate usage of crate-level doc attributes](https://github.com/rust-lang/rust/pull/149197). This means if any of `html_favicon_url`, `html_logo_url`, `html_playground_url`, `issue_tracker_base_url`, or `html_no_source` either has a missing value, an unexpected value, or a value of the wrong type, rustdoc will emit the deny-by-default lint `rustdoc::invalid_doc_attributes`.
93+
94+
95+
<a id="1.93.0-Compatibility-Notes"></a>
96+
97+
Compatibility Notes
98+
-------------------
99+
- [Introduce `pin_v2` into the builtin attributes namespace](https://github.com/rust-lang/rust/pull/139751)
100+
- [Update bundled musl to 1.2.5](https://github.com/rust-lang/rust/pull/142682)
101+
- [On Emscripten, the unwinding ABI used when compiling with `panic=unwind` was changed from the JS exception handling ABI to the wasm exception handling ABI.](https://github.com/rust-lang/rust/pull/147224) If linking C/C++ object files with Rust objects, `-fwasm-exceptions` must be passed to the linker now. On nightly Rust, it is possible to get the old behavior with `-Zwasm-emscripten-eh=false -Zbuild-std`, but it will be removed in a future release.
102+
- The `#[test]` attribute, used to define tests, was previously ignored in various places where it had no meaning (e.g on trait methods or types). Putting the `#[test]` attribute in these places is no longer ignored, and will now result in an error; this may also result in errors when generating rustdoc. [Error when `test` attribute is applied to structs](https://github.com/rust-lang/rust/pull/147841)
103+
- Cargo now sets the `CARGO_CFG_DEBUG_ASSERTIONS` environment variable in more situations. This will cause crates depending on `static-init` versions 1.0.1 to 1.0.3 to fail compilation with "failed to resolve: use of unresolved module or unlinked crate `parking_lot`". See [the linked issue](https://github.com/rust-lang/rust/issues/150646#issuecomment-3718964342) for details.
104+
- [User written types in the `offset_of!` macro are now checked to be well formed.](https://github.com/rust-lang/rust/issues/150465/)
105+
- `cargo publish` no longer emits `.crate` files as a final artifact for user access when the `build.build-dir` config is unset
106+
- [Upgrade the `deref_nullptr` lint from warn-by-default to deny-by-default](https://github.com/rust-lang/rust/pull/148122)
107+
- [Add future-incompatibility warning for `...` function parameters without a pattern outside of `extern` blocks](https://github.com/rust-lang/rust/pull/143619)
108+
- [Introduce future-compatibility warning for `repr(C)` enums whose discriminant values do not fit into a `c_int` or `c_uint`](https://github.com/rust-lang/rust/pull/147017)
109+
- [Introduce future-compatibility warning against ignoring `repr(C)` types as part of `repr(transparent)`](https://github.com/rust-lang/rust/pull/147185)
110+
111+
1112
Version 1.92.0 (2025-12-11)
2113
==========================
3114

compiler/rustc_ast/src/token.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -625,12 +625,12 @@ impl TokenKind {
625625
}
626626

627627
impl Token {
628-
pub fn new(kind: TokenKind, span: Span) -> Self {
628+
pub const fn new(kind: TokenKind, span: Span) -> Self {
629629
Token { kind, span }
630630
}
631631

632632
/// Some token that will be thrown away later.
633-
pub fn dummy() -> Self {
633+
pub const fn dummy() -> Self {
634634
Token::new(TokenKind::Question, DUMMY_SP)
635635
}
636636

compiler/rustc_ast_lowering/src/delegation.rs

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,10 +152,21 @@ impl<'hir> LoweringContext<'_, 'hir> {
152152
) -> DelegationResults<'hir> {
153153
let span = self.lower_span(delegation.path.segments.last().unwrap().ident.span);
154154

155-
let ids = self.get_delegation_ids(
156-
self.resolver.delegation_infos[&self.local_def_id(item_id)].resolution_node,
157-
span,
158-
);
155+
// Delegation can be unresolved in illegal places such as function bodies in extern blocks (see #151356)
156+
let ids = if let Some(delegation_info) =
157+
self.resolver.delegation_infos.get(&self.local_def_id(item_id))
158+
{
159+
self.get_delegation_ids(delegation_info.resolution_node, span)
160+
} else {
161+
return self.generate_delegation_error(
162+
self.dcx().span_delayed_bug(
163+
span,
164+
format!("LoweringContext: the delegation {:?} is unresolved", item_id),
165+
),
166+
span,
167+
delegation,
168+
);
169+
};
159170

160171
match ids {
161172
Ok(ids) => {

compiler/rustc_ast_lowering/src/stability.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ pub(crate) fn extern_abi_enabled(
2929
})
3030
}
3131

32-
#[allow(rustc::untranslatable_diagnostic)]
3332
pub(crate) fn gate_unstable_abi(sess: &Session, features: &Features, span: Span, abi: ExternAbi) {
3433
match extern_abi_enabled(features, span, abi) {
3534
Ok(_) => (),

compiler/rustc_ast_passes/src/feature_gate.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,11 @@ use crate::errors;
1313
macro_rules! gate {
1414
($visitor:expr, $feature:ident, $span:expr, $explain:expr) => {{
1515
if !$visitor.features.$feature() && !$span.allows_unstable(sym::$feature) {
16-
#[allow(rustc::untranslatable_diagnostic)] // FIXME: make this translatable
1716
feature_err(&$visitor.sess, sym::$feature, $span, $explain).emit();
1817
}
1918
}};
2019
($visitor:expr, $feature:ident, $span:expr, $explain:expr, $help:expr) => {{
2120
if !$visitor.features.$feature() && !$span.allows_unstable(sym::$feature) {
22-
// FIXME: make this translatable
23-
#[allow(rustc::diagnostic_outside_of_impl)]
24-
#[allow(rustc::untranslatable_diagnostic)]
2521
feature_err(&$visitor.sess, sym::$feature, $span, $explain).with_help($help).emit();
2622
}
2723
}};
@@ -31,13 +27,11 @@ macro_rules! gate {
3127
macro_rules! gate_alt {
3228
($visitor:expr, $has_feature:expr, $name:expr, $span:expr, $explain:expr) => {{
3329
if !$has_feature && !$span.allows_unstable($name) {
34-
#[allow(rustc::untranslatable_diagnostic)] // FIXME: make this translatable
3530
feature_err(&$visitor.sess, $name, $span, $explain).emit();
3631
}
3732
}};
3833
($visitor:expr, $has_feature:expr, $name:expr, $span:expr, $explain:expr, $notes: expr) => {{
3934
if !$has_feature && !$span.allows_unstable($name) {
40-
#[allow(rustc::untranslatable_diagnostic)] // FIXME: make this translatable
4135
let mut diag = feature_err(&$visitor.sess, $name, $span, $explain);
4236
for note in $notes {
4337
diag.note(*note);
@@ -491,7 +485,6 @@ pub fn check_crate(krate: &ast::Crate, sess: &Session, features: &Features) {
491485
&& (!visitor.features.gen_blocks() && !span.allows_unstable(sym::gen_blocks))
492486
&& (!visitor.features.yield_expr() && !span.allows_unstable(sym::yield_expr))
493487
{
494-
#[allow(rustc::untranslatable_diagnostic)]
495488
// Emit yield_expr as the error, since that will be sufficient. You can think of it
496489
// as coroutines and gen_blocks imply yield_expr.
497490
feature_err(&visitor.sess, sym::yield_expr, *span, "yield syntax is experimental")
@@ -523,7 +516,6 @@ pub fn check_crate(krate: &ast::Crate, sess: &Session, features: &Features) {
523516
if !visitor.features.min_generic_const_args()
524517
&& !span.allows_unstable(sym::min_generic_const_args)
525518
{
526-
#[allow(rustc::untranslatable_diagnostic)]
527519
feature_err(
528520
&visitor.sess,
529521
sym::min_generic_const_args,
@@ -559,7 +551,6 @@ pub fn check_crate(krate: &ast::Crate, sess: &Session, features: &Features) {
559551
if let Ok(snippet) = sm.span_to_snippet(span)
560552
&& snippet == "!"
561553
{
562-
#[allow(rustc::untranslatable_diagnostic)] // FIXME: make this translatable
563554
feature_err(sess, sym::never_patterns, span, "`!` patterns are experimental")
564555
.emit();
565556
} else {

compiler/rustc_attr_parsing/src/attributes/cfg.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,6 @@ fn try_gate_cfg(name: Symbol, span: Span, sess: &Session, features: Option<&Feat
412412
}
413413
}
414414

415-
#[allow(rustc::untranslatable_diagnostic)] // FIXME: make this translatable
416415
fn gate_cfg(gated_cfg: &GatedCfg, cfg_span: Span, sess: &Session, features: &Features) {
417416
let (cfg, feature, has_feature) = gated_cfg;
418417
if !has_feature(features) && !cfg_span.allows_unstable(*feature) {

0 commit comments

Comments
 (0)