Commit graph

317658 commits

Author SHA1 Message Date
Stuart Cook
68f4a99963
Rollup merge of #151887 - scottmcm:homogeneous-try-in-compiler, r=jackh726
Remove some unnecessary `try`-related type annotations

I left a few, like
```rust
let result: Result<_, ModError<'_>> = try {
```
where it felt like seeing it might still be useful for the reader.

Feel free to push back on any of these changes if you think they should be left alone.
2026-02-08 16:58:23 +11:00
Stuart Cook
55277add61
Rollup merge of #150443 - estebank:long-diff-markers, r=jackh726
Support long diff conflict markers

git can be configured to use more than 7 characters for conflict markers, and jj automatically uses longer conflict markers when the text contains any char sequence that could be confused with conflict markers. Ensure that we only point at markers that are consistent with the start marker's length.

Ensure that we only consider char sequences at the beginning of a line as a diff marker.

Fix https://github.com/rust-lang/rust/issues/150352.
2026-02-08 16:58:23 +11:00
bors
08a4ce529f Auto merge of #152314 - Zalathar:rollup-4WUNK14, r=Zalathar
Rollup of 2 pull requests

Successful merges:

 - rust-lang/rust#152310 (Remove `rustdoc` adhoc group)
 - rust-lang/rust#152284 (Avoid a bogus THIR span for `let x = offset_of!(..)`)
2026-02-08 01:54:58 +00:00
Stuart Cook
1992e7111d
Rollup merge of #152284 - Zalathar:bogus-thir-let, r=nnethercote
Avoid a bogus THIR span for `let x = offset_of!(..)`

The code that creates spans for THIR `let` statements was doing span endpoint manipulation without checking for inclusion/context, resulting in bogus spans observed in https://github.com/rust-lang/rust/pull/151693.

The incorrect spans are easiest to observe with `-Zunpretty=thir-tree`, but they also cause strange user-facing diagnostics for irrefutable let-else.
2026-02-08 12:54:00 +11:00
Stuart Cook
d016a67492
Rollup merge of #152310 - Kobzol:remove-rustdoc-adhoc-group, r=Urgau
Remove `rustdoc` adhoc group

With https://github.com/rust-lang/triagebot/pull/2273, reviewers can now tell triagebot to opt them out of being assigned through a given team, so that `r? <team>` does not consider them if they don't want to.

That means that we can now finally get rid of adhoc groups that correspond to actual Rust teams. I wanted to start with a smaller team than `t-compiler` to test this, so I started with `rustdoc`, which was the smallest team that I found an adhoc group for.

Currently, the `rustdoc` team contains the following members:
- aDotInTheVoid
- GuillaumeGomez
- notriddle
- fmease
- camelid
- Manishearth
- Urgau
- lolbinarycat
- yotamofek

Only three of those were previously assignable through `r? rustdoc`. So to reproduce the previous state, I will run `as <username> work set-team-rotation-mode rustdoc off` for the remaining members of the `rustdoc` team before this is merged.

