Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
107 commits
Select commit Hold shift + click to select a range
7488140
Use nightly sync mode for josh-sync
bjorn3 Sep 15, 2026
574e8d2
Introduce `record_non_lazy` and `record_defaulted` macros to write to…
aerooneqq Sep 17, 2026
d3cc844
Prepare for merging from rust-lang/rust
bjorn3 Sep 18, 2026
1981bfa
Merge ref '330d317121e1' from rust-lang/rust
bjorn3 Sep 18, 2026
020ffe1
Move `proc_macro_quoted_spans` to `ProcMacroData`, as it is filled on…
aerooneqq Sep 18, 2026
3033e33
Rename `record` -> `record_some_lazy`, `record_non_lazy` -> `record_s…
aerooneqq Sep 18, 2026
0ef25a5
Merge pull request #1702 from Kobzol/josh-sync-script
Kobzol Sep 18, 2026
9204d85
enable `__powitf2`
folkertdev Sep 20, 2026
f952ea0
support `vpclmulqdq`
folkertdev Sep 20, 2026
465eff3
enable `__powitf2` (#1704)
bjorn3 Sep 21, 2026
2d64a2a
Merge pull request #1705 from folkertdev/vpclmulqdq
bjorn3 Sep 21, 2026
ff88d0d
Integrate `stdarch` tests for aarch64
CathalMullan Jun 13, 2026
df476a9
Merge pull request #1667 from CathalMullan/stdarch
bjorn3 Sep 22, 2026
711bae4
Prepare for merging from rust-lang/rust
bjorn3 Sep 22, 2026
a8408af
Merge ref '1303417c416e' from rust-lang/rust
bjorn3 Sep 22, 2026
29ff6f9
Prepare for merging from rust-lang/rust
bjorn3 Sep 23, 2026
fba788a
Merge ref '6bb1652a020e' (nightly-2026-09-23) from rust-lang/rust
bjorn3 Sep 23, 2026
dc39f01
making clamp_magnitude functions const + adding clamp_magnitude to No…
Eleocraft Sep 24, 2026
c614782
Prepare for merging from rust-lang/rust
Sep 24, 2026
6c26e7e
Merge ref '3670d2532bdf' from rust-lang/rust
Sep 24, 2026
ec11203
temporarily disable broken test on freebsd
RalfJung Sep 24, 2026
6cdd4d4
Merge pull request #5343 from rust-lang/rustup-2026-09-24
RalfJung Sep 24, 2026
d6d250c
adding coretests and fixing docs
Eleocraft Sep 24, 2026
76384db
Prepare for merging from rust-lang/rust
Sep 25, 2026
9b17f12
Merge ref '0d38a842626a' from rust-lang/rust
Sep 25, 2026
801c6d7
Merge pull request #5346 from rust-lang/rustup-2026-09-25
oli-obk Sep 25, 2026
79cbf77
run windows-fs tests natively
RalfJung Sep 20, 2026
3f2e9ee
Applying requested changes
Eleocraft Sep 25, 2026
eb7e04d
Disable RA diagnostics due to many false positives
WhySoBad Sep 25, 2026
cc51d68
Merge pull request #5347 from WhySoBad/disable-RA-diagnostics-zed
saethlin Sep 25, 2026
47f1cc5
Add socket2, integrate socket2 sockets in TCP socket shim
WhySoBad Sep 5, 2026
9afae37
avoid re-opening RefCells quite so often
RalfJung Sep 26, 2026
fd41c62
Disable rust-analyzer diagnostics for Helix
YohDeadfall Sep 26, 2026
32b4629
Merge pull request #5308 from WhySoBad/socket2
RalfJung Sep 26, 2026
8c3ae60
Don't build format string suggestions from `concat!` offsets
h-kurashina Sep 26, 2026
32af1b8
Merge pull request #5349 from YohDeadfall/disable-ra-diagnostics-helix
RalfJung Sep 26, 2026
c22ad42
Prepare for merging from rust-lang/rust
Sep 27, 2026
a8837e4
Merge ref 'c23137133458' from rust-lang/rust
Sep 27, 2026
ca44a87
Merge pull request #5350 from rust-lang/rustup-2026-09-27
RalfJung Sep 27, 2026
b1d3d37
Don't assert EINPROGRESS for non-blocking `connect` on TCP sockets
WhySoBad Sep 27, 2026
742e775
Prepare for merging from rust-lang/rust
Sep 28, 2026
fb006eb
Merge ref '22697761c6a0' from rust-lang/rust
Sep 28, 2026
5c42b6d
fmt
Sep 28, 2026
ea5a525
Merge pull request #5353 from rust-lang/rustup-2026-09-28
RalfJung Sep 28, 2026
42f663b
Prepare for merging from rust-lang/rust
bjorn3 Sep 28, 2026
965e5c1
Merge ref 'd080e7dff1b0' (nightly-2026-09-28) from rust-lang/rust
bjorn3 Sep 28, 2026
f9d8355
Simplify rustup.sh a bit
bjorn3 Sep 28, 2026
b9e7e71
nonzero doc: replacing tabs with spaces
Eleocraft Sep 28, 2026
6cf905c
Merge pull request #5348 from WhySoBad/fix-non-blocking-connect-asser…
RalfJung Sep 28, 2026
d10b01c
Use `{IntTy,UintTy}::name` in `Ty::primitive_symbol`
nnethercote Sep 29, 2026
935c565
Factor out repeated `get_normal_item` calls
nnethercote Jul 27, 2026
bc7618a
Add test case for an invalid attribute with nested `cfg_attr`
nnethercote Jul 27, 2026
7af2cce
Remove unused `rustc_middle::ty::cast::IntTy::is_signed`
nnethercote Sep 29, 2026
a4cd051
Prepare for merging from rust-lang/rust
Sep 29, 2026
a3f6598
Merge ref '5d8937173e7c' from rust-lang/rust
Sep 29, 2026
52e0abb
fmt
Sep 29, 2026
3e5b244
Mark duplicate attr messages as not machine applicable
nnethercote Jul 28, 2026
238f30f
Merge pull request #5357 from rust-lang/rustup-2026-09-29
RalfJung Sep 29, 2026
da3a408
add relnotes 1.99.0
BoxyUwU Sep 29, 2026
bc0240c
Don't use the metadata based crate_hash for rustdoc runs
Daniel-B-Smith Sep 28, 2026
0883f59
x86_64: cleanup `reg_component`
folkertdev Sep 29, 2026
7f5fdab
x86 callconv: refactor into separate classify methods
folkertdev Sep 26, 2026
457af24
x86 callconv: put regparam into `Flavor::General`
folkertdev Sep 26, 2026
330b5d1
miri: implement again shims for LLVM intrinsics for `_mm_mulhi_epi16`…
eduardosm Sep 29, 2026
14d09db
cycle handling: mirror old solver
lcnr Sep 29, 2026
8ad444f
Merge pull request #5358 from eduardosm/revert-116609
RalfJung Sep 29, 2026
36358d0
gating f16 and f128 tests behind target_has_reliable
Eleocraft Sep 29, 2026
2eeeb39
Use more default field values in `Resolver`
estebank Sep 29, 2026
728205b
Forbid `Reborrow` impls for types with destructors
Jules-Bertholet Sep 30, 2026
a5e0df2
Remove `rustc_middle::ty::cast::IntTy`
nnethercote Sep 29, 2026
9bdf58f
Move `rustc_middle::ty::cast::CastKind`
nnethercote Sep 29, 2026
f69dfad
Prepare for merging from rust-lang/rust
Sep 30, 2026
2297dad
Merge ref '5c543b0b8c73' from rust-lang/rust
Sep 30, 2026
7c8015d
Merge pull request #5360 from rust-lang/rustup-2026-09-30
RalfJung Sep 30, 2026
257c716
Merge pull request #5336 from RalfJung/win-fs
RalfJung Sep 30, 2026
9970383
Document `Result` case for the `arena_cache` query modifier
nnethercote Sep 1, 2026
52fd615
use cfg_select in a few more places
RalfJung Sep 30, 2026
b02b23f
windows host: use FILE_FLAG_OPEN_REPARSE_POINT to implement O_NOFOLLOW
RalfJung Sep 30, 2026
25fef88
move libc-fs tests back together
RalfJung Sep 30, 2026
c3c4a0a
unix open: reject opening directories
RalfJung Sep 30, 2026
7c70e5d
Merge pull request #5361 from RalfJung/win-nofollow
RalfJung Sep 30, 2026
654d664
add regression test
lcnr Sep 30, 2026
b7448a3
add fstatat test
RalfJung Sep 29, 2026
4912ffd
use utils::into_c_string in more places
RalfJung Sep 29, 2026
5196402
organize and extend statx tests
RalfJung Sep 29, 2026
2cf7527
prefix all test files with miri
RalfJung Sep 29, 2026
c6e51b3
implement fstatat and the equivalent parts of statx
RalfJung Sep 30, 2026
f02d1d5
Prepare for merging from rust-lang/rust
bjorn3 Sep 30, 2026
a4aec95
Merge ref '5c543b0b8c73' (nightly-2026-09-30) from rust-lang/rust
bjorn3 Sep 30, 2026
ce32541
Merge pull request #5362 from RalfJung/fstatat
RalfJung Sep 30, 2026
f6e6de6
Fix rustc test suite
bjorn3 Sep 30, 2026
bbf5442
Fix pushes
bjorn3 Sep 30, 2026
5658d6b
update lockfile
RalfJung Sep 30, 2026
72d2b90
Rollup merge of #163532 - bjorn3:sync_cg_clif-2026-09-30, r=bjorn3
JonathanBrouwer Sep 30, 2026
234753b
Rollup merge of #163534 - RalfJung:miri, r=RalfJung
JonathanBrouwer Sep 30, 2026
3116943
Rollup merge of #163435 - BoxyUwU:relnotes_1_99, r=BoxyUwU
JonathanBrouwer Sep 30, 2026
74a63be
Rollup merge of #163279 - Eleocraft:clamp-magnitude-unsigned-limit, r…
JonathanBrouwer Sep 30, 2026
9a1f6e3
Rollup merge of #162900 - aerooneqq:record-tables-through-macros, r=p…
JonathanBrouwer Sep 30, 2026
f2af2be
Rollup merge of #163455 - Daniel-B-Smith:smithdb3/163426, r=bjorn3
JonathanBrouwer Sep 30, 2026
54dd252
Rollup merge of #163368 - h-kurashina:fix-156101, r=mejrs
JonathanBrouwer Sep 30, 2026
e489136
Rollup merge of #163470 - nnethercote:misc-attr-error-stuff, r=Jonath…
JonathanBrouwer Sep 30, 2026
37e7791
Rollup merge of #163492 - folkertdev:x86-callconv-refactor, r=oli-obk
JonathanBrouwer Sep 30, 2026
a4f97e0
Rollup merge of #163496 - lcnr:weaken-cycle-handling, r=jackh726
JonathanBrouwer Sep 30, 2026
24efd6d
Rollup merge of #163509 - estebank:default-more, r=petrochenkov
JonathanBrouwer Sep 30, 2026
c18efec
Rollup merge of #163519 - Jules-Bertholet:no-reborrow-destructor, r=m…
JonathanBrouwer Sep 30, 2026
1c672e1
Rollup merge of #163520 - nnethercote:cast-cleanups, r=oli-obk
JonathanBrouwer Sep 30, 2026
5c09ea5
Rollup merge of #163524 - nnethercote:arena_cache-Result-doc, r=Zalathar
JonathanBrouwer Sep 30, 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
6 changes: 4 additions & 2 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2558,8 +2558,10 @@ dependencies = [
"serde",
"serde_json",
"smallvec",
"socket2",
"tempfile",
"ui_test",
"windows-sys 0.61.2",
]

[[package]]
Expand Down Expand Up @@ -5472,9 +5474,9 @@ checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03"

[[package]]
name = "socket2"
version = "0.6.3"
version = "0.6.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3a766e1110788c36f4fa1c2b71b387a7815aa65f88ce0229841826633d93723e"
checksum = "c3d1e2c7f27f8d4cb10542a02c49005dbd6e93095799d6f3be745fae9f8fedd4"
dependencies = [
"libc",
"windows-sys 0.61.2",
Expand Down
130 changes: 130 additions & 0 deletions RELEASES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,133 @@
Version 1.99.0 (2026-10-01)
==========================

<a id="1.99.0-Language"></a>

Language
--------
- [Add allow-by-default `raw_borrows_via_references` lint that checks for references that decay immediately into raw borrows](https://github.com/rust-lang/rust/pull/138230)
- [Extend `unconditional_panic` lint to function calls that panic when the chunks/windows size is zero](https://github.com/rust-lang/rust/pull/153563)
- [Stabilize C-variadic function definitions](https://github.com/rust-lang/rust/pull/155697)
- [Stabilize the ability to use `#[unsafe(naked)]` functions to define C-variadic functions (`#![feature(c_variadic_naked_functions)]`).](https://github.com/rust-lang/rust/pull/159746)
- [Trait methods are now resolved on an adjusted never type (producing a FCW)](https://github.com/rust-lang/rust/pull/156047)
- [Coerce from inference variables to trait objects if the inference variable is related via subtyping to a type that is known to be `Sized`](https://github.com/rust-lang/rust/pull/157820)
- [Stabilize `#[my_macro] mod foo;`](https://github.com/rust-lang/rust/pull/157857). This allows outlined modules (`mod foo;`) anywhere in the body of a custom attribute or derive macro.
- [Fix the `overflowing_literals` lint with repeated negation](https://github.com/rust-lang/rust/pull/158302). For instance, it will now no longer lint on `--128_i8`, which is already detected by the `arithmetic_overflow` lint.
- [Add POSIX symbols to the `invalid_runtime_symbol_definitions` and `suspicious_runtime_symbol_definitions` lints](https://github.com/rust-lang/rust/pull/158522)
- [Lint unused `#[path]` attributes on inline modules](https://github.com/rust-lang/rust/pull/158835)
- [Enable `unreachable_cfg_select_predicates` lint as part of `unused` lint group](https://github.com/rust-lang/rust/pull/159179)
- [Stabilize passing 128-bit integers via vector registers with `asm!` on x86](https://github.com/rust-lang/rust/pull/159525)
- [Explicitly document that some allocations are allowed to grow in-place (but none are allowed to shrink)](https://github.com/rust-lang/rust/pull/159729)
- We now [guarantee](https://github.com/rust-lang/rust/pull/159730) that the contents of an `UnsafeCell` can be accessed without going through `get`
- [The `invalid_reference_casting` lint was adjusted accordingly](https://github.com/rust-lang/rust/pull/159960)
- [Account for globally enabled target features in `global_asm!`](https://github.com/rust-lang/rust/pull/160594)
- [Warn if an invalid `doc` attribute is used on a macro invocation](https://github.com/rust-lang/rust/pull/161003)


<a id="1.99.0-Compiler"></a>

Compiler
--------
- [Convert `-Ctarget-cpu` into a target-modifier for AVR, AMDGCN and NVPTX](https://github.com/rust-lang/rust/pull/150732)
- [Enable `static_position_independent_executables` on all gnu targets](https://github.com/rust-lang/rust/pull/158510)
- When providing a suggestion about a missing method, rustc now prefers an exactly matching name from a [doc alias attribute](https://doc.rust-lang.org/rustdoc/advanced-features.html#add-aliases-for-an-item-in-documentation-search) over a similarity search from other method names. If your new users sometimes expect a method under a different name, adding a doc alias will now help them find it via rustc suggestions, in addition to helping them find it via rustdoc search: [When suggesting method names, prefer *exact* doc aliases over similar names](https://github.com/rust-lang/rust/pull/160369)


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

Platform Support
----------------
- [Promote `riscv64-unknown-linux-musl` to Tier 2 with host tools](https://github.com/rust-lang/rust/pull/158766)


Refer to Rust's [platform support page][platform-support-doc]
for more information on Rust's tiered platform support.

[platform-support-doc]: https://doc.rust-lang.org/rustc/platform-support.html

<a id="1.99.0-Libraries"></a>

Libraries
---------
- Iteration on `RangeInclusive` (`a..=b` ranges) is now [optimized better in some circumstances](https://github.com/rust-lang/rust/pull/155114). As a side effect of this, the behavior of `RangeInclusive` values that has already been exhausted (as an iterator) has changed. For example, the return values of `start()` and `end()` on such ranges may return different values, and using such ranges as slice indexes may have different behavior. These behaviors were not guaranteed to be stable, so these changes are considered to not be breaking changes.
- [Relax `transmute_copy` to accept `?Sized` types](https://github.com/rust-lang/rust/pull/155989)
- [Update `transmute_copy` to use a non-unwinding panic](https://github.com/rust-lang/rust/pull/155989)
- [Don't escape U+FF9E and U+FF9F in `escape_debug_ext`](https://github.com/rust-lang/rust/pull/158057)
- [Re-export `core::fmt::NumBuffer` in `alloc` (and `std`)](https://github.com/rust-lang/rust/pull/161430)


<a id="1.99.0-Stabilized-APIs"></a>

Stabilized APIs
---------------

- [`IntoIterator` for `Box<[T; N]>`](https://doc.rust-lang.org/stable/std/iter/trait.IntoIterator.html#impl-IntoIterator-for-Box%3C%5BT;+N%5D,+A%3E)
- [`IntoIterator` for `&Box<[T; N]>`](https://doc.rust-lang.org/stable/std/iter/trait.IntoIterator.html#impl-IntoIterator-for-%26Box%3C%5BT;+N%5D,+A%3E)
- [`IntoIterator` for `&mut Box<[T; N]>`](https://doc.rust-lang.org/stable/std/iter/trait.IntoIterator.html#impl-IntoIterator-for-%26mut+Box%3C%5BT;+N%5D,+A%3E)
- [`VecDeque::retain_back`](https://doc.rust-lang.org/stable/std/collections/struct.VecDeque.html#method.retain_back)
- [`core::ffi::VaList`](https://doc.rust-lang.org/stable/core/ffi/struct.VaList.html)
- [`Box::into_non_null`](https://doc.rust-lang.org/stable/std/boxed/struct.Box.html#method.into_non_null)
- [`Box::from_non_null`](https://doc.rust-lang.org/stable/std/boxed/struct.Box.html#method.from_non_null)
- [`Vec::into_parts`](https://doc.rust-lang.org/stable/std/vec/struct.Vec.html#method.into_parts)
- [`Vec::from_parts`](https://doc.rust-lang.org/stable/std/vec/struct.Vec.html#method.from_parts)
- [`core::mem::size_of_val_raw`](https://doc.rust-lang.org/stable/core/mem/fn.size_of_val_raw.html)
- [`core::mem::align_of_val_raw`](https://doc.rust-lang.org/stable/core/mem/fn.align_of_val_raw.html)
- [`core::alloc::Layout::for_value_raw`](https://doc.rust-lang.org/stable/core/alloc/struct.Layout.html#method.for_value_raw)
- [`String::from_utf8_lossy_owned`](https://doc.rust-lang.org/stable/std/string/struct.String.html#method.from_utf8_lossy_owned)
- [`string::FromUtf8Error::into_utf8_lossy`](https://doc.rust-lang.org/stable/std/string/struct.FromUtf8Error.html#method.into_utf8_lossy)
- [`FusedIterator for StepBy<I>`](https://doc.rust-lang.org/stable/std/iter/struct.StepBy.html#impl-FusedIterator-for-StepBy%3CI%3E)
- [`std::fs::set_times`](https://doc.rust-lang.org/stable/std/fs/fn.set_times.html)
- [`std::fs::set_times_nofollow`](https://doc.rust-lang.org/stable/std/fs/fn.set_times_nofollow.html)

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

Cargo
-----
- Add a new built-in profile `debug`. This is a preparation for transitioning the `dev` profile away from debugging to give a saner default for faster development iterations. Currently there is no difference between `dev` and `debug` profiles. [docs](https://doc.rust-lang.org/nightly/cargo/reference/profiles.html#debug-1) [#17214](https://github.com/rust-lang/cargo/pull/17214)
- Workspace members on edition 2024 or later can now override an inherited workspace dependency's `default-features` field. For example, `serde = { workspace = true, default-features = false }` now turns off default features even when the workspace definition enables them. On earlier editions, `default-features = false` is ignored with a warning. ([RFC 3945](https://github.com/rust-lang/rfcs/pull/3945)) [#17126](https://github.com/rust-lang/cargo/pull/17126)

See also the [full Cargo changelog](https://doc.rust-lang.org/nightly/cargo/CHANGELOG.html#cargo-199-2026-10-01)

<a id="1.99.0-Rustdoc"></a>

Rustdoc
-----
- [Add new `unused_footnote_definition` rustdoc lint](https://github.com/rust-lang/rust/pull/137858)
- Smarter filtering of trait impls yields performance improvements of 20% on average and up to 40% on some real-world crates. ([1](https://github.com/rust-lang/rust/pull/159623), [2](https://github.com/rust-lang/rust/pull/159721), [3](https://github.com/rust-lang/rust/pull/159779), [4](https://github.com/rust-lang/rust/pull/159854), [5](https://github.com/rust-lang/rust/pull/159091))

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

Compatibility Notes
-------------------
- [Fully deprecate the legacy integral modules](https://github.com/rust-lang/rust/pull/146882). For example, `std::i32::MAX` should be accessed via `i32::MAX` instead.
- [Upgrade `no_mangle_generic_items` into hard error](https://github.com/rust-lang/rust/pull/154585)
- [The `Pin::new_unchecked` has had its safety invariants changed slightly](https://github.com/rust-lang/rust/pull/156935)
- [Do not promote references to extern statics](https://github.com/rust-lang/rust/pull/157641)
- [Ensure that the inferred types of `let` patterns typecheck](https://github.com/rust-lang/rust/pull/157841)
- [hermit/fs: Return `unsupported()` instead of `from_raw_os_error(22)`](https://github.com/rust-lang/rust/pull/158247)
- [Fixed a bug where `#[repr(simd)]` was accidentally allowed on macro invocations on stable Rust](https://github.com/rust-lang/rust/pull/158523)
- [Abort const-eval when there are generics in the type of the value being produced](https://github.com/rust-lang/rust/pull/159504)
- [Attributes not applying to anything are now an error in code blocks in doc comments](https://github.com/rust-lang/rust/pull/159849)
- [`Box::leak`: tell people to avoid unleaking](https://github.com/rust-lang/rust/pull/160323)
- [PowerPC inline ASM: Fix scalar floats being in the wrong vector lane on little endian](https://github.com/rust-lang/rust/pull/160441)
- [Do not take `doc(cfg())` into account when filtering doctests](https://github.com/rust-lang/rust/pull/159014)
- [Infer anonymous lifetimes in the types of associated consts as `'static`](https://github.com/rust-lang/rust/pull/156508)
- Macros that expand to a semicolon now produce a warning lint (`semicolon_in_expressions_from_non_local_macros`) even when the macro comes from another crate. Previously, such warnings only appeared for macros from the same crate, to avoid showing warnings that can't be fixed locally; however, this masked problems, as integration tests from the crate providing the macro get compiled as a separate crate, so tests often wouldn't reveal this issue. If you encounter a lint like this, please make sure to report it to the crate providing the macro so they can fix it; don't just silence it in your own crate.
- [`semicolon_in_expressions_from_macros`: Lint on non-local macros too](https://github.com/rust-lang/rust/pull/159222)
- [Split non-local `semicolon_in_expressions_from_macros` into a separate lint](https://github.com/rust-lang/rust/pull/159700)
- In Cargo, incremental compilation is now disabled by default when running in CI. CI is detected via the `CI` environment variable. [#17220](https://github.com/rust-lang/cargo/pull/17220)

<a id="1.99.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.

- [Update to LLVM 23](https://github.com/rust-lang/rust/pull/158734)

Version 1.98.1 (2026-09-03)
===========================

Expand Down
31 changes: 16 additions & 15 deletions compiler/rustc_attr_parsing/src/attributes/cfg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,8 @@ pub fn parse_cfg_attr(
features: Option<&Features>,
lint_node_id: ast::NodeId,
) -> Option<(CfgEntry, Vec<(WithTokens<AttrItem>, Span)>)> {
match &cfg_attr.get_normal_item().args {
let item = cfg_attr.get_normal_item();
match &item.args {
ast::AttrArgs::Delimited(ast::DelimArgs { dspan, delim, tokens }) if !tokens.is_empty() => {
check_cfg_attr_bad_delim(&sess.psess, *dspan, *delim);
match parse_in(&sess.psess, tokens.clone(), "`cfg_attr` input", |p| {
Expand All @@ -316,11 +317,11 @@ pub fn parse_cfg_attr(
Err(e) => {
let suggestions = CFG_ATTR_TEMPLATE.suggestions(
ParsedDescription::Attribute,
cfg_attr.get_normal_item().unsafety,
item.unsafety,
sym::cfg_attr,
);
e.with_span_suggestions(
cfg_attr.get_normal_item().span,
item.span,
"must be of the form",
suggestions,
Applicability::HasPlaceholders,
Expand All @@ -334,25 +335,24 @@ pub fn parse_cfg_attr(
}
}
_ => {
let (span, reason) = if let ast::AttrArgs::Delimited(ast::DelimArgs { dspan, .. }) =
cfg_attr.get_normal_item().args
{
(dspan.entire(), AttributeParseErrorReason::ExpectedAtLeastOneArgument)
} else {
(cfg_attr.get_normal_item().span, AttributeParseErrorReason::ExpectedList)
};
let (span, reason) =
if let ast::AttrArgs::Delimited(ast::DelimArgs { dspan, .. }) = item.args {
(dspan.entire(), AttributeParseErrorReason::ExpectedAtLeastOneArgument)
} else {
(item.span, AttributeParseErrorReason::ExpectedList)
};

sess.dcx().emit_err(AttributeParseError {
span,
inner_span: cfg_attr.get_normal_item().span,
inner_span: item.span,
template: CFG_ATTR_TEMPLATE,
path: AttrPath::from_ast(&cfg_attr.get_normal_item().path, identity),
path: AttrPath::from_ast(&item.path, identity),
description: ParsedDescription::Attribute,
reason,
suggestions: diagnostics::AttributeParseErrorSuggestions::CreatedByTemplate(
CFG_ATTR_TEMPLATE.suggestions(
ParsedDescription::Attribute,
cfg_attr.get_normal_item().unsafety,
item.unsafety,
sym::cfg_attr,
),
),
Expand Down Expand Up @@ -389,13 +389,14 @@ fn parse_cfg_attr_internal<'a>(
)?;
let pred_span = pred_start.with_hi(parser.token.span.hi());

let item = attribute.get_normal_item();
let cfg_predicate = AttributeParser::parse_single_args(
sess,
attribute.span,
attribute.get_normal_item().span,
item.span,
attribute.style,
AttrPath { segments: attribute.path().into_boxed_slice(), span: attribute.span },
Some(attribute.get_normal_item().unsafety),
Some(item.unsafety),
AttributeSafety::Normal,
ParsedDescription::Attribute,
pred_span,
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_attr_parsing/src/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1235,7 +1235,7 @@ pub(crate) struct UnknownVersionLiteral {
#[diag("multiple `{$name}` attributes")]
pub(crate) struct UnusedMultiple {
#[primary_span]
#[suggestion("remove this attribute", code = "", applicability = "machine-applicable")]
#[suggestion("remove this attribute", code = "", applicability = "unspecified")]
pub this: Span,
#[note("attribute also specified here")]
pub other: Span,
Expand Down Expand Up @@ -2061,7 +2061,7 @@ pub(crate) struct AdditionalCommaSuggestion {
#[derive(Diagnostic)]
#[diag("unused attribute")]
pub(crate) struct UnusedDuplicate {
#[suggestion("remove this attribute", code = "", applicability = "machine-applicable")]
#[suggestion("remove this attribute", code = "", applicability = "unspecified")]
pub this: Span,
#[note("attribute also specified here")]
pub other: Span,
Expand Down
10 changes: 5 additions & 5 deletions compiler/rustc_borrowck/src/type_check/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1361,7 +1361,7 @@ impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> {
let cast_ty_from = CastTy::from_ty(ty_from);
let cast_ty_to = CastTy::from_ty(*ty);
match (cast_ty_from, cast_ty_to) {
(Some(CastTy::Ptr(_) | CastTy::FnPtr), Some(CastTy::Int(_))) => (),
(Some(CastTy::Ptr(_) | CastTy::FnPtr), Some(CastTy::Int)) => (),
_ => {
span_mirbug!(
self,
Expand All @@ -1379,7 +1379,7 @@ impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> {
let cast_ty_from = CastTy::from_ty(ty_from);
let cast_ty_to = CastTy::from_ty(*ty);
match (cast_ty_from, cast_ty_to) {
(Some(CastTy::Int(_)), Some(CastTy::Ptr(_))) => (),
(Some(CastTy::Int), Some(CastTy::Ptr(_))) => (),
_ => {
span_mirbug!(
self,
Expand All @@ -1396,7 +1396,7 @@ impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> {
let cast_ty_from = CastTy::from_ty(ty_from);
let cast_ty_to = CastTy::from_ty(*ty);
match (cast_ty_from, cast_ty_to) {
(Some(CastTy::Int(_)), Some(CastTy::Int(_))) => (),
(Some(from), Some(to)) if from.is_int_like() && to.is_int_like() => (),
_ => {
span_mirbug!(
self,
Expand All @@ -1413,7 +1413,7 @@ impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> {
let cast_ty_from = CastTy::from_ty(ty_from);
let cast_ty_to = CastTy::from_ty(*ty);
match (cast_ty_from, cast_ty_to) {
(Some(CastTy::Int(_)), Some(CastTy::Float)) => (),
(Some(CastTy::Int), Some(CastTy::Float)) => (),
_ => {
span_mirbug!(
self,
Expand All @@ -1430,7 +1430,7 @@ impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> {
let cast_ty_from = CastTy::from_ty(ty_from);
let cast_ty_to = CastTy::from_ty(*ty);
match (cast_ty_from, cast_ty_to) {
(Some(CastTy::Float), Some(CastTy::Int(_))) => (),
(Some(CastTy::Float), Some(CastTy::Int)) => (),
_ => {
span_mirbug!(
self,
Expand Down
Loading
Loading