about summary refs log tree commit diff
path: root/src/librustc/ty/util.rs
AgeCommit message (Collapse)AuthorLines
2020-03-30rustc -> rustc_middle part 1Mazdak Farrokhzad-1091/+0
2020-03-24normalize some imports, prefer direct ones.Mazdak Farrokhzad-1/+1
2020-03-21rustc: keep upvars tupled in {Closure,Generator}Substs.Eduard-Mihai Burtescu-1/+1
2020-03-07Use ?-operator in more places (clippy::question_mark, had some false ↵Matthias Krüger-6/+1
negatives fixed recently)
2020-03-07Rollup merge of #69656 - matthiaskrgr:iter_nth_zero, r=oli-obkMazdak Farrokhzad-1/+1
Use .next() instead of .nth(0) on iterators.
2020-03-04cover some more nearby casesRalf Jung-3/+3
2020-03-03Use .next() instead of .nth(0) on iterators.Matthias Krüger-1/+1
2020-02-29Rename `syntax` to `rustc_ast` in source codeVadim Petrochenkov-1/+1
2020-02-19Make lookup of associated item by name O(log n)Dylan MacKenzie-1/+1
2020-02-18Rollup merge of #69146 - matthewjasper:literal-qualif, r=eddybMazdak Farrokhzad-2/+38
Always const qualify literals by type r? @eddyb
2020-02-15Add fast path for is_freezeMatthew Jasper-2/+38
2020-02-14Add fast path to eq_opaque_type_and_typeMatthew Jasper-1/+1
2020-02-12Auto merge of #68679 - matthewjasper:needs-type-op, r=varkorbors-4/+88
Improve `ty.needs_drop` * Handle cycles in `needs_drop` correctly * Normalize types when computing `needs_drop` * Move queries from rustc to rustc_ty * Avoid query in simple cases reopens #65918
2020-02-09cache adt_drop_tysMatthew Jasper-1/+1
2020-02-09Apply suggestions from code reviewmatthewjasper-2/+2
Co-Authored-By: varkor <github@varkor.com>
2020-02-08Make `associated_items` query return a sliceJonas Schievink-1/+1
2020-02-02Address review commentsMatthew Jasper-11/+22
* Handle arrays with const-generic lengths * Use closure for repeated code.
2020-02-02Improve needs_drop queryMatthew Jasper-4/+77
* Handle cycles in `needs_drop` correctly * Normalize types when computing `needs_drop` * Move queries from rustc to rustc_ty
2020-02-01Move builtin attribute logic to new rustc_attr crate.Mazdak Farrokhzad-1/+1
For now, this is all the crate contains, but more attribute logic & types will be moved there over time.
2020-01-10Introduce `#![feature(half_open_range_patterns)]`.Mazdak Farrokhzad-22/+73
This feature adds `X..`, `..X`, and `..=X` patterns.
2020-01-09Rollup merge of #67630 - oli-obk:extern_ptr_dangling, r=spastorinoMazdak Farrokhzad-2/+0
Treat extern statics just like statics in the "const pointer to static" representation fixes #67612 r? @spastorino cc @RalfJung this does not affect runtime promotion at all. This is just about promotion within static item bodies.
2020-01-07Move magic traits queries to rustc::traits::drop.Camille GILLOT-198/+1
2020-01-07Move required_region_bounds to rustc::infer::opaque_types.Camille GILLOT-64/+0
2020-01-05Remove rustc_hir reexports in rustc::hir.Mazdak Farrokhzad-3/+3
2020-01-01Rename `syntax_pos` to `rustc_span` in source codeVadim Petrochenkov-1/+1
2019-12-26Treat extern statics just like statics in the "const pointer to static" ↵Oliver Scherer-2/+0
representation
2019-12-22Format the worldMark Rousskov-218/+182
2019-12-201. ast::Mutability::{Mutable -> Mut, Immutable -> Not}.Mazdak Farrokhzad-2/+2
2. mir::Mutability -> ast::Mutability.
2019-11-26Record temporary static references in generator witnessesMatthew Jasper-0/+17
2019-11-21Aggregation of drive-by cosmetic changes.Alexander Regueiro-3/+3
2019-11-12Create intermediate enum ty::ConstKind.Camille GILLOT-2/+1
2019-11-10Merge hir::Mutability into ast::Mutability.Camille GILLOT-2/+2
2019-10-21Rollup merge of #62330 - SimonSapin:no-drop-in-union-fields, r=RalfJungMazdak Farrokhzad-0/+2
Change untagged_unions to not allow union fields with drop This is a rebase of #56440, massaged to solve merge conflicts and make the test suite pass. Change untagged_unions to not allow union fields with drop Union fields may now never have a type with attached destructor. This for example allows unions to use arbitrary field types only by wrapping them in `ManuallyDrop` (or similar). The stable rule remains, that union fields must be `Copy`. We use the new rule for the `untagged_union` feature. Tracking issue: https://github.com/rust-lang/rust/issues/55149
2019-10-15Rollup merge of #65389 - ecstatic-morse:zero-sized-array-no-drop, r=eddybTyler Mandry-0/+3
Return `false` from `needs_drop` for all zero-sized arrays. Resolves #65348. This changes the result of the `needs_drop` query from `true` to `false` for types such as `[Box<i32>; 0]`. I believe this change to be sound because a zero-sized array can never actually hold a value. This is an elegant way of resolving #65348 and #64945, but obviously it has much broader implications.
2019-10-15Rollup merge of #65293 - tmandry:turbo-expander, r=matthewjasperTyler Mandry-4/+17
Optimize `try_expand_impl_trait_type` A lot of time was being spent expanding some large `impl Future` types in fuchsia. This PR takes the number of types being visited in one expansion from >3 billion to about a thousand, and eliminates the compile time regression in https://github.com/rust-lang/rust/issues/65147 (in fact, compile times are better than they were before). Thanks to @Mark-Simulacrum for helping identify the issue and to @matthewjasper for suggesting this change. Fixes #65147. r? @matthewjasper,@nikomatsakis
2019-10-14Only expand types that contain projectionsTyler Mandry-1/+3
2019-10-14Add expanded type cache to OpaqueTypeExpanderTyler Mandry-3/+14
2019-10-13Return `false` from `needs_drop` for all zero-sized arraysDylan MacKenzie-0/+3
2019-10-11Change untagged_unions to not allow union fields with dropUlrik Sverdrup-0/+2
Union fields may now never have a type with attached destructor. This for example allows unions to use arbitrary field types only by wrapping them in ManuallyDrop. The stable rule remains, that union fields must be Copy. We use the new rule for the `untagged_union` feature. See RFC 2514. Note for ui tests: We can't test move out through Box's deref-move since we can't have a Box in a union anymore.
2019-10-09Qualify LangItemMatt Stavola-1/+1
2019-10-09Delegate is_{freeze,copy,sized}_raw to is_item_rawMatt Stavola-21/+12
2019-10-03generate ClosureSubsts from SubstsRefcsmoe-2/+4
2019-09-29clean ClosureSubsts in rustc::tycsmoe-1/+1
2019-09-26Rename `subst::Kind` to `subst::GenericArg`varkor-8/+8
2019-09-25Rename `sty` to `kind`varkor-18/+18
2019-09-09check_match: refactor + improve non-exhaustive diag for default binding modes.Mazdak Farrokhzad-0/+18
2019-08-31Check impl trait substs when checking for recursive typesMatthew Jasper-2/+4
This prevents mutual `async fn` recursion
2019-08-28Add Option<Span> to `require_lang_item`Yuki Okushi-3/+3
2019-08-11add tuple_fields convenience method and use it in a few placesRalf Jung-4/+4
2019-07-13Rollup merge of #62585 - ↵Mazdak Farrokhzad-8/+94
pnkfelix:issue-60431-make-struct-tail-normalize-when-possible, r=eddyb Make struct_tail normalize when possible As noted in commit message: this replaces the existing methods to extract the struct tail(s) with new entry points that make the handling of normalization explicit. Most of the places that call `struct_tail` are during codegen, post type-checking, and therefore they can get away with using `tcx.normalize_erasing_regions` (this is the entry point `struct_tail_erasing_lifetimes`) For other cases that may arise, one can use the core method, which is parameterized over the normalization `Ty -> Ty` closure (`struct_tail_with_normalize`). Or one can use the trivial entry point that does not normalization (`struct_tail_without_normalization`) ---- I spent a little while trying to make a test that exposed the bug via `impl Trait` rather than a projection, but I failed to find something that tripped up the current nightly `rustc`. * I have *not* spent any time trying to make tests that trip up the other places where `struct_tail` was previously being called. While I do think the task of making such tests could be worthwhile, I am simply running out of time. (Its also possible that the layout code is always the first point called, and thus it may be pointless to try to come up with such tests.) I also spent a little time discussing with @eddyb where this code should live. They suggested moving `struct_tail` and its sibling `struct_lockstep_tails` to the `LayoutCx`. But in the interest of time, I have left that refactoring (which may be questionable at this point) to a follow-up task. ---- Fix #60431