Commit Graph

249829 Commits

Author SHA1 Message Date
bors
ee03c286cf Auto merge of #122517 - petrochenkov:bodihash, r=oli-obk
Fill in HIR hash for associated opaque types

Fixes https://github.com/rust-lang/rust/issues/122508
2024-03-15 02:04:04 +00:00
Michael Goulet
571f945713 Ensure RPITITs are created before def-id freezing 2024-03-14 20:30:57 -04:00
bors
c2901f5435 Auto merge of #122511 - matthiaskrgr:rollup-swzilin, r=matthiaskrgr
Rollup of 10 pull requests

Successful merges:

 - #117118 ([AIX] Remove AixLinker's debuginfo() implementation)
 - #121650 (change std::process to drop supplementary groups based on CAP_SETGID)
 - #121764 (Make incremental sessions identity no longer depend on the crate names provided by source code)
 - #122212 (Copy byval argument to alloca if alignment is insufficient)
 - #122322 (coverage: Initial support for branch coverage instrumentation)
 - #122373 (Fix the conflict problem between the diagnostics fixes of lint `unnecessary_qualification`  and  `unused_imports`)
 - #122479 (Implement `Duration::as_millis_{f64,f32}`)
 - #122487 (Rename `StmtKind::Local` variant into `StmtKind::Let`)
 - #122498 (Update version of cc crate)
 - #122503 (Make `SubdiagMessageOp` well-formed)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-03-15 00:03:58 +00:00
bors
ed9d70f56c Auto merge of #3382 - saethlin:sysroots-notification, r=saethlin
Fix sysroot notification list of broken targets

We use this same shell quoting trick on the line above to expand shell variables into the job URL. So this should work a line down as well... right?
2024-03-14 22:45:48 +00:00
Ben Kimock
22f6193ac1 Apply the same shell quoting trick we use in the URL to 2024-03-14 18:43:04 -04:00
bors
f4b771bf1f Auto merge of #122514 - workingjubilee:update-backtrace-for-miri, r=workingjubilee
Use rust-lang/backtrace-rs@6fa4b85

r? `@ghost`
2024-03-14 21:35:39 +00:00
Ralf Jung
48f2f0d725 preserve span when evaluating mir::ConstOperand 2024-03-14 21:55:07 +01:00
Vadim Petrochenkov
ef5513f278 Fill in HIR hash for associated opaque types 2024-03-14 23:29:12 +03:00
许杰友 Jieyou Xu (Joe)
87ced1561f
Pass the correct DefId when suggesting writing the aliased Self type out 2024-03-14 19:39:15 +00:00
Jubilee Young
442cc762c0 Use rust-lang/backtrace-rs@6fa4b85 2024-03-14 12:37:43 -07:00
Vadim Petrochenkov
89b536dbc8 hir: Remove opt_local_def_id_to_hir_id and opt_hir_node_by_def_id
Also replace a few `hir_node()` calls with `hir_node_by_def_id()`
2024-03-14 22:34:24 +03:00
Matthias Krüger
6ce3110ce9
Rollup merge of #122503 - compiler-errors:trait-alias-wf, r=Nilstrieb
Make `SubdiagMessageOp` well-formed

`WF(Diag<'_, G>)` requires `G: EmissionGuarantee`, but we don't currently check this is true due to limitations in the solver. Probably still worth enforcing.

r? `@nnethercote` (or anyone can r+ this, really)
2024-03-14 20:00:22 +01:00
Matthias Krüger
6366c64974
Rollup merge of #122498 - jfgoog:update-cc-crate-version, r=workingjubilee
Update version of cc crate

Reason:

In order to build the Windows version of the Rust toolchain for the Android platform, the following patch to the cc is crate is required to avoid incorrectly determining that we are building with the Android NDK: 57853c4bf8

This patch is present in version 1.0.80 and newer versions of the cc crate. The rustc source distribution currently has 3 different versions of cc in the vendor directory, only one of which has the necessary fix.

We (the Android Rust toolchain) are currently maintaining local patches to upgrade the cc crate dependency versions, which we would like to upstream.
2024-03-14 20:00:21 +01:00
Matthias Krüger
1f4aff7d2b
Rollup merge of #122487 - GuillaumeGomez:rename-stmtkind-local, r=oli-obk
Rename `StmtKind::Local` variant into `StmtKind::Let`

