Commit Graph

237065 Commits

Author SHA1 Message Date
bors
858a42bf46 Auto merge of #116837 - oli-obk:smir_run_macro, r=spastorino
Avoid having `rustc_smir` depend on `rustc_interface` or `rustc_driver`

This is done by moving all the logic into a macro that performs the entire "run" operation in one go.

This makes https://github.com/rust-lang/rust/pull/116806 obsolete

as a follow up we should make the macro usable without manually having to write

```rust
#[macro_use]
extern crate rustc_smir;
extern crate stable_mir;
extern crate rustc_driver;
extern crate rustc_interface;
use rustc_smir::rustc_internal;
```

in every crate that uses the macro.

r? `@spastorino`
2023-10-23 13:57:19 +00:00
Michael Howell
f1a1ef68c7
Remove FIXME after fix
Co-authored-by: León Orell Valerian Liehr <me@fmease.dev>
2023-10-23 06:52:29 -07:00
bjorn3
efd3081083 Update rust-analyzer config 2023-10-23 13:24:46 +00:00
GoodDaisy
0d780b108b fix typos in comments 2023-10-23 20:52:14 +08:00
bjorn3
e5ba1e8417 Implement llvm intrinsics necessary for rav1e
Fixes #1399
2023-10-23 14:06:47 +02:00
bors
8501f1c7ba Auto merge of #116835 - oli-obk:evaluated_static_in_metadata2, r=RalfJung
Various const eval cleanups

This pulls out the pure refactorings from https://github.com/rust-lang/rust/pull/116564

r? `@RalfJung`
2023-10-23 12:01:17 +00:00
Ralf Jung
e94c18ea87 don't talk about 'Data race' when both accesses are atomic 2023-10-23 12:38:39 +02:00
Ralf Jung
369c6d180c clean up imperfect overlap detection in weak-mem emulation 2023-10-23 12:34:39 +02:00
Ralf Jung
1e5f9eb331 detect mixed-size atomic accesses 2023-10-23 12:34:39 +02:00
Oli Scherer
5c9a74d88b Merge associated types with the other alias types 2023-10-23 10:10:22 +00:00
Oli Scherer
3cc26c6aaf Try to work around 32 bit mingw issues 2023-10-23 10:04:47 +00:00
bors
a56bd2b944 Auto merge of #116849 - oli-obk:error_shenanigans, r=cjgillot
Avoid a `track_errors` by bubbling up most errors from `check_well_formed`

I believe `track_errors` is mostly papering over issues that a sufficiently convoluted query graph can hit. I made this change, while the actual change I want to do is to stop bailing out early on errors, and instead use this new `ErrorGuaranteed` to invoke `check_well_formed` for individual items before doing all the `typeck` logic on them.

This works towards resolving https://github.com/rust-lang/rust/issues/97477 and various other ICEs, as well as allowing us to use parallel rustc more (which is currently rather limited/bottlenecked due to the very sequential nature in which we do `rustc_hir_analysis::check_crate`)

cc `@SparrowLii` `@Zoxc` for the new `try_par_for_each_in` function
2023-10-23 09:59:40 +00:00
Oli Scherer
d5c0f4d139 Sync the logic for inherent and weak type aliases 2023-10-23 09:53:04 +00:00
Oli Scherer
9088ba9f3e Make ICE a bit more informative 2023-10-23 09:53:04 +00:00
Oli Scherer
4a5fecb187 Avoid having rustc_smir depend on rustc_interface or rustc_driver 2023-10-23 09:48:15 +00:00
bjorn3
ed8c515cc4 Avoid collect_and_partition_mono_items call when not doing codegen
Fixes #1401
2023-10-23 09:35:15 +00:00
Ralf Jung
f99566ec4d data_race: detect races between atomic and non-atomic accesses, even if both are reads 2023-10-23 11:35:12 +02:00
Yotam Ofek
a6c2481a36 Fix suggestion for renamed coroutines feature 2023-10-23 09:16:13 +00:00
Oli Scherer
066ec1273a Ensure that eval_to_allocation_raw isn't called on static items from miri 2023-10-23 08:35:27 +00:00
Oli Scherer
fec0b54978 Split eval_to_allocation_raw_provider 2023-10-23 08:35:26 +00:00
Oli Scherer
f85b139704 Pull out const error reporting into its own function 2023-10-23 08:35:26 +00:00
Oli Scherer
5784e9e83e Pull mplace validation logic out into an interpreter method 2023-10-23 08:35:26 +00:00
Oli Scherer
0fce74e1c0 The mutability was ignored anyway, so just check for staticness 2023-10-23 08:35:26 +00:00
Oli Scherer
fe8ebb1890 Allow ensure queries to return Result<(), ErrorGuaranteed> 2023-10-23 08:20:29 +00:00
Ralf Jung
a4e42ad185 data_race: clarify and slightly refactor non-atomic handling 2023-10-23 09:45:29 +02:00
bors
6bb4ad6dfb Auto merge of #117071 - matthiaskrgr:rollup-1tcxdgj, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - #105666 (rustdoc: align stability badge to baseline instead of bottom)
 - #117042 (coverage: Emit the filenames section before encoding per-function mappings)
 - #117044 (Miri subtree update)
 - #117049 (add a `csky-unknown-linux-gnuabiv2hf` target )
 - #117051 (fix broken link: update incremental compilation url)
 - #117069 (x.ps1: remove the check for Python from Windows Store)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-10-23 07:32:55 +00:00
