Commit Graph

254892 Commits

Author SHA1 Message Date
Zalathar
c81be68fb4 coverage: Remove confusing comments from CoverageKind
These comments appear to be inspired by the similar comments on
`CounterIncrement` and `ExpressionUsed`. But those comments refer to specific
simplification steps performed during coverage codegen, and there is no
corresponding step for the MC/DC coverage statements.

If these statements do not survive optimization, they will simply not
participate in code generation, just like any other statement.
2024-05-14 17:05:00 +10:00
Zalathar
bfadc3a9b9 coverage: CoverageIdsInfo::mcdc_bitmap_bytes is never needed
This code for recalculating `mcdc_bitmap_bytes` doesn't provide any benefit,
because its result won't have changed from the value in `FunctionCoverageInfo`
that was computed during the MIR instrumentation pass.
2024-05-14 16:41:04 +10:00
bors
58426f4a5b Auto merge of #125026 - Oneirical:clink-tests, r=jieyouxu
Migrate `run-make/c-link-to-rust-va-list-fn` to `rmake`

Part of #121876.

r? `@jieyouxu`
2024-05-14 05:35:13 +00:00
Josh Triplett
e098eb14ae Wording improvement
Co-authored-by: Caleb Cartwright <calebcartwright@users.noreply.github.com>
2024-05-14 06:00:09 +02:00
Josh Triplett
e2d9c0d938 Fix missing word
Co-authored-by: Caleb Cartwright <calebcartwright@users.noreply.github.com>
2024-05-14 06:00:09 +02:00
Josh Triplett
57c32a193f style-guide: When breaking binops handle multi-line first operand better
Use the indentation of the *last* line of the first operand, not the first.

Fixes https://github.com/rust-lang/style-team/issues/189
2024-05-14 06:00:07 +02:00
Michael Goulet
dbd2ca6478 Use a proper probe for shadowing impl 2024-05-13 23:58:33 -04:00
Michael Goulet
052de1da4f And finally add tests 2024-05-13 23:57:56 -04:00
Michael Goulet
1529c661e4 Warn against redundant use<...> 2024-05-13 23:57:56 -04:00
Michael Goulet
f3fb727b08 Don't suggest using use<> syntax to capture APITs 2024-05-13 23:57:56 -04:00
Michael Goulet
6afe1352d9 Suggest adding use<> syntax 2024-05-13 23:57:56 -04:00
Michael Goulet
554becc180 Add some commenting 2024-05-13 23:57:56 -04:00
Michael Goulet
d57e57ca1f Implement initial IMPL_TRAIT_OVERCAPTURES lint 2024-05-13 23:47:35 -04:00
Michael Goulet
8f97a2588c Add test to make sure suggestions are still quick 2024-05-13 23:38:31 -04:00
bors
fba5f44bd8 Auto merge of #125098 - jhpratt:rollup-2qm4gga, r=jhpratt
Rollup of 4 pull requests

Successful merges:

 - #116675 ([ptr] Document maximum allocation size)
 - #124997 (Fix ICE while casting a type with error)
 - #125072 (Add test for dynamic dispatch + Pin::new soundness)
 - #125090 (Migrate fuchsia docs from `pm` to `ffx`)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-05-14 03:19:44 +00:00
Oneirical
45b50d303c lto function, static_library call, rename 2024-05-13 22:56:21 -04:00
Michael Goulet
9f8cdb286e Remove to_term 2024-05-13 22:45:01 -04:00
Michael Goulet
1ad28a6f53 Uplift AliasTy 2024-05-13 22:45:01 -04:00
Oneirical
812f89728a fix fmt 2024-05-13 22:15:11 -04:00
Michael Goulet
2e4c90c3f7 Don't do post-method-probe error reporting steps if we're in a suggestion 2024-05-13 22:05:11 -04:00
Jacob Pratt
32d74f1800
Rollup merge of #125090 - erickt:bump-fuchsia, r=tmandry
Migrate fuchsia docs from `pm` to `ffx`

The `pm` tool has been deprecated, so this migrates the fuchsia documentation to the new `ffx` based tooling.
2024-05-13 21:14:16 -04:00
Jacob Pratt
209703af85
Rollup merge of #125072 - Darksonn:pin-dyn-dispatch-sound, r=jhpratt
Add test for dynamic dispatch + Pin::new soundness

