about summary refs log tree commit diff
path: root/src/librustc/middle
AgeCommit message (Collapse)AuthorLines
2017-09-17rustc: Use reachablility through a queryAlex Crichton-4/+0
Turns out this was already set up as a query, just wasn't using it yet!
2017-09-17Remove unused str_eq lang itemleonardo.yvens-2/+0
It's not a lang item anymore. Also remove outdated note.
2017-09-16Rollup merge of #44560 - qmx:import-TyCtxt, r=eddybAlex Crichton-1/+1
bring TyCtxt into scope got comments both from @eddyb and @nikomatsakis (via https://github.com/rust-lang/rust/pull/44505) that we should always put `TyCtxt` in scope should I just go and import it at other places in the codebase or we just keep doing small improvements?
2017-09-16Auto merge of #43017 - durka:stabilize-const-invocation, r=eddybbors-0/+1
Individualize feature gates for const fn invocation This PR changes the meaning of `#![feature(const_fn)]` so it is only required to declare a const fn but not to call one. Based on discussion at #24111. I was hoping we could have an FCP here in order to move that conversation forward. This sets the stage for future stabilization of the constness of several functions in the standard library (listed below), so could someone please tag the lang team for review. - `std::cell` - `Cell::new` - `RefCell::new` - `UnsafeCell::new` - `std::mem` - `size_of` - `align_of` - `std::ptr` - `null` - `null_mut` - `std::sync` - `atomic` - `Atomic{Bool,Ptr,Isize,Usize}::new` - `once` - `Once::new` - primitives - `{integer}::min_value` - `{integer}::max_value` Some other functions are const but they are also unstable or hidden, e.g. `Unique::new` so they don't have to be considered at this time. After this stabilization, the following `*_INIT` constants in the standard library can be deprecated. I wasn't sure whether to include those deprecations in the current PR. - `std::sync` - `atomic` - `ATOMIC_{BOOL,ISIZE,USIZE}_INIT` - `once` - `ONCE_INIT`
2017-09-14Rollup merge of #44569 - est31:master, r=estebankCorey Farwell-2/+2
"avoid" is a better word here than "disable" You don't "disable" the warning really, you just avoid it (as a conscious action).
2017-09-14bring TyCtxt into scopeDouglas Campos-1/+1
2017-09-14"avoid" is a better word here than "disable"est31-2/+2
2017-09-14Auto merge of #44526 - leodasvacas:remove-deprecated-lang-items, r=arielb1bors-40/+15
Remove deprecated lang items They have been deprecated for years and there is no trace left of them in the compiler. Also removed `require_owned_box` which is dead code and other small refactorings.
2017-09-13Fix initial reviewleonardo.yvens-2/+2
2017-09-13Refactor fn_trait_kindleonardo.yvens-12/+5
Short and sweet
2017-09-13honor #[rustc_const_unstable] attributesAlex Burka-0/+1
2017-09-13Refactor how to get a lang item's nameleonardo.yvens-16/+10
Small refactorings
2017-09-13Remove require_owned_boxleonardo.yvens-4/+0
It's unused and unnecessary
2017-09-12Remove deprecated lang itemsleonardo.yvens-8/+0
They have been deprecated for years and there is no trace left of them in the compiler.
2017-09-12Remove the `cstore` reference from Session in order to prepare encapsulating ↵Michael Woerister-4/+9
CrateStore access in tcx.
2017-09-12Auto merge of #44275 - eddyb:deferred-ctfe, r=nikomatsakisbors-72/+37
Evaluate fixed-length array length expressions lazily. This is in preparation for polymorphic array lengths (aka `[T; T::A]`) and const generics. We need deferred const-evaluation to break cycles when array types show up in positions which require knowing the array type to typeck the array length, e.g. the array type is in a `where` clause. The final step - actually passing bounds in scope to array length expressions from the parent - is not done because it still produces cycles when *normalizing* `ParamEnv`s, and @nikomatsakis' in-progress lazy normalization work is needed to deal with that uniformly. However, the changes here are still useful to unlock work on const generics, which @EpicatSupercell manifested interest in, and I might be mentoring them for that, but we need this baseline first. r? @nikomatsakis cc @oli-obk
2017-09-11Auto merge of #44435 - alexcrichton:in-scope, r=michaelwoeristerbors-2/+2
rustc: Remove HirId from queries This'll allow us to reconstruct query parameters purely from the `DepNode` they're associated with. Closes #44414
2017-09-11rustc: Remove HirId from queriesAlex Crichton-2/+2
This'll allow us to reconstruct query parameters purely from the `DepNode` they're associated with. Some queries could move straight to `HirId` but others that don't always have a correspondance between `HirId` and `DefId` moved to two-level maps where the query operates over a `DefIndex`, returning a map, which is then keyed off `ItemLocalId`. Closes #44414
2017-09-11rustc: evaluate fixed-length array length expressions lazily.Eduard-Mihai Burtescu-40/+5
2017-09-11rustc: remove obsolete const_val::ErrKind::{Negate,Not}On.Eduard-Mihai Burtescu-24/+0
2017-09-11rustc: use ty::Const for the length of TyArray.Eduard-Mihai Burtescu-7/+12
2017-09-11rustc: replace usize with u64 and ConstUsize.Eduard-Mihai Burtescu-9/+4
2017-09-11rustc: introduce ty::Const { ConstVal, Ty }.Eduard-Mihai Burtescu-9/+7
2017-09-11rustc: intern ConstVal's in TyCtxt.Eduard-Mihai Burtescu-14/+40
2017-09-08Use NodeId/HirId instead of DefId for local variables.Eduard-Mihai Burtescu-43/+43
2017-09-07rustc: Remove `CrateStore::crates` as a methodAlex Crichton-13/+12
This commit moves the `crates` method to a query and then migrates all callers to use a query instead of the now-renamed `crates_untracked` method where possible. Closes #41417
2017-09-05rustc: Move stability functionality into queriesAlex Crichton-145/+101
This commit primarily removes the `stability` field from `TyCtxt` as well as its internal mutable state, instead using a query to build the stability index as well as primarily using queries for other related lookups. Like previous commits the calculation of the stability index is wrapped in a `with_ignore` node to avoid regressing the current tests, and otherwise this commit also introduces #44232 but somewhat intentionally so.
2017-09-05rustc: Remove `CrateStore::used_crate*`Alex Crichton-12/+52
This commit removes the `use_crates` and `used_crate_source` methods in favor of a mix of queries and helper methods being used now instead.
2017-09-05rustc: Classify two more CrateStore methods untrackedAlex Crichton-9/+5
These are only called pre-TyCtxt (e.g. lowering/resolve), so make it explicit in the name that they're untracked and therefore unsuitable to called elsewhere.
2017-09-05rustc: Migrate `visible_parent_map` to a queryAlex Crichton-7/+1
Turns out it was basically already a query if you squinted hard enough!
2017-09-05rustc: Migrate `CrateStore::item_body` to a queryAlex Crichton-11/+0
This commit migrates the `item_body` method on `CrateStore` to a query instead to enable better tracking of dependencies and whatnot.
2017-09-05rustc: Remove lang item methods from CrateStoreAlex Crichton-11/+2
Given the previous commit, these are now trivially representable as queries!
2017-09-05rustc: Migrate lang items to a queryAlex Crichton-75/+51
This commit moves the calculation of the `LanguageItems` structure into a query rather than being calculated before the `TyCtxt` exists, with the eventual end goal of removing some `CrateStore` methods.
2017-09-05rustc: Flag some CrateStore methods as "untracked"Alex Crichton-42/+52
The main use of `CrateStore` *before* the `TyCtxt` is created is during resolution, but we want to be sure that any methods used before resolution are not used after the `TyCtxt` is created. This commit starts moving the methods used by resolve to all be named `{name}_untracked` where the rest of the compiler uses just `{name}` as a query. During this transition a number of new queries were added to account for post-resolve usage of these methods.
2017-09-05rustc: Remove a number of mutable fields in cstoreAlex Crichton-12/+0
This commit started by moving methods from `CrateStore` to queries, but it ended up necessitating some deeper refactorings to move more items in general to queries. Before this commit the *resolver* would walk over the AST and process foreign modules (`extern { .. }` blocks) and collect `#[link]` annotations. It would then also process the command line `-l` directives and such. This information was then stored as precalculated lists in the `CrateStore` object for iterating over later. After this, commit, however, this pass no longer happens during resolution but now instead happens through queries. A query for the linked libraries of a crate will crawl the crate for `extern` blocks and then process the linkage annotations at that time.
2017-09-05rustc: Move implementations_of_trait to a queryAlex Crichton-6/+0
While we're at it, make it two separate queries so one's for rustdoc and one's for the compiler, hopefully being a bit more targeted.
2017-09-05rustc: Move original_crate_name to a queryAlex Crichton-5/+0
2017-09-05rustc: Move crate_hash to a queryAlex Crichton-2/+0
2017-09-05rustc: Move crate_disambiguator to queriesAlex Crichton-3/+0
2017-09-05rustc: Move {plugin,derive}_registrar_fn to queriesAlex Crichton-6/+0
2017-09-05rustc: Migrate `CStore::native_libraries` to a queryAlex Crichton-3/+0
2017-09-05rustc: Migrate `CStore::expored_symbols` to a queryAlex Crichton-2/+0
2017-09-05rustc: Move `impl_defaultness` to a queryAlex Crichton-6/+0
2017-09-05rustc: Move a few more cstore methods to queriesAlex Crichton-20/+7
This comit applies the following changes: * Deletes the `is_allocator` query as it's no longer used * Moves the `is_sanitizer_runtime` method to a query * Moves the `is_profiler_runtime` method to a query * Moves the `panic_strategy` method to a query * Moves the `is_no_builtins` method to a query * Deletes the cstore method of `is_compiler_builtins`. The query was added in #42588 but the `CrateStore` method was not deleted A good bit of these methods were used late in linking during trans so a new dedicated structure was created to ship a calculated form of this information over to the linker rather than having to ship the whole of `TyCtxt` over to linking.
2017-09-03Auto merge of #44253 - eddyb:nice-scope, r=nikomatsakisbors-179/+177
rustc: rename CodeExtent to Scope and RegionMaps to ScopeTree. r? @nikomatsakis
2017-09-03Auto merge of #44195 - alexcrichton:remove-used-unsafe, r=nikomatsakisbors-5/+50
rustc: Remove the `used_unsafe` field on TyCtxt Now that lint levels are available for the entire compilation, this can be an entirely local lint in `effect.rs` cc #44137
2017-09-01rustc: rename CodeExtent to Scope and RegionMaps to ScopeTree.Eduard-Mihai Burtescu-179/+177
2017-09-01rustc: use hir::ItemLocalId instead of ast::NodeId in CodeExtent.Eduard-Mihai Burtescu-202/+151
2017-09-01rustc: take TyCtxt and RegionMaps in CodeMap::span.Eduard-Mihai Burtescu-26/+22
2017-09-01rustc: use hir::ItemLocalId instead of ast::NodeId in CFG.Eduard-Mihai Burtescu-47/+49