If more people from `t-rustdoc` want to join the review rotation, they can send [triagebot](https://rust-lang.zulipchat.com/#narrow/dm/261224-triagebot) a DM with `work set-team-rotation-mode rustdoc on`.

CC @rust-lang/rustdoc
2026-02-08 12:54:00 +11:00
bors
c69e1a04db Auto merge of #152308 - JonathanBrouwer:rollup-3QU52Xc, r=JonathanBrouwer
Rollup of 7 pull requests

Successful merges:

 - rust-lang/rust#151745 (Remove a couple of unnecessary flags and env vars in bootstrap)
 - rust-lang/rust#152217 (Convert to inline diagnostics in `rustc_lint`)
 - rust-lang/rust#152056 (RwLock: refine documentation to emphasize non-reentrancy guarantees)
 - rust-lang/rust#152261 (Introduce helper `ty::Generics::has_own_self`)
 - rust-lang/rust#152288 (Allow only a single accepter per attribute)
 - rust-lang/rust#152292 (Minor change for readability)
 - rust-lang/rust#152300 (Port `rustc_regions` to the new attribute parser)
2026-02-07 22:18:38 +00:00
Jakub Beránek
d53133eec2
Remove rustdoc adhoc group 2026-02-07 22:03:40 +01:00
Jonathan Brouwer
4230c3ab25
Rollup merge of #152300 - jdonszelmann:port-rustc-regions, r=JonathanBrouwer
Port `rustc_regions` to the new attribute parser

r? @JonathanBrouwer
2026-02-07 19:34:51 +01:00
Jonathan Brouwer
7b8be37c1f
Rollup merge of #152292 - GrigorenkoPV:sigma, r=Noratrieb
Minor change for readability

Everyone praise inline const blocks!
2026-02-07 19:34:51 +01:00
Jonathan Brouwer
f8580ec1dd
Rollup merge of #152288 - JonathanBrouwer:one_accepter_per_attr, r=jdonszelmann
Allow only a single accepter per attribute

This is what we discussed last thursday, that we don't need to support this.

r? @jdonszelmann
2026-02-07 19:34:50 +01:00
Jonathan Brouwer
725eb60ded
Rollup merge of #152261 - fmease:has-own-self, r=BoxyUwU
Introduce helper `ty::Generics::has_own_self`

The pattern `generics.has_self && generics.parent.is_none()` only occurs 5 times in rustc+rustdoc at the time of writing but I keep getting reminded/annoyed that there doesn't exist a nice wrapper fn that abstracts it & immediately clarifies the intent. Most recently that happened when working on my open PR RUST-129543 in which I add yet another occurrence of it ([via](ae8c0a5a46/compiler/rustc_hir_analysis/src/collect/resolve_bound_vars.rs (L1771-L1773))).

For context, `generics.has_self` indicates that there is a `Self` type parameter (at position 0) in the "oldest" / "root" generic parameter list in the chain of generic parameter lists (rephrased: it's true if the chain *as a whole* has a `Self` type parameter). `has_own_self` on the other hand indicates that the `own_params` contain a `Self` type parameter which is sometimes needed for offsetting the own parameters or arguments.
2026-02-07 19:34:50 +01:00
Jonathan Brouwer
5964330d29
Rollup merge of #152056 - hzeller:feature-20260203-clarify-rwlock-reentrance, r=joboet
RwLock: refine documentation to emphasize non-reentrancy guarantees

This addresses the need for clarification brought up in rust-lang/rust#149693. Specifically, it notes that some implementations may choose to panic if they detect deadlock situations during recursive locking attempts for both `read()` and `write()` calls.

  * Provide an example highlighting that multiple read locks can be held across different threads simultaneously.
  * Remove the example that shows a situation that can potentially deadlock. (as demonstrated in the very same documentation a few paragraphs above)
  * Improve documentation regarding the possibility of panics during recursive read or write lock attempts.

Issues: https://github.com/rust-lang/rust/issues/149693
2026-02-07 19:34:49 +01:00
Jonathan Brouwer
e96bcca366
Rollup merge of #152217 - JonathanBrouwer:convert_line, r=jdonszelmann
Convert to inline diagnostics in `rustc_lint`

For https://github.com/rust-lang/rust/issues/151366
r? @jdonszelmann
This was a big one! Second to last one, `rustc_parse` is the last one and even bigger :P
2026-02-07 19:34:49 +01:00
Jonathan Brouwer
0471141209
Rollup merge of #151745 - bjorn3:remove_unnecessary_flags, r=clubby789
Remove a couple of unnecessary flags and env vars in bootstrap
2026-02-07 19:34:48 +01:00
Jonathan Brouwer
580c8d3c20
Update remaining session-diagnostics tests 2026-02-07 19:34:21 +01:00
Jonathan Brouwer
3837431516
Remove ui-fulldeps tests for slugs 2026-02-07 19:34:21 +01:00
Jonathan Brouwer
f35d734d3f
Remove rustc_fluent_macro 2026-02-07 19:34:21 +01:00
Jonathan Brouwer
c814f76c06
Convert to inline diagnostics in rustc_lint 2026-02-07 19:34:21 +01:00
Jana Dönszelmann
cf1a784f3f
Port rustc_regions to the new attribute parser 2026-02-07 17:24:40 +01:00
bors
c7f5f3e0d5 Auto merge of #152294 - JonathanBrouwer:rollup-ygNTxe8, r=JonathanBrouwer
Rollup of 3 pull requests

Successful merges:

 - rust-lang/rust#149960 (add `unreachable_cfg_select_predicates` lint)
 - rust-lang/rust#152168 (Port `rustc_intrinsic_const_stable_indirect` and `rustc_intrinsic` to the new attribute parser)
 - rust-lang/rust#152289 (Also duplicate `#[expect]` attribute in `#[derive]`-ed code)
2026-02-07 15:20:28 +00:00
Jonathan Brouwer
fced23053c
Rollup merge of #152289 - Urgau:expect-in-derive-150553, r=jdonszelmann
Also duplicate `#[expect]` attribute in `#[derive]`-ed code

This PR updates our derive logic to also duplicate any `#[expect]` attribute in the `#[derive]`-ed code, as we already do for all the other lint attribute (`#[allow]`, `#[warn]`, `#[deny]`, ...).

The original and duplicated attribute share the same attribute id, which due to the way [`check_expectations`](56aaf58ec0/compiler/rustc_lint/src/expect.rs (L28-L46)) is implemented makes the expectation fulfilled if the lint is either trigger in the original code or the derived code.

This was discussed by T-lang in https://github.com/rust-lang/rust/issues/150553#issuecomment-3780810363.

cc @rust-lang/lang-ops (in case you want to do an FCP)
Fixes rust-lang/rust#150553
2026-02-07 16:04:41 +01:00
Jonathan Brouwer
6e7f929f7c
Rollup merge of #152168 - jdonszelmann:port-rustc-intrinsic-const-stable-indirect, r=jonathanbrouwer
Port `rustc_intrinsic_const_stable_indirect` and `rustc_intrinsic` to the new attribute parser

r? @JonathanBrouwer
2026-02-07 16:04:41 +01:00
Jonathan Brouwer
972a53167c
Rollup merge of #149960 - folkertdev:cfg-select-unreachable-lint, r=JonathanBrouwer
add `unreachable_cfg_select_predicates` lint

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

Split out from https://github.com/rust-lang/rust/pull/149783. This lint is emitted on branches of a `cfg_select!` that are statically known to be unreachable. The lint is only emitted when the feature is enabled, so this change specifically does not need an FCP, and the lint will be stabilized alongside the feature (see https://github.com/rust-lang/rust/pull/149783#issuecomment-3648000286).
2026-02-07 16:04:40 +01:00
Pavel Grigorenko
da421f5585 const { 'Σ'.len_utf8() } 2026-02-07 17:20:39 +03:00
Urgau
2407f47903 Also duplicate #[expect] attribute in #[derive]-ed code 2026-02-07 14:29:40 +01:00
Jonathan Brouwer
fd7ff90f70
Allow only a single accepter per attribute 2026-02-07 14:28:12 +01:00
Jana Dönszelmann
c42a581d2f
Port rustc_intrinsic_const_stable_indirect to the new attribute parser 2026-02-07 14:12:56 +01:00
Jana Dönszelmann
9249e9f78a
Port rustc_intrinsic to the new attribute parser 2026-02-07 14:12:56 +01:00
Zalathar
cc3fdc637a Avoid a bogus THIR span for let x = offset_of!(..) 2026-02-07 23:41:24 +11:00
Zalathar
fb5a4dca32 Regression test for let x = offset_of!(..) else { .. } span 2026-02-07 23:41:23 +11:00
Folkert de Vries
bad1a450c0
use test instead of unix to be platform-independent 2026-02-07 13:33:25 +01:00
bors
8c5605e130 Auto merge of #152282 - JonathanBrouwer:rollup-EaeQJAR, r=JonathanBrouwer
Rollup of 8 pull requests

Successful merges:

 - rust-lang/rust#148590 (Stabilize `atomic_try_update`and deprecate `fetch_update` starting 1.99.0)
 - rust-lang/rust#150522 (Stabilize new inclusive range type and iterator type)
 - rust-lang/rust#152235 (Convert to inline diagnostics in `rustc_parse`)
 - rust-lang/rust#152267 (feat: Implement `int_from_ascii` for `NonZero<T>`)
 - rust-lang/rust#151576 (Stabilize `core::hint::cold_path`)
 - rust-lang/rust#151933 (Linker-plugin-based LTO: give an explanation how to use linker-plugin-lto with full LTO)
 - rust-lang/rust#152010 (Ignore all debuginfo tests for LLDB that we do not run in CI)
 - rust-lang/rust#152199 (Move `rustc_query_system::cache`.)
2026-02-07 12:07:03 +00:00
Jonathan Brouwer
ae9d2d9395
Rollup merge of #152199 - nnethercote:rm-rustc_query_system-cache, r=Zalathar
Move `rustc_query_system::cache`.

It only defines two types, `Cache` and `WithDepNode`. Neither has anything much to do with queries -- they use `DepNodeIndex`, that's all.

This commit moves the module into `rustc_middle`, to where they are used. It also renames the extremely non-descriptive `Cache` as `WithDepNodeCache`.

r? @Zalathar
2026-02-07 13:06:36 +01:00
Jonathan Brouwer
3391e4ca2f
Rollup merge of #152010 - workingjubilee:what-does-the-scouter-say-about-the-lldb-version-level, r=Noratrieb
Ignore all debuginfo tests for LLDB that we do not run in CI

We only run LLDB 1500 in CI. Any test with a min-lldb-version above that is currently ignored. It's not clear any of these tests actually work with that LLDB version, and they definitely don't work on LLDB ~2100. So, ignore them until we fix debuginfo testing.

Fixes rust-lang/rust#151966
2026-02-07 13:06:36 +01:00
Jonathan Brouwer
150024ead4
Rollup merge of #151933 - foxtran:doc/linker-plugin-lto-full-lto, r=nnethercote
Linker-plugin-based LTO: give an explanation how to use linker-plugin-lto with full LTO

Closes rust-lang/rust#138910

The existing linker-plugin-based LTO documentation does not describe the correct usage of full LTO. Specifically, when invoking `rustc` with full LTO, the `-C lto` flag must be passed in addition to `-C linker-plugin-lto`.

Also, this PR documents the use of full LTO when linking Rust with Fortran. Unfortunately, LLVM `flang` does not currently support ThinLTO, so full LTO is the only viable option in this case.

Toolchain combinations were slightly updated.

TODO:
- [x] check swiftc compiler. Almost unusable.
- [x] check how std lib is actually compiled
- [x] add note about LLD and bitcode
- [x] report bug to LLVM: https://github.com/llvm/llvm-project/issues/179800

<details>
  <summary>Swiftc is unusable</summary>

https://www.swift.org/install/ gave me LLVM-17. During playing with swift main + rust static library, LLVM-23 removed main :D

```console
# thin LTO Rust:
rustc --crate-type=staticlib -Clinker-plugin-lto -Copt-level=3 ./ftn.rs
# full LTO swift:
swiftc -static libftn.a main.swift -lto=llvm-full -O -use-ld=/tmp/test/llvm-project/install/bin/ld.lld -Xlinker --gc-sections -Xlinker --as-needed -o sr
 ./sr
> ftn() returned: 77
# thin LTO swift:
swiftc -static libftn.a main.swift -lto=llvm-thin -O -use-ld=/tmp/test/llvm-project/install/bin/ld.lld -Xlinker --gc-sections -Xlinker --as-needed -o sr
./sr
> No output
```

</details>
2026-02-07 13:06:36 +01:00
Jonathan Brouwer
27d6b3c9b7
Rollup merge of #151576 - tgross35:stabilize-cold-path, r=jhpratt
Stabilize `core::hint::cold_path`

`cold_path` has been around unstably for a while and is a rather useful tool to have. It does what it is supposed to and there are no known remaining issues, so stabilize it here (including const).

Newly stable API:

```rust
// in core::hint
pub const fn cold_path();
```

I have opted to exclude `likely` and `unlikely` for now since they have had some concerns about ease of use that `cold_path` doesn't suffer from. `cold_path` is also significantly more flexible; in addition to working with boolean `if` conditions, it can be used in `match` arms, `if let`, closures, and other control flow blocks. `likely` and `unlikely` are also possible to implement in user code via `cold_path`, if desired.

Closes: https://github.com/rust-lang/rust/issues/136873 (tracking issue)

---

There has been some design and implementation work for making `#[cold]` function in more places, such as `if` arms, `match` arms, and closure bodies. Considering a stable `cold_path` will cover all of these usecases, it does not seem worth pursuing a more powerful `#[cold]` as an alternative way to do the same thing. If the lang team agrees, then:

Closes: https://github.com/rust-lang/rust/issues/26179
Closes: https://github.com/rust-lang/rust/pull/120193
2026-02-07 13:06:35 +01:00
Jonathan Brouwer
0a5d0e9aa2
Rollup merge of #152267 - sorairolake:feature/nonzero-from-ascii, r=dtolnay
feat: Implement `int_from_ascii` for `NonZero<T>`

- Tracking issue: rust-lang/rust#134821

This pull request adds `from_ascii` and `from_ascii_radix` methods to `NonZero<T>` that parses a non-zero integer from an ASCII-byte slice (`&[u8]`) with decimal digits or digits in a given base.

When using the combination of `int::from_ascii` or `int::from_ascii_radix` and `NonZero::<T>::new`, [`IntErrorKind::Zero`](https://doc.rust-lang.org/core/num/enum.IntErrorKind.html#variant.Zero) cannot be returned as an error.

`NonZero::<T>::from_str_radix` and `NonZero::<T>::from_str` require a string (`&str`) as a parameter.

```rust
// Cannot return `IntErrorKind::Zero` as an error.
assert_eq!(NonZero::new(u8::from_ascii(b"0").unwrap()), None);

// Can return `IntErrorKind::Zero` as an error.
let err = NonZero::<u8>::from_ascii(b"0").unwrap_err();
assert_eq!(err.kind(), &IntErrorKind::Zero);
```

See also rust-lang/rust#152193
2026-02-07 13:06:35 +01:00
Jonathan Brouwer
828b9c2cdf
Rollup merge of #152235 - JonathanBrouwer:convert_parse, r=JonathanBrouwer
Convert to inline diagnostics in `rustc_parse`

This was the most annoying one by far, had to make a few changes to the representation of two errors (no user-facing changes tho), these changes are in separate commits for clarity :)

For https://github.com/rust-lang/rust/issues/151366
r? @jdonszelmann
2026-02-07 13:06:34 +01:00
Jonathan Brouwer
29079e41a7
Rollup merge of #150522 - pitaj:stabilize-new-rangeinclusive, r=tgross35
Stabilize new inclusive range type and iterator type

Part 1 of stabilizing the new range types for rust-lang/rust#125687

stabilizes `core::range::RangeInclusive` and `core::range::RangeInclusiveIter`. Newly stable API:

```rust
// in core and std
pub mod range;

// in core::range

pub struct RangeInclusive<Idx> {
    pub start: Idx,
    pub last: Idx,
}

impl<Idx: fmt::Debug> fmt::Debug for RangeInclusive<Idx> { /* ... */ }

impl<Idx: PartialOrd<Idx>> RangeInclusive<Idx> {
    pub const fn contains<U>(&self, item: &U) -> bool
    where
        Idx: [const] PartialOrd<U>,
        U: ?Sized + [const] PartialOrd<Idx>;

    pub const fn is_empty(&self) -> bool
    where
        Idx: [const] PartialOrd;
}

impl<Idx: Step> RangeInclusive<Idx> {
    pub fn iter(&self) -> RangeInclusiveIter<Idx>;
}

impl<T> const RangeBounds<T> for RangeInclusive<T> { /* ... */ }
impl<T> const RangeBounds<T> for RangeInclusive<&T> { /* ... */ }

impl<T> const From<RangeInclusive<T>> for legacy::RangeInclusive<T> { /* ... */ }
impl<T> const From<legacy::RangeInclusive<T>> for RangeInclusive<T> { /* ... */ }

pub struct RangeInclusiveIter<A>(/* ... */);

impl<A: Step> RangeInclusiveIter<A> {
    pub fn remainder(self) -> Option<RangeInclusive<A>>;
}

impl<A: Step> Iterator for RangeInclusiveIter<A> {
    type Item = A;
    /* ... */
}

impl<A: Step> DoubleEndedIterator for RangeInclusiveIter<A> { /* ... */ }
impl<A: Step> FusedIterator for RangeInclusiveIter<A> { }
impl<A: Step> IntoIterator for RangeInclusive<A> {
    type Item = A;
    type IntoIter = RangeInclusiveIter<A>;
    /* ... */
}

impl ExactSizeIterator for RangeInclusiveIter<u8> { }
impl ExactSizeIterator for RangeInclusiveIter<i8> { }

unsafe impl<T> const SliceIndex<[T]> for range::RangeInclusive<usize> {
    type Output = [T];
    /* ... */
}
unsafe impl const SliceIndex<str> for range::RangeInclusive<usize> {
    type Output = str;
    /* ... */
}
```

I've removed the re-exports temporarily because from what I can tell, there's no way to make re-exports of stable items unstable. They will be added back and stabilized in a separate PR.
2026-02-07 13:06:34 +01:00
Jonathan Brouwer
6fe0999ad6
Rollup merge of #148590 - GrigorenkoPV:atomic_try_update, r=jhpratt
Stabilize `atomic_try_update`and deprecate `fetch_update` starting 1.99.0

Tracking issue: rust-lang/rust#135894
FCP completed: https://github.com/rust-lang/rust/issues/135894#issuecomment-3685449783

~1.96.0 was chosen because I don't think the remaining month until 1.93.0 becomes beta is enough for the FCP to finish and this to get merged, so 1.94.0 + a couple of versions of leeway: https://github.com/rust-lang/rust/issues/135894#issuecomment-3491707614~

1.99 suggested in https://github.com/rust-lang/rust/pull/148590#discussion_r2730000452

Closes rust-lang/rust#135894
2026-02-07 13:06:33 +01:00
Jonathan Brouwer
00dd7dbe57
Allow more capitalized words 2026-02-07 10:31:36 +01:00
Jonathan Brouwer
0ef518c946
Disable the run-make/translation test for now 2026-02-07 10:30:42 +01:00
Jonathan Brouwer
c5587ca919
Split parse_inner_attr errors by case 2026-02-07 10:30:42 +01:00
Jonathan Brouwer
cda9b8c157
Split ComparisonOrShiftInterpretedAsGenericSugg 2026-02-07 10:30:42 +01:00
Jonathan Brouwer
9a114c686f
Convert to inline diagnostics in rustc_parse 2026-02-07 10:30:40 +01:00
bors
06cafcbe08 Auto merge of #152274 - JonathanBrouwer:rollup-5GoDGKf, r=JonathanBrouwer
Rollup of 4 pull requests

Successful merges:

 - rust-lang/rust#146900 (Add avr_target_feature)
 - rust-lang/rust#150949 (Port symbol mangler attrs)
 - rust-lang/rust#152252 (Convert diagnostic style checks)
 - rust-lang/rust#152265 (Use `.map.collect` to aggregate in `.to_ty` of tuples)
2026-02-07 08:55:53 +00:00
Jonathan Brouwer
5e476baeab
Rollup merge of #152265 - lapla-cogito:tytuple_agg, r=Zalathar
Use `.map.collect` to aggregate in `.to_ty` of tuples

Since rust-lang/rust#48994 might have been resolved, we can address the FIXME.
2026-02-07 09:41:08 +01:00
Jonathan Brouwer
723eb92a31
Rollup merge of #152252 - JonathanBrouwer:port-tidy-checks, r=jdonszelmann
Convert diagnostic style checks

For https://github.com/rust-lang/rust/issues/151366

r? @jdonszelmann
2026-02-07 09:41:07 +01:00
Jonathan Brouwer
defc1d7a95
Rollup merge of #150949 - Bryntet:port_symbol_mangler_attrs, r=jdonszelmann,JonathanBrouwer
Port symbol mangler attrs

Tracking issue: rust-lang/rust#131229

@JonathanBrouwer could you run perf on this?
2026-02-07 09:41:07 +01:00
Jonathan Brouwer
d7c812cb57
Rollup merge of #146900 - taiki-e:avr-target-feature, r=workingjubilee
Add avr_target_feature

This adds the following unstable target features (tracking issue: https://github.com/rust-lang/rust/issues/146889):

- The following two are particularly important for properly supporting inline assembly:
  - `tinyencoding`: AVR has devices that reduce the number of registers, similar to RISC-V's RV32E. This feature is necessary to support inline assembly in such devices. (see also https://github.com/rust-lang/rust/pull/146901)
  - `lowbytefirst`: AVR's memory access is per 8-bit, and when writing 16-bit ports, the bytes must be written in a specific order. This order depends on devices, making this feature necessary to write proper inline assembly for such use cases. (see also 2a528760bf)
- The followings help recognizing whether specific instructions are available:
  - `addsubiw`
  - `break`
  - `eijmpcall`
  - `elpm`
  - `elpmx`
  - `ijmpcall`
  - `jmpcall`
  - `lpm`
  - `lpmx`
  - `movw`
  - `mul`
  - `rmw`
  - `spm`
  - `spmx`

  Of these, all except `addsubiw`, `break`, `ijmpcall`, `lpm`, `rmw`, `spm`, and `spmx` have [corresponding conditional codes in avr-libc](https://github.com/search?q=repo%3Aavrdudes%2Favr-libc+%2F__AVR_HAVE_%2F&type=code&p=1). LLVM also has `des` feature, but I excluded it from this PR because [DES](https://en.wikipedia.org/wiki/Data_Encryption_Standard) is insecure.

- Report future-incompatible warning (https://github.com/rust-lang/rust/issues/116344) for -C target-feature=-sram and -C target-cpu=<device_without_sram> cases because SRAM is minimum requirement for non-assembly language in both avr-gcc and LLVM.
  - See https://github.com/rust-lang/rust/pull/146900#issuecomment-3323558005 for details.

LLVM also has `smallstack`, `wrappingrjmp`, and `memmappedregs` features, but I skipped them because they didn't seem to belong to either of the above categories, but I might have missed something.

(The feature names are match with [definitions in LLVM](https://github.com/llvm/llvm-project/blob/llvmorg-21.1.0/llvm/lib/Target/AVR/AVRDevices.td).)

cc @Patryk27 @Rahix
r? workingjubilee

@rustbot label +O-AVR +A-target-feature
2026-02-07 09:41:06 +01:00