about summary refs log tree commit diff
path: root/src/librustc_metadata
AgeCommit message (Collapse)AuthorLines
2020-01-11Rollup merge of #67806 - Centril:splitsynmore, r=petrochenkovMazdak Farrokhzad-1/+1
Extract `rustc_ast_passes`, move gating, & refactor linting Based on https://github.com/rust-lang/rust/pull/67770. This PR extracts a crate `rustc_ast_passes`: - `ast_validation.rs`, which is contributed by `rustc_passes` (now only has HIR based passes) -- the goal here is to improve recompilation of the parser, - `feature_gate.rs`, which is contributed by `syntax` and performs post-expansion-gating & final erroring for pre-expansion gating, - `show_span`, which is contributed by `syntax`. To facilitate this, we first have to also: - Move `{leveled_}feature_err{_err}` from `syntax::feature_gate::check` into `rustc_session::parse`. - Move `get_features` into `rustc_parse::config`, the only place it is used. - Move some some lint datatypes and traits, e.g. `LintBuffer`, `BufferedEarlyLint`, `BuiltinLintDiagnostics`, `LintPass`, and `LintArray` into `rustc_session::lint`. - Move all the hard-wired lint `static`s into `rustc_session::lint::builtin`.
2020-01-11simplify feature_err importsMazdak Farrokhzad-1/+1
2020-01-10Auto merge of #65241 - tmiasko:no-std-san, r=alexcrichtonbors-111/+1
build-std compatible sanitizer support ### Motivation When using `-Z sanitizer=*` feature it is essential that both user code and standard library is instrumented. Otherwise the utility of sanitizer will be limited, or its use will be impractical like in the case of memory sanitizer. The recently introduced cargo feature build-std makes it possible to rebuild standard library with arbitrary rustc flags. Unfortunately, those changes alone do not make it easy to rebuild standard library with sanitizers, since runtimes are dependencies of std that have to be build in specific environment, generally not available outside rustbuild process. Additionally rebuilding them requires presence of llvm-config and compiler-rt sources. The goal of changes proposed here is to make it possible to avoid rebuilding sanitizer runtimes when rebuilding the std, thus making it possible to instrument standard library for use with sanitizer with simple, although verbose command: ``` env CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUSTFLAGS=-Zsanitizer=thread cargo test -Zbuild-std --target x86_64-unknown-linux-gnu ``` ### Implementation * Sanitizer runtimes are no long packed into crates. Instead, libraries build from compiler-rt are used as is, after renaming them into `librusc_rt.*`. * rustc obtains runtimes from target libdir for default sysroot, so that they are not required in custom build sysroots created with build-std. * The runtimes are only linked-in into executables to address issue #64629. (in previous design it was hard to avoid linking runtimes into static libraries produced by rustc as demonstrated by sanitizer-staticlib-link test, which still passes despite changes made in #64780). cc @kennytm, @japaric, @firstyear, @choller
2020-01-10Point at the span for the definition of crate foreign ADTsEsteban Küber-0/+4
2020-01-10nix syntax::errors & prefer rustc_errors over errorsMazdak Farrokhzad-13/+11
2020-01-09add CStore::item_generics_num_lifetimesMazdak Farrokhzad-6/+5
2020-01-09{rustc::util -> rustc_data_structures}::capturesMazdak Farrokhzad-1/+1
2020-01-09Link sanitizer runtimes instead of injecting crate dependenciesTomasz Miąsko-104/+1
2020-01-09Remove sanitizer_runtime attributeTomasz Miąsko-7/+0
2020-01-08normalize rustc::hir::intravisit importsMazdak Farrokhzad-2/+1
2020-01-08intravisit: abstract over HIR MapMazdak Farrokhzad-1/+4
2020-01-08- remove syntax::{span_warn!, span_err!, span_fatal!. struct_err!}Mazdak Farrokhzad-17/+15
- remove syntax::{help!, span_help!, span_note!} - remove unused syntax::{struct_span_fatal, struct_span_err_or_warn!, span_err_or_warn!} - lintify check_for_bindings_named_same_as_variants + conflicting_repr_hints - inline syntax::{struct_span_warn!, diagnostic_used!} - stringify_error_code! -> error_code! & use it more. - find_plugin_registrar: de-fatalize an error - de-fatalize metadata errors - move type_error_struct! to rustc_typeck - struct_span_err! -> rustc_errors
2020-01-05Remove rustc_hir reexports in rustc::hir.Mazdak Farrokhzad-24/+26
2020-01-04extract Export, ExportMap from hir::defMazdak Farrokhzad-34/+30
2020-01-04DefId{Map,Set} -> rustc::hir::def_idMazdak Farrokhzad-2/+1
2020-01-04canonicalize FxHash{Map,Set} importsMazdak Farrokhzad-6/+4
2020-01-02Normalize `syntax::edition` imports.Mazdak Farrokhzad-2/+2
2020-01-02Normalize `syntax::symbol` imports.Mazdak Farrokhzad-7/+7
2020-01-02Normalize `syntax::source_map` imports.Mazdak Farrokhzad-5/+5
2020-01-01Rename `syntax_pos` to `rustc_span` in source codeVadim Petrochenkov-19/+19
2019-12-31Auto merge of #67032 - cjgillot:hirene, r=Zoxcbors-1/+1
Allocate HIR on an arena 4/4 This is the fourth and last PR in the series started by #66931, #66936 and #66942. The last commits should compile on their own. The difference with the previous PR is given by https://github.com/cjgillot/rust/compare/hirene-ty...hirene A few more cleanups may be necessary, please tell me. r? @eddyb like the other cc @Zoxc
2019-12-30Rename `libsyntax_ext` and `libsyntax_expand` in codeVadim Petrochenkov-4/+4
2019-12-30Make things build againVadim Petrochenkov-3/+3
2019-12-30Remove HirVec from Generics.Camille GILLOT-1/+1
2019-12-27Fallout in other crates.Camille GILLOT-3/+3
2019-12-26Fallout in other crates.Camille GILLOT-2/+2
2019-12-22Format the worldMark Rousskov-1159/+1213
2019-12-21Use Arena inside hir::Mod.Camille GILLOT-1/+1
2019-12-21Use Arena inside hir::StructField.Camille GILLOT-1/+1
2019-12-21Use Arena inside hir::ImplItem.Camille GILLOT-5/+5
2019-12-21Use Arena inside hir::TraitItem.Camille GILLOT-5/+5
2019-12-21Use Arena inside hir::ForeignItem.Camille GILLOT-3/+3
2019-12-21Handle Attributes in arena.Camille GILLOT-4/+4
2019-12-21Use Arena inside hir::Item.Camille GILLOT-7/+7
2019-12-21Use Arena inside hir::Crate.Camille GILLOT-1/+1
2019-12-201. ast::Mutability::{Mutable -> Mut, Immutable -> Not}.Mazdak Farrokhzad-8/+6
2. mir::Mutability -> ast::Mutability.
2019-12-13Require stable/unstable annotations for the constness of all stable ↵Oliver Scherer-0/+19
functions with a `const` modifier
2019-12-11Rollup merge of #67074 - ehuss:extern-options, r=petrochenkovMazdak Farrokhzad-9/+11
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-9/+11
2019-12-08Auto merge of #66981 - michaelwoerister:measureme-0.5.0, r=Mark-Simulacrumbors-1/+1
Update measureme crate to 0.5.0 This PR updates the `measureme` self-profiling crate to the latest release. Heads up, this version changes the trace file format, so the `summarize` tool on perf.rlo needs to be updated to 0.5 too. r? @Mark-Simulacrum cc @wesleywiser
2019-12-08Rollup merge of #66991 - Nashenas88:body_cache_cleanup, r=eddybMazdak Farrokhzad-5/+5
Cleanup BodyCache After this PR: - `BodyCache` is renamed to `BodyAndCache` - `ReadOnlyBodyCache` is renamed to `ReadOnlyBodyAndCache` - `ReadOnlyBodyAndCache::body` fn is removed and all calls to it are replaced by a deref (possible due to fix of its `Deref` imp in #65947) cc @eddyb @oli-obk
2019-12-06Rename to `then_some` and `then`varkor-1/+1
2019-12-06Use `to_option` in various placesvarkor-5/+3
2019-12-05rustc: Apply clearer naming to BodyAndCache, fix Deref impl, remove unneeded ↵Paul Daniel Faria-5/+5
Index impl, remove body fn rustc_codegen_ssa: Fix BodyAndCache reborrow to Body and change instances of body() call to derefence rustc_mir: Fix BodyAndCache reborrow to Body and change intances of body() call to derefence
2019-12-04Auto merge of #66275 - oli-obk:organize-intrinsics-promotion-checks, r=RalfJungbors-1/+11
Organize intrinsics promotion checks cc @vertexclique supersedes #61835 r? @RalfJung
2019-12-03Update measureme crate to 0.5.0.Michael Woerister-1/+1
2019-12-03Explain why "loading" constness from extern crates does not necessarily load ↵Oliver Scherer-1/+5
anything
2019-12-03Check intrinsics for callability in const fnsMahmut Bulut-1/+7
2019-12-02syntax: Use `ast::MacArgs` for macro definitionsVadim Petrochenkov-1/+4
2019-12-02Remove HasLocalDecls impl from BodyCache's, properly reborrow to Body, ↵Paul Daniel Faria-2/+2
rename all body_cache back to body