about summary refs log tree commit diff
path: root/src/librustc/ty
AgeCommit message (Collapse)AuthorLines
2019-10-07fix ICE from debug output by using `kind_ty` in dumping closureNiko Matsakis-2/+9
Also, make `-Zverbose` dump all info about constants.
2019-10-07avoid ICE when extracting closure-kind-ty from a canonicalized valueNiko Matsakis-1/+3
In such a case, the `Infer` is converted to a `Bound`
2019-10-07correct bug in the "has escaping regions" visitorNiko Matsakis-7/+9
Existing code could overlook types/substitutions that are embedded in (e.g.) an unevaluated constant.
2019-10-07make type-flags exhaustiveNiko Matsakis-1/+3
Didn't find any bugs here, but you really don't want these to fall out of sync.
2019-10-07Auto merge of #64739 - guanqun:remove-as-str, r=estebankbors-0/+4
Remove as_str if the type is already &str Fix https://github.com/rust-lang/rust/issues/62642 r? @estebank do you think the suggestion tip is good enough?
2019-10-07Remove `force_ex!`.Nicholas Nethercote-13/+5
2019-10-07Remove `def_id!`.Nicholas Nethercote-12/+9
2019-10-07Remove `krate!`.Nicholas Nethercote-5/+1
2019-10-07Remove `force!`.Nicholas Nethercote-5/+1
2019-10-06Auto merge of #64564 - jonas-schievink:cowardly-default, r=nikomatsakisbors-0/+11
Deny specializing items not in the parent impl Part of https://github.com/rust-lang/rust/issues/29661 (https://github.com/rust-lang/rfcs/pull/2532). At least sort of? This was discussed in https://github.com/rust-lang/rust/pull/61812#discussion_r300504114 and is needed for that PR to make progress (fixing an unsoundness). One annoyance with doing this is that it sometimes requires users to copy-paste a provided trait method into an impl just to mark it `default` (ie. there is no syntax to forward this impl method to the provided trait method). cc @Centril and @arielb1
2019-10-06Auto merge of #65089 - nnethercote:optimize-integral-pattern-matching, ↵bors-16/+2
r=Mark-Simulacrum Optimize integral pattern matching Various improvements to integral pattern matching. Together they reduce instruction counts for `unicode_normalization-check-clean` by about 16%. r? @Mark-Simulacrum
2019-10-06Remove loaded_from_cache map from DepGraphMark Rousskov-8/+0
It's now unused, even with -Zquery-dep-graph
2019-10-05Pacify tidyJonas Schievink-1/+4
2019-10-05Fix the bootstrapJonas Schievink-0/+8
2019-10-04clean up GeneratorSubstscsmoe-5/+5
2019-10-04remove GeneratorSubsts visitorscsmoe-1/+1
2019-10-04replace GeneratorSubsts inside related typescsmoe-5/+5
2019-10-04generate GeneratorSubsts from SubstsRefcsmoe-22/+20
2019-10-04replace GeneratorSubsts with SubstsRefcsmoe-2/+10
2019-10-04Introduce a special case in `IntRange::from_const`.Nicholas Nethercote-16/+2
The `if let Some(val) = value.try_eval_bits(...)` branch in `from_const()` is very hot for the `unicode_normalization` benchmark. This commit introduces a special-case alternative for scalars that avoids `try_eval_bits()` and all the functions it calls (`Const::eval()`, `ConstValue::try_to_bits()`, `ConstValue::try_to_scalar()`, and `Scalar::to_bits()`), instead extracting the result immediately. The type and value checking done by `Scalar::to_bits()` is replicated by moving it into a new function `Scalar::check_raw()` and using that new function in the special case. PR #64673 introduced some special-case handling of scalar types in `Const::try_eval_bits()`. This handling is now moved out of that function into the new `IntRange::integral_size_and_signed_bias` function. This commit reduces the instruction count for `unicode_normalization-check-clean` by about 10%.
2019-10-04Rollup merge of #64874 - matthewjasper:simplify-euv, r=eddybMazdak Farrokhzad-1/+1
Simplify ExprUseVisitor * Remove HIR const qualification * Remove parts of ExprUseVisitor that aren't being used r? @eddyb
2019-10-04Rollup merge of #64817 - csmoe:closure, r=nikomatsakisMazdak Farrokhzad-38/+51
Replace ClosureSubsts with SubstsRef Addresses https://github.com/rust-lang/rust/issues/42340 part 3 https://github.com/rust-lang/rust/pull/59312 might benefit from this clean up. r? @nikomatsakis
2019-10-03Remove -Zprofile-queriesMark Rousskov-50/+1
2019-10-03generate ClosureSubsts from SubstsRefcsmoe-110/+46
2019-10-02Rollup merge of #64989 - sinkuu:fix_ice_64964, r=davidtwcoMazdak Farrokhzad-0/+6
Fix ICE #64964 Fixes #64964, which is an ICE with `await`ing in a method + incr-comp.
2019-10-02Rollup merge of #64961 - rust-lang:spastorino-patch-1, r=oli-obkMazdak Farrokhzad-1/+2
Make comment about dummy type a bit more clear
2019-10-02Fix async/await ICE #64964Shotaro Yamada-0/+6
2019-10-02Compute the layout of uninhabited structsOliver Scherer-4/+12
2019-10-01Rollup merge of #64840 - michaelwoerister:self-profiling-raii-refactor, ↵Tyler Mandry-15/+15
r=wesleywiser SelfProfiler API refactoring and part one of event review This PR refactors the `SelfProfiler` a little bit so that most profiling methods are RAII-based. The codegen backend code already had something similar, this refactoring pulls this functionality up into `SelfProfiler` itself, for general use. The second commit of this PR is a review and update of the existing events we are already recording. Names have been made more consistent. CGU names have been removed from event names. They will be added back in when function parameter recording is implemented. There is still some work to be done for adding new events, especially around trait resolution and the incremental system. r? @wesleywiser
2019-10-02typo fix in the codeGuanqun Lu-1/+1
2019-10-02comment fixesGuanqun Lu-0/+4
2019-10-01Rollup merge of #64950 - nnethercote:simplify-interners, r=varkor,spastorinoMazdak Farrokhzad-47/+22
Simplify interners Some code readability improvements.
2019-10-01Update src/librustc/ty/mod.rsSantiago Pastorino-1/+1
Co-Authored-By: Oliver Scherer <github35764891676564198441@oli-obk.de>
2019-10-01Make comment about dummy type a bit more clearSantiago Pastorino-1/+2
2019-10-01Rollup merge of #64895 - davidtwco:issue-64130-async-error-definition, ↵Mazdak Farrokhzad-1/+36
r=nikomatsakis async/await: improve not-send errors cc #64130. ``` note: future does not implement `std::marker::Send` because this value is used across an await --> $DIR/issue-64130-non-send-future-diags.rs:15:5 | LL | let g = x.lock().unwrap(); | - has type `std::sync::MutexGuard<'_, u32>` LL | baz().await; | ^^^^^^^^^^^ await occurs here, with `g` maybe used later LL | } | - `g` is later dropped here ``` r? @nikomatsakis
2019-10-01Remove the `$lt_tcx` parameter from `direct_interners!`.Nicholas Nethercote-7/+7
It's not necessary.
2019-10-01Inline and remove `intern_method!`.Nicholas Nethercote-26/+14
It's only used in two places, and the code is shorter and more readable with it gone.
2019-10-01Remove special treatment for `_intern_canonical_var_infos`.Nicholas Nethercote-14/+1
This is a leftover from when there were global and thread-local arenas.
2019-10-01Reorder the slice interners.Nicholas Nethercote-2/+2
So the order matches the order in `CtxtInterners`.
2019-10-01Avoid `SmallVec::collect()` in `List<Predicate>::super_fold_with()`.Nicholas Nethercote-2/+15
Also avoid interning when it's not necessary. This commit reduces instruction counts for a couple of benchmarks by up to 1%.
2019-10-01Avoid `SmallVec::collect()` in `Result::intern_with()`.Nicholas Nethercote-2/+23
This commit reduces instruction counts for several benchmarks by up to 5%.
2019-10-01Avoid `SmallVec::collect()` in `SubstsRef::super_fold_with()`.Nicholas Nethercote-8/+35
This commit reduces instruction counts for several benchmarks by up to 5%.
2019-09-30async/await: improve obligation errorsDavid Wood-1/+36
This commit improves obligation errors for async/await: ``` note: future does not implement `std::marker::Send` because this value is used across an await --> $DIR/issue-64130-non-send-future-diags.rs:15:5 | LL | let g = x.lock().unwrap(); | - has type `std::sync::MutexGuard<'_, u32>` LL | baz().await; | ^^^^^^^^^^^ await occurs here, with `g` maybe used later LL | } | - `g` is later dropped here ``` Signed-off-by: David Wood <david@davidtw.co>
2019-09-30Remove HIR based const qualificationMatthew Jasper-1/+1
2019-09-30Auto merge of #64778 - csmoe:index, r=eddybbors-15/+15
Introduce librustc_index crate Closes #50592
2019-09-30Self-Profiling: Make names of existing events more consistent and use new API.Michael Woerister-15/+11
2019-09-30Self-Profiling: Refactor SelfProfiler API to be RAII based where possible.Michael Woerister-0/+4
2019-09-29Auto merge of #64673 - Mark-Simulacrum:opt-match-ck, r=oli-obkbors-2/+16
Optimize try_eval_bits to avoid layout queries This specifically targets match checking, but is possibly more widely useful as well. In code with large, single-value match statements, we were previously spending a lot of time running layout_of for the primitive types (integers, chars) -- which is essentially useless. This optimizes the code to avoid those query calls by directly obtaining the size for these types, when possible. It may be worth considering adding a `size_of` query in the future which might be far faster, especially if specialized for "const" cases -- match arms being the most obvious example. It's possibly such a function would benefit from *not* being a query as well, since it's trivially evaluatable from the sty for many cases whereas a query needs to hash the input and such.
2019-09-29Optimize try_eval_bits to avoid layout queriesMark Rousskov-2/+16
This specifically targets match checking, but is possibly more widely useful as well. In code with large, single-value match statements, we were previously spending a lot of time running layout_of for the primitive types (integers, chars) -- which is essentially useless. This optimizes the code to avoid those query calls by directly obtaining the size for these types, when possible. It may be worth considering adding a `size_of` query in the future which might be far faster, especially if specialized for "const" cases -- match arms being the most obvious example. It's possibly such a function would benefit from *not* being a query as well, since it's trivially evaluatable from the sty for many cases whereas a query needs to hash the input and such.
2019-09-29Rollup merge of #64858 - skinny121:str-const-generics, r=varkorMazdak Farrokhzad-2/+15
Add support for relating slices in `super_relate_consts` This allows passing strings as generic arguments. Fixes #63773 Fixes #60813 r? @varkor