about summary refs log tree commit diff
path: root/src/librustc/util
AgeCommit message (Collapse)AuthorLines
2016-11-10rustc: clean up lookup_item_type and remove TypeScheme.Eduard Burtescu-4/+4
2016-11-10rustc: unify and simplify managing associated items.Eduard Burtescu-26/+0
2016-11-08Replace FnvHasher use with FxHasher.Nicholas Nethercote-10/+10
This speeds up compilation by 3--6% across most of rustc-benchmarks.
2016-11-05Rollup merge of #37583 - michaelwoerister:hir-stats, r=alexcrichtonAlex Crichton-0/+34
Add `-Z hir-stats` for collecting statistics on HIR and AST The data collected will be printed to the commandline and looks like the following: ``` // stats for libcore PRE EXPANSION AST STATS Name Accumulated Size Count Item Size ---------------------------------------------------------------- TypeBinding 2_280 57 40 Mod 3_560 89 40 PathListItem 6_516 181 36 Variant 7_872 82 96 LifetimeDef 21_280 380 56 StructField 22_880 260 88 Lifetime 23_800 1_190 20 Local 30_192 629 48 ForeignItem 31_504 179 176 Arm 42_880 670 64 Mac 46_960 587 80 FnDecl 57_792 1_204 48 TraitItem 69_504 362 192 TyParamBound 98_280 945 104 Block 108_384 2_258 48 Stmt 144_720 3_618 40 ImplItem 230_272 1_028 224 Item 467_456 1_826 256 Pat 517_776 4_623 112 Attribute 745_680 15_535 48 Ty 1_114_848 9_954 112 PathSegment 1_218_528 16_924 72 Expr 3_082_408 20_279 152 ---------------------------------------------------------------- Total 8_095_372 POST EXPANSION AST STATS Name Accumulated Size Count Item Size ---------------------------------------------------------------- MacroDef 1_056 12 88 Mod 3_400 85 40 TypeBinding 4_280 107 40 PathListItem 6_516 181 36 Variant 7_872 82 96 StructField 24_904 283 88 ForeignItem 31_504 179 176 TraitItem 69_504 362 192 Local 85_008 1_771 48 Arm 100_288 1_567 64 Lifetime 123_980 6_199 20 LifetimeDef 126_728 2_263 56 TyParamBound 297_128 2_857 104 FnDecl 305_856 6_372 48 Block 481_104 10_023 48 Stmt 535_120 13_378 40 Item 1_469_952 5_742 256 Attribute 1_629_840 33_955 48 ImplItem 1_732_864 7_736 224 Pat 2_360_176 21_073 112 PathSegment 5_888_448 81_784 72 Ty 6_237_168 55_689 112 Expr 12_013_320 79_035 152 ---------------------------------------------------------------- Total 33_536_016 HIR STATS Name Accumulated Size Count Item Size ---------------------------------------------------------------- MacroDef 864 12 72 Mod 2_720 85 32 TypeBinding 3_424 107 32 PathListItem 5_068 181 28 Variant 6_560 82 80 StructField 20_376 283 72 ForeignItem 27_208 179 152 WherePredicate 43_776 684 64 TraitItem 52_128 362 144 Decl 68_992 2_156 32 Local 89_184 1_858 48 Arm 94_368 1_966 48 LifetimeDef 108_624 2_263 48 Lifetime 123_980 6_199 20 Stmt 168_000 4_200 40 TyParamBound 251_416 2_857 88 FnDecl 254_880 6_372 40 Block 583_968 12_166 48 Item 1_240_272 5_742 216 ImplItem 1_361_536 7_736 176 Attribute 1_620_480 33_760 48 Pat 2_073_120 21_595 96 Path 2_385_856 74_558 32 Ty 4_455_040 55_688 80 PathSegment 5_587_904 87_311 64 Expr 7_588_992 79_052 96 ---------------------------------------------------------------- Total 28_218_736 ```
2016-11-04Rollup merge of #37408 - eddyb:lazy-5, r=nikomatsakisAlex Crichton-25/+2
[5/n] rustc: record the target type of every adjustment. _This is part of a series ([prev](https://github.com/rust-lang/rust/pull/37404) | [next](https://github.com/rust-lang/rust/pull/37412)) of patches designed to rework rustc into an out-of-order on-demand pipeline model for both better feature support (e.g. [MIR-based](https://github.com/solson/miri) early constant evaluation) and incremental execution of compiler passes (e.g. type-checking), with beneficial consequences to IDE support as well. If any motivation is unclear, please ask for additional PR description clarifications or code comments._ <hr> The first commit rearranges `tcx.tables` so that all users go through `tcx.tables()`. This in preparation for per-body `Tables` where they will be requested for a specific `DefId`. Included to minimize churn. The rest of the changes focus on adjustments, there are some renamings, but the main addition is the target type, always available in all cases (as opposed to just for unsizing where it was previously needed). Possibly the most significant effect of this change is that figuring out the final type of an expression is now _always_ just one successful `HashMap` lookup (either the adjustment or, if that doesn't exist, the node type).
2016-11-04Add -Zhir-stats for collecting statistics on HIR and ASTMichael Woerister-0/+34
2016-11-02rustc: record the target type of every adjustment.Eduard Burtescu-25/+2
2016-10-30Fix ICE when printing closures, and other similar typesMark-Simulacrum-3/+14
2016-10-30Fix ICE when attempting to get closure generics.Mark-Simulacrum-17/+35
2016-10-27Address comments + Fix rebaseVadim Petrochenkov-28/+0
2016-10-27Preparations and cleanupVadim Petrochenkov-3/+31
Diagnostics for struct path resolution errors in resolve and typeck are unified. Self type is treated as a type alias in few places (not reachable yet). Unsafe cell is seen in constants even through type aliases. All checks for struct paths in typeck work on type level.
2016-10-25Utilize AccumulateVec to avoid heap allocations in mk_{substs, type_list, ↵Mark-Simulacrum-2/+2
tup} calls.
2016-09-20rustc: replace uses of NodeId in Def, other than closures and labels.Eduard Burtescu-1/+2
2016-09-11Use question_mark feature in librustc.Ahmed Charles-1/+1
2016-09-08Refactor `TyStruct`/`TyEnum`/`TyUnion` into `TyAdt`Vadim Petrochenkov-2/+2
2016-09-06Auto merge of #36025 - michaelwoerister:incr-comp-hash-spans, r=nikomatsakisbors-9/+26
incr. comp.: Take spans into account for ICH This PR makes the ICH (incr. comp. hash) take spans into account when debuginfo is enabled. A side-effect of this is that the SVH (which is based on the ICHs of all items in the crate) becomes sensitive to the tiniest change in a code base if debuginfo is enabled. Since we are not trying to model ABI compatibility via the SVH anymore (this is done via the crate disambiguator now), this should be not be a problem. Fixes #33888. Fixes #32753.
2016-09-03Add union typesVadim Petrochenkov-3/+2
2016-09-01Add some infrastructure for timing things where time_passes can't be used.Michael Woerister-9/+26
2016-09-01Auto merge of #34982 - arielb1:bad-tuples-and-objects, r=nikomatsakisbors-4/+0
Turn the RFC1592 warnings into hard errors The warnings have already reached stable, and I want to improve the trait error reporting code. Turning warnings into errors, this is obviously a [breaking-change]. r? @nikomatsakis cc @rust-lang/compiler
2016-09-01turn the RFC1592 warnings into hard errorsAriel Ben-Yehuda-4/+0
The warnings have already reached stable The test rfc1592_deprecated is covered by `bad_sized` and `unsized6`. Fixes #33242 Fixes #33243
2016-08-29Implement copy-on-write scheme for managing the incremental compilation cache.Michael Woerister-3/+38
2016-08-27rustc: use Vec<Kind> in Substs, where Kind is a &TyS | &Region tagged pointer.Eduard Burtescu-14/+7
2016-08-27rustc: pass ty::Region behind an interned 'tcx reference.Eduard Burtescu-8/+10
2016-08-27rustc: use accessors for Substs::{types,regions}.Eduard Burtescu-18/+18
2016-08-17rustc: remove ParamSpace from Substs.Eduard Burtescu-36/+44
2016-08-17rustc: split Generics of a method from its parent Generics.Eduard Burtescu-4/+6
2016-08-17rustc: remove SelfSpace from ParamSpace.Eduard Burtescu-39/+28
2016-08-17rustc: reduce Substs and Generics to a simple immutable API.Eduard Burtescu-74/+54
2016-08-17rustc: move trait objects from TraitRef to ExistentialTraitRef.Eduard Burtescu-49/+55
2016-08-17rustc: use Vec instead of VecPerParamSpace for ty::GenericPredicates.Eduard Burtescu-1/+1
2016-08-13Rename empty/bang to neverAndrew Cann-4/+4
Split Ty::is_empty method into is_never and is_uninhabited
2016-08-13Remove obsolete divergence related stuffAndrew Cann-13/+6
Replace FnOutput with Ty Replace FnConverging(ty) with ty Purge FnDiverging, FunctionRetTy::NoReturn and FunctionRetTy::None
2016-08-13Add EmptyToAny adjustmentAndrew Cann-0/+3
2016-08-13Start implementation of RFC 1216 (make ! a type)Andrew Cann-1/+2
Add `TyKind::Empty` and fix resulting build errors.
2016-08-12rustc: add TyAnon (impl Trait) to the typesystem.Eduard Burtescu-0/+31
2016-07-30Rollup merge of #35080 - jonathandturner:fix_numeric_expected_found, ↵Manish Goregaokar-1/+3
r=nikomatsakis Rename _ to {integer} and {float} for unknown numeric types This PR renames _ to {integer} or {float} for unknown numeric types, to help people parse error messages that have numeric types that haven't been nailed down. Example: ```rust fn main() { let x: String = 4; } ``` Before: ``` error[E0308]: mismatched types --> quicktest.rs:2:21 | 2 | let x: String = 4; | ^ expected struct `std::string::String`, found integral variable | = note: expected type `std::string::String` = note: found type `_` error: aborting due to previous error ``` after: ``` error[E0308]: mismatched types --> quicktest.rs:2:21 | 2 | let x: String = 4; | ^ expected struct `std::string::String`, found integral variable | = note: expected type `std::string::String` = note: found type `{integer}` error: aborting due to previous error ``` ```
2016-07-28Move to {integer} and {float}Jonathan Turner-1/+2
2016-07-28Address mw nitsNiko Matsakis-0/+14
2016-07-28Rename _ to {numerics} for unknown numeric typesJonathan Turner-1/+2
2016-07-06rustc: Update stage0 to beta-2016-07-06Alex Crichton-12/+0
Hot off the presses, let's update our stage0 compiler!
2016-06-09fix damage in librustcAriel Ben-Yehuda-0/+12
2016-06-05rustc: add ReErased to be used by trait selection, MIR and trans.Eduard Burtescu-23/+31
2016-06-04Auto merge of #33622 - arielb1:elaborate-drops, r=nikomatsakisbors-21/+23
[MIR] non-zeroing drop This enables non-zeroing drop through stack flags for MIR. Fixes #30380. Fixes #5016.
2016-06-03fix ICEs with RUST_LOGAriel Ben-Yehuda-21/+23
2016-05-31add `Issue32330` warning marker to bound regionsNiko Matsakis-5/+8
This indicates whether this `BoundRegion` will change from late to early bound when issue 32330 is fixed. It also indicates the function on which the lifetime is declared.
2016-05-11rustc: Split local type contexts interners from the global one.Eduard Burtescu-11/+11
2016-05-11rustc: More interning for data used in Ty<'tcx>.Eduard Burtescu-2/+2
2016-05-11rustc: Generalize a minimum set of functions over 'tcx != 'gcx.Eduard Burtescu-2/+3
2016-05-11rustc: Remove the TyCtxt field from ParameterEnvironment.Eduard Burtescu-1/+1
2016-05-11rustc: Split 'tcx into 'gcx and 'tcx for InferCtxt and its users.Eduard Burtescu-4/+4