about summary refs log tree commit diff
path: root/src/librustc/util
AgeCommit message (Collapse)AuthorLines
2018-03-08Nuke the entire ctfe from orbit, it's the only way to be sureOliver Schneider-4/+0
2018-03-08Produce instead of pointersOliver Schneider-0/+4
2018-03-04Remove ty::Predicate::Equate and ty::EquatePredicate (dead code)Tatsuyuki Ishi-11/+0
2018-03-02Run Rustfix on librustcManish Goregaokar-1/+1
2018-03-01change skolemizations to use universe indexNiko Matsakis-1/+1
2018-03-01obtain `UnificationTable` and `snapshot_vec` from `ena` insteadNiko Matsakis-0/+6
The ena version has an improved interface. I suspect `librustc_data_structures` should start migrating out to crates.io in general.
2018-02-20Do not run the default panic hook inside procedural macros. Fixes #47812John Kåre Alsaker-0/+21
2018-01-31in which HirIdMap is introduced as an affordance for using HirIds moreZack M. Davis-1/+3
The glossaries in the draft rustc-guide book and librustc/README.md state that `NodeId` is being gradually phased out in favor of `HirId`; as such, the present author claims that we ought to have a typedef for efficient `HirId` maps and sets in the module for such, even if no use for them has been made as yet (compatibility constraints preventing the use of it in the author's present unit of work): it is important to create the psychological "affordance" (in James J. Gibson's sense) that `HirId`s are a thing that compiler developers can work with.
2018-01-23Adds support for immovable generators. Move checking of invalid borrows ↵John Kåre Alsaker-2/+25
across suspension points to borrowck. Fixes #44197, #45259 and #45093.
2018-01-10Use the new fs_read_write functions in rustc internalsMatt Brubeck-5/+2
2017-12-23Auto merge of #46881 - michaelwoerister:ensure-coherence, r=nikomatsakisbors-1/+1
incr.comp.: Cache check_match and use ensure() for coherence-related queries. Some minor optimizations. r? @nikomatsakis
2017-12-20connect NLL type checker to the impl trait codeNiko Matsakis-7/+11
We now add the suitable `impl Trait` constraints.
2017-12-20incr.comp.: Cache check_match query.Michael Woerister-1/+1
2017-12-15add a new RegionKind variant: ReClosureBoundNiko Matsakis-0/+8
This is needed to allow the `ClosureRegionRequirements` to capture types that include regions.
2017-12-09Use Try syntax for Option in place of macros or matchMatt Brubeck-10/+4
2017-11-22Make RegionVid use newtype_index!Santiago Pastorino-2/+2
Closes #45843
2017-11-21Auto merge of #45879 - nikomatsakis:nll-kill-cyclic-closures, r=arielb1bors-3/+3
move closure kind, signature into `ClosureSubsts` Instead of using side-tables, store the closure-kind and signature in the substitutions themselves. This has two key effects: - It means that the closure's type changes as inference finds out more things, which is very nice. - As a result, it avoids the need for the `freshen_closure_like` code (though we still use it for generators). - It avoids cyclic closures calls. - These were never meant to be supported, precisely because they make a lot of the fancy inference that we do much more complicated. However, due to an oversight, it was previously possible -- if challenging -- to create a setup where a closure *directly* called itself (see e.g. #21410). We have to see what the effect of this change is, though. Needs a crater run. Marking as [WIP] until that has been assessed. r? @arielb1
2017-11-18make `ty::Predicate` carry a `ClosureSubsts`Niko Matsakis-3/+3
2017-11-17Fix impl Trait Lifetime HandlingTaylor Cramer-0/+4
After this change, impl Trait existentials are desugared to a new `abstract type` definition paired with a set of lifetimes to apply. In-scope generics are included as parents of the `abstract type` generics. Parent regions are replaced with static, and parent regions referenced in the `impl Trait` type are duplicated at the end of the `abstract type`'s generics.
2017-11-03Use a `Set<T>` instead of a `Map<T, bool>`Oliver Schneider-0/+2
2017-10-27fix rebasePaul Liétar-0/+1
2017-10-27Implement RFC 1861: Extern typesPaul Lietar-1/+1
2017-10-08Introduce `Print` trait for displaying typesWonwoo Choi-797/+968
2017-10-08Name higher-ranked lifetimes properly while displayingWonwoo Choi-20/+70
Now they don't shadow other lifetimes.
2017-09-26Auto merge of #44735 - tirr-c:issue-42143, r=arielb1bors-0/+6
Friendlier error message for closure argument type mismatch Rebased #42270. Fixes #42143. --- `test.rs`: ```rust fn main() { foo(|_: i32, _: usize| ()); } fn foo<F>(_: F) where F: Fn(&str, usize) {} ``` Before: ``` error[E0281]: type mismatch: `[closure@test.rs:2:9: 2:30]` implements the trait `std::ops::Fn<(i32, usize)>`, but the trait `for<'r> std::ops::Fn<(&'r str, usize)>` is required --> test.rs:2:5 | 2 | foo(|_: i32, _: usize| ()); | ^^^ --------------------- implements `std::ops::Fn<(i32, usize)>` | | | expected &str, found i32 | requires `for<'r> std::ops::Fn<(&'r str, usize)>` | = note: required by `foo` ``` After (early): ``` error[E0631]: type mismatch in closure arguments --> test.rs:2:5 | 2 | foo(|_: i32, _: usize| ()); | ^^^ --------------------- takes arguments of type `i32` and `usize` | | | expected arguments of type `&str` and `usize` | = note: required by `foo` ``` After (current): ``` error[E0631]: type mismatch in closure arguments --> test.rs:2:5 | 2 | foo(|_: i32, _: usize| ()); | ^^^ --------------------- found signature of `fn(i32, usize) -> _` | | | expected signature of `for<'r> fn(&'r str, usize) -> _` | = note: required by `foo` ``` ~~Compiler output has been changed, and a few tests are failing. Help me writing/fixing tests!~~ r? @nikomatsakis
2017-09-25Auto merge of #44809 - arielb1:small-scope, r=eddybbors-7/+8
encode region::Scope using fewer bytes Now that region::Scope is no longer interned, its size is more important. This PR encodes region::Scope in 8 bytes instead of 12, which should speed up region inference somewhat (perf testing needed) and should improve the margins on #36799 by 64MB (that's not a lot, I did this PR mostly to speed up region inference). This is a perf-sensitive PR. Please don't roll me up. r? @eddyb This is based on #44743 so I could get more accurate measurements on #36799.
2017-09-24move Scope behind an enumAriel Ben-Yehuda-7/+8
2017-09-23Print fn signature when there is closure argument type mismatchWonwoo Choi-0/+6
Fixes #42143. E0281 is totally replaced by E0631. UI tests are updated accordingly.
2017-09-23Compress "small" spans to 32 bits and intern "large" spansVadim Petrochenkov-2/+3
2017-09-11rustc: evaluate fixed-length array length expressions lazily.Eduard-Mihai Burtescu-0/+11
2017-09-11rustc: use ty::Const for the length of TyArray.Eduard-Mihai Burtescu-1/+14
2017-09-08Use NodeId/HirId instead of DefId for local variables.Eduard-Mihai Burtescu-7/+3
2017-09-05rustc: Migrate lang items to a queryAlex Crichton-2/+2
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-01rustc: rename CodeExtent to Scope and RegionMaps to ScopeTree.Eduard-Mihai Burtescu-13/+13
2017-09-01rustc: use hir::ItemLocalId instead of ast::NodeId in CodeExtent.Eduard-Mihai Burtescu-10/+9
2017-08-25Merge remote-tracking branch 'origin/master' into genAlex Crichton-0/+77
2017-08-23-Z profile-queries includes dep_graph.with_task uses in outputMatthew Hammer-1/+6
2017-08-23-Z profile-queries: remove panic when channel is unsetMatthew Hammer-1/+6
2017-08-23profiling with -Z profile-queries recognizes -Z time-passesMatthew Hammer-1/+11
2017-08-23inc comp: -Z profile-queries support; see also ↵Matthew Hammer-0/+57
https://github.com/rust-lang-nursery/rust-forge/blob/master/profile-queries.md
2017-08-14Merge remote-tracking branch 'origin/master' into genAlex Crichton-3/+6
2017-08-14Auto merge of #43740 - michaelwoerister:local-id-in-typecktables, r=arielb1bors-2/+5
Use hir::ItemLocalId as keys in TypeckTables. This PR makes `TypeckTables` use `ItemLocalId` instead of `NodeId` as key. This is needed for incremental compilation -- for stable hashing and for being able to persist and reload these tables. The PR implements the most important part of https://github.com/rust-lang/rust/issues/40303. Some notes on the implementation: * The PR adds the `HirId` to HIR nodes where needed (`Expr`, `Local`, `Block`, `Pat`) which obviates the need to store a `NodeId -> HirId` mapping in crate metadata. Thanks @eddyb for the suggestion! In the future the `HirId` should completely replace the `NodeId` in HIR nodes. * Before something is read or stored in one of the various `TypeckTables` subtables, the entry's key is validated via the new `TypeckTables::validate_hir_id()` method. This makes sure that we are not mixing information from different items in a single table. That last part could be made a bit nicer by either (a) new-typing the table-key and making `validate_hir_id()` the only way to convert a `HirId` to the new-typed key, or (b) just encapsulate sub-table access a little better. This PR, however, contents itself with not making things significantly worse. Also, there's quite a bit of switching around between `NodeId`, `HirId`, and `DefIndex`. These conversions are cheap except for `HirId -> NodeId`, so if the valued reviewer finds such an instance in a performance critical place, please let me know. Ideally we convert more and more code from `NodeId` to `HirId` in the future so that there are no more `NodeId`s after HIR lowering anywhere. Then the amount of switching should be minimal again. r? @eddyb, maybe?
2017-08-12Fix some typosBastien Orivel-1/+1
2017-08-11Use DefIndex instead of NodeId in UpvarId.Michael Woerister-2/+2
2017-08-11Make TypeckTables::type_dependent_defs use ItemLocalId instead of NodeId.Michael Woerister-0/+3
2017-08-09Initial pass review commentsAlex Crichton-1/+1
2017-08-09Merge remote-tracking branch 'origin/master' into genAlex Crichton-5/+27
2017-07-31async-llvm(25): Restore -Ztime-passes output for trans and LLVM.Michael Woerister-5/+27
2017-07-28Generator literal supportJohn Kåre Alsaker-1/+42
2017-07-12integrate anon dep nodes into trait selectionNiko Matsakis-4/+2