bors
d32b1583df Auto merge of #3136 - rust-lang:rustup-2023-10-23, r=RalfJung
Automatic Rustup
2023-10-23 06:42:19 +00:00
Zalathar
71b7322440 Fix comment: coverage-map tests compile to LLVM IR, not MIR 2023-10-23 17:41:40 +11:00
Zalathar
f83f7966f5 coverage: Add UI tests for values accepted by -Cinstrument-coverage 2023-10-23 17:41:40 +11:00
The Miri Conjob Bot
dd683dd12e fmt 2023-10-23 08:40:43 +02:00
Matthias Krüger
cec7d4a075
Rollup merge of #117069 - xobs:x.ps1-remove-windows-store-check, r=albertlarsan68
x.ps1: remove the check for Python from Windows Store

When installing Python from the Windows Store, a copy of `python.exe` is installed inder the Microsoft directory in the user's local AppData directory. Currently, `x.ps1` checks for this file, because by default running `python.exe` opens a link to the Microsoft Store rather than running Python.

Once the user installs Python, however, this contains a valid interpreter. Unfortuantely, `x.ps1` can't tell the difference between a legitimate Python install and the stub.

Remove the check, as it makes it impossible to use the official version from Microsoft once it has been installed.

This resolves #117067
2023-10-23 08:12:41 +02:00
Matthias Krüger
2636745678
Rollup merge of #117051 - gvozdvmozgu:fix-incremental-compilation-link, r=Nilstrieb
fix broken link: update incremental compilation url
2023-10-23 08:12:41 +02:00
Matthias Krüger
9acb775c50
Rollup merge of #117049 - Dirreke:csky-unknown-linux-gunabiv2, r=bjorn3
add a `csky-unknown-linux-gnuabiv2hf` target

This is the rustc side changes to support csky based Linux target(`csky-unknown-linux-gnuabiv2`).

Tier 3 policy:

> A tier 3 target must have a designated developer or developers (the "target maintainers") on record to be CCed when issues arise regarding the target. (The mechanism to track and CC such developers may evolve over time.)

I pledge to do my best maintaining it.

> Targets must use naming consistent with any existing targets; for instance, a target for the same CPU or OS as an existing Rust target should use the same name for that CPU or OS. Targets should normally use the same names and naming conventions as used elsewhere in the broader ecosystem beyond Rust (such as in other toolchains), unless they have a very good reason to diverge. Changing the name of a target can be highly disruptive, especially once the target reaches a higher tier, so getting the name right is important even for a tier 3 target.

This `csky`  section is the arch name and the `unknown-linux` section is the same as other linux target, and `gnuabiv2` is from the  cross-compile toolchain of  `gcc`. the `hf`means hardfloat.

> Target names should not introduce undue confusion or ambiguity unless absolutely necessary to maintain ecosystem compatibility. For example, if the name of the target makes people extremely likely to form incorrect beliefs about what it targets, the name should be changed or augmented to disambiguate it.

I think the explanation in platform support doc is enough to make this aspect clear.

> Tier 3 targets may have unusual requirements to build or use, but must not create legal issues or impose onerous legal terms for the Rust project or for Rust developers or users.

It's using open source tools only.

> The target must not introduce license incompatibilities.

No new license

> Anything added to the Rust repository must be under the standard Rust license (MIT OR Apache-2.0).

Understood.

> The target must not cause the Rust tools or libraries built for any other host (even when supporting cross-compilation to the target) to depend on any new dependency less permissive than the Rust licensing policy. This applies whether the dependency is a Rust crate that would require adding new license exceptions (as specified by the tidy tool in the rust-lang/rust repository), or whether the dependency is a native library or binary. In other words, the introduction of the target must not cause a user installing or running a version of Rust or the Rust tools to be subject to any new license requirements.

There are no new dependencies/features required.

