Commit graph

32506 commits

Author SHA1 Message Date
Lukas Wirth
edb432639b
Merge pull request #18609 from ChayimFriedman2/unsafe-coverage
feat: Extend reported unsafe operations
2024-12-04 06:40:40 +00:00
Lukas Wirth
99c9a9942a
Merge pull request #18604 from ChayimFriedman2/complete-helpers
feat: Complete derive helper attributes
2024-12-04 06:33:29 +00:00
Chayim Refael Friedman
327b8c9f93 Extend reported unsafe operations
We add union fields access (in both expressions and patterns) and inline assembly.

That completes the unsafe check (there are some other unsafe things but they are unstable), and so also opens the door to reporting unused unsafe without annoying people about their not-unused unsafe blocks.
2024-12-04 08:27:59 +02:00
Chayim Refael Friedman
890d155ffe Complete derive helper attributes
Only their names, anything can go inside.
2024-12-04 08:20:41 +02:00
Lukas Wirth
ab652f7795
Merge pull request #18608 from Veykril/push-rrozmpnyknkx
Better parser recovery for paths
2024-12-04 06:18:39 +00:00
Lukas Wirth
83f5150978 Update mbe test output 2024-12-04 07:03:11 +01:00
Lukas Wirth
caba872f88 fix: Don't create empty path nodes 2024-12-04 07:01:45 +01:00
Lukas Wirth
b6fc9c14ac Better parser recovery for incomplete attributes 2024-12-04 06:45:59 +01:00
Lukas Wirth
308f5e2814
Merge pull request #18522 from tareknaser/configure_typing_exclude_chars
Add Configurable Option to Exclude Trigger Characters for Typing Assists
2024-12-04 05:17:40 +00:00
Lukas Wirth
4b4cec882a
Merge pull request #18605 from ChayimFriedman2/wildcard-imports
fix: Fixed another bug with glob imports
2024-12-04 05:15:46 +00:00
Laurențiu Nicola
c195d843f4
Merge pull request #18595 from markmurphydev/remove_platform_intrinsic
Remove references to platform-intrinsic ABI
2024-12-04 04:07:25 +00:00
Laurențiu Nicola
273d481922
Merge pull request #18607 from ChayimFriedman2/pattern-record-no-record
fix: Fix shadowing of record enum variant in patterns
2024-12-04 03:51:41 +00:00
Laurențiu Nicola
06fbbd5440
Merge pull request #18606 from ChayimFriedman2/improve-soundness-just-a-bit
minor: Improve soundness a bit by making `TaggedArcPtr::try_as_arc_owned()` unsafe
2024-12-04 03:44:01 +00:00
Chayim Refael Friedman
4ec7e61229 Fix shadowing of record enum variant in patterns 2024-12-04 04:02:54 +02:00
Chayim Refael Friedman
3aeb5e66c4 Improve soundness a bit by making TaggedArcPtr::try_as_arc_owned() unsafe
Since the `ManuallyDrop` it returns can be safely used to consume the `Arc`, which is can cause UB if done incorrectly. See #18499.
2024-12-04 03:38:37 +02:00
Chayim Refael Friedman
215cbe9e71 Fixed another bug with glob imports
When a glob import overriding the visibility of a previous glob import was not properly resolved when the items are only available in the next fixpoint iteration.

The bug was hidden until #18390.
2024-12-04 03:15:32 +02:00
Mark Murphy
1dbe681757 Remove references to platform-intrinsic ABI 2024-12-03 17:30:17 -05:00
Tarek
9aff46632e chore: deprecate typing.autoClosingAngleBrackets configuration
Signed-off-by: Tarek <tareknaser360@gmail.com>
2024-12-03 22:38:51 +02:00
Tarek
d6b701e251 internal: Make exclude characters for typing assists configurable, default to None
Signed-off-by: Tarek <tareknaser360@gmail.com>
2024-12-03 22:38:51 +02:00
Chayim Refael Friedman
4049c3b6a9 Support AsyncFnX traits
Only in calls, because to support them in bounds we need support from Chalk. However we don't yet report error from bounds anyway, so this is less severe.

