about summary refs log tree commit diff
path: root/src/librustc_metadata
AgeCommit message (Collapse)AuthorLines
2019-09-27getting more context for duplicate lang items (fixes #60561)Tomas Tauber-8/+9
Where possible, the error message includes the name of the crate that brought in the crate with duplicate lang items (which helps with debugging). This information is passed on from cstore using the `extern_crate` query.
2019-09-26Rename `ForeignItem.node` to `ForeignItem.kind`varkor-2/+2
2019-09-26Rename `Item.node` to `Item.kind`varkor-16/+16
2019-09-26Rename `Ty.node` to `Ty.kind`varkor-1/+1
2019-09-26Rename `TraitItem.node` to `TraitItem.kind`varkor-2/+2
2019-09-26Rename `ImplItem.node` to `ImplItem.kind`varkor-17/+16
2019-09-26Rename `Pat.node` to `Pat.kind`varkor-1/+1
2019-09-26Rename `Expr.node` to `Expr.kind`varkor-1/+1
For both `ast::Expr` and `hir::Expr`.
2019-09-26Auto merge of #62661 - arielb1:never-reserve, r=nikomatsakisbors-3/+4
reserve `impl<T> From<!> for T` this is necessary for never-type stabilization. cc #57012 #35121 I think we wanted a crater run for this @nikomatsakis? r? @nikomatsakis
2019-09-25Rename `sty` to `kind`varkor-2/+2
2019-09-25Rollup merge of #64599 - csmoe:doc_async_reexport, r=nikomatsakisMazdak Farrokhzad-1/+16
Rustdoc render async function re-export Closes #63710 r? @nikomatsakis
2019-09-24resolve the rustc_reservation_impl attribute in 1 placeAriel Ben-Yehuda-3/+4
2019-09-24bug-out asyncness query on non-local funtionscsmoe-1/+2
2019-09-23Allow using upstream generics in a dylib crate typeAlex Crichton-7/+6
... just don't export them!
2019-09-23rustc: Fix mixing crates with different `share_generics`Alex Crichton-2/+26
This commit addresses #64319 by removing the `dylib` crate type from the list of crate type that exports generic symbols. The bug in #64319 arises because a `dylib` crate type was trying to export a symbol in an uptream crate but it miscalculated the symbol name of the uptream symbol. This isn't really necessary, though, since `dylib` crates aren't that heavily used, so we can just conservatively say that the `dylib` crate type never exports generic symbols, forcibly removing them from the exported symbol lists if were to otherwise find them. The fix here happens in two places: * First is in the `local_crate_exports_generics` method, indicating that it's now `false` for the `Dylib` crate type. Only rlibs actually export generics at this point. * Next is when we load exported symbols from upstream crate. If, for our compilation session, the crate may be included from a dynamic library, then its generic symbols are removed. When the crate was linked into a dynamic library its symbols weren't exported, so we can't consider them a candidate to link against. Overally this should avoid situations where we incorrectly calculate the upstream symbol names in the face of differnet `share_generics` options, ultimately... Closes #64319
2019-09-23rustc: Convert `dependency_formats` to a queryAlex Crichton-12/+391
This commit converts a field of `Session`, `dependency_formats`, into a query of `TyCtxt`. This information then also needed to be threaded through to other remaining portions of the linker, but it's relatively straightforward. The only change here is that instead of `HashMap<CrateType, T>` the data structure changed to `Vec<(CrateType, T)>` to make it easier to deal with in queries.
2019-09-21rename is_async_fn to asyncnesscsmoe-5/+4
2019-09-19append asyncness info to functionscsmoe-3/+3
2019-09-19add is_async_fn querycsmoe-0/+15
2019-09-17Generate proc macro harness in AST order.Aaron Hill-1/+5
This ensures that we match the order used by proc macro metadata serialization. Fixes #64251
2019-09-15Avoid some unnecessary `&str` to `Ident` conversionsMatthew Jasper-1/+2
2019-09-12Auto merge of #64303 - nnethercote:avoid-more-Symbol-to-string-operations, ↵bors-2/+2
r=petrochenkov Avoid more `Symbol`-to-string operations These commits avoid various `Symbol`-to-string conversions, by doing more operations directly on `Symbol`s. This requires adding a few more static `Symbol`s to the binary. r? @petrochenkov
2019-09-11Avoid two `Symbol::as_str()` calls.Nicholas Nethercote-2/+2
2019-09-08Improve wording.Charles Lew-2/+2
2019-09-05Remove rustc_diagnostic_macros featureMark Rousskov-1/+0
2019-09-05Replace diagnostic plugins with macro_rulesMark Rousskov-10/+3
2019-09-05Restrict error code length to 80 columnsMark Rousskov-1/+2
The global restriction is 100, but since error codes are printed out via --explain we want to restrict them to just 80 columns.
2019-09-03use TokenStream rather than &[TokenTree] for built-in macrosAleksey Kladov-1/+1
That way, we don't loose the jointness info
2019-08-30Add a "diagnostic item" schemeOliver Scherer-1/+34
This allows lints and other diagnostics to refer to items by a unique ID instead of relying on whacky path resolution schemes that may break when items are relocated.
2019-08-29Rollup merge of #63867 - petrochenkov:dhelpers, r=matthewjasperMazdak Farrokhzad-3/+1
resolve: Block expansion of a derive container until all its derives are resolved So, it turns out there's one more reason to block expansion of a `#[derive]` container until all the derives inside it are resolved, beside `Copy` (https://github.com/rust-lang/rust/pull/63248). The set of derive helper attributes registered by derives in the container also has to be known before the derives themselves are expanded, otherwise it may be too late (see https://github.com/rust-lang/rust/pull/63468#issuecomment-524550872 and the `#[stable_hasher]`-related test failures in https://github.com/rust-lang/rust/pull/63468). So, we stop our attempts to unblock the container earlier, as soon as the `Copy` status is known, and just block until all its derives are resolved. After all the derives are resolved we immediately go and process their helper attributes in the item, without delaying it until expansion of the individual derives. Unblocks https://github.com/rust-lang/rust/pull/63468 r? @matthewjasper (as a reviewer of https://github.com/rust-lang/rust/pull/63248) cc @c410-f3r
2019-08-29Rollup merge of #63933 - wesleywiser:cleanup_from_move_promoted, r=oli-obkMazdak Farrokhzad-33/+25
Resolve some small issues related to #63580 This resolves some feedback left on #63580 after it was merged: - Adds documentation to `mir::Static` and `mir::StaticKind` - Simplifies `maybe_get_optimized_mir()` and `maybe_get_promoted_mir()` cc @bjorn3 @RalfJung
2019-08-28Extract `Decoder::entry_unless_proc_macro()`Wesley Wiser-22/+20
2019-08-28Simplify `maybe_get_optimized_mir` and `maybe_get_promoted_mir`Wesley Wiser-29/+23
Since both functions are always unwrapped, don't wrap the return value in an `Option`.
2019-08-28Auto merge of #63127 - kper:pr, r=nikomatsakisbors-19/+19
Cleanup: Consistently use `Param` instead of `Arg` #62426 Fixes #62426
2019-08-27Cleanup: Consistently use `Param` instead of `Arg` #62426Kevin Per-19/+19
2019-08-27metadata: Eliminate `FullProcMacro`Vadim Petrochenkov-42/+20
Fix caching of loaded proc macros
2019-08-27Respect attributes on proc macro definitionsVadim Petrochenkov-8/+10
2019-08-27proc_macro: Turn `quote` into a regular built-in macroVadim Petrochenkov-11/+1
Previously in was implemented using a special hack in the metadata loader
2019-08-27resolve: Block expansion of a derive container until all its derives are ↵Vadim Petrochenkov-3/+1
resolved Also mark derive helpers as known as a part of the derive container's expansion instead of expansion of the derives themselves which may happen too late.
2019-08-22Resolve PR commentsWesley Wiser-4/+9
2019-08-22Fix tidyWesley Wiser-2/+4
2019-08-22Move promoted out of mir::BodyWesley Wiser-25/+60
2019-08-20rustc_metadata: replace LazySeq<T> with Lazy<[T]>.Eduard-Mihai Burtescu-296/+301
2019-08-18Auto merge of #63269 - Aaron1011:feature/proc-macro-data, r=eddyb,petrochenkovbors-143/+192
Serialize additional data for procedural macros Split off from #62855 This PR serializes the declaration `Span` and attributes for all procedural macros. This allows Rustdoc to properly render doc comments and source links when performing inlinig procedural macros across crates
2019-08-17Serialize additional data for procedural macrosAaron Hill-143/+192
Split off from #62855 This PR deerializes the declaration `Span` and attributes for all procedural macros from their underlying function definitions. This allows Rustdoc to properly render doc comments and source links when inlining procedural macros across crates
2019-08-17Remove unused `SyntaxContext` serialization implsMatthew Jasper-16/+0
The implementations were wrong and unused.
2019-08-17Stop emulating cross-crate hygiene with gensymsMatthew Jasper-1/+32
Most `Ident`s are serialized as `InternedString`s the exceptions are: * Reexports * Attributes * Idents in macro definitions Using gensyms helped reexports emulate hygiene. However, the actual item wouldn't have a gensymmed name so would be usable cross-crate. So removing this case until we have proper cross-crate hygiene seems sensible. Codegen attributes (`inline`, `export_name`) are resolved by their `Symbol`. This meant that opaque macro-expanded codegen attributes could cause linker errors. This prevented making built-in derives hygienic.
2019-08-16Rollup merge of #63632 - vext01:vext01-comment-fixes, r=eddybMazdak Farrokhzad-1/+1
A couple of comment fixes. This change fixes a couple of comments in the compiler code. The first change was discussed with @eddyb. This one confused me because I thought only *public* defs were in the table (not so). The second was a typo I noticed yesterday. OK to go in?
2019-08-16Fix a comment for the def_path_table.Edd Barrett-1/+1
The definition path table contains *all* definitions, not just public definitions.
2019-08-15`Ident::with_empty_ctxt` -> `Ident::with_dummy_span`Vadim Petrochenkov-4/+4
`Ident` has had a full span rather than just a `SyntaxContext` for a long time now.