Commit Graph

263592 Commits

Author SHA1 Message Date
Matthias Krüger
85eb465a10
Rollup merge of #128912 - compiler-errors:do-not-recommend-impl, r=lcnr
Store `do_not_recommend`-ness in impl header

Alternative to #128674

It's less flexible, but also less invasive. Hopefully it's also performant. I'd recommend we think separately about the design for how to gate arbitrary diagnostic attributes moving forward.
2024-08-12 23:10:51 +02:00
Matthias Krüger
4c49418472
Rollup merge of #128712 - compiler-errors:normalize-borrowck, r=lcnr
Normalize struct tail properly for `dyn` ptr-to-ptr casting in new solver

Realized that the new solver didn't handle ptr-to-ptr casting correctly.

r? lcnr

Built on #128694
2024-08-12 23:10:50 +02:00
Chayim Refael Friedman
aa6e8d3db5 Allow declaring cfg groups in rust-project.json, to help sharing common cfgs 2024-08-12 22:03:16 +03:00
schvv31n
027b19fa9b std::fmt::FormatterFn -> std::fmt::FromFn 2024-08-12 18:33:30 +01:00
Jakub Beránek
6863db5219 Remove unused script from run-make tests 2024-08-12 18:46:06 +02:00
bors
91376f4162 Auto merge of #129008 - GuillaumeGomez:rollup-6citttb, r=GuillaumeGomez
Rollup of 10 pull requests

Successful merges:

 - #128149 (nontemporal_store: make sure that the intrinsic is truly just a hint)
 - #128394 (Unify run button display with "copy code" button and with mdbook buttons)
 - #128537 (const vector passed through to codegen)
 - #128632 (std: do not overwrite style in `get_backtrace_style`)
 - #128878 (Slightly refactor `Flags` in bootstrap)
 - #128886 (Get rid of some `#[allow(rustc::untranslatable_diagnostic)]`)
 - #128929 (Fix codegen-units tests that were disabled 8 years ago)
 - #128937 (Fix warnings in rmake tests on `x86_64-unknown-linux-gnu`)
 - #128978 (Use `assert_matches` around the compiler more)
 - #128994 (Fix bug in `Parser::look_ahead`.)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-08-12 16:31:22 +00:00
Rémy Rakic
2abfa35acd add change tracker notice 2024-08-12 15:28:39 +00:00
Rémy Rakic
ee5d15ce43 regenerate ./x completions
to pick up changes to `./x miri` and `./x test` commands
2024-08-12 15:28:39 +00:00
Rémy Rakic
5e872568a8 rename ./x test's --rustc-args to --compiletest-rustc-args 2024-08-12 15:28:38 +00:00
Rémy Rakic
0ad798aec7 remove unexpected --rustc-args from ./x miri 2024-08-12 15:28:38 +00:00
Rémy Rakic
bc9ca2902e clarify that --rustc-args is for compiletest tests 2024-08-12 15:28:38 +00:00
Rémy Rakic
754f565fe2 don't use --rustc-args to test the stdlib's size optimizations feature 2024-08-12 15:28:38 +00:00
Rémy Rakic
83727eca21 don't use rustflags for --rustc-args 2024-08-12 15:28:38 +00:00
Guillaume Gomez
99a785d62d
Rollup merge of #128994 - nnethercote:fix-Parser-look_ahead-more, r=compiler-errors
Fix bug in `Parser::look_ahead`.

The special case was failing to handle invisible delimiters on one path.

