about summary refs log tree commit diff
path: root/src/librustc/ty
AgeCommit message (Collapse)AuthorLines
2019-08-15hygiene: `ExpnInfo` -> `ExpnData`Vadim Petrochenkov-34/+34
For naming consistency with everything else in this area
2019-08-15hygiene: Merge `ExpnInfo` and `InternalExpnData`Vadim Petrochenkov-2/+2
2019-08-15hygiene: Remove `Option`s from functions returning `ExpnInfo`Vadim Petrochenkov-11/+7
The expansion info is not optional and should always exist
2019-08-15syntax_pos: `NO_EXPANSION`/`SyntaxContext::empty()` -> `SyntaxContext::root()`Vadim Petrochenkov-2/+2
For consistency with `ExpnId::root`. Also introduce a helper `Span::with_root_ctxt` for creating spans with `SyntaxContext::root()` context
2019-08-15Auto merge of #63575 - Centril:rollup-anlv9g5, r=Centrilbors-0/+3
Rollup of 11 pull requests Successful merges: - #62984 (Add lint for excess trailing semicolons) - #63075 (Miri: Check that a ptr is aligned and inbounds already when evaluating `*`) - #63490 (libsyntax: cleanup and refactor `pat.rs`) - #63507 (When needing type annotations in local bindings, account for impl Trait and closures) - #63509 (Point at the right enclosing scope when using `await` in non-async fn) - #63528 (syntax: Remove `DummyResult::expr_only`) - #63537 (expand: Unimplement `MutVisitor` on `MacroExpander`) - #63542 (Add NodeId for Arm, Field and FieldPat) - #63543 (Merge Variant and Variant_) - #63560 (move test that shouldn't be in test/run-pass/) - #63570 (Adjust tracking issues for `MaybeUninit<T>` gates) Failed merges: r? @ghost
2019-08-14Handle cfg(bootstrap) throughoutMark Rousskov-9/+9
2019-08-12Resolve types when suggesting boxed closureEsteban Küber-0/+3
2019-08-12Rollup merge of #62108 - Zoxc:sharded-queries, r=oli-obkMazdak Farrokhzad-26/+28
Use sharded maps for queries Based on https://github.com/rust-lang/rust/pull/61779. r? @Gankro
2019-08-11Rollup merge of #63464 - Mark-Simulacrum:deref-instance, r=eddybMark Rousskov-2/+2
Copy ty::Instance instead of passing by reference ty::Instance is small and Copy, we should not be adding additional indirection. Fixes #63409. r? @eddyb
2019-08-11Copy ty::Instance instead of passing by referenceMark Rousskov-2/+2
ty::Instance is small and Copy, we should not be adding additional indirection.
2019-08-11Remove `HAS_NORMALIZABLE_PROJECTION`Matthew Jasper-17/+8
2019-08-11Remove `is_self` and `has_self_ty` methodsMatthew Jasper-48/+16
2019-08-11proper doc comment for 'recovered' field of variantRalf Jung-2/+2
Curtesy of petrochenkov
2019-08-11note a FIXMERalf Jung-0/+1
2019-08-11add tuple_fields convenience method and use it in a few placesRalf Jung-8/+20
2019-08-11fix a commentRalf Jung-1/+1
2019-08-10Rollup merge of #63350 - iluuu1994:use-associated-type-bounds, r=CentrilMazdak Farrokhzad-7/+6
Use associated_type_bounds where applicable - closes #61738
2019-08-08Use associated_type_bounds where applicable - closes #61738Ilija Tovilo-7/+6
2019-08-07Auto merge of #62457 - ↵bors-4/+21
zackmdavis:minimax_search_and_the_structure_of_cognition, r=varkor pretty-pretty extremal constants! (A resurrection of the defunct #57073.) While many programmers may intuitively appreciate the significance of "magic numbers" like −2147483648, Rust is about empowering everyone to build reliable and efficient software! It's a bit more legible to print the constant names (even noisy fully-qualified-paths thereof). The bit-manipulation methods mirror those in `librustc_mir::hair::pattern::_match::all_constructors`; thanks to the immortal Varkor for guidance. Resolves #56393. r? @varkor
2019-08-07Auto merge of #61919 - alexreg:fix-atb-1, r=nikomatsakisbors-12/+13
Fix for "ambiguous associated type" issue with ATBs Fixes #61752. r? @nikomatsakis CC @Centril
2019-08-06pretty-pretty extremal constants!Zack M. Davis-4/+21
While many programmers may intuitively appreciate the significance of "magic numbers" like −2147483648, Rust is about empowering everyone to build reliable and efficient software! It's a bit more legible to print the constant names (even noisy fully-qualified-paths thereof). The bit-manipulation methods mirror those in `librustc_mir::hair::pattern::_match::all_constructors`; thanks to the immortal Varkor for guidance. Resolves #56393.
2019-08-07Rollup merge of #63034 - tmandry:reduce-generator-size-regressions, r=cramertjMazdak Farrokhzad-10/+39
Fix generator size regressions due to optimization I tested the generator optimizations in #60187 and #61922 on the Fuchsia build, and noticed that some small generators (about 8% of the async fns in our build) increased in size slightly. This is because in #60187 we split the fields into two groups, a "prefix" non-overlap region and an overlap region, and lay them out separately. This can introduce unnecessary padding bytes between the two groups. In every single case in the Fuchsia build, it was due to there being only a single variant being used in the overlap region. This means that we aren't doing any overlapping, period. So it's better to combine the two regions into one and lay out all the fields at once, which is what this change does. r? @cramertj cc @eddyb @Zoxc
2019-08-06Fix generator size regressions due to optimizationTyler Mandry-0/+21
I tested the generator optimizations in #60187 and #61922 on the Fuchsia build, and noticed that some small generators (about 8% of the async fns in our build) increased in size slightly. This is because in #60187 we split the fields into two groups, a "prefix" non-overlap region and an overlap region, and lay them out separately. This can introduce unnecessary padding bytes between the two groups. In every single case in the Fuchsia build, it was due to there being only a single variant being used in the overlap region. This means that we aren't doing any overlapping, period. So it's better to combine the two regions into one and lay out all the fields at once, which is what this change does.
2019-08-05Get rid of one more useless `lift` invocationOliver Scherer-2/+1
2019-08-05Prevent array length printing cycle with debug assertionsOliver Scherer-1/+6
2019-08-05Address comment and formatting nitsOliver Scherer-2/+2
2019-08-05Clear the ParamEnv where its information is irrelevantOliver Scherer-13/+17
2019-08-05Fiddle param env through to `try_eval_bits` in most placesOliver Scherer-25/+36
2019-08-05Don't abort on unevaluated constants without at least tryting to eval themOliver Scherer-21/+37
2019-08-05Clean up the `ty::Const::assert*` methodsOliver Scherer-25/+11
2019-08-05Ensure `type_param_predicates` fn only returns predicates for type param ↵Alexander Regueiro-1/+1
with given def-ID.
2019-08-05A few cosmetic improvements.Alexander Regueiro-13/+14
2019-08-05Auto merge of #63079 - RalfJung:ctfe-no-align, r=oli-obkbors-2/+2
CTFE: simplify ConstValue by not checking for alignment I hope the test suite actually covers the problematic cases here? r? @oli-obk Fixes https://github.com/rust-lang/rust/issues/61952
2019-08-03Auto merge of #63059 - Centril:sound-bind-by-move, r=matthewjasperbors-1/+1
Make `#![feature(bind_by_move_pattern_guards)]` sound without `#[feature(nll)]` Implements https://github.com/rust-lang/rust/issues/15287#issuecomment-507054617 making `#![feature(bind_by_move_pattern_guards)]]` sound without also having `#![feature(nll)]`. The logic here is that if we see a `match` guard, we will refuse to downgrade NLL errors to warnings. This is in preparation for hopefully stabilizing the former feature in https://github.com/rust-lang/rust/pull/63118. As fall out from the implementation we also: Fixes https://github.com/rust-lang/rust/issues/31287 Fixes https://github.com/rust-lang/rust/issues/27282 r? @matthewjasper
2019-08-03Auto merge of #62946 - RalfJung:miri_type_dispatch_first, r=oli-obkbors-0/+6
Miri: dispatch first on the type Based on the fact that Miri now always has intptrcast available, we can change binops and casts to first check the type of the source operand and then decide based on that what to do, instead of considering the value (pointer vs bits) first.
2019-08-03Auto merge of #63180 - varkor:trait-alias-impl-trait, r=Centrilbors-19/+20
Change opaque type syntax from `existential type` to type alias `impl Trait` This implements a new feature gate `type_alias_impl_trait` (this is slightly different from the originally proposed feature name, but matches what has been used in discussion since), deprecating the old `existential_types` feature. The syntax for opaque types has been changed. In addition, the "existential" terminology has been replaced with "opaque", as per previous discussion and the RFC. This makes partial progress towards implementing https://github.com/rust-lang/rust/issues/63063. r? @Centril
2019-08-03Rollup merge of #63208 - tmandry:issue-62658, r=cramertjMazdak Farrokhzad-0/+2
Round generator sizes to a multiple of their alignment Fixes #62658. r? @cramertj cc @eddyb
2019-08-02add is_any_ptr type test; this also helps pacify tidyRalf Jung-0/+6
2019-08-02CTFE: simplify Value type by not checking for alignmentRalf Jung-2/+2
2019-08-02Address review commentsvarkor-1/+1
2019-08-02Replace `exist_ty` and `ExistTy` with `opaque_ty` and `OpaqueTy`varkor-2/+2
2019-08-02Fix fallout after rebasevarkor-1/+1
2019-08-02Replace "existential" by "opaque"varkor-17/+18
2019-08-01Round generator sizes to multiple of their alignmentTyler Mandry-0/+2
Fixes #62658.
2019-07-31Remove redundant method with const variable resolutionvarkor-7/+5
2019-07-30Do not downgrade NLL errors for bind_by_move_pattern_guards when AST says it ↵Mazdak Farrokhzad-1/+1
is OK.
2019-07-29Wrap promoted generator fields in MaybeUninitTyler Mandry-10/+18
This prevents uninhabited fields from "infecting" the abi and largest_niche of the generator layout. This fixes a latent bug, where an uninhabited field could be promoted to the generator prefix and cause the entire generator to become uninhabited.
2019-07-28Fix `cfg(parallel_compiler)` modeVadim Petrochenkov-33/+15
Fix rebase
2019-07-28Remove lint annotations in specific crates that are already enforced by ↵Vadim Petrochenkov-1/+2
rustbuild Remove some random unnecessary lint `allow`s
2019-07-26Rollup merge of #62964 - RalfJung:ty-tests, r=CentrilMazdak Farrokhzad-2/+2
clarify and unify some type test names * `is_mutable_pointer`: use `ptr` suffix for consistency with `is_region_ptr`, `is_fn_ptr`, `is_unsafe_ptr`. * `is_pointer_sized`: the name is misleading as this only tests for pointer-sized *integers*, so rename to `is_ptr_sized_integral`.