| Age | Commit message (Collapse) | Author | Lines |
|
unstable feature usage metrics
example output
```
test-lib on ξ master [?] is π¦ v0.1.0 via π¦ v1.80.1
β― cat src/lib.rs
ββββββββ¬βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β File: src/lib.rs
ββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββ
1 β #![feature(unix_set_mark)]
2 β pub fn add(left: u64, right: u64) -> u64 {
3 β left + right
4 β }
5 β
6 β #[cfg(test)]
7 β mod tests {
8 β use super::*;
9 β
10 β #[test]
11 β fn it_works() {
12 β let result = add(2, 2);
13 β assert_eq!(result, 4);
14 β }
15 β }
ββββββββ΄βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
test-lib on ξ master [?] is π¦ v0.1.0 via π¦ v1.80.1
β― cargo +stage1 rustc -- -Zmetrics-dir=$PWD/metrics
Compiling test-lib v0.1.0 (/home/yaahc/tmp/test-lib)
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.08s
test-lib on ξ master [?] is π¦ v0.1.0 via π¦ v1.80.1
β― cat metrics/unstable_feature_usage.json
ββββββββ¬βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β File: metrics/unstable_feature_usage.json
ββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
1 β {"lib_features":[{"symbol":"unix_set_mark"}],"lang_features":[]}
```
related to https://github.com/rust-lang/rust/issues/129485
|
|
I think the control flow in this function is complicated and confusing,
largely due to the use of two booleans `print_formatted` and
`fallback_to_println` that are set in multiple places and then used to
guide proceedings.
As well as hurting readability, this leads to at least one bug: if the
`write_termcolor_buf` call fails and the pager also fails, the function
will try to print color output to stdout, but that output will be empty
because `write_termcolor_buf` failed. I.e. the `if fallback_to_println`
body fails to check `print_formatted`.
This commit rewrites the function to be neater and more Rust-y, e.g. by
putting the result of `write_termcolor_buf` into an `Option` so it can
only be used on success, and by using `?` more. It also changes
terminology a little, using "pretty" to mean "formatted and colorized".
The result is a little shorter, more readable, and less buggy.
|
|
It's not necessary because `show_md_content_with_pager` is only ever
called if `is_terminal` is true.
|
|
`bat` is known as `batcat` on Ubuntu and Debian, not `catbat`.
|
|
|
|
busybox less does not support the -r flag and less(1) says:
USE OF THE -r OPTION IS NOT RECOMMENDED.
|
|
|
|
|
|
|
|
People often parse `-vV` output to get to the host triple, which is
annoying to do. It's easier to just get it directly.
|
|
This changes the naming to the new naming, used by `--print
target-tuple`.
It does not change all locations, but many.
|
|
|
|
The OS version depends on the deployment target environment variables,
the access of which we want to move to later in the compilation pipeline
that has access to more information, for example `env_depinfo`.
|
|
|
|
|
|
|
|
Disallow hidden references to mutable static
Closes #123060
Tracking:
- https://github.com/rust-lang/rust/issues/123758
|
|
Use `Vec` in `rustc_interface::Config::locale_resources`
This allows a third-party tool to injects its own resources, when receiving the config via `rustc_driver::Callbacks::config`.
|
|
Fix #128930: Print documentation of CLI options missing their arg
Fix #128930. Failing to give an argument to CLI options which require it now prints something like:
```
$ rustc --print
error: Argument to option 'print' missing
Usage:
--print [crate-name|file-names|sysroot|target-libdir|cfg|check-cfg|calling-conventions|target-list|target-cpus|target-features|relocation-models|code-models|tls-models|target-spec-json|all-target-specs-json|native-static-libs|stack-protector-strategies|link-args|deployment-target]
Compiler information to print on stdout
```
|
|
|
|
This does change the external interface, but not in a way that will
cause any breakage because external users don't mention the lifetimes.
|
|
|
|
Bump boostrap compiler to new beta
Accidentally left some comments on the update cfgs commit directly xd
|
|
Apple: Refactor deployment target version parsing
Refactor deployment target parsing to make it easier to do https://github.com/rust-lang/rust/pull/129342 (I wanted to make sure of all the places that `std::env::var` is called).
Specifically, my goal was to minimize the amount of target-specific configuration, so to that end I renamed the `opts` function that generates the `TargetOptions` to `base`, and made it return the LLVM target and `target_arch` too. In the future, I would like to move even more out of the target files and into `spec::apple`, as it makes it easier for me to maintain.
For example, this fixed a bug in `aarch64-apple-watchos`, which wasn't passing the deployment target as part of the LLVM triple. This (probably) fixes https://github.com/rust-lang/rust/issues/123582 and fixes https://github.com/rust-lang/rust/issues/107630.
We also now parse the patch version of deployment targets, allowing the user to specify e.g. `MACOSX_DEPLOYMENT_TARGET=10.12.6`.
Finally, this fixes the LLVM target name for visionOS, it should be `*-apple-xros` and not `*-apple-visionos`.
Since I have changed all the Apple targets here, I smoke-tested my changes by running the following:
```console
# Build each target
./x build library --target="aarch64-apple-darwin,aarch64-apple-ios,aarch64-apple-ios-macabi,aarch64-apple-ios-sim,aarch64-apple-tvos,aarch64-apple-tvos-sim,aarch64-apple-visionos,aarch64-apple-visionos-sim,aarch64-apple-watchos,aarch64-apple-watchos-sim,arm64_32-apple-watchos,arm64e-apple-ios,armv7k-apple-watchos,armv7s-apple-ios,i386-apple-ios,x86_64-apple-darwin,x86_64-apple-ios,x86_64-apple-ios-macabi,x86_64-apple-tvos,x86_64-apple-watchos-sim,x86_64h-apple-darwin"
# Test that we can still at least link basic projects
cargo new foobar && cd foobar && cargo +stage1 build --target=aarch64-apple-darwin --target=aarch64-apple-ios --target=aarch64-apple-ios-macabi --target=aarch64-apple-ios-sim --target=aarch64-apple-tvos --target=aarch64-apple-tvos-sim --target=aarch64-apple-visionos --target=aarch64-apple-visionos-sim --target=aarch64-apple-watchos --target=aarch64-apple-watchos-sim --target=arm64_32-apple-watchos --target=armv7s-apple-ios --target=i386-apple-ios --target=x86_64-apple-darwin --target=x86_64-apple-ios --target=x86_64-apple-ios-macabi --target=x86_64-apple-tvos --target=x86_64-apple-watchos-sim --target=x86_64h-apple-darwin
```
I couldn't build for the `arm64e-apple-darwin` target, the `armv7k-apple-watchos` and `arm64e-apple-ios` targets failed to link, and I know that the `i686-apple-darwin` target requires a bit of setup, but all of this is as it was before this PR.
r? thomcc
CC `@BlackHoleFox`
I would recommend using `rollup=never` when merging this, in case we need to bisect this later.
|
|
|
|
This allows a third-party tool to injects its own resources,
when receiving the config via `rustc_driver::Callbacks::config`.
|
|
- Merge minimum OS version list into one function (makes it easier to
see the logic in it).
- Parse patch deployment target versions.
- Consistently specify deployment target in LLVM target (previously
omitted on `aarch64-apple-watchos`).
|
|
|
|
Rustc driver cleanup
This adds a few comments to the driver to clarify a bit what's happening and does some cleanup.
|
|
|
|
|
|
|
|
More `unreachable_pub`
Add `unreachable_pub` checking to some more compiler crates. A follow-up to #126013.
r? ``@Urgau``
|
|
|
|
|
|
|
|
Use more slice patterns inside the compiler
Nothing super noteworthy. Just replacing the common 'fragile' pattern of "length check followed by indexing or unwrap" with slice patterns for legibility and 'robustness'.
r? ghost
|
|
|
|
|
|
|
|
The previous commit updated `rustfmt.toml` appropriately. This commit is
the outcome of running `x fmt --all` with the new formatting options.
|
|
|
|
|
|
Various refactorings to rustc_interface
This should make it easier to move the driver interface away from queries in the future. Many custom drivers call queries like `queries.global_ctxt()` before they are supposed to be called, breaking some things like certain `--print` and `-Zunpretty` options, `-Zparse-only` and emitting the dep info at the wrong point in time. They are also not actually necessary at all. Passing around the query output manually would avoid recomputation too and would be just as easy. Removing driver queries would also reduce the amount of global mutable state of the compiler. I'm not removing driver queries in this PR to avoid breaking the aforementioned custom drivers.
|
|
Deprecate no-op codegen option `-Cinline-threshold=...`
This deprecates `-Cinline-threshold` since using it has no effect. This has been the case since the new LLVM pass manager started being used, more than 2 years ago.
Recommend using `-Cllvm-args=--inline-threshold=...` instead.
Closes #89742 which is E-help-wanted.
|
|
|
|
|
|
This paves the way for tracking more state (e.g. error tainting) in the diagnostic context handle
|
|
This deprecates `-Cinline-threshold` since using it has no effect. This
has been the case since the new LLVM pass manager started being used,
more than 2 years ago.
|
|
The flag `--no-stack-check` does not exist:
$ rustc --no-stack-check
error: Unrecognized option: 'no-stack-check'. Did you mean `-C no-stack-check`?
|