The returned future is shown in its name within inlay hints instead of as a nicer `impl Future`, but that can wait for another PR.
2024-12-03 21:26:26 +02:00
Lukas Wirth
e6276c8b64
Merge pull request #18555 from ChayimFriedman2/issue-17321
fix: Fix a bug when synthetic AST node were searched in the AST ID map and caused panics
2024-12-03 15:39:52 +00:00
Lukas Wirth
a74c90b5d3
Merge pull request #18592 from darichey/status-bar-visibility
vscode: Only show status bar item in relevant files
2024-12-03 14:53:35 +00:00
David Richey
cf80dddb59 Only show status bar item in relevant files 2024-12-03 14:40:26 +00:00
bors
bedc7d7ba4 Auto merge of #104342 - mweber15:add_file_location_to_more_types, r=wesleywiser
Require `type_map::stub` callers to supply file information

This change attaches file information (`DIFile` reference and line number) to struct debug info nodes.

Before:

```
; foo.ll
...
!5 = !DIFile(filename: "<unknown>", directory: "")
...
!16 = !DICompositeType(tag: DW_TAG_structure_type, name: "MyType", scope: !2, file: !5, size: 32, align: 32, elements: !17, templateParams: !19, identifier: "4cb373851db92e732c4cb5651b886dd0")
...
```

After:

```
; foo.ll
...
!3 = !DIFile(filename: "foo.rs", directory: "/home/matt/src/rust98678", checksumkind: CSK_SHA1, checksum: "bcb9f08512c8f3b8181ef4726012bc6807bc9be4")
...
!16 = !DICompositeType(tag: DW_TAG_structure_type, name: "MyType", scope: !2, file: !3, line: 3, size: 32, align: 32, elements: !17, templateParams: !19, identifier: "9e5968c7af39c148acb253912b7f409f")
...
```

Fixes #98678

r? `@wesleywiser`
2024-12-03 12:49:57 +00:00
Lukas Wirth
c4e040ea8d
Merge pull request #18589 from SomeoneToIgnore/proper-resolve-advertisement
Advertise completions and inlay hints resolve server capabilities based on the client capabilities
2024-12-03 09:24:14 +00:00
Kirill Bulatov
4261ac7856 Advertise completions and inlay hints resolve server capabilities based on the client capabilities. 2024-12-03 10:51:17 +02:00
bors
5df5ee06a9 Auto merge of #133321 - compiler-errors:const-checker, r=wesleywiser
Get rid of HIR const checker

As far as I can tell, the HIR const checker was implemented in https://github.com/rust-lang/rust/pull/66170 because we were not able to issue useful const error messages in the MIR const checker.

This seems to have changed in the last 5 years, probably due to work like #90532. I've tweaked the diagnostics slightly and think the error messages have gotten *better* in fact.

Thus I think the HIR const checker has reached the end of its usefulness, and we can retire it.

cc `@RalfJung`
2024-12-03 04:39:48 +00:00
bors
ffa39d4692 Auto merge of #133770 - GuillaumeGomez:rollup-l62iyyx, r=GuillaumeGomez
Rollup of 10 pull requests

Successful merges:

 - #131713 (Stabilize `const_maybe_uninit_write`)
 - #133535 (show forbidden_lint_groups in future-compat reports)
 - #133610 (Move `Const::{from_anon_const,try_from_lit}` to hir_ty_lowering)
 - #133701 (Use c"lit" for CStrings without unwrap)
 - #133704 (fix ICE when promoted has layout size overflow)
 - #133705 (add "profiler" and "optimized-compiler-builtins" option coverage for ci-rustc)
 - #133710 (Reducing `target_feature` check-cfg merge conflicts)
 - #133732 (Fix `-Zdump-mir-dataflow`)
 - #133746 (Change `AttrArgs::Eq` to a struct variant)
 - #133763 (Fix `f16::midpoint` const feature gate)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-12-03 00:51:25 +00:00
Guillaume Gomez
445b974696
Rollup merge of #133763 - Urgau:f16-midpoint-const-feat, r=Amanieu
Fix `f16::midpoint` const feature gate