> Compiling, linking, and emitting functional binaries, libraries, or other code for the target (whether hosted on the target itself or cross-compiling from another target) must not depend on proprietary (non-FOSS) libraries. Host tools built for the target itself may depend on the ordinary runtime libraries supplied by the platform and commonly used by other applications built for the target, but those libraries must not be required for code generation for the target; cross-compilation to the target must not require such libraries at all. For instance, rustc built for the target may depend on a common proprietary C runtime library or console output library, but must not depend on a proprietary code generation library or code optimization library. Rust's license permits such combinations, but the Rust project has no interest in maintaining such combinations within the scope of Rust itself, even at tier 3.

As previously said it's using open source tools only.

> "onerous" here is an intentionally subjective term. At a minimum, "onerous" legal/licensing terms include but are not limited to: non-disclosure requirements, non-compete requirements, contributor license agreements (CLAs) or equivalent, "non-commercial"/"research-only"/etc terms, requirements conditional on the employer or employment of any particular Rust developers, revocable terms, any requirements that create liability for the Rust project or its developers or users, or any requirements that adversely affect the livelihood or prospects of the Rust project or its developers or users.

There are no such terms present/

> Neither this policy nor any decisions made regarding targets shall create any binding agreement or estoppel by any party. If any member of an approving Rust team serves as one of the maintainers of a target, or has any legal or employment requirement (explicit or implicit) that might affect their decisions regarding a target, they must recuse themselves from any approval decisions regarding the target's tier status, though they may otherwise participate in discussions.

I'm not the reviewer here.

> This requirement does not prevent part or all of this policy from being cited in an explicit contract or work agreement (e.g. to implement or maintain support for a target). This requirement exists to ensure that a developer or team responsible for reviewing and approving a target does not face any legal threats or obligations that would prevent them from freely exercising their judgment in such approval, even if such judgment involves subjective matters or goes beyond the letter of these requirements.

I'm not the reviewer here.

> Tier 3 targets should attempt to implement as much of the standard libraries as possible and appropriate (core for most targets, alloc for targets that can support dynamic memory allocation, std for targets with an operating system or equivalent layer of system-provided functionality), but may leave some code unimplemented (either unavailable or stubbed out as appropriate), whether because the target makes it impossible to implement or challenging to implement. The authors of pull requests are not obligated to avoid calling any portions of the standard library on the basis of a tier 3 target not implementing those portions.

It supports for std

> The target must provide documentation for the Rust community explaining how to build for the target, using cross-compilation if possible. If the target supports running binaries, or running tests (even if they do not pass), the documentation must explain how to run such binaries or tests for the target, using emulation if possible or dedicated hardware if necessary.

I have added the documentation, and I think it's clear.

> Tier 3 targets must not impose burden on the authors of pull requests, or other developers in the community, to maintain the target. In particular, do not post comments (automated or manual) on a PR that derail or suggest a block on the PR based on a tier 3 target. Do not send automated messages or notifications (via any medium, including via ``@)`` to a PR author or others involved with a PR regarding a tier 3 target, unless they have opted into such messages.

Understood.

> Backlinks such as those generated by the issue/PR tracker when linking to an issue or PR are not considered a violation of this policy, within reason. However, such messages (even on a separate repository) must not generate notifications to anyone involved with a PR who has not requested such notifications.

Understood.

> Patches adding or updating tier 3 targets must not break any existing tier 2 or tier 1 target, and must not knowingly break another tier 3 target without approval of either the compiler team or the maintainers of the other tier 3 target.

I believe I didn't break any other target.

> In particular, this may come up when working on closely related targets, such as variations of the same architecture with different features. Avoid introducing unconditional uses of features that another variation of the target may not have; use conditional compilation or runtime detection, as appropriate, to let each target run code supported by that target.

I think there are no such problems in this PR.
2023-10-23 08:12:40 +02:00
Matthias Krüger
fe4fde24e5
Rollup merge of #117044 - RalfJung:miri, r=RalfJung
Miri subtree update

This should unblock https://github.com/rust-lang/rust/pull/116581
2023-10-23 08:12:40 +02:00
Matthias Krüger
dde77f7a33
Rollup merge of #117042 - Zalathar:file-table, r=cjgillot
coverage: Emit the filenames section before encoding per-function mappings

When embedding coverage information in LLVM IR (and ultimately in the resulting binary), there are two main things that each CGU needs to emit:

- A single `__llvm_covmap` record containing a coverage header, which mostly consists of a list of filenames used by the CGU's coverage mappings.
- Several `__llvm_covfun` records, one for each instrumented function, each of which contains the hash of the list of filenames in the header.

There is a kind of loose cyclic dependency between the two: we need the hash of the file table before we can emit the covfun records, but we need to traverse all of the instrumented functions in order to build the file table.

The existing code works by processing the individual functions first. It lazily adds filenames to the file table, and stores the mostly-complete function records in a temporary list. After this it hashes the file table, emits the header (containing the file table), and then uses the hash to emit all of the function records.

This PR reverses that order: first we traverse all of the functions (without trying to prepare their function records) to build a *complete* file table, and then emit it immediately. At this point we have the file table hash, so we can then proceed to build and emit all of the function records, without needing to store them in an intermediate list.