Fixes (but doesn't close until beta backported) #128895.

r? `@davidtwco`
2024-08-12 17:09:20 +02:00
Guillaume Gomez
7c6dca9050
Rollup merge of #128978 - compiler-errors:assert-matches, r=jieyouxu
Use `assert_matches` around the compiler more

It's a useful assertion, especially since it actually prints out the LHS.
2024-08-12 17:09:19 +02:00
Guillaume Gomez
bb35b888b5
Rollup merge of #128937 - lqd:clean-rmake-tests, r=jieyouxu
Fix warnings in rmake tests on `x86_64-unknown-linux-gnu`

r? `@jieyouxu`

This PR fixes some warnings I saw in rmake tests. I didn't deny more warnings in this PR until `@jieyouxu` gives their opinion, but maybe we should actually deny all warnings in `rmake.rs` files?

I've also only looked at non-ignored tests on `x86_64-unknown-linux-gnu`, and denying warnings would require a try build for all targets 😓.
2024-08-12 17:09:19 +02:00
Guillaume Gomez
5b6379a86d
Rollup merge of #128929 - saethlin:enable-codegen-units-tests, r=compiler-errors
Fix codegen-units tests that were disabled 8 years ago

I don't know if any of these tests still have value. They were disabled by https://github.com/rust-lang/rust/pull/33890, and we've survived without them for a while. But considering how small this test suite is, maybe it's worth having them.

I also had to add some normalization to the codegen-units tests output. I think the fact that I had to add some underscores how poor our test coverage is.
2024-08-12 17:09:18 +02:00
Guillaume Gomez
ea74eff55c
Rollup merge of #128886 - GrigorenkoPV:untranslatable-diagnostic, r=nnethercote
Get rid of some `#[allow(rustc::untranslatable_diagnostic)]`

`@rustbot` label +A-translation
cc https://github.com/rust-lang/rust/issues/100717
2024-08-12 17:09:17 +02:00
Guillaume Gomez
355a23292a
Rollup merge of #128878 - Kobzol:refactor-flags, r=onur-ozkan
Slightly refactor `Flags` in bootstrap

The next step for https://github.com/rust-lang/rust/issues/126819 is to track commands executed inside `Config::parse`. This is quite challenging, because (tracked) command execution needs to access some state that is stored inside `Config`, which creates a sort of a chicken-and-egg problem.

I would like to first untangle `Config::parse` a little bit, which is what this PR starts with.

Tracking issue: https://github.com/rust-lang/rust/issues/126819

r? `@onur-ozkan`
2024-08-12 17:09:17 +02:00
Guillaume Gomez
aa6f240972
Rollup merge of #128632 - joboet:dont_overwrite_style, r=Amanieu
std: do not overwrite style in `get_backtrace_style`

If another thread calls `set_backtrace_style` while a `get_backtrace_style` is reading the environment variables, `get_backtrace_style` will overwrite the value. Use an atomic CAS to avoid this.
2024-08-12 17:09:16 +02:00
Guillaume Gomez
aea5087964
Rollup merge of #128537 - Jamesbarford:118980-const-vector, r=RalfJung,nikic
const vector passed through to codegen

This allows constant vectors using a repr(simd) type to be propagated
through to the backend by reusing the functionality used to do a similar
thing for the simd_shuffle intrinsic

#118209

r​? RalfJung
2024-08-12 17:09:15 +02:00
Guillaume Gomez
c6e3385d95
Rollup merge of #128394 - GuillaumeGomez:run-button, r=t-rustdoc
Unify run button display with "copy code" button and with mdbook buttons

Follow-up of https://github.com/rust-lang/rust/pull/128339.

It looks like this (coherency++, yeay!):

![Screenshot from 2024-07-30 15-16-31](https://github.com/user-attachments/assets/5e262e5b-f338-4085-94ca-e223033a43db)

Can be tested [here](https://rustdoc.crud.net/imperio/run-button/foo/struct.Bar.html).

r? `@notriddle`
2024-08-12 17:09:15 +02:00
Guillaume Gomez
095ca33bb6
Rollup merge of #128149 - RalfJung:nontemporal_store, r=jieyouxu,Amanieu,Jubilee
nontemporal_store: make sure that the intrinsic is truly just a hint

The `!nontemporal` flag for stores in LLVM *sounds* like it is just a hint, but actually, it is not -- at least on x86, non-temporal stores need very special treatment by the programmer or else the Rust memory model breaks down. LLVM still treats these stores as-if they were normal stores for optimizations, which is [highly dubious](https://github.com/llvm/llvm-project/issues/64521). Let's avoid all that dubiousness by making our own non-temporal stores be truly just a hint, which is possible on some targets (e.g. ARM). On all other targets, non-temporal stores become regular stores.

~~Blocked on https://github.com/rust-lang/stdarch/pull/1541 propagating to the rustc repo, to make sure the `_mm_stream` intrinsics are unaffected by this change.~~

Fixes https://github.com/rust-lang/rust/issues/114582
Cc `@Amanieu` `@workingjubilee`
2024-08-12 17:09:14 +02:00
Shoyu Vanilla
81561ff168 fix: Trailing excess comma in "Convert to named struct" assist 2024-08-12 23:36:28 +09:00
bors
0a336b3934 Auto merge of #17865 - ShoyuVanilla:exhaust-block, r=Veykril
fix: Missing non-exhaustive let diagnostics inside async or unsafe block

The reason that this test doesn't have a pointer deref case is because the following code;
```rust
fn test(ptr: *const Result<i32, !>) {
    unsafe {
        let Ok(_x) = *ptr;
    }
}
```
is getting a block with no stmts but tail one in here(thus, no diagnostic error),
0daeb5c0b0/crates/hir-ty/src/diagnostics/expr.rs (L256-L257)
while the following is getting a block with a single stmt without tail 🤔
```rust
fn test(x: Result<i32, &'static !>) {
    let Ok(_y) = x;
}
```
I'll make a more deep inspection and file this as a new issue

_Originally posted by `@ShoyuVanilla` in https://github.com/rust-lang/rust-analyzer/pull/17853#discussion_r1712993585_
2024-08-12 14:34:10 +00:00
Shoyu Vanilla
3bb7f35ec4 fix: Missing non-exhaustive let diagnostics inside async or unsafe block 2024-08-12 23:19:03 +09:00
bors
e66f3db9fa Auto merge of #17864 - Veykril:lsif, r=Veykril
fix: Build and run build scripts in lsif command
2024-08-12 12:34:31 +00:00
Lukas Wirth
1b983e33c6 Build and run build scripts in lsif command 2024-08-12 14:33:11 +02:00
bors
ff63552892 Auto merge of #17863 - Veykril:include-diags, r=Veykril
fix: Resolve included files to their calling modules in IDE layer

Fixes https://github.com/rust-lang/rust-analyzer/issues/17390 at the expense of reporting duplicate diagnostics for modules that have includes in them when both the calling and called file are included.
2024-08-12 11:48:32 +00:00
Lukas Wirth
1ebd727255 Resolve included files to their calling modules in IDE layer 2024-08-12 13:45:33 +02:00
bors
bdc0b7859f Auto merge of #17861 - Veykril:bump-lock, r=Veykril
minor: Bump lockfile
2024-08-12 11:05:08 +00:00
Lukas Wirth
9431039e8a Allow new license combination 2024-08-12 12:51:47 +02:00
bors
a2b10a39bc Auto merge of #17862 - lnicola:publish-libs-members, r=lnicola
Only keep lib/ in publish-libs

Follow-up to #17860, see https://github.com/rust-lang/rust-analyzer/actions/runs/10350212090/job/28646162590.
2024-08-12 10:50:59 +00:00
Laurențiu Nicola
696ecea575 Only keep lib/ in publish-libs 2024-08-12 13:45:38 +03:00
bors
5e753ffe25 Auto merge of #17850 - Veykril:rust-analyzer-crate, r=Veykril
internal: Reply to requests with defaults when vfs is still loading

There is no reason for us to hit the database with queries when we certainly haven't reached a stable state yet. Instead we just reply with default request results until we are in a state where we can do meaningful work. This should save us from wasting resources while starting up at worst, and at best save us from creating query and interning entries that are non-meaningful which ultimately just end up wasting memory.
2024-08-12 10:21:06 +00:00
bors
e08b80c0fb Auto merge of #128371 - andjo403:rangeAttribute, r=nikic
Add range attribute to scalar function results and arguments

as LLVM 19 adds the range attribute this starts to use it for better optimization.
hade been interesting to see a perf run with the https://github.com/rust-lang/rust/pull/127513

closes https://github.com/rust-lang/rust/issues/50156
cc https://github.com/rust-lang/rust/issues/49572 shall be fixed but not possible to see as there is asserts that already trigger the optimization.
2024-08-12 10:20:00 +00:00
Ralf Jung
6839a8f6d5 bootstrap: clear miri ui-test deps when miri sysroot gets rebuilt 2024-08-12 12:12:33 +02:00
bors
563dc1cd33 Auto merge of #17860 - Veykril:publish-libs, r=Veykril
fix: Fix publish libs workflow
2024-08-12 10:06:38 +00:00
Lukas Wirth
234d383f5f internal: Reply to requests with defaults when vfs is still loading 2024-08-12 12:05:15 +02:00
Lukas Wirth
407944764a fix: Fix publish libs workflow 2024-08-12 11:52:04 +02:00
Lukas Wirth
69f613892a minor: Bump lockfile 2024-08-12 11:51:43 +02:00
Ralf Jung
75743dc5a0 make the codegen test also cover an ill-behaved arch, and add links 2024-08-12 11:42:38 +02:00
bors
7c53ff2da4 Auto merge of #17843 - mo8it:flycheck, r=Veykril
internal: Performance optimizations

- Use `Command::arg` directly
- Avoid the overhead of the `select!` macro when possible
- Use `select_biased!`
2024-08-12 09:27:47 +00:00
bors
c2d1555788 Auto merge of #17842 - mo8it:crossbeam-channel, r=Veykril
internal: Optimize the usage of channel senders

Used `Sender` directly instead of a boxed closure. There is no need to use the boxed closure. This also allows the caller to decide to do something other than `unwrap` (not a fan of it BTW).
2024-08-12 09:13:37 +00:00
bors
757b0a5ace Auto merge of #17859 - Veykril:rustc_deprecated_safe_2024, r=Veykril
fix: Correctly support `#[rustc_deprecated_safe_2024]`

Fixes https://github.com/rust-lang/rust-analyzer/issues/17852
2024-08-12 08:59:08 +00:00
Lukas Wirth
3355c788f1 fix: Correctly support #[rustc_deprecated_safe_2024] 2024-08-12 10:56:59 +02:00
mo8it
f7c4716dbf Use the send method 2024-08-12 10:55:04 +02:00
mo8it
285285d3fd Add more track_caller 2024-08-12 10:54:46 +02:00
mo8it
7586ba6bfb Add track_caller 2024-08-12 10:44:00 +02:00
mo8it
94bd4da3f1 Revert "Remove unneeded send method"
This reverts commit 567bde603cfeedb5cfc44e441578c5416bfc4f35.
2024-08-12 10:42:35 +02:00