about summary refs log tree commit diff
path: root/src/librustc_metadata
AgeCommit message (Collapse)AuthorLines
2018-07-16ItemKindcsmoe-82/+82
2018-07-16ForeignItemKindcsmoe-5/+5
2018-07-16TyKindcsmoe-1/+1
2018-07-16ExprKindcsmoe-1/+1
2018-07-11Deny bare trait objects in in src/librustc_metadataljedrz-12/+14
2018-07-10Upgrade to LLVM's master branch (LLVM 7)Alex Crichton-25/+0
This commit upgrades the main LLVM submodule to LLVM's current master branch. The LLD submodule is updated in tandem as well as compiler-builtins. Along the way support was also added for LLVM 7's new features. This primarily includes the support for custom section concatenation natively in LLD so we now add wasm custom sections in LLVM IR rather than having custom support in rustc itself for doing so. Some other miscellaneous changes are: * We now pass `--gc-sections` to `wasm-ld` * The optimization level is now passed to `wasm-ld` * A `--stack-first` option is passed to LLD to have stack overflow always cause a trap instead of corrupting static data * The wasm target for LLVM switched to `wasm32-unknown-unknown`. * The syntax for aligned pointers has changed in LLVM IR and tests are updated to reflect this. * The `thumbv6m-none-eabi` target is disabled due to an [LLVM bug][llbug] Nowadays we've been mostly only upgrading whenever there's a major release of LLVM but enough changes have been happening on the wasm target that there's been growing motivation for quite some time now to upgrade out version of LLD. To upgrade LLD, however, we need to upgrade LLVM to avoid needing to build yet another version of LLVM on the builders. The revision of LLVM in use here is arbitrarily chosen. We will likely need to continue to update it over time if and when we discover bugs. Once LLVM 7 is fully released we can switch to that channel as well. [llbug]: https://bugs.llvm.org/show_bug.cgi?id=37382
2018-07-04Auto merge of #51895 - nikomatsakis:move-self-trait-predicate-to-items, ↵bors-0/+37
r=scalexm Move self trait predicate to items This is a "reimagination" of @tmandry's PR #50183. The main effect is described in this comment from one of the commits: --- Before we had the following results for `predicates_of`: ```rust trait Foo { // predicates_of: Self: Foo fn bar(); // predicates_of: Self: Foo (inherited from trait) } ``` Now we have removed the `Self: Foo` from the trait. However, we still add it to the trait ITEM. This is because when people do things like `<T as Foo>::bar()`, they still need to prove that `T: Foo`, and having it in the `predicates_of` seems to be the cleanest way to ensure that happens right now (otherwise, we'd need special case code in various places): ```rust trait Foo { // predicates_of: [] fn bar(); // predicates_of: Self: Foo } ``` However, we sometimes want to get the list of *just* the predicates truly defined on a trait item (e.g., for chalk, but also for a few other bits of code). For that, we define `predicates_defined_on`, which does not contain the `Self: Foo` predicate yet, and we plumb that through metadata and so forth. --- I'm assigning @eddyb as the main reviewer, but I thought I might delegate to scalexm for this one in any case. I also want to post an alternative that I'll leave in the comments; it occurred to me as I was writing. =) r? @eddyb cc @scalexm @tmandry @leodasvacas
2018-07-02introduce `predicates_defined_on` for traitsNiko Matsakis-0/+37
This new query returns only the predicates *directly defined* on an item (in contrast to the more common `predicates_of`, which returns the predicates that must be proven to reference an item). These two sets are almost always identical except for traits, where `predicates_of` includes an artificial `Self: Trait<...>` predicate (basically saying that you cannot use a trait item without proving that the trait is implemented for the type parameters). This new query is only used in chalk lowering, where this artificial `Self: Trait` predicate is problematic. We encode it in metadata but only where needed since it is kind of repetitive with existing information. Co-authored-by: Tyler Mandry <tmandry@gmail.com>
2018-07-01call it `hir::VisibilityKind` instead of `hir::Visibility_:*`Zack M. Davis-1/+1
It was pointed out in review that the glob-exported underscore-suffixed convention for `Spanned` HIR nodes is no longer preferred: see February 2016's #31487 for AST's migration away from this style towards properly namespaced NodeKind enums. This concerns #51968.
2018-06-30in which hir::Visibility recalls whence it came (i.e., becomes Spanned)Zack M. Davis-1/+3
There are at least a couple (and plausibly even three) diagnostics that could use the spans of visibility modifiers in order to be reliably correct (rather than hacking and munging surrounding spans to try to infer where the visibility keyword must have been). We follow the naming convention established by the other `Spanned` HIR nodes: the "outer" type alias gets the "prime" node-type name, the "inner" enum gets the name suffixed with an underscore, and the variant names are prefixed with the prime name and `pub use` exported from here (from HIR). Thanks to veteran reviewer Vadim Petrochenkov for suggesting this uniform approach. (A previous draft, based on the reasoning that `Visibility::Inherited` should not have a span, tried to hack in a named `span` field on `Visibility::Restricted` and a positional field on `Public` and `Crate`. This was ... not so uniform.)
2018-06-30Auto merge of #51717 - Mark-Simulacrum:snap, r=alexcrichtonbors-1/+0
Bootstrap from 1.28.0 beta
2018-06-30Bootstrap from 1.28.0-beta.3Mark Simulacrum-1/+0
2018-06-30Fortify dummy span checkingVadim Petrochenkov-2/+2
2018-06-30expansion: Give names to some fields of `SyntaxExtension`Vadim Petrochenkov-5/+10
2018-06-28Auto merge of #50997 - michaelwoerister:pre-analyze-filemaps, r=Mark-Simulacrumbors-6/+3
Make FileMap::{lines, multibyte_chars, non_narrow_chars} non-mutable. This PR removes most of the interior mutability from `FileMap`, which should be beneficial, especially in a multithreaded setting. This is achieved by initializing the state in question when the filemap is constructed instead of during lexing. Hopefully this doesn't degrade performance. cc @wesleywiser
2018-06-28Support delegation in stable hashing macrosVadim Petrochenkov-0/+1
2018-06-28Use `Ident`s for associated item definitions in HIRVadim Petrochenkov-1/+1
Remove emulation of hygiene with gensyms
2018-06-28Use `Ident`s in a number of structures in HIRVadim Petrochenkov-7/+5
Namely: labels, type parameters, bindings in patterns, parameter names in functions without body. All of these do not need hygiene after lowering to HIR, only span locations.
2018-06-27Make FileMap::{lines, multibyte_chars, non_narrow_chars} non-mutable.Michael Woerister-6/+3
2018-06-27Make opaque::Encoder append-only and make it infallibleJohn Kåre Alsaker-18/+16
2018-06-23hygiene: Do not reset expansion info for `quote!`Vadim Petrochenkov-2/+2
2018-06-21async await desugaring and testsTaylor Cramer-1/+4
2018-06-21Parse async fn header.Without Boats-6/+6
This is gated on edition 2018 & the `async_await` feature gate. The parser will accept `async fn` and `async unsafe fn` as fn items. Along the same lines as `const fn`, only `async unsafe fn` is permitted, not `unsafe async fn`.The parser will not accept `async` functions as trait methods. To do a little code clean up, four fields of the function type struct have been merged into the new `FnHeader` struct: constness, asyncness, unsafety, and ABI. Also, a small bug in HIR printing is fixed: it previously printed `const unsafe fn` as `unsafe const fn`, which is grammatically incorrect.
2018-06-20Use ty::Generics instead of hir::Generics for various checksvarkor-2/+3
2018-06-20Refactor generic parameters in rustdoc/cleanvarkor-11/+8
2018-06-20Remove all traces of lifetimes() and types() methodsvarkor-6/+4
2018-06-20Remove specific parameter iterators from hir::Genericsvarkor-2/+7
2018-06-20Refactor hir::GenericParam as a structvarkor-4/+11
2018-06-19Update the error message for a missing global allocatorSimon Sapin-2/+4
Don’t mention `#[default_lib_allocator]` (which is an implementation detail irrelevant to most users) and instead suggest using `#[global_allocator]`, which is often the correct fix.
2018-06-18Auto merge of #51414 - oli-obk:impl_trait_type_def, r=pnkfelixbors-26/+8
Add existential type definitions Note: this does not allow creating named existential types, it just desugars `impl Trait` to a less (but still very) hacky version of actual `existential type` items. r? @nikomatsakis
2018-06-14rustc: rename ty::maps to ty::query.Eduard-Mihai Burtescu-2/+2
2018-06-07Add existential type definitonsOliver Schneider-26/+8
2018-06-03Remove is_import fieldMark Simulacrum-6/+3
2018-06-01Update recursion limitsJohn Kåre Alsaker-0/+2
2018-06-01Make metadata decoding use AllocDecodingState/Session.Michael Woerister-35/+19
2018-05-26Use `Ident`s for fields in HIRVadim Petrochenkov-1/+1
2018-05-23Auto merge of #50528 - whitfin:issue-50508, r=michaelwoeristerbors-143/+72
Remove attribute_cache from CrateMetadata This PR will fix #50508 by removing the `attribute_cache` from the `CrateMetadata` struct. Seeing as performance was referenced in the original issue, I also cleaned up a `self.entry(node_id);` call which might have occasionally happened redundantly. r? @michaelwoerister
2018-05-19rustc: introduce {ast,hir}::AnonConst to consolidate so-called "embedded ↵Eduard-Mihai Burtescu-8/+8
constants".
2018-05-18Catch an issue missed in rebaseIsaac Whitfield-3/+2
2018-05-18Remove unnecessary impl methods for CrateMetadataIsaac Whitfield-97/+36
2018-05-18Serialize attributes into the CrateRootIsaac Whitfield-54/+66
2018-05-18Remove unnecessary clone call for panic_strategyIsaac Whitfield-1/+1
2018-05-18Avoid removing from cstore_impl for nowIsaac Whitfield-0/+5
2018-05-18Attempt to pass CrateMetadata flags on creationIsaac Whitfield-60/+39
2018-05-18Avoid generating attributes more than once for CrateMetadataIsaac Whitfield-40/+49
2018-05-18Remove attribute_cache from CrateMetadataIsaac Whitfield-22/+8
2018-05-17Pass crate editions to macro expansions, update testsVadim Petrochenkov-10/+17
2018-05-17Keep crate edition in metadataVadim Petrochenkov-1/+15
2018-05-17Rename trans to codegen everywhere.Irina Popa-7/+8
2018-05-15Rename `has_type_parameters` to `requires_monomorphization`varkor-1/+1