about summary refs log tree commit diff
path: root/src/librustc_middle/ty/sty.rs
AgeCommit message (Collapse)AuthorLines
2020-08-30mv compiler to compiler/mark-2288/+0
2020-08-23Prefer https link for wikipedia URLsLzu Tao-1/+1
2020-08-20Add missing tick for docLzu Tao-1/+1
2020-08-17rust_ast::ast => rustc_astUjjwal Sharma-1/+1
2020-08-16Rollup merge of #74399 - mark-i-m:ty-err-4, r=eddybTyler Mandry-7/+1
Move DelaySpanBugEmitted to ty::context This makes it even hard to abuse. r? @eddyb cc @LeSeulArtichaut as this will probably conflict with your PR :/
2020-08-16move DelaySpanBugEmitted to ty::contextmark-7/+1
2020-08-16rustc_typeck: construct {Closure,Generator}Substs more directly.Eduard-Mihai Burtescu-27/+67
2020-08-14Fix tests and address review commentsMatthew Jasper-1/+1
2020-08-14Rework `rustc_serialize`Matthew Jasper-27/+23
- Move the type parameter from `encode` and `decode` methods to the trait. - Remove `UseSpecialized(En|De)codable` traits. - Remove blanket impls for references. - Add `RefDecodable` trait to allow deserializing to arena-allocated references safely. - Remove ability to (de)serialize HIR. - Create proc-macros `(Ty)?(En|De)codable` to help implement these new traits.
2020-07-30Address code review comments.jumbatm-4/+11
- Make `is_repr_nullable_ptr` freestanding again to avoid usage of ImproperCTypesVisitor in ClashingExternDeclarations (and don't accidentally revert the ParamEnv::reveal_all() fix from a week earlier) - Revise match condition for 1 Adt, 1 primitive - Generalise check for non-null type so that it would also work for ranges which exclude any single value (all bits set, for example) - Make is_repr_nullable_ptr return the representable type instead of just a boolean, to avoid adding an additional, independent "source of truth" about the FFI-compatibility of Option-like enums. Also, rename to `repr_nullable_ptr`.
2020-07-27it works again :tada:Bastian Kauschke-0/+3
2020-07-27`PredicateKint` -> `PredicateKind`, the beginning of the endBastian Kauschke-0/+22
2020-07-27progressBastian Kauschke-2/+1
2020-07-20ty: `STILL_FURTHER_SPECIALIZABLE` w/out prnt substDavid Wood-6/+42
This commit modifies the `STILL_FURTHER_SPECIALIZABLE` flag so that the flag isn't set by the parent substs of closures or generators. Signed-off-by: David Wood <david@davidtw.co>
2020-07-16Move `ty::Const` and `ty::ConstKind` into their own modulesOliver Scherer-323/+4
2020-07-15s/try_to_usize/try_to_machine_usize/Oliver Scherer-3/+3
2020-07-15Reduce the amount of interning and `layout_of` calls in const eval.Oliver Scherer-17/+58
2020-07-15WithOptConstParam::dummy -> WithOptConstParam::unknownBastian Kauschke-1/+1
2020-07-15ty_def_id -> def_id_for_type_ofBastian Kauschke-1/+1
2020-07-15improve namingBastian Kauschke-4/+4
2020-07-15const_eval_resolveBastian Kauschke-1/+1
2020-07-15ConstKind::UnevaluatedBastian Kauschke-5/+5
2020-07-15begin using `WithOptParam`Bastian Kauschke-6/+13
2020-06-30change `skip_binder` to use T by valueBastian Kauschke-10/+6
2020-06-24Improve GeneratorLayout debug outputTyler Mandry-1/+0
2020-06-24Allow calling GeneratorSubsts::variant_name() without substsTyler Mandry-1/+1
2020-06-20Don't set STILL_FURTHER_SPECIALIZABLE for regions/bound variablesMatthew Jasper-3/+0
2020-06-19pretty/mir: const value enums with no variantsDavid Wood-0/+3
This commit modifies the pretty printer and const eval in the MIR so that `destructure_const` (used in `pretty_print_const_value`) can handle enums with no variants (or types containing enums with no variants). Signed-off-by: David Wood <david@davidtw.co>
2020-06-16format derivesWho? Me?!-13/+2
Co-authored-by: lzutao <taolzu@gmail.com>
2020-06-15make all uses of ty::Error or ConstKind::Error delay a span bugmark-9/+24
2020-06-15Rollup merge of #72707 - matthewjasper:rustc_min_spec, r=oli-obkRalf Jung-2/+0
Use min_specialization in the remaining rustc crates This adds a lot of `transmute` calls to replace the unsound uses of specialization. It's ugly, but at least it's honest about what's going on. cc #71420, @RalfJung
2020-06-10Use min_specialization in the remaining rustc cratesMatthew Jasper-2/+0
2020-06-09lint: transitive FFI-safety for transparent typesDavid Wood-0/+5
This commit ensures that if a `repr(transparent)` newtype's only non-zero-sized field is FFI-safe then the newtype is also FFI-safe. Previously, ZSTs were ignored for the purposes of linting FFI-safety in transparent structs - thus, only the single non-ZST would be checked for FFI-safety. However, if the non-zero-sized field is a generic parameter, and is substituted for a ZST, then the type would be considered FFI-unsafe (as when every field is thought to be zero-sized, the type is considered to be "composed only of `PhantomData`" which is FFI-unsafe). In this commit, for transparent structs, the non-zero-sized field is identified (before any substitutions are applied, necessarily) and then that field's type (now with substitutions) is checked for FFI-safety (where previously it would have been skipped for being zero-sized in this case). To handle the case where the non-zero-sized field is a generic parameter, which is substituted for `()` (a ZST), and is being used as a return type - the `FfiUnsafe` result (previously `FfiPhantom`) is caught and silenced. Signed-off-by: David Wood <david@davidtw.co>
2020-06-07Rollup merge of #73059 - lcnr:outdated-comment, r=matthewjasperDylan DPC-4/+0
remove outdated comment r? @matthewjasper
2020-06-06remove outdated commentBastian Kauschke-4/+0
2020-06-01`PolyTraitRef::self_ty` returns `Binder<Ty>`Dylan MacKenzie-2/+2
2020-05-30Rollup merge of #72419 - RalfJung:read-discriminant, r=oli-obk,eddybYuki Okushi-1/+16
Miri read_discriminant: return a scalar instead of raw underlying bytes r? @oli-obk @eddyb
2020-05-28Auto merge of #72494 - lcnr:predicate-cleanup, r=nikomatsakisbors-3/+3
Pass more `Copy` types by value. There are a lot of locations where we pass `&T where T: Copy` by reference, which should both be slightly less performant and less readable IMO. This PR currently consists of three fairly self contained commits: - passes `ty::Predicate` by value and stops depending on `AsRef<ty::Predicate>`. - changes `<&List<_>>::into_iter` to iterate over the elements by value. This would break `List`s of non copy types. But as the only list constructor requires `T` to be copy anyways, I think the improved readability is worth this potential future restriction. - passes `mir::PlaceElem` by value. Mir currently has quite a few copy types which are passed by reference, e.g. `Local`. As I don't have a lot of experience working with MIR, I mostly did this to get some feedback from people who use MIR more frequently - tries to reuse `ty::Predicate` in case it did not change in some places, which should hopefully fix the regression caused by #72055 r? @nikomatsakis for the first commit, which continues the work of #72055 and makes adding `PredicateKind::ForAll` slightly more pleasant. Feel free to reassign though
2020-05-25fix discriminant_ty for non-enumsRalf Jung-4/+9
2020-05-25Add helper method for determining the type of a discriminantRalf Jung-0/+10
2020-05-23iterate List by valueBastian Kauschke-3/+3
2020-05-22Remove ReScopeMatthew Jasper-24/+8
2020-05-20introduce newtype'd `Predicate<'tcx>`Bastian Kauschke-0/+1
2020-05-20make `to_predicate` take a `tcx` argumentNiko Matsakis-2/+2
2020-05-20rename `Predicate` to `PredicateKind`, introduce aliasBastian Kauschke-1/+1
2020-05-12Remove ty::UnnormalizedProjectionJack Huey-7/+0
2020-05-08Remove ast::{Ident, Name} reexports.Camille GILLOT-2/+2
2020-04-23Modify `as_local_hir_id` to return a bare `HirId`marmeladema-1/+1
2020-04-23Modify `as_local_hir_id` to accept a `LocalDefId` instead of a `DefId`marmeladema-1/+1
2020-04-23librustc_middle: return LocalDefId instead of DefId in local_def_idmarmeladema-2/+3