about summary refs log tree commit diff
path: root/src/librustc/session
AgeCommit message (Collapse)AuthorLines
2018-09-15rustc: add unstable support for --extern crate_name without a path.Eduard-Mihai Burtescu-21/+22
2018-09-14Rollup merge of #53950 - michaelwoerister:more-lto-cli, r=alexcrichtonkennytm-20/+65
Allow for opting out of ThinLTO and clean up LTO related cli flag handling. It turns out that there currently is no way to explicitly disable ThinLTO (except for the nightly-only `-Zthinlto` flag). This PR extends `-C lto` to take `yes` and `no` in addition to `thin` and `fat`. It should be backwards compatible. It also cleans up how LTO mode selection is handled. Note that merging the PR in the current state would make the new values for `-C lto` available on the stable channel. I think that would be fine but maybe some team should vote on it.
2018-09-08Rollup merge of #54007 - japaric:gh53964, r=cramertjkennytm-0/+4
crates that provide a `panic_handler` are exempt from the `unused_extern_crates` lint fixes the *first* false positive reported in #53964
2018-09-06crates that provide a `panic_handler` are exempt from `unused_extern_crates`Jorge Aparicio-0/+4
fixes the *first* false positive reported in #53964
2018-09-06Validate syntax of `--cfg` command line argumentsVadim Petrochenkov-14/+25
2018-09-05Allow for opting out of ThinLTO and clean up LTO related cli flag handling.Michael Woerister-20/+65
2018-08-31Support local ThinLTO with incremental compilation.Michael Woerister-8/+13
2018-08-30Rollup merge of #53472 - eddyb:fx-pls, r=pnkfelixPietro Albini-7/+6
Use FxHash{Map,Set} instead of the default Hash{Map,Set} everywhere in rustc. Most of the compiler uses the `Fx` hasher but some places ended up with the default one.
2018-08-28Fix warnings about the `native` target-cpuAlex Crichton-7/+0
This fixes a regression from #53031 where specifying `-C target-cpu=native` is printing a lot of warnings from LLVM about `native` being an unknown CPU. It turns out that `native` is indeed an unknown CPU and we have to perform a mapping to an actual CPU name, but this mapping is only performed in one location rather than all locations we inform LLVM about the target CPU. This commit centralizes the mapping of `native` to LLVM's value of the native CPU, ensuring that all locations we inform LLVM about the `target-cpu` it's never `native`. Closes #53322
2018-08-28Use FxHash{Map,Set} instead of the default Hash{Map,Set} everywhere in rustc.Eduard-Mihai Burtescu-7/+6
2018-08-23use String::new() instead of String::from(""), "".to_string(), "".to_owned() ↵Matthias Krüger-3/+3
or "".into()
2018-08-20Auto merge of #52101 - japaric:linker-flavor, r=alexcrichtonbors-8/+1
try to infer linker flavor from linker name and vice versa This is a second take on PR #50359 that implements the logic proposed in https://github.com/rust-lang/rust/pull/50359#pullrequestreview-116663121 With this change it would become possible to link `thumb*` binaries using GNU's LD on stable as `-C linker=arm-none-eabi-ld` would be enough to change both the linker and the linker flavor from their default values of `arm-none-eabi-gcc` and `gcc`. To link `thumb*` binaries using rustc's LLD on stable `-Z linker-flavor` would need to be stabilized as `-C linker=rust-lld -Z linker-flavor=ld.lld` are both required to change the linker and the linker flavor, but this PR doesn't propose that. We would probably need some sort of stability guarantee around `rust-lld`'s name and availability to make linking with rustc's LLD truly stable. With this change it would also be possible to link `thumb*` binaries using a system installed LLD on stable using the `-C linker=ld.lld` flag (provided that `ld.lld` is a symlink to the system installed LLD). r? @alexcrichton
2018-08-19mv codemap source_mapDonato Sciarra-12/+12
2018-08-19mv codemap() source_map()Donato Sciarra-2/+2
2018-08-19mv (mod) codemap source_mapDonato Sciarra-6/+6
2018-08-19mv CodeMap SourceMapDonato Sciarra-4/+4
2018-08-18Use the new Entry::or_default method where possible.Eduard-Mihai Burtescu-2/+2
2018-08-15Clean up CodegenUnit name generation.Michael Woerister-0/+10
2018-08-09try to infer linker flavor from linker name and vice versaJorge Aparicio-8/+1
2018-08-09Move span_bug and bug helper functions to utilMark Rousskov-38/+0
2018-08-09Cache ignored attributes inside ICH entirelyMark Rousskov-6/+0
2018-08-09Move Fingerprint to data structuresMark Rousskov-1/+1
2018-08-09Reuse Hash impls for session data structuresMark Rousskov-33/+5
2018-08-09Remove dependency on rustc::ty from code_statsMark Rousskov-14/+1
2018-08-09Move rustc::util::fs into separate (new) crateMark Rousskov-2/+2
2018-08-08Address review comments for #53031 and fix some merge fallout.Michael Woerister-0/+7
2018-08-07Fix issue around dllimport and ThinLTO as LLD runs it.Michael Woerister-8/+19
2018-08-07Fix outdated description of -Zcross-lang-lto.Michael Woerister-1/+1
2018-08-04Use diagnostic API on SessionMark Rousskov-1/+1
2018-08-04Move share_generics getter onto options directlyMark Rousskov-0/+18
2018-08-04Move basic_options to impl of DefaultMark Rousskov-60/+62
2018-08-04Normalize DebugInfoLevel to standard styleMark Rousskov-15/+13
2018-08-04Normalize EntryFnType variants to standard styleMark Rousskov-3/+2
2018-08-04Normalize variants of Passes to standard styleMark Rousskov-11/+9
2018-08-04Normalize variants of CrateType to standard styleMark Rousskov-21/+20
This is a clippy-breaking change.
2018-08-04Privatize some exports from code_statsMark Rousskov-2/+2
2018-08-02Include additional data in the json outputWesley Wiser-1/+1
2018-08-02First pass at json outputWesley Wiser-0/+7
2018-08-02Basic profilingWesley Wiser-1/+18
2018-07-29Auto merge of #52738 - ljedrz:push_to_extend, r=eddybbors-3/+1
Replace push loops with extend() where possible Or set the vector capacity where I couldn't do it. According to my [simple benchmark](https://gist.github.com/ljedrz/568e97621b749849684c1da71c27dceb) `extend`ing a vector can be over **10 times** faster than `push`ing to it in a loop: 10 elements (6.1 times faster): ``` test bench_extension ... bench: 75 ns/iter (+/- 23) test bench_push_loop ... bench: 458 ns/iter (+/- 142) ``` 100 elements (11.12 times faster): ``` test bench_extension ... bench: 87 ns/iter (+/- 26) test bench_push_loop ... bench: 968 ns/iter (+/- 3,528) ``` 1000 elements (11.04 times faster): ``` test bench_extension ... bench: 311 ns/iter (+/- 9) test bench_push_loop ... bench: 3,436 ns/iter (+/- 233) ``` Seems like a good idea to use `extend` as much as possible.
2018-07-29Replace push loops with collect() and extend() where possibleljedrz-3/+1
2018-07-29Auto merge of #52767 - ljedrz:avoid_format, r=petrochenkovbors-2/+2
Prefer to_string() to format!() Simple benchmarks suggest in some cases it can be faster by even 37%: ``` test converting_f64_long ... bench: 339 ns/iter (+/- 199) test converting_f64_short ... bench: 136 ns/iter (+/- 34) test converting_i32_long ... bench: 87 ns/iter (+/- 16) test converting_i32_short ... bench: 87 ns/iter (+/- 49) test converting_str ... bench: 54 ns/iter (+/- 15) test formatting_f64_long ... bench: 349 ns/iter (+/- 176) test formatting_f64_short ... bench: 145 ns/iter (+/- 14) test formatting_i32_long ... bench: 98 ns/iter (+/- 14) test formatting_i32_short ... bench: 93 ns/iter (+/- 15) test formatting_str ... bench: 86 ns/iter (+/- 23) ```
2018-07-28Auto merge of #52355 - pietroalbini:zfeature, r=eddybbors-0/+2
Add the -Zcrate-attr=foo unstable rustc option This PR adds a new unstable option to `rustc`: `-Zcrate-attr=foo`. The option can be used to inject crate-level attributes from the CLI, and it's meant to be used by tools like Crater that needs to add their own attributes to a crate without changing the source code. The exact reason I need this is to implement "edition runs" in Crater: we need to add the preview feature flag to every crate, and editing the crates' source code on the fly might produce unexpected results, while a compiler flag is more reliable. cc https://github.com/rust-lang-nursery/crater/issues/282 @Mark-Simulacrum
2018-07-28Rollup merge of #52765 - sinkuu:remove_nonzeroing_move_opt, r=pnkfelixkennytm-9/+0
Remove unused "-Zenable_nonzeroing_move_hints" flag Removing a dead option which seems to be a remnant of the old drop-flag system.
2018-07-27Add the -Zcrate-attr=foo nightly rustc flag to inject crate attributesPietro Albini-0/+2
2018-07-27Prefer to_string() to format!()ljedrz-2/+2
2018-07-27Auto merge of #52681 - pnkfelix:z-borrowck-migrate, r=nikomatsakisbors-1/+16
Add `-Z borrowck=migrate` This adds `-Z borrowck=migrate`, which represents the way we want to migrate to NLL under Rust versions to come. It also hooks this new mode into `--edition 2018`, which means we're officially turning NLL on in the 2018 edition. The basic idea of `-Z borrowck=migrate` that there are cases where NLL is fixing old soundness bugs in the borrow-checker, but in order to avoid just breaking code by immediately rejecting the programs that hit those soundness bugs, we instead use the following strategy: If your code is accepted by NLL, then we accept it. If your code is rejected by both NLL and the old AST-borrowck, then we reject it. If your code is rejected by NLL but accepted by the old AST-borrowck, then we emit the new NLL errors as **warnings**. These warnings will be turned into hard errors in the future, and they say so in these diagnostics. Fix #46908
2018-07-27Remove unused option flagShotaro Yamada-9/+0
2018-07-26Add `migrate` to list of values for `-Z borrowck=...`Felix S. Klock II-1/+1
2018-07-26Add `-Z borrowck=migrate` flag, use it to link NLL up to AST-borrowck.Felix S. Klock II-0/+15