Commit graph

21816 commits

Author SHA1 Message Date
bors
d6deffe2de Auto merge of #148552 - chenyukang:yukang-fix-148392-closure-diag, r=petrochenkov
Provide more general note for borrowing outside of closure

Fixes rust-lang/rust#148392
2025-11-12 14:32:06 +00:00
Stuart Cook
64b56378f5
Rollup merge of #148780 - klensy:filecheck-typo, r=jieyouxu
fix filecheck typos in tests

Fixes few filecheck annotation typos in tests.
2025-11-12 12:26:41 +11:00
Stuart Cook
60b2068eed
Rollup merge of #148770 - folkertdev:naked-c-variadic, r=workingjubilee
implement `feature(c_variadic_naked_functions)`

tracking issue: https://github.com/rust-lang/rust/issues/148767

[#t-lang > C-variadic naked functions](https://rust-lang.zulipchat.com/#narrow/channel/213817-t-lang/topic/C-variadic.20naked.20functions/with/554593886)

This feature allows naked c-variadic function definitions with any ABI that is supported for foreign c-variadic functions.

```rust
#![feature(c_variadic, c_variadic_naked_functions)]

#[unsafe(naked)]
unsafe extern "win64" fn variadic_win64(_: u32, _: ...) -> u32 {
    core::arch::naked_asm!(
        r#"
        push    rax
        mov     qword ptr [rsp + 40], r9
        mov     qword ptr [rsp + 24], rdx
        mov     qword ptr [rsp + 32], r8
        lea     rax, [rsp + 40]
        mov     qword ptr [rsp], rax
        lea     eax, [rdx + rcx]
        add     eax, r8d
        pop     rcx
        ret
    "#,
    )
}
```

r? ````@workingjubilee````
2025-11-12 12:26:40 +11:00
Stuart Cook
ab8bdf7d3e
Rollup merge of #148536 - folkertdev:cmse-async-const-fn, r=davidtwco
cmse: add test for `async` and `const` functions

tracking issue: https://github.com/rust-lang/rust/issues/81391
tracking issue: https://github.com/rust-lang/rust/issues/75835

Some additional tests that seemed useful while working on the RFC text.

`async` functions are disallowed (because `-> impl Trait` is not supported).

`const` entry functions are allowed, `nonsecure-call` does not make sense, because this abi can only be used on function pointers, which cannot be evaluated during constant evaluation.

The async test is in the `c-variadic.rs` file because it has the minicore-compatible machinery for defining an async function. Splitting that logic out (like `minisimd.rs`) turns out to be complicated because the async stuff relies on types defined by minicore.

r? `````@davidtwco`````
2025-11-12 12:26:40 +11:00
Stuart Cook
a2c8493550
Rollup merge of #148465 - Jarcho:for_span, r=davidtwco,Zalathar
Adjust spans into the `for` loops context before creating the new desugaring spans.

When lowering `for` loops, the spans for the `into_iter` call and the `Some` pattern used the span of the provided pattern and head expression. If either of those came from a different `SyntaxContext` this would result in some very strange contexts. e.g.:

```rust
macro_rules! m { ($e:expr) => { { $e } } }
for _ in m!(expr) {}
```

This would result in the `into_iter` call have a context chain of `desugar => m!() => root` which is completely nonsensical; `m!()`  does not have a `for` loop. The `into_iter` call also ends up located at `{ $e }` rather than inside the `for _ in _` part.

This fixes that by walking the spans up to the `for` loop's context first. This will not handle adjusting the location of macro variable expansions (e.g. `for _ in $e`), but this does adjust the context to match the `for` loops.

---

This ended up causing rust-lang/rust-clippy#16008. Clippy should be using a `debug_assert` rather than `unreachable`, but it still results in a bug either way.
2025-11-12 12:26:38 +11:00
Stuart Cook
87ba9a5251
Rollup merge of #148080 - GuillaumeGomez:fix-jump-def-links, r=lolbinarycat
[rustdoc] Fix invalid jump to def macro link generation

Follow-up of https://github.com/rust-lang/rust/issues/147820.

I realized that when there was no intra-doc link linking to the same item, then the generated link for macros in jump to def would be invalid.

To make the code less redundant, I merged the "registering" of items and the href generation use the same code for macros.

r? `````@notriddle`````
2025-11-12 12:26:37 +11:00
Stuart Cook
b98d127133
Rollup merge of #147974 - JohnTitor:diag-detect-buf-reuse-pattern, r=estebank
Improve diagnostics for buffer reuse with borrowed references

Addresses rust-lang/rust#147694

I'm not sure the current note wording is the best so I appreciate any feedback.
2025-11-12 12:26:36 +11:00
Stuart Cook
4cd28dea58
Rollup merge of #147753 - chenyukang:yukang-147749, r=fmease
Suggest add bounding value for RangeTo

Fixes rust-lang/rust#147749
2025-11-12 12:26:35 +11:00
Jason Newcomb
76067c446c Adjust spans into the for loops context before creating the pattern and into_iter call spans. 2025-11-11 19:18:19 -05:00
bors
11339a0ef5 Auto merge of #144674 - rperier:add_note_if_a_type_impl_a_trait_with_the_same_name, r=lcnr
Add a diagnostic for similarly named traits

cc rust-lang/rust#133123

This is a first proposal, suggestions are welcome
2025-11-11 21:54:08 +00:00
Guillaume Gomez
dacabcd20d Update jump to def macro link generation test 2025-11-11 17:41:17 +01:00
Romain Perier
c8c04663c5 Add a note when a type implements a trait with the same name as the required one
This is useful when you have two dependencies that use different trait for
the same thing and with the same name. The user can accidentally implement
the bad one which might be confusing. This commits refactorizes existing
diagnostics about multiple different crates with the same version and adds
a note when similarly named traits are found. All diagnostics are merged
into a single one.
2025-11-11 17:36:43 +01:00
bors
2636cb4c13 Auto merge of #148818 - Zalathar:rollup-4vujcg0, r=Zalathar
Rollup of 13 pull requests

Successful merges:

 - rust-lang/rust#148694 (std: support `RwLock` and thread parking on TEEOS)
 - rust-lang/rust#148712 (Port `cfg_select!` to the new attribute parsing system)
 - rust-lang/rust#148760 (rustc_target: hide TargetOptions::vendor)
 - rust-lang/rust#148771 (IAT: Reinstate early bailout)
 - rust-lang/rust#148775 (Fix a typo in the documentation for the strict_shr function)
 - rust-lang/rust#148779 (Implement DynSend and DynSync for std::panic::Location.)
 - rust-lang/rust#148781 ([rustdoc] Remove unneeded `allow(rustc::potential_query_instability)`)
 - rust-lang/rust#148783 (add test for assoc type norm wf check)
 - rust-lang/rust#148785 (Replace `master` branch references with `main`)
 - rust-lang/rust#148791 (fix "is_closure_like" doc comment)
 - rust-lang/rust#148792 (Prefer to use file.stable_id over file.name from source map)
 - rust-lang/rust#148805 (rustc-dev-guide subtree update)
 - rust-lang/rust#148807 (Document (and test) a problem with `Clone`/`Copy` deriving.)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-11-11 13:30:50 +00:00
yukang
0b45ab3987 Suggest add bounding value for RangeTo 2025-11-11 20:13:10 +08:00
Stuart Cook
224ff38814
Rollup merge of #148807 - nnethercote:doc-Copy-Clone-problem, r=saethlin
Document (and test) a problem with `Clone`/`Copy` deriving.

I think this is useful information. I have worked on `derive` impls quite a bit and didn't know about this issue until today.

r? `@saethlin`
2025-11-11 21:11:57 +11:00
Stuart Cook
561d0a1792
Rollup merge of #148783 - lcnr:add-soundness-test, r=BoxyUwU
add test for assoc type norm wf check

This is soundness critical 😁 sure is helpful to have tests for that. cc ``@rust-lang/types``

r? ``@BoxyUwU``
2025-11-11 21:11:53 +11:00
Stuart Cook
24e0724c6b
Rollup merge of #148771 - fmease:iat-reinstate-early-elim, r=BoxyUwU
IAT: Reinstate early bailout

Apparently, some people are already using IATs in their projects and get blocked by https://github.com/rust-lang/rust/issues/142006#issuecomment-3508543649 (cc dupes https://github.com/rust-lang/rust/issues/143952 & https://github.com/rust-lang/rust/issues/148535). Since the (temporary) fix is so trivial, let's just do it.

Addresses https://github.com/rust-lang/rust/issues/142006#issuecomment-3508543649.

cc ```@luissantosHCIT``` (https://github.com/rust-lang/rust/issues/148535).

r? ```@BoxyUwU```
2025-11-11 21:11:50 +11:00
Stuart Cook
e26b42333d
Rollup merge of #148712 - JonathanBrouwer:cfg_select, r=jdonszelmann
Port `cfg_select!` to the new attribute parsing system

Best reviewed commit by commit, since it involves some moving around of code

r? `````@jdonszelmann`````
2025-11-11 21:11:48 +11:00
Stuart Cook
7327bbc811
Rollup merge of #148647 - JonathanBrouwer:unsafe_attr_refactor, r=jdonszelmann
Check unsafety for non-macro attributes in `validate_attr`

r? `````@jdonszelmann`````

Also adds a test for a previously untested case, unnecessary unsafe on a proc macro attribute

In preparation for https://github.com/rust-lang/rust/issues/148453
2025-11-11 21:09:41 +11:00
Stuart Cook
f342c62537
Rollup merge of #148639 - midsterx:test/rustdoc, r=GuillaumeGomez
test(rustdoc): move tests into jump-to-def

Fixes https://github.com/rust-lang/rust/issues/148548
2025-11-11 21:09:40 +11:00
Stuart Cook
303dd1cb35
Rollup merge of #148608 - osamakader:doc-test-builder, r=GuillaumeGomez
Add test for --test-builder success path

Fixes rust-lang/rust#148586
2025-11-11 21:09:39 +11:00
Stuart Cook
417bea36ef
Rollup merge of #148508 - estebank:issue-74617, r=nnethercote
Provide more context when mutably borrowing an imutably borrowed value

Point at statics and consts being mutable borrowed or written to:

```
error[E0594]: cannot assign to immutable static item `NUM`
  --> $DIR/E0594.rs:4:5
   |
LL | static NUM: i32 = 18;
   | --------------- this `static` cannot be written to
...
LL |     NUM = 20;
   |     ^^^^^^^^ cannot assign
```

Point at the expression that couldn't be mutably borrowed from a pattern:

```
error[E0596]: cannot borrow data in a `&` reference as mutable
  --> $DIR/mut-pattern-of-immutable-borrow.rs:19:14
   |
LL |     match &arg.field {
   |           ---------- this cannot be borrowed as mutable
LL |         Some(ref mut s) => s.push('a'),
   |              ^^^^^^^^^ cannot borrow as mutable
```

Partially address rust-lang/rust#74617.
2025-11-11 21:09:38 +11:00
Stuart Cook
eb415e9a25
Rollup merge of #148506 - estebank:issue-41966, r=davidtwco
Special case detecting `'static` lifetime requirement coming from `-> Box<dyn Trait>`

```
error[E0310]: the parameter type `R` may not live long enough
  --> $DIR/implicit-static-lifetime-in-dyn-trait-return-type.rs:10:5
   |
LL | fn bb<R>(r: R) -> Box<dyn Foo> {
   |                       ------- this `dyn Trait` has an implicit `'static` lifetime bound
LL |     Box::new(Bar(r))
   |     ^^^^^^^^^^^^^^^^
   |     |
   |     the parameter type `R` must be valid for the static lifetime...
   |     ...so that the type `R` will meet its required lifetime bounds
   |
help: consider adding an explicit lifetime bound
   |
LL | fn bb<R: 'static>(r: R) -> Box<dyn Foo> {
   |        +++++++++
```

Partly address rust-lang/rust#41966 and rust-lang/rust#54753. rust-lang/rust#103849, which shows a case where there's an intermediary binding, is not addressed at all, as aren't cases *other* than `Box<dyn Trait>` return type.
2025-11-11 21:09:37 +11:00
Stuart Cook
6487148d80
Rollup merge of #146495 - fmease:rustdoc-erase-doc-priv-items-attr, r=GuillaumeGomez
rustdoc: Erase `#![doc(document_private_items)]`

I just found out about the existence of `#![doc(document_private_items)]`. Apparently it was added by PR rust-lang/rust#50669 back in 2018 without any tests or docs as a replacement for some specific forms of the removed `#![doc(passes)]` / `#![doc(no_default_passes)]`.

However, rustc and rustdoc actually emit the deny-by-default lint `invalid_doc_attributes` for it (but if you allow it, the attribute does function)! To be more precise since PR rust-lang/rust#82708 (1.52, May 2021) which introduced lint `invalid_doc_attributes`, rust{,do}c has emitted a future-incompat warning for this attribute. And since PR rust-lang/rust#111505 (1.78, May 2024) that lint is deny by default. I presume nobody knew this attribute existed and thus it was never allowlisted.

Given the fact that since 2021 nobody has ever opened a ticket ([via](https://github.com/rust-lang/rust/issues?q=is%3Aissue+document_private_items)) complaining about the lint emission and the fact that GitHub code search doesn't yield any actual uses ([via](https://github.com/search?q=%2F%23%21%5C%5Bdoc%5C%28.*%3Fdocument_private_items%2F+language%3ARust&type=code&ref=advsearch)), I'm led to believe that nobody knows about and uses this attribute.

I don't find the existence of this attribute to be justified since in my view the flag `--document-private-items` is strictly superior: In most if not all cases, you don't want to "couple" your crate with this "mode" even if you gate it behind a cfg; instead, you most likely want to set this manually at invocation time, via a build config file like `.cargo/config.toml` or via a command runner like `just` I'd say.

Because of this I propose to wipe this attribute from existence. I don't believe it's worth cratering this (i.e., temporarily emitting a hard error for this attribute and running crater) given the fact that it's been undocumented since forever and led to a warning for years.
2025-11-11 21:09:33 +11:00
Stuart Cook
3538bc18fe
Rollup merge of #143619 - beetrees:varargs-named, r=jdonszelmann
`c_variadic`: Add future-incompatibility warning for `...` arguments without a pattern outside of `extern` blocks

This PR makes `...` arguments without a pattern in non-foreign functions (such as the argument in `unsafe extern "C" fn f(...) {}`) a future-compatibility warning; making this error would be consistent with how `unsafe extern "C" fn f(u32) {}` is handled. Allowing `...` arguments without a pattern in non-foreign functions is a source of confusion for programmers coming from C, where the `...` parameter is never named and instead calling `va_start` is required; disallowing `...` arguments without a pattern also improves the overall consistency of the Rust language by matching the treatment of other arguments without patterns. `...` arguments without a pattern in `extern` blocks (such as `unsafe extern "C" { fn f(...); }`) continue to compile without warnings after this PR, as they are already stable and heavily used (and don't cause the mentioned confusion as they are just being used in function declarations).

As all the syntax gating for `c_variadic` has been done post-expansion, this is technically a breaking change. In particular, code like this has compiled on stable since Rust 1.35.0:
```rust
#[cfg(any())] // Equivalent to the more recent #[cfg(false)]
unsafe extern "C" fn bar(_: u32, ...) {}
```
Since this is more or less a stability hole and a Crater run shows only the `binrw` crate is using this, I think it would be ok to break this. This will require a lang FCP.

The idea of rejecting `...` pre-expansion was first raised here https://github.com/rust-lang/rust/pull/143546#issuecomment-3043142052.

Tracking issue: rust-lang/rust#44930
cc `@folkertdev` `@workingjubilee`
r? `@joshtriplett`
2025-11-11 21:09:33 +11:00
Stuart Cook
5b9211c5b3
Rollup merge of #141470 - GuillaumeGomez:function_casts_as_integer, r=urgau
Add new `function_casts_as_integer` lint

The `function_casts_as_integer` lint detects cases where users cast a function pointer into an integer.

*warn-by-default*

### Example

```rust
fn foo() {}
let x = foo as usize;
```

```
warning: casting a function into an integer implicitly
  --> $DIR/function_casts_as_integer.rs:9:17
   |
LL |     let x = foo as usize;
   |                 ^^^^^^^^
   |
help: add `fn() as usize`
   |
LL |     let x = foo as fn() as usize;
   |                 +++++++
```

### Explanation

You should never cast a function directly into an integer but go through a cast as `fn` first to make it obvious what's going on. It also allows to prevent confusion with (associated) constants.

Related to https://github.com/rust-lang/rust/issues/81686 and https://stackoverflow.com/questions/68701177/whats-the-meaning-of-casting-a-rust-enum-variant-to-a-numeric-data-type

r? ````@urgau````
2025-11-11 21:09:32 +11:00
lcnr
2570c2322b add test for assoc type norm wf check 2025-11-11 11:05:47 +01:00
klensy
ecb0d3bfbd
Update tests/codegen-llvm/deduced-param-attrs.rs
Co-authored-by: Tomasz Miąsko <tomasz.miasko@gmail.com>
2025-11-11 12:31:37 +03:00
Nicholas Nethercote
c6dbda8996 Document (and test) a problem with Clone/Copy deriving. 2025-11-11 11:35:10 +11:00
bors
29a69716f2 Auto merge of #148397 - frank-king:feature/pin-pattern, r=Nadrieril,traviscross
Implement `&pin` patterns and `ref pin` binding modes

Implement `&pin` patterns and `ref pin` binding modes, part of [pin ergonomics](https://github.com/rust-lang/rust/issues/130494).

r? `@Nadrieril`

cc `@traviscross` `@eholk`
2025-11-10 18:56:57 +00:00
bors
055d0d6aaf Auto merge of #135634 - joboet:trivial-clone, r=Mark-Simulacrum
stop specializing on `Copy`

fixes https://github.com/rust-lang/rust/issues/132442

`std` specializes on `Copy` to optimize certain library functions such as `clone_from_slice`. This is unsound, however, as the `Copy` implementation may not be always applicable because of lifetime bounds, which specialization does not take into account; the result being that values are copied even though they are not `Copy`. For instance, this code:
```rust
struct SometimesCopy<'a>(&'a Cell<bool>);

impl<'a> Clone for SometimesCopy<'a> {
    fn clone(&self) -> Self {
        self.0.set(true);
        Self(self.0)
    }
}

impl Copy for SometimesCopy<'static> {}

let clone_called = Cell::new(false);
// As SometimesCopy<'clone_called> is not 'static, this must run `clone`,
// setting the value to `true`.
let _ = [SometimesCopy(&clone_called)].clone();
assert!(clone_called.get());
```
should not panic, but does ([playground](https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=6be7a48cad849d8bd064491616fdb43c)).

To solve this, this PR introduces a new `unsafe` trait: `TrivialClone`. This trait may be implemented whenever the `Clone` implementation is equivalent to copying the value (so e.g. `fn clone(&self) -> Self { *self }`). Because of lifetime erasure, there is no way for the `Clone` implementation to observe lifetime bounds, meaning that even if the `TrivialClone` has stricter bounds than the `Clone` implementation, its invariant still holds. Therefore, it is sound to specialize on `TrivialClone`.

I've changed all `Copy` specializations in the standard library to specialize on `TrivialClone` instead. Unfortunately, the unsound `#[rustc_unsafe_specialization_marker]` attribute on `Copy` cannot be removed in this PR as `hashbrown` still depends on it. I'll make a PR updating `hashbrown` once this lands.

With `Copy` no longer being considered for specialization, this change alone would result in the standard library optimizations not being applied for user types unaware of `TrivialClone`. To avoid this and restore the optimizations in most cases, I have changed the expansion of `#[derive(Clone)]`: Currently, whenever both `Clone` and `Copy` are derived, the `clone` method performs a copy of the value. With this PR, the derive macro also adds a `TrivialClone` implementation to make this case observable using specialization. I anticipate that most users will use `#[derive(Clone, Copy)]` whenever both are applicable, so most users will still profit from the library optimizations.

Unfortunately, Hyrum's law applies to this PR: there are some popular crates which rely on the precise specialization behaviour of `core` to implement "specialization at home", e.g. [`libAFL`](89cff63702/libafl_bolts/src/tuples.rs (L27-L49)). I have no remorse for breaking such horrible code, but perhaps we should open other, better ways to satisfy their needs – for example by dropping the `'static` bound on `TypeId::of`...
2025-11-10 15:41:43 +00:00
Guillaume Gomez
d05f297164 Add more test for function_cast_as_integer lint 2025-11-10 16:38:28 +01:00
Guillaume Gomez
0a2c473ae7 Convert function_cast_as_integer lint suggestion to plain *const () cast 2025-11-10 16:38:28 +01:00
Guillaume Gomez
2ac32ae7a0 Add ui test for function_casts_as_integer lint 2025-11-10 16:38:28 +01:00
Guillaume Gomez
725f4ad24b Allow function_casts_as_integer in non-related ui tests 2025-11-10 16:38:28 +01:00
klensy
e611ef32f8 fix filecheck typos in tests 2025-11-10 17:55:01 +03:00
beetrees
02e1f4421d
c_variadic: Add future-incompatibility warning for ... arguments without a pattern outside of extern blocks 2025-11-10 14:33:56 +01:00
midsterx
ee8c913bdf test(rustdoc): move tests into jump-to-def 2025-11-09 23:10:27 -08:00
Frank King
5ef48ed448 Implement &pin patterns and ref pin bindings 2025-11-10 09:57:08 +08:00
Osama Abdelkader
f1bbe593d5 tests: skip rustdoc test-builder success path for remote client
Signed-off-by: Osama Abdelkader <osama.abdelkader@gmail.com>
2025-11-10 01:31:02 +02:00
Esteban Küber
71b0755a98 Provide more context when mutably borrowing an imutable borrow
Point at statics and consts being mutable borrowed or written to:

```
error[E0594]: cannot assign to immutable static item `NUM`
  --> $DIR/E0594.rs:4:5
   |
LL | static NUM: i32 = 18;
   | --------------- this `static` cannot be written to
...
LL |     NUM = 20;
   |     ^^^^^^^^ cannot assign
```

Point at the expression that couldn't be mutably borrowed from a pattern:

```
error[E0596]: cannot borrow data in a `&` reference as mutable
  --> $DIR/mut-pattern-of-immutable-borrow.rs:19:14
   |
LL |     match &arg.field {
   |           ---------- this cannot be borrowed as mutable
LL |         Some(ref mut s) => s.push('a'),
   |              ^^^^^^^^^ cannot borrow as mutable
```
2025-11-09 22:14:48 +00:00
León Orell Valerian Liehr
6ed469c806
IAT: Reinstate early bailout 2025-11-09 22:52:28 +01:00
joboet
16d2b5534e
prevent TrivialClone implementations from appearing in rustdoc output 2025-11-09 22:26:15 +01:00
Folkert de Vries
9129b902d0
use feature(c_variadic_naked_functions) in tests 2025-11-09 22:07:52 +01:00
Folkert de Vries
ebd173f512
add feature(c_variadic_naked_functions) 2025-11-09 22:07:11 +01:00
Matthias Krüger
5430082e39
Rollup merge of #148655 - GuillaumeGomez:keyword-as-macros, r=yotamofek,fmease
Fix invalid macro tag generation for keywords which can be followed by values

Fixes https://github.com/rust-lang/rust/issues/148617.

The problem didn't come from the `generate-macro-expansion` feature but was actually uncovered thanks to it.

Keywords like `if` or `return`, when followed by a `!` were considered as macros, which was wrong and let to invalid class stack and to the panic.

~~While working on it, I realized that `_` was considered as a keyword, so I fixed that as well in the second commit.~~ (reverted, see https://github.com/rust-lang/rust/pull/148655#issuecomment-3508220823, https://github.com/rust-lang/rust/pull/148655#issuecomment-3508262637)

r? `@yotamofek`
2025-11-09 20:59:54 +01:00
Guillaume Gomez
2c4a593b5c Add regression tests for keywords wrongly considered as macros 2025-11-09 18:00:52 +01:00
Matthias Krüger
7e9b67d355
Rollup merge of #148716 - camelid:finish-type_const, r=BoxyUwU
mgca: Finish implementation of `#[type_const]`

tracking issue: rust-lang/rust#132980
fixes rust-lang/rust#140729
fixes rust-lang/rust#140860

- **Fix `#[type_const]` attribute placement validation**
- **Perform WF-checking on type_const RHS's**
- **Check type_const type is ConstParamTy_ and that RHS matches it**
- **Check that impls of `#[type_const]` consts also have the attr**

r? ```@BoxyUwU```
2025-11-09 17:37:07 +01:00
Matthias Krüger
e5a69bb215
Rollup merge of #148683 - fmease:rm-const_trait-attr, r=fee1-dead
Remove `#[const_trait]`

Remove `#[const_trait]` since we now have `const trait`. Update all structured diagnostics that still suggested the attribute.

r? ```@rust-lang/project-const-traits```
2025-11-09 17:37:05 +01:00
joboet
7c430e7646
automatically implement TrivialClone for closures and tuples
If each of the component types is `TrivialClone`, the closure/tuple itself can be trivially cloned.
2025-11-09 17:31:19 +01:00