about summary refs log tree commit diff
path: root/src/librustc/session
AgeCommit message (Collapse)AuthorLines
2018-11-22rustc_target: separate out an individual Align from AbiAndPrefAlign.Eduard-Mihai Burtescu-1/+1
2018-11-22rustc_target: rename abi::Align to AbiAndPrefAlign.Eduard-Mihai Burtescu-2/+2
2018-11-21rustc: implement and use Default on more types.Eduard-Mihai Burtescu-1/+1
2018-11-19Fix error message for `-C panic=xxx`.Eric Huss-1/+1
2018-11-18Remove mir::StatementKind::EndRegionMatthew Jasper-2/+0
Since lexical MIR borrow check is gone, and validation no longer uses these, they can be removed.
2018-11-15Rollup merge of #55901 - euclio:speling, r=petrochenkovPietro Albini-6/+6
fix various typos in doc comments
2018-11-13fix various typos in doc commentsAndy Russell-6/+6
2018-11-12Make `NodeId` a `newtype_index` to enable niche optimizationsOliver Scherer-2/+2
2018-11-11rustc: Clean up allocator injection logicAlex Crichton-2/+0
This commit cleans up allocator injection logic found in the compiler around selecting the global allocator. It turns out that now that jemalloc is gone the compiler never actually injects anything! This means that basically everything around loading crates here and there can be easily pruned. This also removes the `exe_allocation_crate` option from custom target specs as it's no longer used by the compiler anywhere.
2018-11-11Rollup merge of #55630 - petrochenkov:noprelude, r=Centrilkennytm-0/+4
resolve: Filter away macro prelude in modules with `#[no_implicit_prelude]` on 2018 edition This is a tiny thing. For historical reasons macro prelude (macros from `#[macro_use] extern crate ...`, including `extern crate std`) is still available in modules with `#[no_implicit_prelude]`. This PR provides proper isolation and removes those names from scope. `#[no_implicit_prelude]` modules still have built-in types (`u8`), built-in attributes (`#[inline]`) and built-in macros (`env!("PATH")`) in scope. We can introduce some `#[no_implicit_prelude_at_all]` to remove those as well, but that's a separate issue. The change is done only on 2018 edition for backward compatibility. I'm pretty sure this can be done on 2015 as well because `#[no_implicit_prelude]` is rarely used, but I don't want to go through the crater/deprecation process right now, maybe later. cc https://github.com/rust-lang/rust/issues/53977 r? @ghost
2018-11-08Rollup merge of #55576 - birkenfeld:opt-level-error-msg, r=cramertjMark Rousskov-1/+1
Clarify error message for -C opt-level The new levels s and z are not mentioned as possible values.
2018-11-07Rollup merge of #55692 - matthiaskrgr:remark_debuginfo_hint, r=michaelwoeristerkennytm-2/+1
-C remark: fix incorrect warning about requiring "--debuginfo" instead of "-C debuginfo=n" Previously suggested "--debuginfo" does not actually work.
2018-11-07Rollup merge of #55495 - wesleywiser:opt_fuel_rustbuild, r=nikomatsakiskennytm-1/+1
Don't print opt fuel messages to stdout because it breaks Rustbuild Rustbuild passes `--message-format json` to the compiler invocations which causes JSON to be emitted on stdout. Printing optimization fuel messages to stdout breaks the json and causes Rustbuild to fail. Work around this by emitting optimization fuel related messages on stderr instead.
2018-11-05-C remark: fix incorrect warning about requiring "--debuginfo" instead of ↵Matthias Krüger-2/+1
"-C debuginfo=n"
2018-11-03resolve: Filter away macro prelude in modules with `#[no_implicit_prelude]` ↵Vadim Petrochenkov-0/+4
on 2018 edition
2018-11-01Clarify error message for -C opt-levelGeorg Brandl-1/+1
The new levels s and z are not mentioned as possible values.
2018-10-29Don't print opt fuel messages to stdout because it breaks RustbuildWesley Wiser-1/+1
Rustbuild passes `--message-format json` to the compiler invocations which causes JSON to be emitted on stdout. Printing optimization fuel messages to stdout breaks the json and causes Rustbuild to fail. Work around this by emitting optimization fuel related messages on stderr instead.
2018-10-29Emit Retag statements, kill Validate statementsRalf Jung-3/+2
Also "rename" -Zmir-emit-validate to -Zmir-emit-retag, which is just a boolean (yes or no).
2018-10-19Prefer `Default::default` over `FxHash*::default` in struct constructorsOliver Scherer-6/+4
2018-10-19Deprecate the `FxHashMap()` and `FxHashSet()` constructor function hackOliver Scherer-3/+3
2018-10-18Rollup merge of #55031 - nikic:verify_llvm_ir, r=Mark-Simulacrumkennytm-0/+1
Improve verify_llvm_ir config option LLVM IR verification has been disabled by default in #51230. However, the implementation doesn't quite match what was discussed in the discussion. This patch implements two changes: * Make `verify_llvm_ir` influence the behavior of the compiled rustc binary, rather than just the rustc build system. That is, if `verify_llvm_ir=true`, even manual invocations of the built rustc will verify LLVM IR. * Enable verification of LLVM IR in CI, for non-deploy and deploy-alt builds. This is similar to how LLVM assertions are handled.
2018-10-17Auto merge of #54671 - petrochenkov:extpre2015, r=nikomatsakisbors-18/+0
resolve: Scale back hard-coded extern prelude additions on 2015 edition https://github.com/rust-lang/rust/pull/54404 stabilized `feature(extern_prelude)` on 2015 edition, including the hard-coded parts not passed with `--extern`. First of all, I'd want to confirm that this is intended stabilization, rather than a part of the "extended beta" scheme that's going to be reverted before releasing stable. (EDIT: to clarify - this is a question, I'm \*asking\* for confirmation, rather than give it.) Second, on 2015 edition extern prelude is not so fundamentally tied to imports and is a mere convenience, so this PR scales them back to the uncontroversial subset. The "uncontroversial subset" means that if libcore is injected it brings `core` into prelude, if libstd is injected it brings `std` and `core` into prelude. On 2015 edition this can be implemented through the library prelude (rather than hard-coding in the compiler) right now, I'll do it in a follow-up PR. UPDATE: The change is done for both 2015 and 2018 editions now as discussed below. Closes https://github.com/rust-lang/rust/issues/53166
2018-10-15rustc/session: move consts up to improve readabilityljedrz-9/+9
2018-10-15rustc/session: use to_owned when no string conversion is neededljedrz-2/+2
2018-10-15rustc/session: improve common patternsljedrz-58/+35
2018-10-15rustc/session: improve allocationsljedrz-5/+6
2018-10-15rustc/session: whitespace & formatting improvementsljedrz-85/+79
2018-10-13Revert "rustc_resolve: move extern_prelude from Resolver to Session."Vadim Petrochenkov-18/+0
This reverts commit e90985acdec9928da9f6d157cfeb64f0ee98bffe.
2018-10-13Improve verify_llvm_ir config optionNikita Popov-0/+1
* Make it influence the behavior of the compiled rustc, rather than just the rustc build system. That is, if verify_llvm_ir=true, even manual invocations of the built rustc will verify LLVM IR. * Enable verification of LLVM IR in CI, for non-deploy and deploy-alt builds. This is similar to how LLVM assertions are handled.
2018-10-11Support for disabling the PLT on ELF targetsGabriel Majeri-2/+26
Disable the PLT where possible to improve performance for indirect calls into shared libraries. This optimization is enabled by default where possible. - Add the `NonLazyBind` attribute to `rustllvm`: This attribute informs LLVM to skip PLT calls in codegen. - Disable PLT unconditionally: Apply the `NonLazyBind` attribute on every function. - Only enable no-plt when full relro is enabled: Ensures we only enable it when we have linker support. - Add `-Z plt` as a compiler option
2018-10-02Move prelude crate names into `Session`.David Wood-7/+6
Avoid hardcoding and special-casing the `std` crate name in the item path logic by moving the prelude crate name logic into the `Session` type so it can be reused in the item path logic and resolve module.
2018-10-01Rollup merge of #54676 - ↵kennytm-2/+0
pnkfelix:issue-15287-kill-zflag-disabling-ast-check, r=alexcrichton Remove `-Z disable_ast_check_for_mutation_in_guard` One should use `#![feature(bind_by_move_pattern_guards)]` over `-Z disable_ast_check_for_mutation_in_guard` cc #15287
2018-10-01Auto merge of #54675 - alexcrichton:defaultlibs, r=varkorbors-0/+2
rust: Add a `-C default-linker-libraries` option This commit adds a new codegen option for the compiler which disables rustc's passing of `-nodefaultlibs` by default on relevant platforms. Sometimes Rust is linked with C code which fails to link with `-nodefaultlibs` and is unnecessarily onerous to get linking correctly with `-nodefaultlibs`. An example of this is that when you compile C code with sanitizers and then pass `-fsanitize=address` to the linker, it's incompatible with `-nodefaultlibs` also being passed to the linker. In these situations it's easiest to turn off Rust's default passing of `-nodefaultlibs`, which was more ideological to start with than anything! Preserving the default is somewhat important but having this be opt-in shouldn't cause any breakage. Closes #54237
2018-09-30Auto merge of #54650 - eddyb:no-extern's-land, r=alexcrichtonbors-1/+18
Don't lint non-extern-prelude extern crate's in Rust 2018. Fixes #54381 by silencing the lint telling users to remove `extern crate` when `use` doesn't work. r? @alexcrichton cc @petrochenkov @nikomatsakis @Centril
2018-09-29don't elide lifetimes in paths in librustc/Zack M. Davis-7/+7
This seemed like a good way to kick the tires on the elided-lifetimes-in-paths lint (#52069)—seems to work! This was also pretty tedious—it sure would be nice if `cargo fix` worked on this codebase (#53896)!
2018-09-29rust: Add a `-C default-linker-libraries` optionAlex Crichton-0/+2
This commit adds a new codegen option for the compiler which disables rustc's passing of `-nodefaultlibs` by default on relevant platforms. Sometimes Rust is linked with C code which fails to link with `-nodefaultlibs` and is unnecessarily onerous to get linking correctly with `-nodefaultlibs`. An example of this is that when you compile C code with sanitizers and then pass `-fsanitize=address` to the linker, it's incompatible with `-nodefaultlibs` also being passed to the linker. In these situations it's easiest to turn off Rust's default passing of `-nodefaultlibs`, which was more ideological to start with than anything! Preserving the default is somewhat important but having this be opt-in shouldn't cause any breakage. Closes #54237
2018-09-28rustc_resolve: move extern_prelude from Resolver to Session.Eduard-Mihai Burtescu-1/+18
2018-09-28Prefer `#![feature(bind_by_move_pattern_guards)]` over `-Z ↵Felix S. Klock II-2/+0
disable_ast_check_for_mutation_in_guard`
2018-09-26add -Z emit-stack-sizesJorge Aparicio-0/+2
2018-09-25incr.comp.: Don't automatically enable -Zshare-generics for incr.comp. builds.Michael Woerister-1/+0
2018-09-23Auto merge of #54325 - michaelwoerister:incr-thinlto-tests, r=alexcrichtonbors-0/+11
incr.comp.: Allow for more fine-grained testing of CGU reuse and use it to test incremental ThinLTO. This adds some tests specifically targeted at incremental ThinLTO, plus the infrastructure for tracking the kind of cache hit/miss we had for a given CGU. @alexcrichton, let me know if you can think of any more tests to add. ThinLTO works rather reliably for small functions, so we should be able to test it in a robust way. I think after this lands it might time for a "Help us test incremental ThinLTO" post on irlo. r? @alexcrichton
2018-09-22Auto merge of #54188 - lqd:fallout-53695, r=nikomatsakisbors-1/+1
NLL: disallow creation of immediately unusable variables Fix #53695 Original description follows ---- This WIP PR is for discussing the impact of fixing #53695 by injecting a fake read in let patterns. (Travis will fail, at least the `mir-opt` suite is failing in its current state)
2018-09-20Auto merge of #54241 - vi:suggest_with_applicability, r=estebankbors-3/+8
Remove usages of span_suggestion without Applicability Use `Applicability::Unspecified` for all of them instead. Shall deprecations for the non-`_with_applicability` functions be added? Shall clippy be addressed somehow? r? @estebank
2018-09-18incr.comp.: Allow for more fine-grained testing of CGU reuse and use it to ↵Michael Woerister-0/+11
test incremental ThinLTO.
2018-09-18Refactor 'ReadForMatch' into 'FakeRead' and add the cause of the fake readRemy Rakic-1/+1
2018-09-18Rollup merge of #54232 - pnkfelix:add-way-to-disable-diagnostic-buffering, ↵Guillaume Gomez-0/+4
r=nikomatsakis add `-Z dont-buffer-diagnostics` Add `-Z dont-buffer-diagnostics`, a way to force NLL to immediately its diagnostics. This is mainly intended for developers who want to see the error in its original context in the control flow. Two uses cases for that are: 1. `-Z treat-err-as-bug` (which then allows extraction of a stack-trace to the origin of the error) 2. RUST_LOG=... rustc, in which case it is often useful to see the logging statements that occurred immediately prior to the point where the diagnostic was signalled.
2018-09-17Whitespace fix again.Vitaly _Vi Shukela-5/+5
2018-09-17Add -Z dont-buffer-diagnostics, a way to force NLL to immediately emit its ↵Felix S. Klock II-0/+4
diagnostics. This is mainly intended for `rustc` developers who want to see a diagnostic in its original context in the control flow. Two uses cases for that are: * `-Z treat-err-as-bug` which then allows extraction of a stack-trace to the origin of the error (a case that is so important that we make that flag imply this one, effectively). * `RUST_LOG=... rustc`, in which case it is often useful to see the logging statements that occurred immediately prior to the point where the diagnostic was signalled. Drive-by: Added some documentation pointing future devs at HandlerFlags, and documented the fields of `HandlerFlags` itself.
2018-09-17Fix style according to review comments.Vitaly _Vi Shukela-2/+6
2018-09-16Remove usages of span_suggestion without ApplicabilityVitaly _Vi Shukela-3/+4
Use Applicability::Unspecified for all of them instead.