about summary refs log tree commit diff
path: root/src/librustc_interface
AgeCommit message (Collapse)AuthorLines
2019-12-20introduce 'type AttrVec'Mazdak Farrokhzad-4/+3
2019-12-20Rollup merge of #67131 - Centril:item-merge, r=petrochenkovMazdak Farrokhzad-15/+10
Merge `TraitItem` & `ImplItem into `AssocItem` In this PR we: - Merge `{Trait,Impl}Item{Kind?}` into `AssocItem{Kind?}` as discussed in https://github.com/rust-lang/rust/issues/65041#issuecomment-538105286. - This is done by using the cover grammar of both forms. - In particular, it requires that we syntactically allow (under `#[cfg(FALSE)]`): - `default`ness on `trait` items, - `impl` items without a body / definition (`const`, `type`, and `fn`), - and associated `type`s in `impl`s with bounds, e.g., `type Foo: Ord;`. - The syntactic restrictions are replaced by semantic ones in `ast_validation`. - Move syntactic restrictions around C-variadic parameters from the parser into `ast_validation`: - `fn`s in all contexts now syntactically allow `...`, - `...` can occur anywhere in the list syntactically (`fn foo(..., x: usize) {}`), - and `...` can be the sole parameter (`fn foo(...) {}`. r? @petrochenkov
2019-12-19Fix documentation typoLeSeulArtichaut-1/+1
2019-12-12`AssocImplKind::{Method -> Fn}`.Mazdak Farrokhzad-1/+1
2019-12-12Remove `ast::{Impl,Trait}{Item,ItemKind}`.Mazdak Farrokhzad-10/+5
2019-12-12Unify associated item mut visitors.Mazdak Farrokhzad-2/+2
2019-12-12parse: refactor fun ret ty & param tyMazdak Farrokhzad-4/+4
2019-12-11rustc: Link LLVM directly into rustc againAlex Crichton-77/+12
This commit builds on #65501 continue to simplify the build system and compiler now that we no longer have multiple LLVM backends to ship by default. Here this switches the compiler back to what it once was long long ago, which is linking LLVM directly to the compiler rather than dynamically loading it at runtime. The `codegen-backends` directory of the sysroot no longer exists and all relevant support in the build system is removed. Note that `rustc` still supports a dynamically loaded codegen backend as it did previously, it just no longer supports dynamically loaded codegen backends in its own sysroot. Additionally as part of this the `librustc_codegen_llvm` crate now once again explicitly depends on all of its crates instead of implicitly loading them through the sysroot. This involved filling out its `Cargo.toml` and deleting all the now-unnecessary `extern crate` annotations in the header of the crate. (this in turn required adding a number of imports for names of macros too). The end results of this change are: * Rustbuild's build process for the compiler as all the "oh don't forget the codegen backend" checks can be easily removed. * Building `rustc_codegen_llvm` is much simpler since it's simply another compiler crate. * Managing the dependencies of `rustc_codegen_llvm` is much simpler since it's "just another `Cargo.toml` to edit" * The build process should be a smidge faster because there's more parallelism in the main rustc build step rather than splitting `librustc_codegen_llvm` out to its own step. * The compiler is expected to be slightly faster by default because the codegen backend does not need to be dynamically loaded. * Disabling LLVM as part of rustbuild is still supported, supporting multiple codegen backends is still supported, and dynamic loading of a codegen backend is still supported.
2019-12-11Rollup merge of #67074 - ehuss:extern-options, r=petrochenkovMazdak Farrokhzad-11/+12
Add options to --extern flag. This changes the `--extern` flag so that it can take a series of options that changes its behavior. The general syntax is `[opts ':'] name ['=' path]` where `opts` is a comma separated list of options. Two options are supported, `priv` which replaces `--extern-private` and `noprelude` which avoids adding the crate to the extern prelude. ```text --extern priv:mylib=/path/to/libmylib.rlib --extern noprelude:alloc=/path/to/liballoc.rlib ``` `noprelude` is to be used by Cargo's build-std feature in order to use `--extern` to reference standard library crates. This also includes a second commit which adds the `aux-crate` directive to compiletest. I can split this off into a separate PR if desired, but it helps with defining these kinds of tests. It is based on #54020, and can be used in the future to replace and simplify some of the Makefile tests.
2019-12-09Add options to --extern flag.Eric Huss-11/+12
2019-12-06Auto merge of #65195 - varkor:to_option, r=Centrilbors-22/+7
Rename `bool::then_*` to `bool::to_option_*` and use where appropriate Name change following https://github.com/rust-lang/rfcs/pull/2757. Also try it out throughout the compiler in places I think makes the code more readable.
2019-12-06Rename to `then_some` and `then`varkor-4/+4
2019-12-06Use `to_option_with` in several placesvarkor-1/+1
2019-12-06Use `to_option` in various placesvarkor-22/+7
2019-12-06Fix Query type docsÖmer Sinan Ağacan-2/+2
`give` no longer exists, `compute` is used to generate query results now.
2019-12-03Move early lint declarations to librustc_sessionMark Rousskov-2/+1
2019-12-01rustc_plugin: Some further cleanupVadim Petrochenkov-2/+1
Remove a useless test
2019-12-01rustc_plugin: Remove support for plugins adding LLVM passesVadim Petrochenkov-10/+5
2019-12-01rustc_plugin: Remove support for adding plugins from command lineVadim Petrochenkov-12/+2
2019-12-01rustc_plugin: Remove support for plugin argumentsVadim Petrochenkov-2/+1
2019-11-30pass Queries to compiler callbacksRalf Jung-0/+1
2019-11-29Rollup merge of #66791 - cjgillot:arena, r=Mark-SimulacrumRalf Jung-139/+194
Handle GlobalCtxt directly from librustc_interface query system This PR constructs the `GlobalCtxt` as a member of the `Queries` in librustc_interface. This simplifies the code to construct it, at the expense of added complexity in the query control flow. This allows to handle the arenas directly from librustc_interface. Based on #66707 r? @Zoxc
2019-11-28rustc_metadata: Merge `cstore.rs` into `creader.rs`Vadim Petrochenkov-3/+2
2019-11-27Allocate HIR Forest on arena.Camille GILLOT-3/+1
2019-11-27Misc renames.Camille GILLOT-7/+6
2019-11-27Simplify handling of AllArenas.Camille GILLOT-6/+5
2019-11-27Rename BoxedGlobalCtxt.Camille GILLOT-7/+7
2019-11-27Rename lifetimes.Camille GILLOT-22/+22
2019-11-26Move local Arena to Queries.Camille GILLOT-2/+10
2019-11-26Formatting.Camille GILLOT-37/+35
2019-11-26Have Queries own the GlobalCtxt.Camille GILLOT-53/+56
The construction of the GlobalCtxt is moved from a generator's stack to the Queries struct. Since the GlobalCtxt requires the HIR Forest and the arenas to live longer, those are moved into Queries the same way. The resulting handling of objects is more brittle, because consumers of the Once objects need to be careful of their initialisation.
2019-11-26Make the HIR map own the Definitions.Camille GILLOT-1/+1
2019-11-26Review nits.Camille GILLOT-4/+1
2019-11-25Superfluous lifetime.Camille GILLOT-2/+2
2019-11-25Pass Queries by reference.Camille GILLOT-5/+5
2019-11-25Remove wrong comment.Camille GILLOT-5/+0
2019-11-24Tidy.Camille GILLOT-1/+3
2019-11-24Move linking ouside the interface queries.Camille GILLOT-20/+44
2019-11-24Isolate compiler queries inside the Queries type.Camille GILLOT-44/+76
2019-11-24rustc_plugin: Remove support for syntactic pluginsVadim Petrochenkov-21/+8
2019-11-22Rollup merge of #66575 - Mark-Simulacrum:no-uii, r=petrochenkovMazdak Farrokhzad-1/+1
Remove pretty printing of specific nodes in AST The ability to print a specific item as identified by NodeId or path seems not particularly useful, and certainly carries quite a bit of complexity with it. This is intended to simplify our CLI parsing a bit and remove a non-uncomplicated piece of it; I largely did this to remove the dependency on NodeId from librustc/session but it's not really necessary to do so in this invasive a way. The alternative is moving it to librustc_interface or driver, probably.
2019-11-22Auto merge of #66565 - Mark-Simulacrum:syntax-cfg-mod, r=petrochenkovbors-6/+2
Move process_configure_mod to rustc_parse This removes the hack in favor of perhaps a less principled, but less painful, approach. This also supports my work to decouple `Session` from librustc, as `ParseSess` currently has `Attribute` as "part" of it but after this PR will no longer do so.
2019-11-20Delete ProcessCfgModMark Rousskov-6/+2
The previous commit removes the use of this, and now we cleanup.
2019-11-20Remove pretty printing of specific nodes in ASTMark Rousskov-1/+1
The ability to print a specific item as identified by NodeId or path seems not particularly useful, and certainly carries quite a bit of complexity with it.
2019-11-17Rename directory `rustc_plugin` -> `rustc_plugin_impl`Vadim Petrochenkov-1/+1
2019-11-17rustc_plugin: Remove the compatibility shimVadim Petrochenkov-3/+3
2019-11-17Rollup merge of #66456 - Centril:driver-codes, r=Mark-SimulacrumYuki Okushi-28/+14
Move `DIAGNOSTICS` usage to `rustc_driver` Remove `rustc_interface`'s dependency on `rustc_error_codes` and centralize all usages of `DIAGNOSTICS` in `rustc_driver`. Once we remove all references to `rustc_error_codes` in all other crates but `rustc_driver`, this should allow for incremental recompilation of the compiler to be smoother when tweaking error codes. This works towards https://github.com/rust-lang/rust/issues/66210#issuecomment-551862528. (May include traces of minor drive-by cleanup.) r? @Mark-Simulacrum
2019-11-16rustc_plugin: Remove `Registry::register_attribute`Vadim Petrochenkov-8/+1
2019-11-16move DIAGNOSTICS usage to rustc_driverMazdak Farrokhzad-28/+14
2019-11-14Update to use new librustc_error_codes libraryGuillaume Gomez-15/+3