about summary refs log tree commit diff
path: root/src/librustc/session
AgeCommit message (Collapse)AuthorLines
2016-07-28Store `crate_disambiguator` as an `InternedString`Niko Matsakis-2/+5
We used to use `Name`, but the session outlives the tokenizer, which means that attempts to read this field after trans has complete otherwise panic. All reads want an `InternedString` anyhow.
2016-07-24Tidy ups for code gen options helpCameron Hart-5/+6
Remove duplication code gen options and updated help to reflect changes.
2016-07-22remove the now-unused multiline error codeAriel Ben-Yehuda-77/+4
2016-07-21Auto merge of #34715 - scottcarr:mir-test, r=nikomatsakisbors-0/+2
Add MIR Optimization Tests I've starting working on the infrastructure for testing MIR optimizations. The plan now is to have a set of test cases (written in Rust), compile them with -Z dump-mir, and check the MIR before and after each pass.
2016-07-20add mir optimization tests, dump-mir-dir optionScott A Carr-0/+2
2016-07-19Merge branch 'master' into issue-30961Cameron Hart-10/+19
2016-07-17Auto merge of #34860 - jseyfried:encapsulate_hygiene, r=nrcbors-2/+2
Clean up and encapsulate `syntax::ext::mtwt`, rename `mtwt` to `hygiene` r? @nrc
2016-07-17Rename `mtwt` to `hygiene`Jeffrey Seyfried-2/+2
2016-07-17Auto merge of #34789 - jonathandturner:simplify_liberror, r=alexcrichtonbors-8/+17
Simplify librustc_errors This is part 2 of the error crate refactor, starting with #34403. In this refactor, I focused on slimming down the error crate to fewer moving parts. As such, I've removed quite a few parts and replaced the with simpler, straight-line code. Specifically, this PR: * Removes BasicEmitter * Remove emit from emitter, leaving emit_struct * Renames emit_struct to emit * Removes CoreEmitter and focuses on a single Emitter * Implements the latest changes to error format RFC (#1644) * Removes (now-unused) code in emitter.rs and snippet.rs * Moves more tests to the UI tester, removing some duplicate tests in the process There is probably more that could be done with some additional refactoring, but this felt like it was getting to a good state. r? @alexcrichton cc: @Manishearth (as there may be breaking changes in stuff I removed/changed)
2016-07-16Merge branch 'master' into issue-30961Cameron Hart-6/+1
2016-07-14Remove emit from emitter, leaving emit_structJonathan Turner-4/+6
2016-07-14Remove BasicEmitterJonathan Turner-4/+11
2016-07-12Mention the crate type cdylib in rustc's usageDridi Boukelmoune-1/+1
2016-07-10Move variant_size_differences out of transJonas Schievink-5/+0
Also enhances the error message a bit, fixes #30505 on the way, and adds a test (which was missing). Closes #34018
2016-07-11Add help for target CPUs, features, relocation and code models.Cameron Hart-2/+28
2016-07-08Adapt backend to trans::partitioning dictating the codegen-unit setup.Michael Woerister-9/+56
2016-07-03prefer `if let` to match with `None => {}` arm in some placesZack M. Davis-8/+5
This is a spiritual succesor to #34268/8531d581, in which we replaced a number of matches of None to the unit value with `if let` conditionals where it was judged that this made for clearer/simpler code (as would be recommended by Manishearth/rust-clippy's `single_match` lint). The same rationale applies to matches of None to the empty block.
2016-06-28cleanup: refactor away `ast::NodeIdAssigner`Jeffrey Seyfried-15/+4
2016-06-23make old school mode a bit more configurableJonathan Turner-1/+4
2016-06-23Consolidate codemap tests and fix more errors for travisJonathan Turner-7/+6
2016-06-23Move errors from libsyntax to its own crateJonathan Turner-8/+8
2016-06-06Remove old -Z options that do nothingJonas Schievink-11/+0
Technically, this is a [breaking-change], but I'm not sure what the policy for -Z flags is (especially unused ones).
2016-06-03Auto merge of #33460 - shepmaster:16-bit-pointers, r=Aatchbors-0/+1
Support 16-bit pointers as well as i/usize I'm opening this pull request to get some feedback from the community. Although Rust doesn't support any platforms with a native 16-bit pointer at the moment, the [AVR-Rust][ar] fork is working towards that goal. Keeping this forked logic up-to-date with the changes in master has been onerous so I'd like to merge these changes so that they get carried along when refactoring happens. I do not believe this should increase the maintenance burden. This is based on the original work of Dylan McKay (@dylanmckay). [ar]: https://github.com/avr-rust/rust
2016-05-27Emit "no-frame-pointer-elim" attribute for closures, shims, and glue.Michael Woerister-1/+6
2016-05-25trans: save metadata even with -Z no-trans.Eduard Burtescu-1/+1
2016-05-25rustc: use a simpler scheme for plugin registrar symbol names.Eduard Burtescu-0/+10
2016-05-20Auto merge of #33553 - alexcrichton:cdylibs, r=brsonbors-1/+4
rustc: Add a new crate type, cdylib This commit is an implementation of [RFC 1510] which adds a new crate type, `cdylib`, to the compiler. This new crate type differs from the existing `dylib` crate type in a few key ways: * No metadata is present in the final artifact * Symbol visibility rules are the same as executables, that is only reachable `extern` functions are visible symbols * LTO is allowed * All libraries are always linked statically This commit is relatively simple by just plubming the compiler with another crate type which takes different branches here and there. The only major change is an implementation of the `Linker::export_symbols` function on Unix which now actually does something. This helps restrict the public symbols from a cdylib on Unix. With this PR a "hello world" `cdylib` is 7.2K while the same `dylib` is 2.4MB, which is some nice size savings! [RFC 1510]: https://github.com/rust-lang/rfcs/pull/1510 Closes #33132
2016-05-19rustc: Add a new crate type, cdylibAlex Crichton-1/+4
This commit is an implementation of [RFC 1510] which adds a new crate type, `cdylib`, to the compiler. This new crate type differs from the existing `dylib` crate type in a few key ways: * No metadata is present in the final artifact * Symbol visibility rules are the same as executables, that is only reachable `extern` functions are visible symbols * LTO is allowed * All libraries are always linked statically This commit is relatively simple by just plubming the compiler with another crate type which takes different branches here and there. The only major change is an implementation of the `Linker::export_symbols` function on Unix which now actually does something. This helps restrict the public symbols from a cdylib on Unix. With this PR a "hello world" `cdylib` is 7.2K while the same `dylib` is 2.4MB, which is some nice size savings! [RFC 1510]: https://github.com/rust-lang/rfcs/pull/1510 Closes #33132
2016-05-19Support 16-bit pointers as well as i/usizeJake Goulding-0/+1
This is based on the original work of Dylan McKay for the [avr-rust project][ar]. [ar]: https://github.com/avr-rust/rust
2016-05-18fix indentation of session/mod.rsNiko Matsakis-3/+3
2016-05-18thread the DepGraph to session/crate-storeNiko Matsakis-10/+26
This is a [breaking-change] for plugin authors. You must now create a dep-graph earlier.
2016-05-09Auto merge of #32900 - alexcrichton:panic2abort, r=nikomatsakisbors-4/+37
rustc: Implement custom panic runtimes This commit is an implementation of [RFC 1513] which allows applications to alter the behavior of panics at compile time. A new compiler flag, `-C panic`, is added and accepts the values `unwind` or `panic`, with the default being `unwind`. This model affects how code is generated for the local crate, skipping generation of landing pads with `-C panic=abort`. [RFC 1513]: https://github.com/rust-lang/rfcs/blob/master/text/1513-less-unwinding.md Panic implementations are then provided by crates tagged with `#![panic_runtime]` and lazily required by crates with `#![needs_panic_runtime]`. The panic strategy (`-C panic` value) of the panic runtime must match the final product, and if the panic strategy is not `abort` then the entire DAG must have the same panic strategy. With the `-C panic=abort` strategy, users can expect a stable method to disable generation of landing pads, improving optimization in niche scenarios, decreasing compile time, and decreasing output binary size. With the `-C panic=unwind` strategy users can expect the existing ability to isolate failure in Rust code from the outside world. Organizationally, this commit dismantles the `sys_common::unwind` module in favor of some bits moving part of it to `libpanic_unwind` and the rest into the `panicking` module in libstd. The custom panic runtime support is pretty similar to the custom allocator support with the only major difference being how the panic runtime is injected (takes the `-C panic` flag into account). Closes #32837
2016-05-09rustc: Implement custom panic runtimesAlex Crichton-4/+37
This commit is an implementation of [RFC 1513] which allows applications to alter the behavior of panics at compile time. A new compiler flag, `-C panic`, is added and accepts the values `unwind` or `panic`, with the default being `unwind`. This model affects how code is generated for the local crate, skipping generation of landing pads with `-C panic=abort`. [RFC 1513]: https://github.com/rust-lang/rfcs/blob/master/text/1513-less-unwinding.md Panic implementations are then provided by crates tagged with `#![panic_runtime]` and lazily required by crates with `#![needs_panic_runtime]`. The panic strategy (`-C panic` value) of the panic runtime must match the final product, and if the panic strategy is not `abort` then the entire DAG must have the same panic strategy. With the `-C panic=abort` strategy, users can expect a stable method to disable generation of landing pads, improving optimization in niche scenarios, decreasing compile time, and decreasing output binary size. With the `-C panic=unwind` strategy users can expect the existing ability to isolate failure in Rust code from the outside world. Organizationally, this commit dismantles the `sys_common::unwind` module in favor of some bits moving part of it to `libpanic_unwind` and the rest into the `panicking` module in libstd. The custom panic runtime support is pretty similar to the custom allocator support with the only major difference being how the panic runtime is injected (takes the `-C panic` flag into account).
2016-05-09Add #[cfg(target_has_atomic)] to get atomic support for the current targetAmanieu d'Antras-0/+10
2016-05-05Fix some some duplicate words.Georg Brandl-1/+1
2016-05-02Auto merge of #32756 - nikomatsakis:borrowck-snippet, r=nrcbors-2/+2
Overhaul borrowck error messages and compiler error formatting generally This is a major overhaul of how the compiler reports errors. The primary goal is to be able to give many spans within the same overall context, such as this: ``` ./borrow-errors.rs:73:17: 73:20: error: cannot borrow `*vec` as immutable because previous closure requires unique access [E0501] 70 let append = |e| { ~~~ closure construction occurs here 71 vec.push(e) ~~~ previous borrow occurs due to use of `vec` in closure 72 }; 73 let data = &vec[3]; ~~~ borrow occurs here 74 } ~ borrow from closure ends here ``` However, in the process we made a number of other changes: - Removed the repetitive filenames from snippets and just give the line number. - Color the line numbers blue so they "fade away" - Remove the file name and line number from the error code suggestions since they don't seem to fit anymore. (This should probably happen in more places, like existing notes.) - Newlines in between errors to help group them better. This PR is not quite ready to land, but we thought it made sense to stop here and get some feedback from people at large. It'd be great if people can check out the branch and play with it. We'd be especially interested in hearing about cases that don't look good with the new formatting (I suspect they exist). Here is a checklist of some pending work items for this PR. Some of them may be best left for follow-up PRs: - [x] Accommodate multiple files in a `MultiSpan` (this should be easy) - In this case, we want to print filenames though. - [x] Remove duplicate E0500 code. - [x] Make the header message bold, rather than current hack that makes all errors/warnings bold - [x] Update warning text color (yellow is hard to read w/ a white background) Moved numerous follow-ups to: https://github.com/rust-lang/rust/issues/33240 Joint work with @jonathandturner. Fixes https://github.com/rust-lang/rust/issues/3533
2016-05-02refactor to use new snippet code and modelNiko Matsakis-2/+2
Major changes: - Remove old snippet rendering code and use the new stuff. - Introduce `span_label` method to add a label - Remove EndSpan mode and replace with a fn to get the last character of a span. - Stop using `Option<MultiSpan>` and just use an empty `MultiSpan` - and probably a bunch of other stuff :)
2016-04-29Emit warning to user when attempting to use optimize for size on non-nightly ↵Brandon Edens-0/+4
builds.
2016-04-28Place optimize for size and minsize rustc invocation options behind a nightlyBrandon Edens-11/+12
compiler check to prevent their inclusion in the stable / beta compilers.
2016-04-28Add opt-level options for optimizing for size and minimum size. This attemptsBrandon Edens-9/+13
to mimic the behavior of clang's options Os and Oz.
2016-04-28Auto merge of #33217 - aochagavia:fileloader, r=nrcbors-1/+13
rustc_driver: Allow running the compiler with a FileLoader cc @nrc. I chose to implement this in such a way that it doesn't break anything. Please let me know if you want me to change anything.
2016-04-27rustc_driver: Allow running the compiler with a FileLoaderAdolfo Ochagavía-1/+13
2016-04-26save-analysis-json: thread through -z optionNick Cameron-1/+3
In fact, we make JSOn the default and add an option for save-analysis-csv for the legacy behaviour. We also rename some bits and pieces `dxr` -> `save-analysis`
2016-04-20librustc: remove outdated workaroundTamir Duberstein-3/+0
Fixed upstream: https://github.com/llvm-mirror/llvm/commit/ca07e256f62f
2016-04-20Auto merge of #31709 - ranma42:target_feature-from-llvm, r=alexcrichtonbors-0/+57
Compute `target_feature` from LLVM This is a work-in-progress fix for #31662. The logic that computes the target features from the command line has been replaced with queries to the `TargetMachine`.
2016-04-17Auto merge of #33012 - pravic:describe-L-rustc-option, r=alexcrichtonbors-2/+3
List possible keys of the -L rustc option. Since `rustc --help -v` does not describe it, only *rustc.1* man page, but there is no man for Windows. r? @alexcrichton cc @steveklabnik
2016-04-16Auto merge of #32909 - sanxiyn:unused-trait-import-2, r=alexcrichtonbors-2/+0
Remove unused trait imports
2016-04-15Describe possible keys of the -L rustc option.pravic-2/+3
2016-04-14Rollup merge of #32868 - kraai:remove-comma, r=GuillaumeGomezSteve Klabnik-1/+1
Remove an extra command from the usage message
2016-04-12Remove unused trait importsSeo Sanghyeon-2/+0