Commit graph

22408 commits

Author SHA1 Message Date
roifewu
06cf9ca521 minor: simplify and enhance notable traits rendering 2025-04-21 19:03:35 +08:00
Lukas Wirth
d16b862ea5 fix: Support unstable UnsafePinned struct in type layout calc 2025-04-21 09:35:30 +02:00
Lukas Wirth
5680911972 fix: Fix completion_snippets_custom config always erroring 2025-04-21 08:18:11 +02:00
Lukas Wirth
af301a88ec Back out "When changing the config, do not emit an error if a field is missing"
This backs out commit 8497fc321c.
2025-04-21 08:10:00 +02:00
Chayim Refael Friedman
db6db2aacc Allow wrapping builtin#offset_of fields argument in parentheses
This is necessary to correctly handle nested fields (`foo.bar`), see the comments in the code for explanation.
2025-04-21 03:43:15 +03:00
Chayim Refael Friedman
0f325c7ff8 Remove unnecessary predefined symbol clones
Now that they're const it's no longer needed.

Nothing manual was performed: only a regexp search of `sym::([\w][\w\d]*)\.clone\(\)` and replace by `sym::$1`.
2025-04-21 03:10:13 +03:00
Chayim Refael Friedman
9477e46bec Get rid of static predefined symbols
Make them all `const`.
2025-04-21 03:07:35 +03:00
Chayim Refael Friedman
812a035689 Parse generic consts
A lang team experiment, https://github.com/rust-lang/rust/issues/113521.
2025-04-21 02:11:56 +03:00
Chayim Refael Friedman
8497fc321c When changing the config, do not emit an error if a field is missing 2025-04-20 22:45:25 +03:00
Chayim Refael Friedman
ff62cf63e6 Remove unused macro arm 2025-04-20 22:37:02 +03:00
bbb651
c7cf6bf7c3 doc: Fix dead manual links 2025-04-20 20:28:52 +03:00
bbb651
2ffcb99683 doc: Rework generated configuration to have anchors
Also first line of default code blocks being used as the language instead of json
and fixes a missing `json` language in a doc comment code block.
2025-04-20 19:29:54 +03:00
jackh726
6daa791fab Update chalk 2025-04-20 16:20:08 +00:00
Chayim Refael Friedman
150bb4a00f
Merge pull request #19617 from ChayimFriedman2/more-actual
internal: Make `HirFileId`, `EditionedFileId` and macro files Salsa struct
2025-04-19 19:21:53 +00:00
Chayim Refael Friedman
c58ddafe90 Make HirFileId, EditionedFileId and macro files Salsa struct
And make more queries non-interned.

Also flip the default for queries, now the default is to not intern and to intern a query you need to say `invoke_interned`.
2025-04-19 22:10:52 +03:00
jyn
3b964a7105 allow using null to unset an environment variable
this makes three changes:
- all callsites of `toolchain::command` are changed to use
  `command(path, extra_env)`, instead of manually adding the env after
  the fact.
- all `map<str, str>` are changed to `map<str, option<str>>`.
- `command` checks for None and calls `env_remove` if so.

this caught several places where environment variables weren't being
propagated:
- when running `rustc --print=target-libdir`
- when running `cargo rustc -- --print=target-spec-json`
- when running the custom DiscoverLinkedProjects config. I *think* this
  is for use with non-cargo build systems, so I didn't change it.
2025-04-19 12:15:22 -04:00
jyn
46ce4746e6 don't ignore config values that fail to parse
previously, these would just silently be ignored. now they give a
warning such as:
```
invalid config values: /completion/snippets/custom: invalid type: null, expected a map; /cargo/extraEnv: invalid type: null, expected a string;
```
2025-04-19 10:08:05 -04:00
A4-Tacks
13bdfab6b5
Fix replace_string_with_char escaped char quote 2025-04-19 19:16:44 +08:00
Lukas Wirth
a09a5502c3
Merge pull request #19613 from ChayimFriedman2/subst
fix: Fix a panic when a trait method in an impl declares a lifetime parameter not in the trait declaration
2025-04-18 18:51:14 +00:00
A4-Tacks
9ef1417d45
Support ide-assists raw_string suffix 2025-04-18 22:06:22 +08:00
Chayim Refael Friedman
41227f01d2 Sort notable traits in hover
Previously it was ordered by what accidentally happened to be the crate graph order, which isn't sensible, plus it caused changes when any change was done to salsa IDs.
2025-04-18 12:45:22 +03:00
Lukas Wirth
32052e5054
Merge pull request #19616 from ChayimFriedman2/transparent-diags
internal: Make hir-ty non-diagnostic queries transparent
2025-04-18 08:53:53 +00:00
Chayim Refael Friedman
5e3a914dc2 Make hir-ty non-diagnostic queries transparent
That is, all queries that have a `with_diagnostic` variant.