While working on [the `#[derive(SmartPointer)]` RFC][1], I realized that the soundness of <code>impl [DispatchFromDyn](https://doc.rust-lang.org/stable/std/ops/trait.DispatchFromDyn.html) for [Pin](https://doc.rust-lang.org/stable/std/pin/struct.Pin.html)</code> relies on the restriction that you can't implement [`Unpin`](https://doc.rust-lang.org/stable/std/marker/trait.Unpin.html) for trait objects.

As far as I can tell, the relevant error exists to solve some unrelated issues with coherence. To avoid cases where `Pin` is made unsound due to changes in the coherence-related errors, add a test that verifies that unsound use of `Pin` and `DispatchFromDyn` does not become allowed in the future.

[1]: https://github.com/rust-lang/rfcs/pull/3621
2024-05-13 21:14:16 -04:00
Jacob Pratt
18d9c039bb
Rollup merge of #124997 - gurry:124848-ice-should-be-sized, r=Nadrieril
Fix ICE while casting a type with error

Fixes #124848

The ICE originates here: f9a3fd9661/compiler/rustc_hir_typeck/src/cast.rs (L143) The underlying cause is that a type with error, `MyType` was involved in a cast. During cast checks the below method `pointer_kind` was called: f9a3fd9661/compiler/rustc_hir_typeck/src/cast.rs (L87-L91) Thanks to the changes in PR #123491, `type_is_sized_modulo_regions` in `pointer_kind` returned `false` which caused control to reach the `span_bug` here: f9a3fd9661/compiler/rustc_hir_typeck/src/cast.rs (L143) resulting in an ICE.

This PR fixes the issue by changing the `span_bug` to a `span_delayed_bug`.
2024-05-13 21:14:15 -04:00
Jacob Pratt
74a78af0e2
Rollup merge of #116675 - joshlf:patch-10, r=scottmcm
[ptr] Document maximum allocation size

Partially addresses https://github.com/rust-lang/unsafe-code-guidelines/issues/465
2024-05-13 21:14:15 -04:00
bors
9105c57b7f Auto merge of #124256 - nnethercote:rm-NtIdent-NtLifetime, r=petrochenkov
Remove `NtIdent` and `NtLifetime`

This is one part of the bigger "remove `Nonterminal` and `TokenKind::Interpolated`" change drafted in #114647. More details in the individual commit messages.

r? `@petrochenkov`
2024-05-14 01:10:38 +00:00
Jules Bertholet
fe8f66e4bc
rustc_hir_typeck: Account for skipped_ref_pats in expr_use_visitor
Fixes #125058
2024-05-13 18:36:49 -04:00
bors
34582118af Auto merge of #125076 - compiler-errors:alias-term, r=lcnr
Split out `ty::AliasTerm` from `ty::AliasTy`

Splitting out `AliasTerm` (for use in project and normalizes goals) and `AliasTy` (for use in `ty::Alias`)

r? lcnr
2024-05-13 22:20:43 +00:00
Nicholas Nethercote
95e519ecbf Remove NtIdent and NtLifetime.
The extra span is now recorded in the new `TokenKind::NtIdent` and
`TokenKind::NtLifetime`. These both consist of a single token, and so
there's no operator precedence problems with inserting them directly
into the token stream.

The other way to do this would be to wrap the ident/lifetime in invisible
delimiters, but there's a lot of code that assumes an interpolated
ident/lifetime fits in a single token, and changing all that code to work with
invisible delimiters would have been a pain. (Maybe it could be done in a
follow-up.)

This change might not seem like much of a win, but it's a first step toward the
much bigger and long-desired removal of `Nonterminal` and
`TokenKind::Interpolated`. That change is big and complex enough that it's
worth doing this piece separately. (Indeed, this commit is based on part of a
late commit in #114647, a prior attempt at that big and complex change.)
2024-05-14 08:19:58 +10:00
Michael Goulet
fa84018c2e Apply nits 2024-05-13 16:55:58 -04:00
bors
ab14f944af Auto merge of #125086 - matthiaskrgr:rollup-xob4lof, r=matthiaskrgr
Rollup of 5 pull requests

Successful merges:

 - #119515 (style-guide: Format single associated type `where` clauses on the same line)
 - #119959 ([meta] Clarify prioritization alert)
 - #123817 (Stabilize `seek_seek_relative`)
 - #125063 (Don't call `env::set_var` in `rustc_driver::install_ice_hook`)
 - #125071 (Migrate rustdoc target spec json path)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-05-13 20:14:47 +00:00
Erick Tryzelaar
58ee9192e0 Migrate fuchsia docs from pm to ffx
The `pm` tool has been deprecated, so this migrates the fuchsia
documentation to the new `ffx` based tooling.
2024-05-13 20:14:31 +00:00
Matthias Krüger
ed2c2c06e6
Rollup merge of #125071 - GuillaumeGomez:migrate-rustdoc-target-spec-json-path, r=jieyouxu
Migrate rustdoc target spec json path

Part of https://github.com/rust-lang/rust/issues/121876.

r? `@jieyouxu`
2024-05-13 20:29:19 +02:00
Matthias Krüger
472391dbf6
Rollup merge of #125063 - tbu-:pr_set_ice_hook_env, r=michaelwoerister
Don't call `env::set_var` in `rustc_driver::install_ice_hook`

Modifying an environment variable would make the function unsafe to call.
2024-05-13 20:29:19 +02:00
Matthias Krüger
b0cbd4e5f3
Rollup merge of #123817 - slanterns:seek_relative, r=dtolnay
Stabilize `seek_seek_relative`

This PR stabilizes `seek_seek_relative`:

```rust
// std::io::Seek

trait Seek {
    fn seek_relative(&mut self, offset: i64) -> Result<()>;
}
```

<br>

Tracking issue: https://github.com/rust-lang/rust/issues/117374.
Implementation PR: https://github.com/rust-lang/rust/pull/116750.

FCPs already completed in the tracking issue.

Closes https://github.com/rust-lang/rust/issues/117374.

r? libs-api
2024-05-13 20:29:18 +02:00
Matthias Krüger
cf8a084d26
Rollup merge of #119959 - fmease:triagebot-prioritization-alert-label, r=apiraino
[meta] Clarify prioritization alert

Apparently, there used to exist the label <kbd>I-nominated</kbd> judging from this entry:

8847bda592/triagebot.toml (L393)

Since it was replaced with individual team labels, I think it makes sense to update the prioritization alert. Of course, it's not super important since the members of WG-prioritization already know that. This is just cleanup.

r? apiraino or wg-prioritization
2024-05-13 20:29:17 +02:00
Matthias Krüger
4d1cce9de5
Rollup merge of #119515 - joshtriplett:style-guide-gat-where-clause-same-line, r=compiler-errors
style-guide: Format single associated type `where` clauses on the same line

In particular, lifetime-generic associated types often have a
`where Self: 'a` bound, which we can format on the same line.
2024-05-13 20:29:17 +02:00
Joshua Liebow-Feeser
293b5cb1ca [ptr] Document maximum allocation size 2024-05-13 11:14:45 -07:00
Luca Barbato
4db00fe229 Use an helper to move the files
In case the source is not in the same filesystem.
2024-05-13 19:16:20 +02:00
Michael Goulet
3bcdf3058e split out AliasTy -> AliasTerm 2024-05-13 11:59:42 -04:00
bors
030a12ce2b Auto merge of #125074 - bjorn3:sync_cg_clif-2024-05-13, r=bjorn3
Subtree sync for rustc_codegen_cranelift

A variety of bug fixes, added support for naked functions, a couple more vendor intrinsics implemented.

r? `@ghost`

`@rustbot` label +A-codegen +A-cranelift +T-compiler
2024-05-13 15:30:18 +00:00
Josh Triplett
163b1a6615 Reword formatting for where clauses
Suggested-by: Caleb Cartwright <calebcartwright@users.noreply.github.com>
2024-05-13 16:43:13 +02:00
Josh Triplett
9ff777bf50 style-guide: Also format where clauses on one line for short function decls 2024-05-13 16:43:13 +02:00
Josh Triplett
2af29af710 style-guide: Not all where clauses can be written as inline bounds 2024-05-13 16:43:13 +02:00
Josh Triplett
2f20bb4a97 style-guide: Give a second example for associated type formatting
Show an example that has bounds.
2024-05-13 16:43:13 +02:00
Josh Triplett
3742a4bd90 style-guide: Format single associated type where clauses on the same line
In particular, lifetime-generic associated types often have a
`where Self: 'a` bound, which we can format on the same line.
2024-05-13 16:42:47 +02:00
bjorn3
75f8bdbca4 Merge commit '3270432f4b0583104c8b9b6f695bf97d6bbf3ac2' into sync_cg_clif-2024-05-13 2024-05-13 13:26:33 +00:00
bors
421f7ca3a9 Auto merge of #125061 - RalfJung:interpret-error, r=cjgillot
interpret: move error macros into error.rs
2024-05-13 13:25:00 +00:00
bjorn3
3270432f4b Rustup to rustc 1.80.0-nightly (ef0027897 2024-05-12) 2024-05-13 13:22:02 +00:00
Guillaume Gomez
b515de83af Migrate run-make/rustdoc-target-spec-json-path to rmake 2024-05-13 15:21:13 +02:00
Guillaume Gomez
4057a7b1e3 Add library_search_path to Rustdoc 2024-05-13 15:21:12 +02:00