about summary refs log tree commit diff
path: root/compiler/rustc_session
AgeCommit message (Collapse)AuthorLines
2021-07-14Make --cap-lints and related options leave crate hash aloneJeremy Fitzhardinge-3/+3
Closes: #87144
2021-07-14Add -Zfuture-incompat-test to assist with testing future-incompat reports.Eric Huss-0/+2
2021-07-13Auto merge of #86922 - joshtriplett:target-abi, r=oli-obkbors-1/+3
target abi Implement cfg(target_abi) (RFC 2992) Add an `abi` field to `TargetOptions`, defaulting to "". Support using `cfg(target_abi = "...")` for conditional compilation on that field. Gated by `feature(cfg_target_abi)`. Add a test for `target_abi`, and a test for the feature gate. Add `target_abi` to tidy as a platform-specific cfg. Update targets to use `target_abi` All eabi targets have `target_abi = "eabi".` All eabihf targets have `target_abi = "eabihf"`. `armv6_unknown_freebsd` and `armv7_unknown_freebsd` have `target_abi = "eabihf"`. All abi64 targets have `target_abi = "abi64"`. All ilp32 targets have `target_abi = "ilp32"`. All softfloat targets have `target_abi = "softfloat"`. All *-uwp-windows-* targets have `target_abi = "uwp"`. All spe targets have `target_abi = "spe"`. All macabi targets have `target_abi = "macabi"`. aarch64-apple-ios-sim has `target_abi = "sim"`. `x86_64-fortanix-unknown-sgx` has `target_abi = "fortanix"`. `x86_64-unknown-linux-gnux32` has `target_abi = "x32"`. Add FIXME entries for targets for which existing values need to change once `cfg_target_abi` becomes stable. (All of them are tier 3 targets.) Add a test for `target_abi` in `--print cfg`.
2021-07-11Simplify future incompatible reporting.Eric Huss-19/+2
2021-07-07Implement cfg(target_abi) (RFC 2992)Josh Triplett-1/+3
Add an `abi` field to `TargetOptions`, defaulting to "". Support using `cfg(target_abi = "...")` for conditional compilation on that field. Gated by `feature(cfg_target_abi)`. Add a test for `target_abi`, and a test for the feature gate. Add `target_abi` to tidy as a platform-specific cfg. This does not add an abi to any existing target.
2021-07-07Profile incremental hashingRyan Levick-1/+1
2021-07-06Auto merge of #86572 - rylev:force-warnings-always, r=nikomatsakisbors-1/+11
Force warnings even when can_emit_warnings == false Fixes an issue mentioned in #85512 with --cap-lints overriding --force-warnings. Fixes https://github.com/rust-lang/rust/issues/86751 r? `@ehuss`
2021-07-06Add flag to configure `large_assignments` lintTomasz Miąsko-0/+2
The `large_assignments` lints detects moves over specified limit. The limit is configured through `move_size_limit = "N"` attribute placed at the root of a crate. When attribute is absent, the lint is disabled. Make it possible to enable the lint without making any changes to the source code, through a new flag `-Zmove-size-limit=N`. For example, to detect moves exceeding 1023 bytes in a cargo crate, including all dependencies one could use: ``` $ env RUSTFLAGS=-Zmove-size-limit=1024 cargo build -vv ```
2021-07-06Revert "Revert "Merge CrateDisambiguator into StableCrateId""bjorn3-13/+13
This reverts commit 8176ab8bc18fdd7d3c2cf7f720c51166364c33a3.
2021-07-04Combine individual limit queries into single `limits` queryAaron Hill-0/+14
2021-07-04Query-ify global limit attribute handlingAaron Hill-38/+7
2021-07-03Rollup merge of #84029 - drahnr:master, r=petrochenkovYuki Okushi-0/+3
add `track_path::path` fn for usage in `proc_macro`s Adds a way to declare a dependency on external files without including them, to either re-trigger the build of a file as well as covering the use case of including dependencies within the `rustc` invocation, such that tools like `sccache`/`cachepot` are able to handle references to external files which are not included. Ref #73921
2021-07-02add track_path::path fn for proc-macro usageBernhard Schuster-0/+3
Ref #73921
2021-07-01New force_warn diagnostic builder and ensure cap-lints doesn't reduce ↵Ryan Levick-0/+10
force_warn level
2021-07-01Rollup merge of #86652 - nagisa:nagisa/non-leaf-fp, r=petrochenkovGuillaume Gomez-12/+0
Add support for leaf function frame pointer elimination This PR adds ability for the target specifications to specify frame pointer emission type that's not just “always” or “whatever cg decides”. In particular there's a new mode that allows omission of the frame pointer for leaf functions (those that don't call any other functions). We then set this new mode for Aarch64-based Apple targets. Fixes #86196
2021-07-01Auto merge of #86617 - joshtriplett:prune-dependencies, r=Mark-Simulacrumbors-1/+0
Remove unused dependencies from compiler crates Various compiler crates have dependencies that they don't appear to use. I used some scripting to detect such dependencies, filtered them based on some manual review, and removed those that do indeed appear to be entirely unused.
2021-06-30Add support for leaf fn frame pointer eliminationSimonas Kazlauskas-12/+0
This PR adds ability for the target specifications to specify frame pointer emission type that's not just “always” or “whatever cg decides”. In particular there's a new mode that allows omission of the frame pointer for leaf functions (those that don't call any other functions). We then set this new mode for Aarch64-based Apple targets. Fixes #86196
2021-06-30Force warnings even when can_emit_warnings == falseRyan Levick-1/+1
2021-06-28Introduce -Zprofile-closures to evaluate the impact of 2229Aman Arora-0/+2
This creates a CSV with name "closure_profile_XXXXX.csv", where the variable part is the process id of the compiler. To profile a cargo project you can run one of the following depending on if you're compiling a library or a binary: ``` cargo +stage1 rustc --lib -- -Zprofile-closures cargo +stage1 rustc --bin -- -Zprofile-closures ```
2021-06-26Auto merge of #86267 - ZuseZ4:master, r=nagisabors-0/+2
Allow loading of llvm plugins on nightly Based on a discussion in #82734 / with `@wsmoses.` Mainly moves [this](https://github.com/wsmoses/rust/commit/0149bc4e7e596005c665b132877abebe5258a0f6) behind a -Z flag, so it can only be used on nightly, as requested by `@nagisa` in https://github.com/rust-lang/rust/issues/82734#issuecomment-835863940 This change allows loading of llvm plugins like Enzyme. Right now it also requires a shared library LLVM build of rustc for symbol resolution. ```rust // test.rs extern { fn __enzyme_autodiff(_: usize, ...) -> f64; } fn square(x : f64) -> f64 { return x * x; } fn main() { unsafe { println!("Hello, world {} {}!", square(3.0), __enzyme_autodiff(square as usize, 3.0)); } } ``` ``` ./rustc test.rs -Z llvm-plugins="./LLVMEnzyme-12.so" -C passes="enzyme" ./test Hello, world 9 6! ``` I will try to figure out how to simplify the usage and get this into stable in a later iteration, but having this on nightly will already help testing further steps.
2021-06-25rustc_session: Remove unused dependency bitflagsJosh Triplett-1/+0
Unused since commit 64af7eae1ea25102c8197f9f190ee65ddc4f8a10 ("Move SanitizerSet to rustc_target").
2021-06-21Only hash OutputTypes keys in non-crate-hash modeAaron Hill-34/+74
This effectively turns OutputTypes into a hybrid where keys (OutputType) are TRACKED and the values (optional paths) are TRACKED_NO_CRATE_HASH.
2021-06-21make -Zno-codegen TRACKED_NO_CRATE_HASHJeremy Fitzhardinge-1/+1
2021-06-21In --emit KIND=PATH options, only hash KINDJeremy Fitzhardinge-2/+12
The PATH has no material effect on the emitted artifact, and setting the patch via `-o` or `--out-dir` does not affect the hash. Closes https://github.com/rust-lang/rust/issues/86044
2021-06-21Auto merge of #85775 - adamrk:warn-unused-target-fields, r=nagisabors-5/+13
Emit warnings for unused fields in custom targets. Add a warning which lists any fields in a custom target `json` file that aren't used. Currently unrecognized fields are ignored so, for example, a typo in the `json` will silently produce a target which isn't the one intended.
2021-06-18Auto merge of #85284 - eggyal:custom-profiler-runtime, r=jackh726bors-2/+2
Provide option for specifying the profiler runtime Currently, if `-Zinstrument-coverage` is enabled, the target is linked against the `library/profiler_builtins` crate (which pulls in LLVM's compiler-rt runtime). This option enables backends to specify an alternative runtime crate for handling injected instrumentation calls.
2021-06-17Emit warnings for unused fields in custom targets.Adam Bratschi-Kaye-5/+13
2021-06-15Auto merge of #86311 - LeSeulArtichaut:cleanup-array-iter, r=jackh726bors-2/+2
Use the now available implementation of `IntoIterator` for arrays
2021-06-14Use the now available implementation of `IntoIterator` for arraysLeSeulArtichaut-2/+2
2021-06-14Auto merge of #86117 - ehuss:force-warns-underscore, r=rylevbors-1/+2
Fix force-warns to allow dashes. The `--force-warns` flag was not allowing lint names with dashes, only supporting underscores. This changes it to allow dashes to match the behavior of the A/W/D/F flags.
2021-06-13allow loading of llvm plugins on nightlyManuel Drehwald-0/+2
2021-06-10Fix force-warns to allow dashes.Eric Huss-1/+2
2021-06-10gcc-lld mvp1000teslas-0/+18
ignore test if rust-lld not found create ld -> rust-lld symlink at build time instead of run time for testing in ci copy instead of symlinking remove linux check test for linker, suggestions from bjorn3 fix overly restrictive lld matcher use -Zgcc-ld flag instead of -Clinker-flavor refactor code adding lld to gcc path revert ci changes suggestions from petrochenkov rename gcc_ld to gcc-ld in dirs
2021-06-07Revert "Merge CrateDisambiguator into StableCrateId"bjorn3-13/+13
This reverts commit d0ec85d3fb6d322496cb8f4bc1c21e19f23284ad.
2021-06-05Auto merge of #84234 - jyn514:blanket-hash, r=Aaron1011bors-20/+22
Implement DepTrackingHash for `Option` through blanket impls instead of macros This avoids having to add a new macro call for both the `Option` and the type itself. Noticed this while working on https://github.com/rust-lang/rust/pull/84233. r? `@Aaron1011`
2021-06-04Auto merge of #85788 - rylev:force-warns, r=nikomatsakisbors-4/+27
Support for force-warns Implements https://github.com/rust-lang/rust/issues/85512. This PR adds a new command line option `force-warns` which will force the provided lints to warn even if they are allowed by some other mechanism such as `#![allow(warnings)]`. Some remaining issues: * https://github.com/rust-lang/rust/issues/85512 mentions that `force-warns` should also be capable of taking lint groups instead of individual lints. This is not implemented. * If a lint has a higher warning level than `warn`, this will cause that lint to warn instead. We probably want to allow the lint to error if it is set to a higher lint and is not allowed somewhere else. * One test is currently ignored because it's not working - when a deny-by-default lint is allowed, it does not currently warn under `force-warns`. I'm not sure why, but I wanted to get this in before the weekend. r? `@nikomatsakis`
2021-06-04Implement DepTrackingHash for `Option` through blanket impls instead of macrosJoshua Nelson-20/+22
This avoids having to add a new macro call for both the `Option` and the type itself.
2021-06-02Force warn on lint groups as wellRyan Levick-2/+11
2021-06-02Miscellaneous inlining improvementsTomasz Miąsko-0/+2
2021-06-01Rollup merge of #85473 - infinity0:master, r=jackh726Guillaume Gomez-1/+1
fix split-debuginfo error message
2021-05-31Auto merge of #85702 - Aaron1011:no-vec-sort, r=michaelwoeristerbors-26/+10
Don't sort a `Vec` before computing its `DepTrackingHash` Previously, we sorted the vec prior to hashing, making the hash independent of the original (command-line argument) order. However, the original vec was still always kept in the original order, so we were relying on the rest of the compiler always working with it in an 'order-independent' way. This assumption was not being upheld by the `native_libraries` query - the order of the entires in its result depends on the order of entries in `Options.libs`. This lead to an 'unstable fingerprint' ICE when the `-l` arguments were re-ordered. This PR removes the sorting logic entirely. Re-ordering command-line arguments (without adding/removing/changing any arguments) seems like a really niche use case, and correctly optimizing for it would require additional work. By always hashing arguments in their original order, we can entirely avoid a cause of 'unstable fingerprint' errors.
2021-05-30Auto merge of #85559 - 12101111:sanitizer-crt-static, r=nagisabors-0/+8
Diagnose use sanitizers with crt-static Fix: https://github.com/rust-lang/rust/issues/85459
2021-05-30Auto merge of #85362 - jsgf:fix-emit-metadata, r=estebankbors-0/+5
Use command line metadata path if provided If the command-line has `--emit metadata=some/path/libfoo.rmeta` then use that. Closes #85356 I couldn't find any existing tests for the `--emit TYPE=PATH` command line syntax, so I wasn't sure how to test this aside from ad-hoc manual testing. Is there a ui test type for "generated output file with expected name"?
2021-05-30Merge CrateDisambiguator into StableCrateIdbjorn3-13/+13
2021-05-28Use command line metadata path if providedJeremy Fitzhardinge-0/+5
If the command-line has `--emit metadata=some/path/libfoo.rmeta` then use that. Closes #85356
2021-05-28Initial support for force-warnsRyan Levick-3/+17
2021-05-29Diagnose use sanitizers with crt-static12101111-0/+8
2021-05-25Don't sort a `Vec` before computing its `DepTrackingHash`Aaron Hill-26/+10
Previously, we sorted the vec prior to hashing, making the hash independent of the original (command-line argument) order. However, the original vec was still always kept in the original order, so we were relying on the rest of the compiler always working with it in an 'order-independent' way. This assumption was not being upheld by the `native_libraries` query - the order of the entires in its result depends on the order of entries in `Options.libs`. This lead to an 'unstable fingerprint' ICE when the `-l` arguments were re-ordered. This PR removes the sorting logic entirely. Re-ordering command-line arguments (without adding/removing/changing any arguments) seems like a really niche use case, and correctly optimizing for it would require additional work. By always hashing arguments in their original order, we can entirely avoid a cause of 'unstable fingerprint' errors.
2021-05-25Rollup merge of #85361 - bjorn3:rustdoc_target_json_path_canonicalize, r=jyn514Guillaume Gomez-1/+4
Use TargetTriple::from_path in rustdoc This fixes the problem reported in https://github.com/Rust-for-Linux/linux/pull/272 where rustdoc requires the absolute path of a target spec json instead of accepting a relative path like rustc.
2021-05-24Use parse_target_triple in rustdocbjorn3-1/+4