Commit Graph

2708 Commits

Author SHA1 Message Date
Matthias Krüger 4c92186f21 Rollup merge of #139969 - psumbera:libc-rust-analyzer, r=lnicola
update libc

This is needed for https://github.com/rust-lang/rust/pull/138699#discussion_r2048603474
2025-04-17 21:53:26 +02:00
petr sumbera - Sun Microsystems - Prague Czech Republic 35a4140723 update libc 2025-04-17 13:39:46 +02:00
Matthias Krüger 0de803c38d Rollup merge of #138632 - clubby789:stabilize-cfg-boolean-lit, r=davidtwco,Urgau,traviscross
Stabilize `cfg_boolean_literals`

Closes #131204
`@rustbot` labels +T-lang +I-lang-nominated
This will end up conflicting with the test in #138293 so whichever doesn't land first will need updating

--

# Stabilization Report

## General design

### What is the RFC for this feature and what changes have occurred to the user-facing design since the RFC was finalized?

[RFC 3695](https://github.com/rust-lang/rfcs/pull/3695), none.

### What behavior are we committing to that has been controversial? Summarize the major arguments pro/con.

None

### Are there extensions to this feature that remain unstable? How do we know that we are not accidentally committing to those?

None

## Has a call-for-testing period been conducted? If so, what feedback was received?

Yes; only positive feedback was received.

## Implementation quality

### Summarize the major parts of the implementation and provide links into the code (or to PRs)

Implemented in [#131034](https://github.com/rust-lang/rust/pull/131034).

### Summarize existing test coverage of this feature

- [Basic usage, including `#[cfg()]`, `cfg!()` and `#[cfg_attr()]`](https://github.com/rust-lang/rust/blob/6d71251cf9e40326461f90f8ff9a7024706aea87/tests/ui/cfg/true-false.rs)
- [`--cfg=true/false` on the command line being accessible via `r#true/r#false`](https://github.com/rust-lang/rust/blob/6d71251cf9e40326461f90f8ff9a7024706aea87/tests/ui/cfg/raw-true-false.rs)
- [Interaction with the unstable `#[doc(cfg(..))]` feature](https://github.com/rust-lang/rust/tree/6d71251/tests/rustdoc-ui/cfg-boolean-literal.rs)
- [Denying `--check-cfg=cfg(true/false)`](https://github.com/rust-lang/rust/tree/6d71251/tests/ui/check-cfg/invalid-arguments.rs)
- Ensuring `--cfg false` on the command line doesn't change the meaning of `cfg(false)`: `tests/ui/cfg/cmdline-false.rs`
- Ensuring both `cfg(true)` and `cfg(false)` on the same item result in it being disabled: `tests/ui/cfg/both-true-false.rs`

### What outstanding bugs in the issue tracker involve this feature? Are they stabilization-blocking?

The above mentioned issue; it should not block as it interacts with another unstable feature.

### What FIXMEs are still in the code for that feature and why is it ok to leave them there?

None

### Summarize contributors to the feature by name for recognition and assuredness that people involved in the feature agree with stabilization
- `@clubby789` (RFC)
- `@Urgau` (Implementation in rustc)

### Which tools need to be adjusted to support this feature. Has this work been done?

`rustdoc`'s  unstable`#[doc(cfg(..)]` has been updated to respect it. `cargo` has been updated with a forward compatibility lint to enable supporting it in cargo once stabilized.

## Type system and execution rules

### What updates are needed to the reference/specification? (link to PRs when they exist)

A few lines to be added to the reference for configuration predicates, specified in the RFC.
2025-04-17 06:25:15 +02:00
Mara Bos 1f3199c899 Disable some r-a tests in bootstrap. 2025-04-14 16:53:24 +02:00
Mara Bos 5113f5e602 Update rust-analyzer for new proc_macro span api. 2025-04-11 15:30:03 +02:00
Matthias Krüger 7661224f1e Rollup merge of #139496 - Skgland:139455-went-too-far, r=Veykril
Revert r-a changes of rust-lang/rust#139455

I discovered https://github.com/rust-lang/rust/issues/132735#issuecomment-2784205477 that I might have done too much in rust-lang/rust#132735 by also removing support in r-a.
So this reverts the commit with the changes to r-a.

r? RalfJung
2025-04-08 21:25:58 +02:00
Ralf Jung 742b378371 make hover_feature test less fragile 2025-04-08 12:13:17 +02:00
Bennet Bleßmann bc2912386f Revert "remove rust-analyser support for extern "rust-intrinsic" blocks"
This reverts commit 51b51b51d7.
2025-04-07 20:30:27 +02:00
Stuart Cook 9209c5eb60 Rollup merge of #139455 - Skgland:remove_rust-intrinsic_ABI, r=oli-obk
Remove support for `extern "rust-intrinsic"` blocks

Part of rust-lang/rust#132735

Looked manageable and there didn't appear to have been progress in the last two weeks,
so decided to give it a try.
2025-04-07 22:29:20 +10:00
Bennet Bleßmann 6dfb29624c update docs
- src\doc\nomicon\src\ffi.md should also have its ABI list updated
2025-04-06 21:41:47 +02:00
Skgland 51b51b51d7 remove rust-analyser support for extern "rust-intrinsic" blocks 2025-04-06 21:41:46 +02:00
Guillaume Gomez 5797532940 Clean up rustc-literal-escaper usage in rust-analyzer 2025-04-05 20:06:52 +02:00
Guillaume Gomez 2e3a161871 Update rustc-literal-escaper version to 0.0.2 2025-04-04 22:26:10 +02:00
Guillaume Gomez bba0d57bb2 Remove usage of rustc_lexer::unescape in rust-analyzer 2025-04-04 14:59:14 +02:00
clubby789 984c51f6a1 Stabilize cfg_boolean_literals 2025-04-03 18:10:48 +00:00
Jakub Beránek f0efb9748e Support metadata version 10 in proc-macro-srv 2025-04-01 08:59:04 +02:00
Vadim Petrochenkov 2dfd2a2a24 Remove attribute #[rustc_error] 2025-03-30 01:32:21 +03:00
Michael Goulet e250bd16da Suppress must_use for ControlFlow in rust-analyzer 2025-03-16 17:47:57 +00:00
bors 374ce1f909 Auto merge of #136932 - m-ou-se:fmt-width-precision-u16, r=scottmcm
Reduce formatting `width` and `precision` to 16 bits

This is part of https://github.com/rust-lang/rust/issues/99012

This is reduces the `width` and `precision` fields in format strings to 16 bits. They are currently full `usize`s, but it's a bit nonsensical that we need to support the case where someone wants to pad their value to eighteen quintillion spaces and/or have eighteen quintillion digits of precision.

By reducing these fields to 16 bit, we can reduce `FormattingOptions` to 64 bits (see https://github.com/rust-lang/rust/pull/136974) and improve the in memory representation of `format_args!()`. (See additional context below.)

This also fixes a bug where the width or precision is silently truncated when cross-compiling to a target with a smaller `usize`. By reducing the width and precision fields to the minimum guaranteed size of `usize`, 16 bits, this bug is eliminated.

This is a breaking change, but affects almost no existing code.

---

Details of this change:

There are three ways to set a width or precision today:

1. Directly a formatting string, e.g. `println!("{a:1234}")`
2. Indirectly in a formatting string, e.g. `println!("{a:width$}", width=1234)`
3. Through the unstable `FormattingOptions::width` method.

This PR:

- Adds a compiler error for 1. (`println!("{a:9999999}")` no longer compiles and gives a clear error.)
- Adds a runtime check for 2. (`println!("{a:width$}, width=9999999)` will panic.)
- Changes the signatures of the (unstable) `FormattingOptions::[get_]width` methods to use a `u16` instead.

---

Additional context for improving `FormattingOptions` and `fmt::Arguments`:

All the formatting flags and options are currently:

- The `+` flag (1 bit)
- The `-` flag (1 bit)
- The `#` flag (1 bit)
- The `0` flag (1 bit)
- The `x?` flag (1 bit)
- The `X?` flag (1 bit)
- The alignment (2 bits)
- The fill character (21 bits)
- Whether a width is specified (1 bit)
- Whether a precision is specified (1 bit)
- If used, the width (a full usize)
- If used, the precision (a full usize)

Everything except the last two can simply fit in a `u32` (those add up to 31 bits in total).

If we can accept a max width and precision of u16::MAX, we can make a `FormattingOptions` that is exactly 64 bits in size; the same size as a thin reference on most platforms.

If, additionally, we also limit the number of formatting arguments, we can also reduce the size of `fmt::Arguments` (that is, of a `format_args!()` expression).
2025-03-11 04:07:05 +00:00
Mara Bos ce512c2e4d Fix rust-analyzer for 16-bit fmt width and precision. 2025-03-10 12:20:05 +01:00
Laurențiu Nicola 52f39ffe83 Merge pull request #19331 from lnicola/sync-from-rust
minor: Sync from downstream
2025-03-10 09:52:17 +00:00
Laurențiu Nicola 1d983bf794 Format code 2025-03-10 11:37:21 +02:00
Lukas Wirth af32b22982 Merge pull request #19328 from Veykril/push-umwykvoskvyp
internal: Run proc-macro server tests as separate CI job
2025-03-10 09:30:22 +00:00
Laurențiu Nicola c372c55f2b Fix simd layout test 2025-03-10 11:21:03 +02:00
Laurențiu Nicola 87d5bf2b92 Bump rustc crates 2025-03-10 11:20:56 +02:00
Lukas Wirth ee79f3e9dc Run proc-macro server tests are separate CI job
Touch tt
2025-03-10 10:16:32 +01:00
Lukas Wirth 1c8acd4b7f Merge pull request #19330 from ChayimFriedman2/normalize-projection
fix: Normalize projections in evaluated const display and layout calculation
2025-03-10 09:15:35 +00:00
Lukas Wirth 44fad0b1d6 Merge pull request #19079 from ChayimFriedman2/rename-conflict
feat: Warn the user when a rename will change the meaning of the program
2025-03-10 08:59:43 +00:00
Lukas Wirth f53d1eba48 Merge pull request #19327 from Veykril/push-qyyvkulltzpz
Fix `path` macro hygiene
2025-03-10 08:45:04 +00:00
Laurențiu Nicola e1da1b09bf Merge from rust-lang/rust 2025-03-10 10:41:53 +02:00
Laurențiu Nicola fdee1c1455 Preparing for merge from rust-lang/rust 2025-03-10 10:41:28 +02:00
Lukas Wirth 7ee9ce8480 Fix path macro hygiene 2025-03-10 09:29:27 +01:00
Lukas Wirth c961ee6456 Merge pull request #19311 from aibaars/log-build-script-error
Log build script error output in `load_cargo::load_workspace_at`
2025-03-10 08:16:10 +00:00
Lukas Wirth 71b9103ea2 Merge pull request #19314 from snprajwal/variantdef-impl
fix(hir): `VariantDef` is `impl HasSource`
2025-03-10 08:13:24 +00:00
Lukas Wirth b2a4f3dcef Merge pull request #19316 from snprajwal/git-commit-ec
fix: do not apply editorconfig to git commit msg
2025-03-10 08:11:48 +00:00
Lukas Wirth b2501efad5 Merge pull request #19252 from flodiebold/fix-fixup-delimiters
Fix syntax fixup producing invalid punctuation
2025-03-10 08:11:27 +00:00
Lukas Wirth f36e2ead55 Merge pull request #19232 from ShoyuVanilla/issue-19196
Bump chalk for built-in supports of async closures
2025-03-10 08:11:23 +00:00
Lukas Wirth e1912f8fa9 Rank ADT constructors as constructors for completion scoring 2025-03-09 15:36:53 +01:00
Shoyu Vanilla 965a0c0166 fix: Prevent wrong invocations of needs_parens_in with non-ancestral "parent"s 2025-03-09 18:54:22 +09:00
Shoyu Vanilla 0e4f189e80 internal: Migrate inline_local_variable to SyntaxEditor 2025-03-09 15:51:37 +09:00
Shoyu Vanilla bb82831126 Bump chalk for built-in supports of async closures 2025-03-09 11:41:08 +09:00
¨Florian fee83ba852 Generated doc update 2025-03-08 13:26:28 +01:00
¨Florian e88f892eca Fix syntax fixup producing invalid punctuation
Fixes #19206.
Fixes #18244.
2025-03-08 13:21:00 +01:00
Moulins f79f3d31a3 Use rustc_abi code for SIMD layout in rust-analyzer 2025-03-08 12:36:42 +01:00
Moulins 9917173575 Remove most manual LayoutData creations and move them to rustc_abi
...either as:
- methods on LayoutCalculator, for faillible operations;
- constructors on LayoutData, for infaillible ones.
2025-03-08 12:27:19 +01:00
Prajwal S N b6f1ce8071 fix: do not apply editorconfig to git commit msg
The `max_line_length` property was set to 100 for all filetypes, which
led to git commit messages being wrapped at 100 characters instead of
the usual 75. This introduces an exception for the special file used by
git to write commit messages.

Signed-off-by: Prajwal S N <prajwalnadig21@gmail.com>
2025-03-08 01:44:27 +05:30
Prajwal S N e98837f558 fix(hir): VariantDef is impl HasSource
A new syntax node `ast::VariantDef` has been introduced to map between the HIR node and the AST.
The files have been updated with `cargo test -p xtask`.

Signed-off-by: Prajwal S N <prajwalnadig21@gmail.com>
2025-03-08 01:25:27 +05:30
Arthur Baars bdf602a594 Log build script error output in load_cargo::load_workspace_at 2025-03-07 16:07:56 +01:00
Lukas Wirth d11c5b8d75 Merge pull request #19308 from Veykril/push-rnrxutwlvmly
Move loaded project MSRV back to 1.78, show notification for the warning
2025-03-07 07:06:54 +00:00
Lukas Wirth 5c6a1247fb Pop up a notification for the MSRV project loading warning 2025-03-07 07:51:53 +01:00