Commit Graph

232528 Commits

Author SHA1 Message Date
Ralf Jung
44cc3105b1 stable_mir: docs clarification 2023-08-21 13:55:17 +02:00
Bruce Mitchener
fd2982c0a7 Fix syntax in E0191 explanation.
This trait needs `dyn` in modern Rust.

Fixes #115042.
2023-08-21 18:45:51 +07:00
bors
b131febeb0 Auto merge of #115048 - lnicola:sync-from-ra, r=lnicola
⬆️ `rust-analyzer`
2023-08-21 11:16:53 +00:00
Dmitry Murzin
07b57f9a7a
Add suggestion for some #[deprecated] items 2023-08-21 12:51:51 +03:00
Laurențiu Nicola
e7ef5d8619 Merge commit '9b3d03408c66749d56466bb09baf2a7177deb6ce' into sync-from-ra 2023-08-21 12:44:09 +03:00
bors
5e9d3d8a03 Auto merge of #106561 - GuillaumeGomez:warning-block, r=rustdoc
Add warning block support in rustdoc

Fixes https://github.com/rust-lang/rust/issues/79710.

You can test it [here](https://rustdoc.crud.net/imperio/warning-block/foo/struct.Foo.html). It currently looks like this:

![image](https://user-images.githubusercontent.com/3050060/211413494-e1cf04e4-c081-4a9d-97db-27329405cfa7.png)

So a few things to note:

 * Since it's a new add and it's changing the UI, we'll need to go through an FCP.
 * Does the UI looks good?
 * Is the way picked to add a warning block ok for everyone? The discussion on the issue seemed to be in favour of this solution but it doesn't hurt to double-check.

cc `@rust-lang/rustdoc`
2023-08-21 09:26:02 +00:00
bors
9b3d03408c Auto merge of #15490 - RalfJung:check-invocation-help, r=Veykril
fix help text for rust-analyzer.check.invocation{Strategy,Location}

I highly doubt that `check.invocationLocation` only has an effect if `cargo.buildScripts.overrideCommand` is set -- looks like a copy-paste mistake from `buildScripts.invocationLocation` to me.
2023-08-21 08:06:50 +00:00
Ralf Jung
887cc48ba8 fix help text for rust-analyzer.check.invocation{Strategy,Location} 2023-08-21 09:54:24 +02:00
bors
a5ba57e415 Auto merge of #3034 - RalfJung:ra, r=RalfJung
update recommended RA config

Looks like rust-analyzer.checkOnSave.overrideCommand got renamed to rust-analyzer.check.overrideCommand.
2023-08-21 07:38:54 +00:00
bors
a3892f0ed9 Auto merge of #15374 - jmintb:extern_crate, r=Veykril
feat: Implement extern crate completion

Hi, this is a draft PR for #13002.

I have basic completion working as well as a filter for existing extern crate imports in the same file. This is based on the tests, I have not actually tried this in an editor. Before going further I think this is a good point to stop and get feedback on the
structure and approach I have taken so far. Let me know what you think :)

I will make sure to add more tests, rebase commits and align with the code style guidelines before submitting a final version.

A few specific questions :
1. Is there a better way to check for matching suggestions? right now I just test if an extern crate name starts with the current
user input.
2. Am I creating the `CompletionItem` correctly? I noticed that `use_.rs` invokes a builder where as I do not.
3. When checking for existing extern crate imports the current implementation only looks at the current source file, is that sufficient?
2023-08-21 07:38:29 +00:00
Ralf Jung
2f6ffa923e fix MIRI_AUTO_OPS not having an effect any more 2023-08-21 09:38:06 +02:00
Ralf Jung
5615562b68 update recommended RA config 2023-08-21 09:37:54 +02:00
bors
83ca92243c Auto merge of #3033 - rust-lang:rustup-2023-08-21, r=RalfJung
Automatic sync from rustc
2023-08-21 06:00:57 +00:00
The Miri Conjob Bot
5356aa4304 fmt 2023-08-21 05:39:33 +00:00
The Miri Conjob Bot
f2fb4633f1 Merge from rustc 2023-08-21 05:37:04 +00:00
The Miri Conjob Bot
c05fb4cbf9 Preparing for merge from rustc 2023-08-21 05:29:21 +00:00
bors
c40cfcf049 Auto merge of #115035 - ShE3py:getsetenv-miri-test, r=thomcc
Add data race test to `std::env::{get, set}`

Complements #114968, closes #114949.
2023-08-21 03:31:53 +00:00
bors
8a562f9671 Auto merge of #115023 - GuillaumeGomez:migrate-gui-test-color-35, r=notriddle
Migrate GUI colors test to original CSS color format

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

r? `@notriddle`
2023-08-21 01:45:40 +00:00
Jack Huey
31032ecb15 Add projection obligations when comparing impl too 2023-08-20 21:13:52 -04:00
bors
c60ff10ffd Auto merge of #115029 - ehuss:remove-apple-alt, r=Mark-Simulacrum
Remove apple-alt dist build.

This removes the dist-x86_64-apple-alt build to reduce CI usage because I suspect nobody is using it. This builder is almost identical to the `dist-x86_64-apple` with the small difference that the latter adds `rust.lto=thin`, and I do not think that difference was intentional. The reason they are identical is because llvm assertions were disabled in #44610, but I did not see any discussion about the consequence that this made the alt build identical to the normal build. Perhaps because #44610 was intended to be temporary?
2023-08-21 00:03:27 +00:00
bors
5c6a7e71cd Auto merge of #114993 - RalfJung:panic-nounwind, r=fee1-dead
interpret/miri: call the panic_nounwind machinery the same way codegen does
2023-08-20 22:01:18 +00:00
bors
85ee7e6b46 Auto merge of #115034 - Mark-Simulacrum:bump-version, r=Mark-Simulacrum
Bump version to 1.74.0

r? `@Mark-Simulacrum`
2023-08-20 19:56:27 +00:00
ShE3py
f8a2f31ae4
Add data race test to std::env::{get, set} 2023-08-20 21:50:45 +02:00
bors
b053db25cc Auto merge of #114563 - Mark-Simulacrum:relnotes, r=Mark-Simulacrum
Add release notes for 1.72.0

r? `@cuviper` `@rust-lang/release`
2023-08-20 18:09:59 +00:00
Mark Rousskov
af57ba27dd Bump version to 1.74.0 2023-08-20 14:02:00 -04:00
Jessie Chatham Spencer
37e0e8af10 Implement extern crate completion 2023-08-20 16:36:59 +00:00
Ralf Jung
0277351fdd fix RA build 2023-08-20 18:31:22 +02:00
bors
def52ba2b8 Auto merge of #115024 - RalfJung:anyhow, r=lqd
update anyhow

This is the anyhow version of https://github.com/rust-lang/rust/pull/114944, fixing Miri builds with an existing x.py cache by including https://github.com/dtolnay/anyhow/pull/320.

r? `@lqd`
2023-08-20 16:21:23 +00:00
Eric Huss
889b55bb25 Remove apple-alt dist build. 2023-08-20 08:34:41 -07:00
bors
92217bb93d Auto merge of #3032 - RalfJung:serde, r=RalfJung,oli-obk
pin a version of serde without intransparent unreproducible binary blobs

Serde is [shipping a binary blob in its derive crate](https://github.com/serde-rs/serde/issues/2538), which is highly unexpected and subverts user trust. To make matters worse, the binary is [not even reproducible](https://github.com/serde-rs/serde/issues/2575), making the crate largely unauditable and relinquishing the security benefits of open-source software. Build times are not nearly painful enough to justify forcing users to trust binary blobs.
2023-08-20 14:44:52 +00:00
Ralf Jung
44fa4cdf94 pin a version of serde without intransparent unreproducible binary blobs 2023-08-20 16:31:10 +02:00
Ralf Jung
83283a437e update anyhow 2023-08-20 15:55:33 +02:00
Ralf Jung
49b5701df6 sync printing of MIR terminators with their new names (and dedup some to-str logic) 2023-08-20 15:52:40 +02:00
Ralf Jung
807e5b8022 avoid return in tail position
Co-authored-by: fee1-dead <ent3rm4n@gmail.com>
2023-08-20 15:52:40 +02:00
Ralf Jung
ac3bca24b7 interpret: have assert_* intrinsics call the panic machinery instead of a direct abort 2023-08-20 15:52:40 +02:00
Ralf Jung
788fd44a3b interpret/miri: call panic_cannot_unwind lang item instead of hard-coding the same message 2023-08-20 15:52:40 +02:00
Ralf Jung
818ec8e23a give some unwind-related terminators a more clear name 2023-08-20 15:52:38 +02:00
bors
0510a1526d Auto merge of #114791 - Zalathar:bcb-counter, r=cjgillot
coverage: Give the instrumentor its own counter type, separate from MIR

Within the MIR representation of coverage data, `CoverageKind` is an important part of `StatementKind::Coverage`, but the `InstrumentCoverage` pass also uses it heavily as an internal data structure. This means that any change to `CoverageKind` also needs to update all of the internal parts of `InstrumentCoverage` that manipulate it directly, making the MIR representation difficult to modify.

---

This change fixes that by giving the instrumentor its own `BcbCounter` type for internal use, which is then converted to a `CoverageKind` when injecting coverage information into MIR.

The main change is mostly mechanical, because the initial `BcbCounter` is drop-in compatible with `CoverageKind`, minus the unnecessary `CoverageKind::Unreachable` variant.

I've then removed the `function_source_hash` field from `BcbCounter::Counter`, as a small example of how the two types can now usefully differ from each other. Every counter in a MIR-level function should have the same source hash, so we can supply the hash during the conversion to `CoverageKind::Counter` instead.

---

*Background:* BCB stands for “basic coverage block”, which is a node in the simplified control-flow graph used by coverage instrumentation. The instrumentor pass uses the function's actual MIR control-flow graph to build a simplified BCB graph, then assigns coverage counters and counter expressions to various nodes/edges in that simplified graph, and then finally injects corresponding coverage information into the underlying MIR.
2023-08-20 13:37:47 +00:00
Guillaume Gomez
f2f999e7b2 Migrate GUI colors test to original CSS color format 2023-08-20 14:44:36 +02:00
bors
c0b6ffaaea Auto merge of #114990 - Zoxc:else-if-overflow, r=cjgillot
Fix a stack overflow with long else if chains

This fixes stack overflows when running the `issue-74564-if-expr-stack-overflow.rs` test with the parallel compiler.
2023-08-20 11:48:37 +00:00
bors
ff55fa3026 Auto merge of #113124 - nbdd0121:eh_frame, r=cjgillot
Add MIR validation for unwind out from nounwind functions + fixes to make validation pass

`@Nilstrieb`  This is the MIR validation you asked in https://github.com/rust-lang/rust/pull/112403#discussion_r1222739722.

Two passes need to be fixed to get the validation to pass:
* `RemoveNoopLandingPads` currently unconditionally introduce a resume block (even there is none to begin with!), changed to not do that
* Generator state transform introduces a `assert` which may unwind, and its drop elaboration also introduces many new `UnwindAction`s, so in this case run the AbortUnwindingCalls after the transformation.

I believe this PR should also fix Rust-for-Linux/linux#1016, cc `@ojeda`

r? `@Nilstrieb`
2023-08-20 09:58:52 +00:00
bors
b6ab01a713 Auto merge of #115018 - matthiaskrgr:rollup-pxj0qdb, r=matthiaskrgr
Rollup of 5 pull requests

Successful merges:

 - #114834 (Avoid side-effects from `try_coerce` when suggesting borrowing LHS of cast)
 - #114968 (Fix UB in `std::sys::os::getenv()`)
 - #114976 (Ignore unexpected incr-comp session dirs)
 - #114999 (Migrate GUI colors test to original CSS color format)
 - #115000 (custom_mir: change Call() terminator syntax to something more readable)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-08-20 08:11:08 +00:00
Matthias Krüger
2bca4b5913
Rollup merge of #115000 - RalfJung:custom-mir-call, r=compiler-errors,JakobDegen
custom_mir: change Call() terminator syntax to something more readable

I find our current syntax very hard to read -- I cannot even remember the order of arguments, and having the "next block" *before* the actual function call is very counter-intuitive IMO. So I suggest we use `Call(ret_val = function(v), next_block)` instead.

r? `@JakobDegen`
2023-08-20 08:34:05 +02:00
Matthias Krüger
4542711a69
Rollup merge of #114999 - GuillaumeGomez:migrate-gui-test-color-34, r=notriddle
Migrate GUI colors test to original CSS color format

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

This test needed more cleanup: first I removed duplication by using a function, then I merge similar rules which had the same values.

r? `@notriddle`
2023-08-20 08:34:04 +02:00
Matthias Krüger
e25dfe1ef6
Rollup merge of #114976 - Enselic:incr-comp-dir-error, r=compiler-errors
Ignore unexpected incr-comp session dirs

Clearly the code path can be hit without the presence of a compiler bug.
All it takes is mischief. See #71698.

Ignore problematic directories instead of ICE:ing. `continue`ing is
 already done for problematic dirs in the code block above us.

Closes #71698.

With this fix, the output is this instead of ICE:

```
$ cargo +stage1 new gz-ice && cd gz-ice
$ cargo +stage1 build
$ find target -type f -exec gzip {} \;
$ cargo +stage1 run

     Created binary (application) `gz-ice` package
   Compiling gz-ice v0.1.0 (/tmp/gz-ice)
    Finished dev [unoptimized + debuginfo] target(s) in 0.13s
gzip: target/debug/gz-ice has 1 other link  -- unchanged
gzip: target/debug/deps/gz_ice-de919414dd9926b9 has 1 other link  -- unchanged
   Compiling gz-ice v0.1.0 (/tmp/gz-ice)
warning: failed to garbage collect invalid incremental compilation session directory `/tmp/gz-ice/target/debug/incremental/gz_ice-23qx9z9j9vghe/s-gnwd8daity-kp10sj.lock.gz`: Not a directory (os error 20)

warning: `gz-ice` (bin "gz-ice") generated 1 warning
    Finished dev [unoptimized + debuginfo] target(s) in 0.13s
     Running `target/debug/gz-ice`
Hello, world!
```
2023-08-20 08:34:04 +02:00
Matthias Krüger
7b66abe5a2
Rollup merge of #114968 - ShE3py:unix-getsetenv-ub, r=thomcc
Fix UB in `std::sys::os::getenv()`

Fixes #114949.

Reduced the loops to 1k iterations (100k was taking way too long), Miri no longer shows any UB.

`@rustbot` label +A-process +C-bug +I-unsound +O-unix
2023-08-20 08:34:03 +02:00
Matthias Krüger
33771dfaf0
Rollup merge of #114834 - compiler-errors:try_coerce-side-effects, r=lcnr
Avoid side-effects from `try_coerce` when suggesting borrowing LHS of cast

The name `try_coerce` is a bit misleading -- it has side-effects, so when it's used in diagnostics code, it sometimes causes spurious obligations to be registered which cause other errors to occur that really make no sense in context.

Addendum: let's just rename `try_coerce` to `coerce` -- the `try_` part doesn't really add much, imo.
2023-08-20 08:34:03 +02:00
bors
39e0749329 Auto merge of #114914 - compiler-errors:deduce-tait-in-future-output, r=lcnr
Normalize return type of `deduce_future_output_from_obligations`

Fixes #114909
Also confirmed to fix #114727 manually

Now that we have weak/lazy type aliases, we need to normalize those in future signatures to ensure that `replace_opaque_types_with_inference_vars` actually sees TAITs behind them. This isn't needed in the new solver, but added a test to make sure it doesn't regress there either.

r? types cc `@oli-obk` (who's gone, worst case can delay this PR until he's back)
2023-08-20 06:24:44 +00:00
bors
484cb4e78d Auto merge of #114332 - nbdd0121:riscv, r=compiler-errors
Fix ABI flags in RISC-V/LoongArch ELF file generated by rustc

Fix #114153

It turns out the current way to set these flags are completely wrong. In LLVM the target ABI is used instead of target features to determine these flags.

Not sure how to write a test though. Or maybe a test isn't necessary because this affects only those touching target json?

r? `@Nilstrieb`
2023-08-20 04:38:08 +00:00
bors
82c5732b9a Auto merge of #113966 - lu-zero:relocation-model-in-cfg, r=bjorn3
Add the relocation_model to the cfg

This way is possible to write inline assembly code aware of it.
2023-08-20 02:48:33 +00:00