summary refs log tree commit diff
path: root/src/librustc/session
AgeCommit message (Collapse)AuthorLines
2017-06-01Rollup merge of #42302 - GuillaumeGomez:new-error-codes-next, r=SusurrusCorey Farwell-7/+11
New error codes next Part #42229. To be merged after #42264. cc @Susurrus
2017-05-31Rollup merge of #42277 - citizen428:remove-crate-type-metadata, r=nikomatsakisMark Simulacrum-14/+4
Remove --crate-type=metadata deprecation warning Fixes #38640
2017-05-30Add new error codeGuillaume Gomez-7/+11
2017-05-30Remove --crate-type=metadata deprecation warningMichael Kohl-14/+4
Fixes #38640
2017-05-23incr.comp.: Track expanded spans instead of FileMaps.Michael Woerister-19/+4
2017-05-19Rollup merge of #42056 - sylvestre:master, r=alexcrichtonMark Simulacrum-3/+8
Improve the error management when /proc is not mounted This PR does two things: * Triggers an error on GNU/Linux & Android when /proc/self/exe doesn't exist * Handle the error properly
2017-05-19Rollup merge of #41971 - japaric:pre-link-args, r=alexcrichtonMark Simulacrum-2/+6
add -Z pre-link-arg{,s} to rustc This PR adds two unstable flags to `rustc`: `-Z pre-link-arg` and `-Z pre-link-args`. These are the counterpart of the existing `-C link-arg{,s}` flags and can be used to pass extra arguments at the *beginning* of the linker invocation, before the Rust object files are passed. I have [started] a discussion on the rust-embedded RFCs repo about settling on a convention for passing extra arguments to the linker and there are two options on discussion: `.cargo/config`'s `target.$T.rustflags` and custom target specification files (`{pre,,post}-link-args` fields). However, to compare these two options on equal footing this `-Z pre-link-arg` feature is required. [started]: https://github.com/rust-embedded/rfcs/pull/24 Therefore I'm requesting landing this `-Z pre-link-arg` flag as an experimental feature to evaluate these two options. cc @brson r? @alexcrichton
2017-05-18Enable cross-crate incremental compilation by default.Michael Woerister-1/+1
2017-05-17Improve the error management when /proc is not mountedSylvestre Ledru-3/+8
This PR does two things: * Triggers an error on GNU/Linux & Android when /proc/self/exe doesn't exist * Handle the error properly
2017-05-15Remove (direct) rustc_llvm dependency from rustc_driverRobin Kruppe-1/+1
This does not actually improve build times, since it still depends on rustc_trans, but is better layering and fits the multi-backend future slightly better.
2017-05-15Remove rustc_llvm dependency from librustcRobin Kruppe-54/+0
Consequently, session creation can no longer initialize LLVM. The few places that use the compiler without going through rustc_driver/CompilerCalls thus need to be careful to manually initialize LLVM (via rustc_trans!) immediately after session creation. This means librustc is not rebuilt when LLVM changes.
2017-05-13add -Z pre-link-arg{,s} to rustcJorge Aparicio-2/+6
This commit adds two unstable flags to `rustc`: `-Z pre-link-arg` and `-Z pre-link-args`. These are the counterpart of the existing `-C link-arg{,s}` flags and can be used to pass extra arguments at the *beginning* of the linker invocation, before the Rust object files are passed.
2017-05-10rustc: Add a new `-Z force-unstable-if-unmarked` flagAlex Crichton-0/+2
This commit adds a new `-Z` flag to the compiler for use when bootstrapping the compiler itself. We want to be able to use crates.io crates, but we also want the usage of such crates to be as ergonomic as possible! To that end compiler crates are a little tricky in that the crates.io crates are not annotated as unstable, nor do they expect to pull in unstable dependencies. To cover all these situations it's intended that the compiler will forever now bootstrap with `-Z force-unstable-if-unmarked`. This flags serves a dual purpose of forcing crates.io crates to themselves be unstable while also allowing them to use other "unstable" crates.io crates. This should mean that adding a dependency to compiler no longer requires upstream modification with unstable/staged_api attributes for inclusion!
2017-05-08incr.comp.: Hash more pieces of crate metadata to detect changes there.Michael Woerister-3/+20
2017-05-04rustc: Forbid `-Z` flags on stable/beta channelsAlex Crichton-68/+16
First deprecated in rustc 1.8.0 the intention was to never allow `-Z` flags make their way to the stable channel (or unstable options). After a year of warnings we've seen one of the main use cases, `-Z no-trans`, stabilized as `cargo check`. Otherwise while other use cases remain the sentiment is that now's the time to start forbidding `-Z` by default on stable/beta. Closes #31847
2017-05-02remove `mir_passes` from `Session` and add a FIXMENiko Matsakis-3/+0
2017-05-02simplify the MirPass traits and passes dramaticallyNiko Matsakis-0/+2
Overall goal: reduce the amount of context a mir pass needs so that it resembles a query. - The hooks are no longer "threaded down" to the pass, but rather run automatically from the top-level (we also thread down the current pass number, so that the files are sorted better). - The hook now receives a *single* callback, rather than a callback per-MIR. - The traits are no longer lifetime parameters, which moved to the methods -- given that we required `for<'tcx>` objecs, there wasn't much point to that. - Several passes now store a `String` instead of a `&'l str` (again, no point).
2017-05-02Removal pass for anonymous parametersest31-1/+1
Removes occurences of anonymous parameters from the rustc codebase, as they are to be deprecated. See issue #41686 and RFC 1685.
2017-04-28Auto merge of #41508 - michaelwoerister:generic-path-remapping, r=alexcrichtonbors-13/+48
Implement a file-path remapping feature in support of debuginfo and reproducible builds This PR adds the `-Zremap-path-prefix-from`/`-Zremap-path-prefix-to` commandline option pair and is a more general implementation of #41419. As opposed to the previous attempt, this implementation should enable reproducible builds regardless of the working directory of the compiler. This implementation of the feature is more general in the sense that the re-mapping will affect *all* paths the compiler emits, including the ones in error messages. r? @alexcrichton
2017-04-26remap-path-prefix: Validate number of commandline arguments passed.Michael Woerister-0/+17
2017-04-26Implement a file-path remapping feature in support of debuginfo and ↵Michael Woerister-13/+31
reproducible builds.
2017-04-25Support AddressSanitizer and ThreadSanitizer on x86_64-apple-darwin.kennytm-1/+1
ASan and TSan are supported on macOS, and this commit enables their support. The sanitizers are always built as *.dylib on Apple platforms, so they cannot be statically linked into the corresponding `rustc_?san.rlib`. The dylibs are directly copied to `lib/rustlib/x86_64-apple-darwin/lib/` instead. Note, although Xcode also ships with their own copies of ASan/TSan dylibs, we cannot use them due to version mismatch. There is a caveat: the sanitizer libraries are linked as @rpath, so the user needs to additionally pass `-C rpath`: rustc -Z sanitizer=address -C rpath file.rs ^~~~~~~~ Otherwise there will be a runtime error: dyld: Library not loaded: @rpath/libclang_rt.asan_osx_dynamic.dylib Referenced from: /path/to/executable Reason: image not found Abort trap: 6 The next commit includes a temporary change in compiler to force the linker to emit a usable @rpath.
2017-04-14add 'mir' as part of the --emit flag list in rustc --help menu and man doc.nate-1/+1
This is added because 'rustc' can now generate MIR (referencing to "Teach rustc --emit=mir #39891").
2017-04-13remove `LinkMeta` from `SharedCrateContext`Niko Matsakis-7/+5
A number of things were using `crate_hash` that really ought to be using `crate_disambiguator` (e.g., to create the plugin symbol names). They have been updated. It is important to remove `LinkMeta` from `SharedCrateContext` since it contains a hash of the entire crate, and hence it will change whenever **anything** changes (which would then require rebuilding **everything**).
2017-04-11Fix some nitsSimonas Kazlauskas-3/+2
2017-04-11Make a comment better.Austin Hicks-1/+1
2017-04-11Initial attempt at implementing optimization fuel and re-enabling struct ↵Austin Hicks-1/+1
field reordering.
2017-04-11Tests for -Z fuel=foo=nAustin Hicks-1/+1
2017-04-11Make a comment better.Austin Hicks-1/+1
2017-04-11Initial attempt at implementing optimization fuel and re-enabling struct ↵Austin Hicks-0/+76
field reordering.
2017-04-07-Z linker-flavorJorge Aparicio-3/+18
This patch adds a `-Z linker-flavor` flag to rustc which can be used to invoke the linker using a different interface. For example, by default rustc assumes that all the Linux targets will be linked using GCC. This makes it impossible to use LLD as a linker using just `-C linker=ld.lld` because that will invoke LLD with invalid command line arguments. (e.g. rustc will pass -Wl,--gc-sections to LLD but LLD doesn't understand that; --gc-sections would be the right argument) With this patch one can pass `-Z linker-flavor=ld` to rustc to invoke the linker using a LD-like interface. This way, `rustc -C linker=ld.lld -Z linker-flavor=ld` will invoke LLD with the right arguments. `-Z linker-flavor` accepts 4 different arguments: `em` (emcc), `ld`, `gcc`, `msvc` (link.exe). `em`, `gnu` and `msvc` cover all the existing linker interfaces. `ld` is a new flavor for interfacing GNU's ld and LLD. This patch also changes target specifications. `linker-flavor` is now a mandatory field that specifies the *default* linker flavor that the target will use. This change also makes the linker interface *explicit*; before, it used to be derived from other fields like linker-is-gnu, is-like-msvc, is-like-emscripten, etc. Another change to target specifications is that the fields `pre-link-args`, `post-link-args` and `late-link-args` now expect a map from flavor to linker arguments. ``` diff - "pre-link-args": ["-Wl,--as-needed", "-Wl,-z,-noexecstack"], + "pre-link-args": { + "gcc": ["-Wl,--as-needed", "-Wl,-z,-noexecstack"], + "ld": ["--as-needed", "-z,-noexecstack"], + }, ``` [breaking-change] for users of custom targets specifications
2017-03-21Teach rustc --emit=mirJake Goulding-0/+6
2017-03-17Rollup merge of #40463 - tshepang:nit, r=nikomatsakisCorey Farwell-1/+4
some style fixes
2017-03-13some style fixesTshepang Lekhonkhobe-1/+4
2017-03-12Update usages of 'OSX' (and other old names) to 'macOS'.Corey Farwell-1/+1
As of last year with version 'Sierra', the Mac operating system is now called 'macOS'.
2017-02-25rustc: introduce a query system for type information in ty::maps.Eduard Burtescu-4/+4
2017-02-25Rollup merge of #40037 - froydnj:overflow-checks, r=alexcrichtonEduard-Mihai Burtescu-0/+11
add `-C overflow-checks` option In addition to defining and handling the new option, we also add a method on librustc::Session for determining the necessity of overflow checks. This method provides a single point to sort out the three (!) different ways for turning on overflow checks: -C debug-assertions, -C overflow-checks, and -Z force-overflow-checks. I was seeing a [run-pass/issue-28950.rs](https://github.com/rust-lang/rust/blob/b1363a73ede57ae595f3a1be2bb75d308ba4f7f6/src/test/run-pass/issue-28950.rs) failure on my machine with these patches, but I was also seeing the failure without the changes to the core compiler. We'll see what travis says. Fixes #33134. r? @alexcrichton
2017-02-25Rollup merge of #40022 - wagenet:lib-defaults, r=alexcrichtonEduard-Mihai Burtescu-29/+30
Better handling of lib defaults r? @alexcrichton
2017-02-23Better handling of lib defaultsPeter Wagenet-29/+30
2017-02-22add `-C overflow-checks` optionNathan Froyd-0/+11
In addition to defining and handling the new option, we also add a method on librustc::Session for determining the necessity of overflow checks. This method provides a single point to sort out the three (!) different ways for turning on overflow checks: -C debug-assertions, -C overflow-checks, and -Z force-overflow-checks. Fixes #33134.
2017-02-20incr-comp: track the -Z sanitizer flagJorge Aparicio-3/+5
closes #39611
2017-02-08sanitizer supportJorge Aparicio-1/+24
2017-02-04Auto merge of #38426 - vadimcn:nobundle, r=alexcrichtonbors-0/+5
Implement kind="static-nobundle" (RFC 1717) This implements the "static-nobundle" library kind (last item from #37403). Rustc handles "static-nobundle" libs very similarly to dylibs, except that on Windows, uses of their symbols do not get marked with "dllimport". Which is the whole point of this feature.
2017-02-02introduce `LintTable`Niko Matsakis-14/+7
2017-01-24incr.comp.: Make cross-crate tracking for incr. comp. opt-in.Michael Woerister-0/+2
2017-01-19Feature gateVadim Chugunov-0/+4
2017-01-19Implement the "static-nobundle" library kind (RFC 1717).Vadim Chugunov-0/+1
These are static libraries that are not bundled (as the name implies) into rlibs and staticlibs that rustc generates, and must be present when the final binary artifact is being linked.
2017-01-17Refactor the parser to consume token trees.Jeffrey Seyfried-1/+2
2017-01-10Rollup merge of #38841 - F001:Fix, r=steveklabnikSeo Sanghyeon-1/+1
Update usage of rustc Add proc_macro crate type
2017-01-05Update usage of rustcF001-1/+1
Add proc_macro crate type