It comes from this [discussion](https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/Improve.20naming.20of.20.60ExprKind.3A.3ALet.60.3F).

Starting point was:

> I often end up looking at [ExprKind::Let](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir/enum.ExprKind.html#variant.Let) instead of Local because of the name. I think renaming it (both the `ExprKind` variant and the Let struct) to `LetPattern` or LetPat could improve the situation as I'm not sure I'm not the only one encountering this issue.

And then it evolved into:

> It's already `Expr::Let` instead of `StmtKind::Local`. Counterproposal: rename `StmtKind::Local` to `StmtKind::Let`.

The goal here is to clear this confusion.

r? `@oli-obk`
2024-03-14 20:00:21 +01:00
Matthias Krüger
5d41186446
Rollup merge of #122479 - GrigorenkoPV:duration_millis_float, r=scottmcm
Implement `Duration::as_millis_{f64,f32}`

Implementation of #122451.

Linked const-unstability to #72440, so the post there should probably be updated to mentions the 2 new methods when/if this PR is merged.
2024-03-14 20:00:20 +01:00
Matthias Krüger
b200108bc5
Rollup merge of #122373 - surechen:fix_121331, r=petrochenkov
Fix the conflict problem between the diagnostics fixes of lint `unnecessary_qualification`  and  `unused_imports`

fixes #121331

For an `item` that triggers lint unnecessary_qualification, if the `use item` which imports this item is also trigger unused import, fixing the two lints at the same time may lead to the problem that the `item` cannot be found.
This PR will avoid reporting lint unnecessary_qualification when conflict occurs.

r? ``@petrochenkov``
2024-03-14 20:00:20 +01:00
Matthias Krüger
54a5a49af0
Rollup merge of #122322 - Zalathar:branch, r=oli-obk
coverage: Initial support for branch coverage instrumentation

(This is a review-ready version of the changes that were drafted in #118305.)

This PR adds support for branch coverage instrumentation, gated behind the unstable flag value `-Zcoverage-options=branch`. (Coverage instrumentation must also be enabled with `-Cinstrument-coverage`.)

During THIR-to-MIR lowering (MIR building), if branch coverage is enabled, we collect additional information about branch conditions and their corresponding then/else blocks. We inject special marker statements into those blocks, so that the `InstrumentCoverage` MIR pass can reliably identify them even after the initially-built MIR has been simplified and renumbered.

The rest of the changes are mostly just plumbing needed to gather up the information that was collected during MIR building, and include it in the coverage metadata that we embed in the final binary.

Note that `llvm-cov show` doesn't print branch coverage information in its source views by default; that needs to be explicitly enabled with `--show-branches=count` or similar.

---

The current implementation doesn't have any support for instrumenting `if let` or let-chains. I think it's still useful without that, and adding it would be non-trivial, so I'm happy to leave that for future work.
2024-03-14 20:00:19 +01:00
Matthias Krüger
722514f466
Rollup merge of #122212 - erikdesjardins:byval-align2, r=wesleywiser
Copy byval argument to alloca if alignment is insufficient

Fixes #122211

"Ignore whitespace" recommended.
2024-03-14 20:00:18 +01:00
Matthias Krüger
4dff106433
Rollup merge of #121764 - Zoxc:incr-sess-no-source, r=oli-obk
Make incremental sessions identity no longer depend on the crate names provided by source code

This makes incremental sessions identity no longer depend on the crate names provided by source code, implementing
https://github.com/rust-lang/compiler-team/issues/726.

r? ````@oli-obk````
2024-03-14 20:00:18 +01:00
Matthias Krüger
eaa8dafe1a
Rollup merge of #121650 - GrigorenkoPV:cap_setgid, r=Amanieu
change std::process to drop supplementary groups based on CAP_SETGID

A trivial rebase of #95982

Should fix #39186 (from what I can tell)

Original description:

> Fixes #88716
>
> * Before this change, when a process was given a uid via `std::os::unix::process::CommandExt.uid`, there would be a `setgroups` call (when the process runs) to clear supplementary groups for the child **if the parent was root** (to remove potentially unwanted permissions).
> * After this change, supplementary groups are cleared if we have permission to do so, that is, if we have the CAP_SETGID capability.
>
> This new behavior was agreed upon in #88716 but there was a bit of uncertainty from `@Amanieu` here: [#88716 (comment)](https://github.com/rust-lang/rust/issues/88716#issuecomment-973366600)
>
> > I agree with this change, but is it really necessary to ignore an EPERM from setgroups? If you have permissions to change UID then you should also have permissions to change groups. I would feel more comfortable if we documented set_uid as requiring both UID and GID changing permissions.
>
> The way I've currently written it, we ignore an EPERM as that's what #88716 originally suggested. I'm not at all an expert in any of this so I'd appreciate feedback on whether that was the right way to go.
2024-03-14 20:00:17 +01:00
Matthias Krüger
68ca795286
Rollup merge of #117118 - bzEq:aix-linker, r=wesleywiser
[AIX] Remove AixLinker's debuginfo() implementation

AIX ld's `-s` option doesn't perfectly fit` debuginfo()`'s semantics and may unexpectedly remove metadata in shared libraries. Remove the implementation of `AixLinker` and suggest user to use `strip` utility instead.
2024-03-14 20:00:17 +01:00
bors
fd27e8745f Auto merge of #119849 - lcnr:eagerly-instantiate-binders, r=compiler-errors
more eagerly instantiate binders

The old solver sometimes incorrectly used `sub`, change it to explicitly instantiate binders and use `eq` instead. While doing so I also moved the instantiation before the normalize calls. This caused some observable changes, will explain these inline. This PR therefore requires a crater run and an FCP.

r? types
2024-03-14 18:58:53 +00:00
baitcode
07e0182fd3 Fix minor documentation issue. Code outside the test would fail. Seek documentation clearly states that negative indexes will cause error.
Just making the code in the example to return Result::Ok, instead of Result::Error.
2024-03-14 18:58:23 +00:00
Chris Wailes
f46aceaaf7 Restore correct version of comment and fix logic bug 2024-03-14 11:06:39 -07:00
Trevor Gross
2098fec080 Add UI tests related to feature-gated primitives
Add a test that `f16` and `f128` are usable with the feature gate
enabled, as well as a test that user types with the same name as
primitives are not improperly gated.
2024-03-14 13:32:54 -04:00
Trevor Gross
2529bf2650 Remove unneeded f16 and f128 parser tests
Superceded by feature gate tests.
2024-03-14 13:32:54 -04:00
Trevor Gross
e782d27ec6 Add feature gates for f16 and f128
Includes related tests and documentation pages.

Michael Goulet: Don't issue feature error in resolver for f16/f128
unless finalize

Co-authored-by: Michael Goulet <michael@errs.io>
2024-03-14 13:32:54 -04:00
Michael Goulet
6e4cd8b7cc Make SubdiagMessageOp well-formed 2024-03-14 13:13:08 -04:00
lcnr
c8f0f17ed2 add tests 2024-03-14 17:45:13 +01:00
James Farrell
21904319f8 Update version of cc crate
Reason:

In order to build the Windows version of the Rust toolchain for the Android platform, the following patch to the cc is crate is required to avoid incorrectly determining that we are building with the Android NDK: 57853c4bf8

This patch is present in version 1.0.80 and newer versions of the cc crate. The rustc source distribution currently has 3 different versions of cc in the vendor directory, only one of which has the necessary fix.

We (the Android Rust toolchain) are currently maintaining local patches to upgrade the cc crate dependency versions, which we would like to upstream.
2024-03-14 16:42:15 +00:00
bors
30f74ff0dc Auto merge of #122497 - matthiaskrgr:rollup-pg9ux4r, r=matthiaskrgr
Rollup of 10 pull requests

Successful merges:

 - #119029 (Avoid closing invalid handles)
 - #122238 (Document some builtin impls in the next solver)
 - #122247 (rustdoc-search: depth limit `T<U>` -> `U` unboxing)
 - #122287 (add test ensuring simd codegen checks don't run when a static assertion failed)
 - #122368 (chore: remove repetitive words)
 - #122397 (Various cleanups around the const eval query providers)
 - #122406 (Fix WF for `AsyncFnKindHelper` in new trait solver)
 - #122477 (Change some attribute to only_local)
 - #122482 (Ungate the `UNKNOWN_OR_MALFORMED_DIAGNOSTIC_ATTRIBUTES` lint)
 - #122490 (Update build instructions for OpenHarmony)

Failed merges:

 - #122471 (preserve span when evaluating mir::ConstOperand)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-03-14 16:36:02 +00:00
Markus Reiter
2047e847d7
Fix StdNonZeroNumberProvider for gdb. 2024-03-14 17:34:59 +01:00
Markus Reiter
42c5eb8845
Add comment about NonZero printing as character literal. 2024-03-14 17:34:59 +01:00
Markus Reiter
75fba9d574
Remove LLDB persistent results in compiletest. 2024-03-14 17:34:58 +01:00
Markus Reiter
36a8daeb44
Deduplicate lldb_commands. 2024-03-14 17:34:58 +01:00
Markus Reiter
4a799082fe
Fix StdNonZeroNumberSummaryProvider. 2024-03-14 17:34:58 +01:00
Markus Reiter
ecee730c45
Try fixing debuginfo test. 2024-03-14 17:34:58 +01:00
Markus Reiter
40f8227d6d
Fix lint. 2024-03-14 17:34:57 +01:00
Markus Reiter
bc532a6307
Hide implementation details for NonZero auto traits. 2024-03-14 17:34:57 +01:00
lcnr
323069fd59 rebase 2024-03-14 17:19:40 +01:00
lcnr
6729e0188b one must imagine tidy happy 2024-03-14 17:19:40 +01:00
lcnr
24a1729566 eagerly instantiate binders to avoid relying on sub 2024-03-14 17:19:40 +01:00
Michael Goulet
04524c8f6a Consolidate WF for aliases 2024-03-14 12:17:00 -04:00
bors
14558af15e Auto merge of #16834 - Veykril:macarons, r=Veykril
feat: Support macro calls in eager macros for IDE features

Basically hovering `concat` and `env` in `include!(concat!(env!("OUT_DIR"), "/foo.rs"))` now works and highlights as expected.

This also fixes a few bugs/problems to make it work. Prior we set the call site span to the entire macro call which is kind of wrong, typing inside the call would invalidate the span causing us to leak `MacroCallLoc`s whenever that happened. The same happened for attributes both of which now define their path as the call site.
2024-03-14 15:34:53 +00:00
Lukas Wirth
d085ade631 Remove dead test code 2024-03-14 16:24:51 +01:00
bors
76d364bfdc Auto merge of #3379 - RalfJung:time-with-isolation, r=saethlin
explain time-with-isolation test better

Fixes https://github.com/rust-lang/miri/issues/3377

`@saethlin` do you think this is better?
2024-03-14 14:49:41 +00:00
Matthias Krüger
02b1a91ee8
Rollup merge of #122490 - Amanieu:ohos-tier2-instructions, r=GuillaumeGomez
Update build instructions for OpenHarmony

The platform page now recommends using rustup since the target is now tier 2.
2024-03-14 15:44:37 +01:00
Matthias Krüger
c0fd2db49a
Rollup merge of #122482 - weiznich:fix/122446, r=compiler-errors
Ungate the `UNKNOWN_OR_MALFORMED_DIAGNOSTIC_ATTRIBUTES` lint

This was missed during stablisation of the `#[diagnostic]` attribute namespace.

Fixes #122446
2024-03-14 15:44:36 +01:00
Matthias Krüger
8303c6ae48
Rollup merge of #122477 - surechen:change_attribute_only_local_20240314, r=lcnr
Change some attribute to only_local

Modified according to https://github.com/rust-lang/compiler-team/issues/505.

r? `@lcnr`
2024-03-14 15:44:36 +01:00
Matthias Krüger
54b73006c6
Rollup merge of #122406 - compiler-errors:next-solver-asynckind-wf, r=lcnr
Fix WF for `AsyncFnKindHelper` in new trait solver

`to_opt_closure_kind` ICEs when it sees placeholders... so don't do that

no test b/c I'm too lazy to write a no-core test for this, but I could be convinced otherwise

r? lcnr
2024-03-14 15:44:35 +01:00