summary refs log tree commit diff
path: root/src/librustc/util
AgeCommit message (Collapse)AuthorLines
2018-03-30Rename fs::read_string to read_to_string and stabilizeMatt Brubeck-1/+2
2018-03-29Auto merge of #49313 - sgrif:sg-revert-stuff, r=nikomatsakisbors-1/+1
Remove universes from `ty::ParamEnv` This change was never meant to land. #48407 takes an alternate approach. However, that PR is now blocked on some issues with canonicalization, and rebasing these reverts gets harder each time, so let's just get this bit out of the way now. r? @nikomatsakis
2018-03-23Revert "change skolemizations to use universe index"Sean Griffin-1/+1
This reverts commit 35e78b5cddc04c6bd13da2a1290d27cfb8ae8db8.
2018-03-23Rollup merge of #49262 - oli-obk:fixed_size_array_len, r=estebankAlex Crichton-2/+2
Produce nice array lengths on a best effort basis fixes #49208 r? @estebank
2018-03-22Produce nice array lengths on a best effort basisOliver Schneider-2/+2
2018-03-21work around fallout from these changes in rustcNiko Matsakis-0/+18
2018-03-14remove defaulting to unitAndrew Cann-2/+2
Types will no longer default to `()`, instead always defaulting to `!`. This disables the associated warning and removes the flag from TyTuple
2018-03-13add `canonicalize` method to `InferCtxt` [VIC]Niko Matsakis-0/+9
2018-03-13add handy helper for Cell<usize>, used for perf statsNiko Matsakis-0/+10
2018-03-09Move PROFQ_CHAN to a Session fieldJohn Kåre Alsaker-30/+32
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