summary refs log tree commit diff
path: root/src/librustc_metadata/creader.rs
AgeCommit message (Collapse)AuthorLines
2020-01-18remove rustc_error_codes deps except in rustc_driverMazdak Farrokhzad-1/+0
2020-01-10Auto merge of #65241 - tmiasko:no-std-san, r=alexcrichtonbors-104/+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-10nix syntax::errors & prefer rustc_errors over errorsMazdak Farrokhzad-10/+8
2020-01-09add CStore::item_generics_num_lifetimesMazdak Farrokhzad-2/+1
2020-01-09Link sanitizer runtimes instead of injecting crate dependenciesTomasz Miąsko-104/+1
2020-01-08- remove syntax::{span_warn!, span_err!, span_fatal!. struct_err!}Mazdak Farrokhzad-3/+5
- 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-2/+2
2020-01-02Normalize `syntax::edition` imports.Mazdak Farrokhzad-1/+1
2020-01-02Normalize `syntax::symbol` imports.Mazdak Farrokhzad-1/+1
2020-01-01Rename `syntax_pos` to `rustc_span` in source codeVadim Petrochenkov-1/+1
2019-12-30Rename `libsyntax_ext` and `libsyntax_expand` in codeVadim Petrochenkov-1/+1
2019-12-22Format the worldMark Rousskov-160/+204
2019-12-11Rollup merge of #67074 - ehuss:extern-options, r=petrochenkovMazdak Farrokhzad-7/+8
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-7/+8
2019-12-06Rename to `then_some` and `then`varkor-1/+1
2019-12-06Use `to_option` in various placesvarkor-5/+2
2019-11-28rustc: Move some queries to `rustc_metadata`Vadim Petrochenkov-0/+5
2019-11-28rustc_metadata: Avoid some side effects during speculative crate resolutionVadim Petrochenkov-28/+5
Namely, `update_extern_crate`. Also, stop tracking visited crates in `update_extern_crate`, the rank check does the same thing (prevents visiting dependencies if the rank didn't change), but more precisely.
2019-11-28rustc_metadata: Pass SVH by valueVadim Petrochenkov-6/+5
2019-11-28rustc_metadata: Move `has_global_allocator` from session to cstoreVadim Petrochenkov-17/+16
2019-11-28rustc_metadata: Privatize some fields and methods of `CStore`Vadim Petrochenkov-5/+13
After it's moved to `creader.rs`
2019-11-28rustc_metadata: Merge `cstore.rs` into `creader.rs`Vadim Petrochenkov-16/+93
2019-11-28rustc_metadata: Privatize `CrateMetadata::root`Vadim Petrochenkov-15/+15
2019-11-28rustc_metadata: Privatize all fields of `CrateRoot`Vadim Petrochenkov-34/+33
All of them are read-only
2019-11-28rustc_metadata: Privatize `CrateMetadata::dep_kind`Vadim Petrochenkov-5/+3
2019-11-28rustc_metadata: Privatize `CrateMetadata::source`Vadim Petrochenkov-5/+5
2019-11-28rustc_metadata: Privatize `CrateMetadata::extern_crate`Vadim Petrochenkov-30/+6
2019-11-28rustc_metadata: Privatize `CrateMetadata::dependencies`Vadim Petrochenkov-2/+2
2019-11-28rustc_metadata: Cleanup generation of crate dependency listsVadim Petrochenkov-1/+1
2019-11-25Tweak multiple allocators errorEsteban Küber-1/+3
2019-11-17rustc_metadata: Stop leaking `Lazy` from the `rmeta` moduleVadim Petrochenkov-6/+8
2019-11-17rustc_metadata: Move `CrateMetadata` into `decoder.rs`Vadim Petrochenkov-8/+8
It allows to make most of its fields private
2019-11-17rustc_metadata: Give a constructor to `CratePaths`Vadim Petrochenkov-1/+1
2019-11-17rustc_metadata: Minor cleanupVadim Petrochenkov-1/+1
2019-11-17rustc_metadata: Give a constructor to `CrateMetadata`Vadim Petrochenkov-34/+9
2019-11-17rustc_metadata: Give a constructor to `CrateLocator`Vadim Petrochenkov-16/+9
2019-11-17rustc_metadata: `locator::Context` -> `CrateLocator`Vadim Petrochenkov-17/+17
2019-11-17rustc_metadata: Move some structs from `cstore` to `decoder`Vadim Petrochenkov-2/+2
This allows to privatize their fields.
2019-11-14Update to use new librustc_error_codes libraryGuillaume Gomez-0/+2
2019-11-11Move allocator_kind to CrateStoreMark Rousskov-5/+5
Similarly to the previous commit, there's no need for this to be in Session and have a Once around it.
2019-11-11Move injected_panic_runtime to CrateStoreMark Rousskov-3/+3
This was essentially a "query" previously (with no key, just always run once when resolving the crate dependencies), and remains so, just now in a way that isn't on Session. This removes the need for the `Once` as well.
2019-11-07rustc_metadata: Rename `schema` to `rmeta`Vadim Petrochenkov-1/+1
And change `rmeta.rs` to `rmeta/mod.rs`
2019-11-02Simplify various `Symbol` use points.Nicholas Nethercote-1/+1
Including removing a bunch of unnecessary `.as_str()` calls, and a bunch of unnecessary sigils.
2019-10-31Implement dual proc macro hashingmsizanoen-7/+13
This changes the mechanism of `-Z dual-proc-macro` to record the host proc macro hash in the transistive dependency information and use it during dependency resolution instead of resolving only by name.
2019-10-30Change CrateMetadata's source_map_import_info from RwLock to OnceSantiago Pastorino-2/+2
This field is created lazily on first use and after that is read only. That's exactly what Once is for.
2019-10-27rustc, rustc_passes: don't depend on syntax_expand.Mazdak Farrokhzad-1/+1
This is done by moving some data definitions to syntax::expand.
2019-10-24rustc_metadata: Minimize use of `Lrc` in crate storeVadim Petrochenkov-18/+19
Crate metadatas are still stored as `Lrc<CrateMetadata>` in `CStore` because crate store has to be cloneable due to `Resolver::clone_outputs`.
2019-10-24rustc_metadata: Remove `RwLock` from `CStore`Vadim Petrochenkov-11/+15
2019-10-24Turn crate store into a resolver outputVadim Petrochenkov-5/+21
2019-10-24rustc_metadata: Move some code aroundVadim Petrochenkov-95/+3
Plugin search doesn't need a crate loader, only crate locator