cc https://github.com/rust-lang/rust/pull/131784#discussion_r1866074470
2024-12-02 23:08:59 +01:00
Guillaume Gomez
b765108fb1
Rollup merge of #133746 - oli-obk:push-xwyrylxmrtvq, r=jieyouxu
Change `AttrArgs::Eq` to a struct variant

Cleanups for simplifying https://github.com/rust-lang/rust/pull/131808

Basically changes `AttrArgs::Eq` to a struct variant and then avoids several matches on `AttrArgsEq` in favor of methods on it. This will make future refactorings simpler, as they can either keep methods or switch to field accesses without having to restructure code
2024-12-02 23:08:58 +01:00
Guillaume Gomez
b042adc338
Rollup merge of #133732 - nnethercote:fix-Z-dump-mir-dataflow, r=compiler-errors
Fix `-Zdump-mir-dataflow`

r? `@cjgillot`
2024-12-02 23:08:57 +01:00
Guillaume Gomez
4aed50c883
Rollup merge of #133710 - Urgau:target_feature-merge-conflitcs, r=jieyouxu
Reducing `target_feature` check-cfg merge conflicts

It was rightfully pointed in https://github.com/rust-lang/rust/pull/133099#discussion_r1862490542 that the expected values for the `target_feature` cfg are regularly updated and unfortunately the check-cfg tests for it are very merge-conflict prone.

This PR aims at drastically reducing the likely-hood of those, by normalizing the "and X more" diagnostic, as well as making the full expected list multi-line instead of being on a single one.

cc `@RalfJung`
r? `@jieyouxu`
2024-12-02 23:08:57 +01:00
Guillaume Gomez
591542695a
Rollup merge of #133705 - onur-ozkan:profiler-check, r=jieyouxu
add "profiler" and "optimized-compiler-builtins" option coverage for ci-rustc

Adds "profiler" and "optimized-compiler-builtins" option coverage in CI-rustc config compatibility check.

Resolves #133675
2024-12-02 23:08:56 +01:00
Guillaume Gomez
5b8a020cc5
Rollup merge of #133704 - RalfJung:promoted-size-overflow-ice, r=compiler-errors
fix ICE when promoted has layout size overflow

Turns out there is no reason to distinguish `tainted_by_errors` and `can_be_spurious` here, we can just track whether we allow this even in "infallible" constants.

Fixes https://github.com/rust-lang/rust/issues/125476
2024-12-02 23:08:55 +01:00
Guillaume Gomez
d9c0f46090
Rollup merge of #133701 - kornelski:c-str, r=workingjubilee
Use c"lit" for CStrings without unwrap

I've reviewed uses of `CString::new("lit")`.

Some could be changed to `c"lit"`. Some could be changed to `c"lit".to_owned()`, avoiding an `unwrap()`.

Many `CString` documentation examples could be simplified. I deliberately haven't changed all the examples to use the exact same expression, so that they can demonstrate many ways of creating `CString`s.

I've left UI tests mostly unchanged, because `c""` requires edition 2021, but most UI tests use 2015, and I didn't want to accidentally change what the tests are testing.
2024-12-02 23:08:55 +01:00
Guillaume Gomez
60677d06bf
Rollup merge of #133535 - RalfJung:forbidden_lint_groups-future-compat, r=davidtwco
show forbidden_lint_groups in future-compat reports

Part of https://github.com/rust-lang/rust/issues/81670. This has been a future-compat lint for a while, time to dial it up to show up in reports.
2024-12-02 23:08:53 +01:00
Kornel
8e51a0a75c
Use c"lit" for CStrings without unwrap 2024-12-02 18:16:36 +00:00
Lukas Wirth
aa38be893c
Merge pull request #18561 from markmurphydev/macro_name_raw_variable
Add macro expansion test for raw variable names
2024-12-02 16:23:07 +00:00
Lukas Wirth
8762a4f9be
Merge pull request #18587 from Veykril/push-urrlrursyrws
fix: Fix syntax fixup inserting unnecessary semicolons
2024-12-02 12:50:28 +00:00
Lukas Wirth
e7b96dd2de fix: Fix syntax fixup inserting unnecessary semicolons 2024-12-02 13:35:58 +01:00
Lukas Wirth
d8c162beb1
Merge pull request #18586 from Veykril/push-kolxkxyntxtt
fix: Fix debug configuration querying not inheriting environment
2024-12-02 12:16:33 +00:00
Lukas Wirth
d75f996722 Fix debug configuration querying not inheriting environment 2024-12-02 13:02:31 +01:00
bors
820353a40f Auto merge of #133532 - rami3l:ci/bump-ubuntu, r=Kobzol
Bump unsupported `ubuntu` CI images to 24.04 LTS

