about summary refs log tree commit diff
path: root/compiler/rustc_session/src
AgeCommit message (Collapse)AuthorLines
2021-08-05Remove warnings/errors from compiler when using typeck_body in rustdoc span ↵Guillaume Gomez-0/+4
map builder
2021-08-04Fix overflow in rustc happening if the `err_count()` is reduced in a stage.Hans Kratz-2/+1
This can happen if stashed diagnostics are removed or replaced with fewer errors. The semantics stay the same if built without overflow. Fixes #84219.
2021-08-04Add back -Zno-profiler-runtimeAmanieu d'Antras-2/+4
This was removed by #85284 in favor of -Zprofiler-runtime=<name>. However the suggested -Zprofiler-runtime=None doesn't work because "None" is treated as a crate name.
2021-08-02Rollup merge of #87608 - Aaron1011:remove-system-library, r=Mark-SimulacrumYuki Okushi-5/+0
Remove unused field `Session.system_library_path`
2021-08-01Auto merge of #87449 - matthiaskrgr:clippyy_v2, r=nagisabors-2/+2
more clippy::complexity fixes (also a couple of clippy::perf fixes)
2021-07-30Use multispan suggestions more oftenEsteban Küber-14/+6
* Use more accurate span for `async move` suggestion * Use more accurate span for deref suggestion * Use `multipart_suggestion` more often
2021-07-29Remove unused field `Session.system_library_path`Aaron Hill-5/+0
2021-07-27Rollup merge of #86450 - tmiasko:move-size-limit, r=pnkfelixYuki Okushi-0/+2
Add flag to configure `large_assignments` lint 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 ``` Lint tracking issue #83518.
2021-07-27Auto merge of #83491 - jyn514:remove-pretty, r=pnkfelixbors-80/+41
Remove unstable `--pretty` flag It doesn't do anything `--unpretty` doesn't, and due to a bug, also didn't show up in `--help`. I don't think there's any reason to keep it around, I haven't seen anyone using it. Closes https://github.com/rust-lang/rust/issues/36473.
2021-07-25clippy::single_char_patternMatthias Krüger-2/+2
2021-07-23Rename `known_attrs` to `expanded_inert_attrs` and move to rustc_expandAaron Hill-10/+0
There's no need for this to be (untracked) global state.
2021-07-22Auto merge of #87366 - GuillaumeGomez:rollup-7muueab, r=GuillaumeGomezbors-20/+1
Rollup of 6 pull requests Successful merges: - #87270 (Don't display <table> in item summary) - #87281 (Normalize generic_ty before checking if bound is met) - #87288 (rustdoc: Restore --default-theme, etc, by restoring varname escaping) - #87307 (Allow combining -Cprofile-generate and -Cpanic=unwind when targeting MSVC.) - #87343 (Regression fix to avoid further beta backports: Remove unsound TrustedRandomAccess implementations) - #87357 (Update my name/email in .mailmap) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-07-22Rollup merge of #87307 - michaelwoerister:pgo-unwind-msvc, r=nagisaGuillaume Gomez-20/+1
Allow combining -Cprofile-generate and -Cpanic=unwind when targeting MSVC. The LLVM limitation that previously prevented this has been fixed in LLVM 9 which is older than the oldest LLVM version we currently support. Fixes https://github.com/rust-lang/rust/issues/61002. r? ``@nagisa`` (or anyone else from ``@rust-lang/wg-llvm)``
2021-07-22Auto merge of #86619 - rylev:incr-hashing-profiling, r=wesleywiserbors-1/+1
Profile incremental compilation hashing fingerprints Adds profiling instrumentation for the hashing of incremental compilation fingerprints per query. This will eventually feed into the `measureme` and `rustc-perf` infrastructure for tracking if computing hashes changes over time. TODOs: * [x] Address the FIXME where we are including node interning in the hash timing. * [ ] Update measureme/summarize to handle this new data: https://github.com/rust-lang/measureme/pull/166 * [ ] ~Update rustc-perf to handle the new data from measureme~ (will be done at a later time) r? `@ghost` cc `@michaelwoerister`
2021-07-21Rename force-warns to force-warnRyan Levick-3/+3
2021-07-20Allow combining -Cprofile-generate and -Cpanic=unwind when targetingMichael Woerister-20/+1
MSVC. The LLVM limitation that previously prevented this has been fixed in LLVM 9 which is older than the oldest LLVM version we currently support. See https://github.com/rust-lang/rust/issues/61002.
2021-07-17Make `--force-warns` a normal lint level optioninquisitivecrystal-27/+13
2021-07-16Rollup merge of #87145 - jsgf:fix-lint-opt-hash, r=michaelwoeristerGuillaume Gomez-3/+3
Make --cap-lints and related options leave crate hash alone Closes: #87144
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-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-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.