Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
3a9981a
clippy fix: non_canonical_clone_impl (except Infallible)
hkBst Jan 3, 2026
3a311ed
add abort_immediate
CAD97 Mar 30, 2026
fb99fbe
add missing core::process module docs
CAD97 Mar 30, 2026
e9b36bd
`core::unicode`: Replace `Cased` table with `Lt`
Jules-Bertholet Apr 2, 2026
617d9de
rustdoc: preserve `doc(cfg)` on locally re-exported type aliases
shivendra02467 Apr 7, 2026
e9d0e32
Merge malformed diagnostic attribute lint
mejrs Apr 12, 2026
57fd974
Merge "missing options" lints for diagnostic attributes
mejrs Apr 12, 2026
217c073
move list parsing into its own function
mejrs Apr 12, 2026
0dd591a
Delete unused `AttributeLintKind` variant
mejrs Apr 12, 2026
f468cef
Format the duplicate macro
mejrs Apr 12, 2026
c79fcfc
Fix some irrelevant warnings in `tests/incremental`
Zalathar Apr 3, 2026
8565c4a
Extract `check_compiler_output_for_incr`
Zalathar Apr 3, 2026
316fcbd
Check diagnostic output in incremental `cpass` and `rpass` revisions
Zalathar Apr 3, 2026
7c4cf96
report the `varargs_without_pattern` lint in deps
folkertdev Mar 30, 2026
edee654
Adjust release notes for post-merge feedback
Mark-Simulacrum Apr 13, 2026
58af51e
Emit fatal on invalid const args with nested defs
mu001999 Mar 30, 2026
6f1d601
Update test with revisions
mu001999 Apr 14, 2026
75273e2
Warn instead of error for some ructs_on_unimplemented errors
mejrs Apr 14, 2026
72db94f
Pass allowed options as parameter to diagnostic lints
mejrs Apr 14, 2026
3ce3436
Disallow ZST allocations with `TypedArena`.
nnethercote Apr 15, 2026
81cab93
docs: Use `0b1` instead of `NonZero::MIN` in `NonZero::bit_width` doc…
sorairolake Apr 15, 2026
d6bccac
Fix error code example
mejrs Apr 15, 2026
82545d7
Add regression test
oli-obk Apr 15, 2026
8d64264
Handle non-null pattern types in size skeleton
oli-obk Apr 15, 2026
1fca34d
Emit fatal on defaults for generic params in binders if with nested defs
mu001999 Mar 31, 2026
77419b4
Add FIXME for the fatal errors
mu001999 Apr 15, 2026
e910c38
Add push_mut to release notes
balt-dev Apr 15, 2026
fba9ef8
Add insert_mut to release notes
balt-dev Apr 15, 2026
f52f125
Add `--quiet` flag to x.py and bootstrap to suppress output
erickt Feb 25, 2026
4095bbd
Add new Layout methods to release notes
balt-dev Apr 15, 2026
d87a2e7
Fix typo for danging_ptr
balt-dev Apr 15, 2026
3238112
resolve: Cleanup diagnostic code for struct constructors
petrochenkov Apr 15, 2026
9c2e424
resolve: Remove `type Res` aliases except the one in the crate root
petrochenkov Apr 15, 2026
19c7df6
resolve: Remove `inaccessible_ctor_reexport` resolver field
petrochenkov Apr 15, 2026
dbb83b6
remove calls to AliasTyKind::def_id
WilliamTakeshi Apr 15, 2026
ae6dbdd
Add `--remap-path-scope` as unstable in rustdoc
Urgau Apr 15, 2026
9b64d52
Reduce diagnostic type visibilities.
nnethercote Apr 15, 2026
f3fc537
Move `MustBeNameOfAssociatedFunction` to the crate that uses it.
nnethercote Apr 15, 2026
9bfc3ef
Rollup merge of #154595 - mu001999-contrib:fix/154539, r=BoxyUwU
jhpratt Apr 16, 2026
cd21d61
Rollup merge of #154599 - folkertdev:varargs-without-pattern-in-deps,…
jhpratt Apr 16, 2026
ea2fa8b
Rollup merge of #154699 - Jules-Bertholet:lt-for-cased, r=scottmcm
jhpratt Apr 16, 2026
a2726a7
Rollup merge of #155353 - petrochenkov:globdedup, r=mu001999
jhpratt Apr 16, 2026
3330fa2
Rollup merge of #155357 - Urgau:rustdoc-remap-path-scope, r=Guillaume…
jhpratt Apr 16, 2026
335d09a
Rollup merge of #150649 - hkBst:non-canonical-clone-impl-1, r=scottmcm
jhpratt Apr 16, 2026
3034c55
Rollup merge of #154604 - CAD97:abort-immediate, r=scottmcm
jhpratt Apr 16, 2026
dbf246c
Rollup merge of #154616 - erickt:quiet, r=jieyouxu
jhpratt Apr 16, 2026
c277c34
Rollup merge of #154970 - shivendra02467:fix-rustdoc-154921, r=Guilla…
jhpratt Apr 16, 2026
e15e87f
Rollup merge of #155215 - mejrs:condense_diag_lints, r=JonathanBrouwer
jhpratt Apr 16, 2026
4d463e5
Rollup merge of #155228 - Zalathar:incr-test-diag, r=jieyouxu
jhpratt Apr 16, 2026
9173d38
Rollup merge of #155266 - Mark-Simulacrum:relnotes-fix, r=jieyouxu
jhpratt Apr 16, 2026
ea8b49d
Rollup merge of #155326 - nnethercote:disallow-ZST-TypedArena, r=Nadr…
jhpratt Apr 16, 2026
9e01f03
Rollup merge of #155334 - sorairolake:docs/nonzero-bit-width-literal,…
jhpratt Apr 16, 2026
8fdbb4d
Rollup merge of #155340 - oli-obk:size-skeleton-pat-tys, r=mati865
jhpratt Apr 16, 2026
d553001
Rollup merge of #155347 - balt-dev:patch-1, r=cuviper
jhpratt Apr 16, 2026
8dfe975
Rollup merge of #155356 - WilliamTakeshi:remove_calls_to_def_id, r=Wa…
jhpratt Apr 16, 2026
837292d
Rollup merge of #155364 - nnethercote:reduce-err-struct-visibilities,…
jhpratt Apr 16, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 15 additions & 9 deletions RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ Language