Them being tracked was (maybe) needed before #19462, because back then diagnostics could refer `AstId`s (for macro types), but now they are no longer needed.
2025-04-18 07:04:13 +03:00
Chayim Refael Friedman
346f2d7559 Fix a panic when a trait method in an impl declares a lifetime parameter not in the trait declaration
Shuffle the code a bit.
2025-04-18 06:28:17 +03:00
Lukas Wirth
71d23b9a6b
Merge pull request #19612 from ChayimFriedman2/parent-generics
fix: Fix a bug with predicate lowering of associated items
2025-04-17 08:17:26 +00:00
Matthias Krüger
0e66ad6b7b
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()]`](6d71251cf9/tests/ui/cfg/true-false.rs)
- [`--cfg=true/false` on the command line being accessible via `r#true/r#false`](6d71251cf9/tests/ui/cfg/raw-true-false.rs)
- [Interaction with the unstable `#[doc(cfg(..))]` feature](6d71251/tests/rustdoc-ui/cfg-boolean-literal.rs)
- [Denying `--check-cfg=cfg(true/false)`](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
Chayim Refael Friedman
e1962d2e22 Fix a bug with predicate lowering of associated items
The essence of the bug is that bounds on `impl Trait` got lowered with incorrect bound vars, as if we were lowering the parent.
2025-04-17 00:19:54 +03:00
Chayim Refael Friedman
0a8f808ebc
Merge pull request #19605 from ChayimFriedman2/fix-sig
minor: Fix signature of libc memory usage function on Linux
2025-04-16 14:08:37 +00:00
Chayim Refael Friedman
1cb9b1cb38 Fix signature of libc memory usage function on Linux
A soundness issue!
2025-04-16 16:56:45 +03:00
Wtz_LASR
c0bc939053 add semicolon to use 2025-04-16 21:13:01 +08:00
Lukas Wirth
1748a84888
Merge pull request #19589 from roife/fix-issue-19138
fix: highlighting for tail expr in labelled blocks
2025-04-16 11:20:05 +00:00
roifewu
cfc28f3148 feat: highlight tail expr when cursor is on label 2025-04-16 19:08:44 +08:00
Lukas Wirth
ea273513ed
Merge pull request #19591 from snprajwal/fix-make-macro
fix: use `ast::TokenTree` in `make::expr_macro`
2025-04-16 07:47:25 +00:00
Lukas Wirth
4bef2bf192
Merge pull request #19590 from roife/fix-issue-19540
feat: add `pub(crate) mod` option for unlinked files
2025-04-16 07:43:43 +00:00
Prajwal S N
243854211c
fix: use ast::TokenTree in make::expr_macro
Signed-off-by: Prajwal S N <prajwalnadig21@gmail.com>
2025-04-16 13:06:42 +05:30
Lukas Wirth
d5a3d14cac
Merge pull request #19596 from roife/sig-help-info
feat: enhance signature help to display generic parameters for callables and default values for generic args
2025-04-16 07:27:21 +00:00
Lukas Wirth
50d6f18349
Merge pull request #19588 from Hmikihiro/ext_func_module
fix: `Extract into` function include inline variable in fmt macro
2025-04-16 07:15:15 +00:00
roifewu
727d4b184d feat: enhance signature help to display generic parameters for callables and default values for generic args 2025-04-16 02:41:08 +08:00
roifewu
7fde3fcd2e feat: Add pub(crate) mod option for unlinked files 2025-04-15 13:12:03 +08:00
roifewu
78503f2d1f feat: highlight tail expression in labeled block 2025-04-15 12:58:38 +08:00
Hayashi Mikihiro
28e34c8d33 fix: `Extract into function include inline variable in fmt macro
Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>
2025-04-15 11:19:50 +09:00
Tyler Breisacher
f9716e4782
Remove incorrect doc comment 2025-04-14 19:05:13 -07:00
Lukas Wirth
7fc29a99ef
Merge pull request #19568 from snprajwal/destructure-struct-editor
refactor: editor for `destructure_struct_binding`
2025-04-14 15:35:00 +00:00
Mara Bos
963d076989 Disable some r-a tests in bootstrap. 2025-04-14 16:53:24 +02:00
Lukas Wirth
aded72f8e6
Merge pull request #19572 from snprajwal/expand-rest-pattern
refactor: migrate `expand_rest_pattern` to editor
2025-04-14 14:50:08 +00:00
Lukas Wirth
dc70a78b03
Merge pull request #19569 from snprajwal/fixmes
fix(ast): return correct types for `make::expr_*` methods
2025-04-14 11:10:27 +00:00
Lukas Wirth
8fb2b3e4d6
Merge pull request #19579 from ChayimFriedman2/cyclic-closure
fix: Prevent panics when there is a cyclic dependency between closures
2025-04-14 10:15:03 +00:00
Chayim Refael Friedman
cdc5ba30fc Prevent panics when there is a cyclic dependency between closures
We didn't include them in the sorted closures list, therefore didn't analyze them, then failed to find them.
2025-04-14 07:12:51 +03:00
yukang
5abe9e66b0 Ignore errors from rustfmt which may trigger error notification 2025-04-14 09:33:38 +08:00
Lukas Wirth
40076b577f internal: Render sigantures with view hir command 2025-04-13 12:13:28 +02:00