Closes #133531.

try-job: arm-android
try-job: dist-android
try-job: dist-ohos
2024-12-01 16:57:16 +00:00
bors
e0047a6754 Auto merge of #133499 - nikic:no-backend-verify, r=Mark-Simulacrum
Respect verify-llvm-ir option in the backend

We are currently unconditionally verifying the LLVM IR in the backend (twice), ignoring the value of the verify-llvm-ir option. This has substantial compile-time impact for debug builds.
2024-12-01 04:54:02 +00:00
Laurențiu Nicola
b65911d5ee
Merge pull request #18577 from compiler-errors/redundant-dyn-atb
Remove redundant associated type bounds from `dyn TypeFolder`
2024-11-30 03:55:01 +00:00
Michael Goulet
29d59c58d8 Remove redundant associated type bounds from dyn 2024-11-30 03:33:33 +00:00
bors
6a47267bc7 Auto merge of #133533 - BoxyUwU:bump-boostrap, r=jieyouxu,Mark-Simulacrum
Bump boostrap compiler to new beta

Currently failing due to something about the const stability checks and `panic!`. I'm not sure why though since I wasn't able to see any PRs merged in the past few days that would result in a `cfg(bootstrap)` that shouldn't be removed. cc `@RalfJung` #131349
2024-11-29 22:39:10 +00:00
bors
2aa3eb65f0 Auto merge of #133431 - nnethercote:rm-HybridBitSet, r=Mark-Simulacrum
Remove `HybridBitSet`

`HybridBitSet` was introduced under the name `HybridIdxSetBuf` way back in #53383 where it was a big win for NLL borrow checker performance. In #93984 the more flexible `ChunkedBitSet` was added. Uses of `HybridBitSet` have gradually disappeared (e.g. #116152) and there are now few enough that they can be replaced with `BitSet` or `ChunkedBitSet`, and `HybridBitSet` can be removed, cutting more than 700 lines of code.

r? `@Mark-Simulacrum`
2024-11-29 09:03:50 +00:00
bors
73bfe3ca50 Auto merge of #133409 - RalfJung:target-consistency, r=lcnr
ensure JSON-defined targets are consistent

We have a `check_consistency` check that ensures some invariants which (presumably) the rest of the compiler relies on. However, JSON targets can easily be written in a way that violates those invariants. So this PR applies the same consistency check to JSON targets that we already enforce for built-in targets.

I have converted many of the assertions in that function to new macros that show a nice error instead of a panic; if people are okay with the general approach here, I can do that for the rest of the checks as well.
2024-11-29 01:35:20 +00:00
bors
3de0a642fc Auto merge of #123244 - Mark-Simulacrum:share-inline-never-generics, r=saethlin
Enable -Zshare-generics for inline(never) functions

This avoids inlining cross-crate generic items when possible that are
already marked inline(never), implying that the author is not intending
for the function to be inlined by callers. As such, having a local copy
may make it easier for LLVM to optimize but mostly just adds to binary
bloat and codegen time. In practice our benchmarks indicate this is
indeed a win for larger compilations, where the extra cost in dynamic
linking to these symbols is diminished compared to the advantages in
fewer copies that need optimizing in each binary.

It might also make sense it expand this with other heuristics (e.g.,
`#[cold]`) in the future, but this seems like a good starting point.

FWIW, I expect that doing cleanup in where we make the decision
what should/shouldn't be shared is also a good idea. Way too
much code needed to be tweaked to check this. But I'm hoping
to leave that for a follow-up PR rather than blocking this on it.
2024-11-28 21:44:34 +00:00