about summary refs log tree commit diff
path: root/src/librustc/ty
AgeCommit message (Collapse)AuthorLines
2019-06-04Generate StorageDead along unwind paths for generatorsTyler Mandry-1/+1
2019-06-05Add `modernize_and_adjust` methods.Nicholas Nethercote-4/+2
These combine two `HygieneData::with` calls into one.
2019-06-05Add `SyntaxContext::hygienic_eq`.Nicholas Nethercote-1/+2
This combines multiple `HygieneData::with` calls into one, by combining parts of `hygienic_eq` and `adjust_ident`.
2019-06-05Add and use `SyntaxContext::outer_and_expn_info`.Nicholas Nethercote-3/+2
This combines two `HygieneData::with` calls into one on a hot path.
2019-06-03Auto merge of #57214 - Zoxc:no-local-interners, r=eddybbors-16/+28
Store CtxtInterners for local values in AllArenas r? @eddyb
2019-06-03Auto merge of #61062 - mark-i-m:mono-mv, r=eddyb,oli-obkbors-27/+335
Remove _all_ codegen dependencies on `rustc_mir` :tada: ~This code is pretty self-contained. It has no references to the rest of `rustc_mir`. Moving it to its own crate means that almost all of the references from `rustc_codegen_*` to `rustc_mir` are instead moved to `rustc_monomorphize`, which should help improve compile times for the compiler a bit...~ With the help of eddyb and oli-obk, all of the dependencies of `librustc_codegen_*` on `librustc_mir` have been removed: - dependencies on `rustc_mir::monomorphize` were moved to `rustc::mir::mono` - `rustc_mir::const_eval::const_field` is made into a query. - `rustc_mir::interpret::type_name` is made into a query. This should help reduce compile time when working on `rustc_mir` :clock1: cc #47849 r? @eddyb
2019-06-02query-ify const_fieldMark Mansi-1/+11
2019-06-02move DefPathBasedNames to ty::print::obsoleteMark Mansi-0/+287
2019-06-02deduplicate ty::Instance constructorsMark Mansi-27/+38
2019-06-03Auto merge of #61361 - estebank:infer-type, r=varkorbors-1/+22
Add more detail to type inference error When encountering code where type inference fails, add more actionable information: ``` fn main() { let foo = Vec::new(); } ``` ``` error[E0282]: type annotations needed in `std::vec::Vec<T>` --> $DIR/vector-no-ann.rs:2:16 | LL | let foo = Vec::new(); | --- ^^^^^^^^ cannot infer type for `T` in `std::vec::Vec<T>` | | | consider giving `foo` a type ``` Fix #25633.
2019-06-02Auto merge of #61278 - RalfJung:miri-tag-allocations, r=oli-obkbors-1/+1
Miri: give machine the chance to tag all allocations r? @oli-obk The Miri side of this is at https://github.com/rust-lang/rust/pull/61278.
2019-06-02Auto merge of #61460 - Centril:rollup-8txhjx4, r=Centrilbors-1/+1
Rollup of 6 pull requests Successful merges: - #61380 (Fix some issues with `unwrap_usize` instead of `assert_usize`) - #61423 (codegen: change `$6d$` to `$u6d$`) - #61438 (Point at individual type args on arg count mismatch) - #61441 (Tweak wording when encountering `fn` call in pattern) - #61451 (Fix missing semicolon in doc) - #61458 (Fix typo in AsRef doc) Failed merges: r? @ghost
2019-06-02Rollup merge of #61380 - varkor:expected-usize-got-param, r=eddybMazdak Farrokhzad-1/+1
Fix some issues with `unwrap_usize` instead of `assert_usize` Fixes https://github.com/rust-lang/rust/issues/61337. Fixes https://github.com/rust-lang/rust/issues/61341. Fixes https://github.com/rust-lang/rust/issues/61422. r? @eddyb
2019-06-02Auto merge of #61276 - eddyb:kill-res-upvar, r=petrochenkovbors-22/+10
rustc: remove Res::Upvar. By keeping track of the current "`body_owner`" (the `DefId` of the current fn/closure/const/etc.) in several passes, `Res::Upvar` and `hir::Upvar` don't need to contain contextual information about the closure. By leveraging [`indexmap`](https://docs.rs/indexmap), the list of upvars for a given closure can now also be queried, to check whether a local variable is a closure capture, and so `Res::Upvar` can be merged with `Res::Local`. And finally, the `tcx.upvars(...)` query now collects upvars from HIR, without relying on `rustc_resolve`. r? @petrochenkov cc @varkor @davidtwco
2019-06-02no longer assume that there is a default tag: give the machine the chance to ↵Ralf Jung-1/+1
tag all allocations
2019-06-02Fix unwrapping usize issue with transparent MaybeUnit array wrappervarkor-1/+1
2019-06-01rustc: collect upvars from HIR, instead of during name resolution.Eduard-Mihai Burtescu-15/+1
2019-06-01rustc: use indexmap instead of a plain vector for upvars.Eduard-Mihai Burtescu-14/+16
2019-06-01Auto merge of #61350 - RalfJung:alloc, r=oli-obkbors-1/+1
light refactoring of global AllocMap * rename AllocKind -> GlobalAlloc. This stores the allocation itself, not just its kind. * rename the methods that allocate stuff to have consistent names. Cc @oli-obk
2019-06-01rustc: replace Res in hir::Upvar with only Local/Upvar data.Eduard-Mihai Burtescu-2/+2
2019-06-01Rollup merge of #61389 - Zoxc:arena-cleanup, r=eddybMazdak Farrokhzad-47/+11
Remove GlobalArenas and use Arena instead r? @eddyb
2019-06-01Rollup merge of #61387 - JohnTitor:remove-unused, r=matthewjasperMazdak Farrokhzad-5/+0
Remove ty::BrFresh and RegionConstraintCollector::new_bound Fixes #60957 r? @matthewjasper
2019-05-31On type inference errors use the type argument name when possibleEsteban Küber-1/+22
``` error[E0282]: type annotations needed in `std::result::Result<i32, E>` --> file7.rs:3:13 | 3 | let b = Ok(4); | - ^^ cannot infer type for `E` in `std::result::Result<i32, E>` | | | consider giving `b` a type` ```
2019-05-31rustc_codegen_utils: add new mangling scheme implementation.Eduard-Mihai Burtescu-1/+1
2019-05-31Store CtxtInterners for local values in AllArenasJohn Kåre Alsaker-16/+28
2019-05-31Remove GlobalArenas and use Arena insteadJohn Kåre Alsaker-47/+11
2019-05-31Remove ty::BrFresh and new_boundYuki Okushi-5/+0
2019-05-30Auto merge of #61253 - nnethercote:avoid-hygiene_data-lookups, r=petrochenkovbors-8/+21
Avoid `hygiene_data` lookups These commits mostly introduce compound operations that allow two close adjacent `hygiene_data` lookups to be combined. r? @petrochenkov
2019-05-30light refactoring of global AllocMapRalf Jung-1/+1
* rename AllocKind -> GlobalAlloc. This stores the allocation itself, not just its kind. * rename the methods that allocate stuff to have consistent names.
2019-05-30Optimize `TyCtxt::adjust_ident`.Nicholas Nethercote-8/+16
It's a hot function that returns a 2-tuple, but the hottest call site (`hygienic_eq`) discards the second element. This commit renames `adjust_ident` as `adjust_ident_and_get_scope`, and then introduces a new `adjust_ident` that only computes the first element. This change also avoids the need to pass in an unused `DUMMY_HIR_ID` argument in a couple of places, which is nice.
2019-05-29Optimize `TyCtxt::hygienic_eq`.Nicholas Nethercote-2/+7
It's measurably faster to avoid the context comparison when possible. The commit also adds `hygienic_eq` in one appropriate place.
2019-05-29Rollup merge of #60928 - TheSirC:fix/60229, r=eddybMazdak Farrokhzad-10/+10
Changes the type `mir::Mir` into `mir::Body` Fixes part 1 of #60229 (previously attempted in #60242). I stumbled upon the issue and it seems that the previous attempt at solving it was not merged. This is a second try more up-to-date. The commit should have changed comments as well. At the time of writting, it passes the tidy and check tool.
2019-05-29rustc: rename Mir to mir::Body in comments and to MIR in error strings.Eduard-Mihai Burtescu-3/+3
2019-05-28Fix nitsvarkor-3/+2
2019-05-28Correct pluralisation of tuple/array/associated type binding mismatch errorsvarkor-7/+18
2019-05-28Reintroduce `TypeError::FixedArraySize`varkor-2/+25
2019-05-28Use Display rather than Debug printing for const mismatchvarkor-1/+1
2019-05-28Remove FixedArraySize errorvarkor-9/+0
2019-05-28Eagerly evaluate in `super_relate_consts`varkor-56/+37
2019-05-28Relate identical parameters in array lengthsvarkor-21/+17
2019-05-28Changes the type `mir::Mir` into `mir::Body`Claude-Alban RANÉLY-VERGÉ-DÉPRÉ-8/+8
The commit should have changed comments as well. At the time of writting, it passes the tidy and check tool. Revisions asked by eddyb : - Renamed of all the occurences of {visit/super}_mir - Renamed test structures `CachedMir` to `Cached` Fixing the missing import on `AggregateKind`
2019-05-28Rollup merge of #61164 - RalfJung:scalar, r=oli-obkMazdak Farrokhzad-14/+12
rename Scalar::Bits to Scalar::Raw and bits field to data Also use this opportunity to seal some abstraction leaks (other modules constructing `Scalar::Bits` directly instead of using a constructor). r? @oli-obk
2019-05-26Rename "Associated*" to "Assoc*"Andrew Xu-1/+1
modify pretty.rs which recently added "Associated*"
2019-05-26Rename "Associated*" to "Assoc*"Andrew Xu-51/+51
We are going to uniform the terminology of all associated items. Methods that may or may not have `self` are called "associated functions". Because `AssociatedFn` is a bit long, we rename `Associated` to `Assoc`.
2019-05-26rename Scalar::Bits to Scalar::Raw and bits field to dataRalf Jung-14/+12
2019-05-25Print types for unevaluated constantsOliver Scherer-2/+2
2019-05-25Fix rebase falloutOliver Scherer-5/+5
2019-05-25Break cycle during array length printingOliver Scherer-1/+1
2019-05-25rustc: integrate ty::Const into ty::print as print_const.Eduard-Mihai Burtescu-106/+135
2019-05-25Print unevaluted constants as `_` or as their source representationOliver Scherer-4/+13