---

Along the way, this PR makes some necessary changes that are also worthwhile in their own right:
- We split `FunctionCoverage` into distinct collector/finished phases, which neatly avoids some borrow-checker hassles when extracting a function's final expression/mapping data.
- We avoid having to re-sort a function's mappings when preparing the list of filenames that it uses.
2023-10-23 08:12:39 +02:00
Matthias Krüger
e86f9b6fce
Rollup merge of #105666 - notriddle:notriddle/stab-baseline, r=GuillaumeGomez
rustdoc: align stability badge to baseline instead of bottom

| desc | img |
|------|-----|
| before | ![image](https://user-images.githubusercontent.com/1593513/207412598-3a6468ca-a169-4810-a689-4797688385df.png) |
| | |
| after | ![image](https://user-images.githubusercontent.com/1593513/207412720-b120269a-48a3-40e9-a9b0-6769bb05e104.png) |

Preview: http://notriddle.com/notriddle-rustdoc-demos/stab-baseline/test_dingus/index.html

Based on comment from https://github.com/rust-lang/rust/pull/105509#discussion_r1044816673

r? ``@joshtriplett``
2023-10-23 08:12:39 +02:00
Michael Howell
b67985e113 rustdoc: wrap Type with Box instead of Generics
When these `Box<Generics>` types were introduced,
`Generics` was made with `Vec` and much larger.
Now that it's made with `ThinVec`, `Type` is bigger
and should be boxed instead.
2023-10-22 22:50:25 -07:00
bors
aec4741d42 Auto merge of #116606 - ChrisDenton:empty, r=dtolnay
On Windows make `read_dir` error on the empty path

This makes Windows consistent with other platforms. Note that this should not be taken to imply any decision on #114149 has been taken. However it was felt that while there is a lack of libs-api consensus, we should be consistent across platforms in the meantime.

This is a change in behaviour for Windows so will also need an fcp before merging.

r? libs-api
2023-10-23 05:38:33 +00:00
The Miri Conjob Bot
624f68da16 Merge from rustc 2023-10-23 05:37:15 +00:00
The Miri Conjob Bot
a80b5c00b6 Preparing for merge from rustc 2023-10-23 05:30:20 +00:00
Sean Cross
1f9f041c35 x.ps1: remove the check for Python from Windows Store
When installing Python from the Windows Store, a copy of `python.exe` is
installed inder the Microsoft directory in the user's local AppData
directory. Currently, `x.ps1` checks for this file, because by default
running `python.exe` opens a link to the Microsoft Store rather than
running Python.

Once the user installs Python, however, this contains a valid
interpreter. Unfortuantely, `x.ps1` can't tell the difference between a
legitimate Python install and the stub.

Remove the check, as it makes it impossible to use the official version
from Microsoft once it has been installed.

Signed-off-by: Sean Cross <sean@xobs.io>
2023-10-23 13:25:48 +08:00
bors
62fae2305e Auto merge of #117066 - calebcartwright:rustfmt-sync, r=calebcartwright
rustfmt subtree update

r? `@ghost`

Includes let chain formatting amongst a few other smaller changes and fixes
2023-10-23 02:48:09 +00:00
Caleb Cartwright
35400e8c16 bump rustfmt version 2023-10-22 20:34:12 -05:00
Caleb Cartwright
7650a7542c Merge commit '81fe905ca83cffe84322f27ca43950b617861ff7' into rustfmt-sync 2023-10-22 20:21:44 -05:00
Yacin Tmimi
81fe905ca8 chore: prep v1.7.0 release
bumping from v1.6.0 -> v1.7.0 since we added support for let-chains
2023-10-22 20:18:45 -05:00
Yacin Tmimi
ff3ce6b53c Fix typos and remove merge conflict artifacts from the changelog 2023-10-22 20:18:45 -05:00
Yacin Tmimi
75c7d1daff Add outstanding changelog entries for the next release 2023-10-22 20:18:45 -05:00
bors
111adde7ed Auto merge of #115324 - francorbacho:master, r=davidtwco
Suggest removing redundant arguments in format!()

Closes #105225. This is also a follow-up to #105635, which seems to have become stale.

r? `@estebank`
2023-10-23 00:51:35 +00:00
bors
913ceaee96 Auto merge of #117062 - Kobzol:update-rustc-perf, r=Mark-Simulacrum
Update rustc-perf version

Needed to unblock https://github.com/rust-lang/rust/pull/116033.

The commit first needs to be uploaded to our mirrors.

r? `@Mark-Simulacrum`
2023-10-22 21:57:27 +00:00
bjorn3
7c4fcd4165
Update readme for the move to the rust-lang org 2023-10-22 22:45:03 +02:00