Compiler
--------
- [Stabilize `--remap-path-scope` for controlling the scoping of how paths get remapped in the resulting binary](https://github.com/rust-lang/rust/pull/147611)

- [Stabilize `--remap-path-scope` for controlling the scoping of how paths get remapped in the resulting binary](https://github.com/rust-lang/rust/pull/147611)
- [Apply patches for CVE-2026-6042 and CVE-2026-40200 to vendored musl](https://github.com/rust-lang/rust/pull/155171)

<a id="1.95-Platform-Support"></a>

Expand Down Expand Up @@ -78,25 +79,31 @@ Stabilized APIs
- [`<*const T>::as_ref_unchecked`](https://doc.rust-lang.org/stable/std/primitive.pointer.html#method.as_ref_unchecked)
- [`<*mut T>::as_ref_unchecked`](https://doc.rust-lang.org/stable/std/primitive.pointer.html#method.as_ref_unchecked-1)
- [`<*mut T>::as_mut_unchecked`](https://doc.rust-lang.org/stable/std/primitive.pointer.html#method.as_mut_unchecked)

- [`Vec::push_mut`](https://doc.rust-lang.org/stable/std/vec/struct.Vec.html#method.push_mut)
- [`Vec::insert_mut`](https://doc.rust-lang.org/stable/std/vec/struct.Vec.html#method.insert_mut)
- [`VecDeque::push_front_mut`](https://doc.rust-lang.org/stable/std/collections/struct.VecDeque.html#method.push_front_mut)
- [`VecDeque::push_back_mut`](https://doc.rust-lang.org/stable/std/collections/struct.VecDeque.html#method.push_back_mut)
- [`VecDeque::insert_mut`](https://doc.rust-lang.org/stable/std/collections/struct.VecDeque.html#method.insert_mut)
- [`LinkedList::push_front_mut`](https://doc.rust-lang.org/stable/std/collections/struct.LinkedList.html#method.push_front_mut)
- [`LinkedList::push_back_mut`](https://doc.rust-lang.org/stable/std/collections/struct.LinkedList.html#method.push_back_mut)
- [`Layout::dangling_ptr`](https://doc.rust-lang.org/stable/std/alloc/struct.Layout.html#method.dangling_ptr)
- [`Layout::repeat`](https://doc.rust-lang.org/stable/std/alloc/struct.Layout.html#method.repeat)
- [`Layout::repeat_packed`](https://doc.rust-lang.org/stable/std/alloc/struct.Layout.html#method.repeat_packed)
- [`Layout::extend_packed`](https://doc.rust-lang.org/stable/std/alloc/struct.Layout.html#method.extend_packed)

These previously stable APIs are now stable in const contexts:

- [`fmt::from_fn`](https://doc.rust-lang.org/stable/std/fmt/fn.from_fn.html)
- [`ControlFlow::is_break`](https://doc.rust-lang.org/stable/core/ops/enum.ControlFlow.html#method.is_break)
- [`ControlFlow::is_continue`](https://doc.rust-lang.org/stable/core/ops/enum.ControlFlow.html#method.is_continue)


<a id="1.95-Cargo"></a>

Cargo
-----
- [docs(report): enhance man pages for `cargo report *`](https://github.com/rust-lang/cargo/pull/16430/)<a id="1.95-Rustdoc"></a>
<a id="1.95-Rustdoc"></a>

Rustdoc
-----
- [In search results, rank unstable items lower](https://github.com/rust-lang/rust/pull/149460)
- [Add new "hide deprecated items" setting in rustdoc](https://github.com/rust-lang/rust/pull/151091)

<a id="1.95-Compatibility-Notes"></a>

Compatibility Notes
Expand All @@ -116,7 +123,6 @@ Compatibility Notes
- [JSON target specs](https://doc.rust-lang.org/rustc/targets/custom.html) have been destabilized and now require `-Z unstable-options` to use. Previously, they could not be used without the standard library, which has no stable build mechanism. In preparation for the `build-std` project adding that support, JSON target specs are being proactively gated to ensure they remain unstable even if `build-std` is stabilized. Cargo now includes the `-Z json-target-spec` CLI flag to automatically pass `-Z unstable-options` to the compiler when needed. See [#150151](https://github.com/rust-lang/rust/pull/150151), [#151534](https://github.com/rust-lang/rust/pull/150151), and [rust-lang/cargo#16557](https://github.com/rust-lang/cargo/pull/16557).
- [The arguments of `#[feature]` attributes on invalid targets are now checked](https://github.com/rust-lang/rust/issues/153764)


<a id="1.95-Internal-Changes"></a>

Internal Changes
Expand Down
36 changes: 12 additions & 24 deletions compiler/rustc_arena/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,25 +140,19 @@ impl<T> TypedArena<T> {
/// Allocates an object in the `TypedArena`, returning a reference to it.
#[inline]
pub fn alloc(&self, object: T) -> &mut T {
assert!(size_of::<T>() != 0);

if self.ptr == self.end {
self.grow(1)
}

unsafe {
if size_of::<T>() == 0 {
self.ptr.set(self.ptr.get().wrapping_byte_add(1));
let ptr = ptr::NonNull::<T>::dangling().as_ptr();
// Don't drop the object. This `write` is equivalent to `forget`.
ptr::write(ptr, object);
&mut *ptr
} else {
let ptr = self.ptr.get();
// Advance the pointer.
self.ptr.set(self.ptr.get().add(1));
// Write into uninitialized memory.
ptr::write(ptr, object);
&mut *ptr
}
let ptr = self.ptr.get();
// Advance the pointer.
self.ptr.set(self.ptr.get().add(1));
// Write into uninitialized memory.
ptr::write(ptr, object);
&mut *ptr
}
}

Expand Down Expand Up @@ -302,16 +296,10 @@ impl<T> TypedArena<T> {
let end = self.ptr.get().addr();
// We then calculate the number of elements to be dropped in the last chunk,
// which is the filled area's length.
let diff = if size_of::<T>() == 0 {
// `T` is ZST. It can't have a drop flag, so the value here doesn't matter. We get
// the number of zero-sized values in the last and only chunk, just out of caution.
// Recall that `end` was incremented for each allocated value.
end - start
} else {
// FIXME: this should *likely* use `offset_from`, but more
// investigation is needed (including running tests in miri).
(end - start) / size_of::<T>()
};
assert_ne!(size_of::<T>(), 0);
// FIXME: this should *likely* use `offset_from`, but more
// investigation is needed (including running tests in miri).
let diff = (end - start) / size_of::<T>();
// Pass that to the `destroy` method.
unsafe {
last_chunk.destroy(diff);
Expand Down
18 changes: 3 additions & 15 deletions compiler/rustc_arena/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ impl<T> TypedArena<T> {
if let Some(last_chunk) = chunks_borrow.last_mut() {
self.clear_last_chunk(last_chunk);
let len = chunks_borrow.len();
// If `T` is ZST, code below has no effect.
for mut chunk in chunks_borrow.drain(..len - 1) {
chunk.destroy(chunk.entries);
}
Expand Down Expand Up @@ -117,18 +116,6 @@ fn test_noncopy() {
}
}

#[test]
fn test_typed_arena_zero_sized() {
let arena = TypedArena::default();
#[cfg(not(miri))]
const N: usize = 100000;
#[cfg(miri)]
const N: usize = 1000;
for _ in 0..N {
arena.alloc(());
}
}

#[test]
fn test_typed_arena_clear() {
let mut arena = TypedArena::default();
Expand Down Expand Up @@ -207,7 +194,8 @@ thread_local! {
static DROP_COUNTER: Cell<u32> = Cell::new(0)
}

struct SmallDroppable;
#[allow(unused)]
struct SmallDroppable(u8);

impl Drop for SmallDroppable {
fn drop(&mut self) {
Expand All @@ -222,7 +210,7 @@ fn test_typed_arena_drop_small_count() {
let arena: TypedArena<SmallDroppable> = TypedArena::default();
for _ in 0..100 {
// Allocate something with drop glue to make sure it doesn't leak.
arena.alloc(SmallDroppable);
arena.alloc(SmallDroppable(0));
}
// dropping
};
Expand Down
26 changes: 13 additions & 13 deletions compiler/rustc_ast_lowering/src/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ use super::{
use crate::errors::{InvalidLegacyConstGenericArg, UseConstGenericArg, YieldInClosure};
use crate::{AllowReturnTypeNotation, FnDeclKind, ImplTraitPosition, TryBlockScope};

struct WillCreateDefIdsVisitor {}
pub(super) struct WillCreateDefIdsVisitor;

impl<'v> rustc_ast::visit::Visitor<'v> for WillCreateDefIdsVisitor {
type Result = ControlFlow<Span>;
Expand Down Expand Up @@ -479,18 +479,18 @@ impl<'hir, R: ResolverAstLoweringExt<'hir>> LoweringContext<'_, 'hir, R> {
DefPathData::LateAnonConst,
f.span,
);
let mut visitor = WillCreateDefIdsVisitor {};
let const_value = if let ControlFlow::Break(span) = visitor.visit_expr(&arg) {
Box::new(Expr {
id: self.next_node_id(),
kind: ExprKind::Err(invalid_expr_error(self.tcx, span)),
span: f.span,
attrs: [].into(),
tokens: None,
})
} else {
arg
};
let const_value =
if let ControlFlow::Break(span) = WillCreateDefIdsVisitor.visit_expr(&arg) {
Box::new(Expr {
id: self.next_node_id(),
kind: ExprKind::Err(invalid_expr_error(self.tcx, span)),
span: f.span,
attrs: [].into(),
tokens: None,
})
} else {
arg
};

let anon_const = AnonConst {
id: node_id,
Expand Down
36 changes: 25 additions & 11 deletions compiler/rustc_ast_lowering/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ use std::mem;
use std::sync::Arc;

use rustc_ast::node_id::NodeMap;
use rustc_ast::visit::Visitor;
use rustc_ast::{self as ast, *};
use rustc_attr_parsing::{AttributeParser, Late, OmitDoc};
use rustc_data_structures::fingerprint::Fingerprint;
Expand Down Expand Up @@ -2219,14 +2220,22 @@ impl<'hir, R: ResolverAstLoweringExt<'hir>> LoweringContext<'_, 'hir, R> {
// since later compiler stages cannot handle them (and shouldn't need to be able to).
let default = default
.as_ref()
.filter(|_| match source {
.filter(|anon_const| match source {
hir::GenericParamSource::Generics => true,
hir::GenericParamSource::Binder => {
self.dcx().emit_err(errors::GenericParamDefaultInBinder {
span: param.span(),
});

false
let err = errors::GenericParamDefaultInBinder { span: param.span() };
if expr::WillCreateDefIdsVisitor
.visit_expr(&anon_const.value)
.is_break()
{
// FIXME(mgca): make this non-fatal once we have a better way
// to handle nested items in anno const from binder
// Issue: https://github.com/rust-lang/rust/issues/123629
self.dcx().emit_fatal(err)
} else {
self.dcx().emit_err(err);
false
}
}
})
.map(|def| self.lower_anon_const_to_const_arg_and_alloc(def));
Expand Down Expand Up @@ -2563,12 +2572,17 @@ impl<'hir, R: ResolverAstLoweringExt<'hir>> LoweringContext<'_, 'hir, R> {
let span = self.lower_span(expr.span);

let overly_complex_const = |this: &mut Self| {
let e = this.dcx().struct_span_err(
expr.span,
"complex const arguments must be placed inside of a `const` block",
);
let msg = "complex const arguments must be placed inside of a `const` block";
let e = if expr::WillCreateDefIdsVisitor.visit_expr(expr).is_break() {
// FIXME(mgca): make this non-fatal once we have a better way to handle
// nested items in const args
// Issue: https://github.com/rust-lang/rust/issues/154539
this.dcx().struct_span_fatal(expr.span, msg).emit()
} else {
this.dcx().struct_span_err(expr.span, msg).emit()
};

ConstArg { hir_id: this.next_id(), kind: hir::ConstArgKind::Error(e.emit()), span }
ConstArg { hir_id: this.next_id(), kind: hir::ConstArgKind::Error(e), span }
};

match &expr.kind {
Expand Down
Loading
Loading