about summary refs log tree commit diff
path: root/src/librustc/ty/mod.rs
AgeCommit message (Collapse)AuthorLines
2019-04-28Fix lint findings in librustcflip1995-1/+1
2019-04-27Rollup merge of #60292 - varkor:ty-tuple-substs, r=nikomatsakisMazdak Farrokhzad-1/+1
Replace the `&'tcx List<Ty<'tcx>>` in `TyKind::Tuple` with `SubstsRef<'tcx>` Part of the suggested refactoring for https://github.com/rust-lang/rust/issues/42340. As expected, this is a little messy, because there are many places that the components of tuples are expected to be types, rather than arbitrary kinds. However, it should open up the way for a refactoring of `TyS` itself. r? @nikomatsakis
2019-04-27Auto merge of #59540 - Zoxc:the-arena-2, r=michaelwoeristerbors-5/+1
Use arenas to avoid Lrc in queries #1 Based on https://github.com/rust-lang/rust/pull/59536.
2019-04-26Update handling of Tuplevarkor-1/+1
2019-04-25ignore-tidy-filelength on all files with greater than 3000 linesvarkor-0/+2
2019-04-25Update inferred_outlives_ofJohn Kåre Alsaker-5/+1
2019-04-22Promote rust comments to rustdocAlexey Shmalko-7/+7
2019-04-18Add own_requires_monomorphizationvarkor-5/+13
2019-04-17Deny `internal` in stage0Mateusz Mikuła-1/+1
2019-04-14HirIdify hir::Defljedrz-1/+1
2019-04-03Deny internal lints in librustcflip1995-0/+2
2019-03-28Implement `#[non_exhaustive]` on variants.David Wood-2/+7
This commit removes the check that disallows the `#[non_exhaustive]` attribute from being placed on enum variants and removes the associated tests. Further, this commit lowers the visibility of enum variant constructors when the variant is marked as non-exhaustive.
2019-03-27Add comments for new `AdtDef` functions.David Wood-0/+5
2019-03-24Re-order fields in `Def::Ctor`.David Wood-3/+3
This commit moves the `DefId` field of `Def::Ctor` to be the first field.
2019-03-24Move `CtorOf` into `hir::def`.David Wood-3/+3
This commit moves the definition of `CtorOf` from `rustc::hir` to `rustc::hir::def` and adds imports wherever it is used.
2019-03-24Merge `DefPathData::VariantCtor` and `DefPathData::StructCtor`Vadim Petrochenkov-2/+2
2019-03-24Slightly more uniform treatment of struct and variant constructorsVadim Petrochenkov-2/+2
2019-03-24Remove `VariantDef::parent_did`Vadim Petrochenkov-106/+26
2019-03-24Separate variant id and variant constructor id.David Wood-69/+179
This commit makes two changes - separating the `NodeId` that identifies an enum variant from the `NodeId` that identifies the variant's constructor; and no longer creating a `NodeId` for `Struct`-style enum variants and structs. Separation of the variant id and variant constructor id will allow the rest of RFC 2008 to be implemented by lowering the visibility of the variant's constructor without lowering the visbility of the variant itself. No longer creating a `NodeId` for `Struct`-style enum variants and structs mostly simplifies logic as previously this `NodeId` wasn't used. There were various cases where the `NodeId` wouldn't be used unless there was an unit or tuple struct or enum variant but not all uses of this `NodeId` had that condition, by removing this `NodeId`, this must be explicitly dealt with. This change mostly applied cleanly, but there were one or two cases in name resolution and one case in type check where the existing logic required a id for `Struct`-style enum variants and structs.
2019-03-22Rollup merge of #59266 - estebank:struct-parse-recovery, r=petrochenkovMazdak Farrokhzad-12/+16
Do not complain about non-existing fields after parse recovery When failing to parse struct-like enum variants, the ADT gets recorded as having no fields. Record that we have actually recovered during parsing of this variant to avoid complaing about non-existing fields when actually using it. Fix #57361.
2019-03-17Do not complain about non-existing fields after parse recoveryEsteban Küber-12/+16
When failing to parse struct-like enum variants, the ADT gets recorded as having no fields. Record that we have actually recovered during parsing of this variant to avoid complaing about non-existing fields when actually using it.
2019-03-16Revert the `LazyConst` PROliver Scherer-1/+1
2019-03-15rustc: move the contents of ty::item_path to ty::print.Eduard-Mihai Burtescu-1/+0
2019-03-15rustc: rename item_path to def_path (except the module in ty).Eduard-Mihai Burtescu-1/+1
2019-03-15rustc: remove TyCtxt::parent_def_id in favor of TyCtxt::parent.Eduard-Mihai Burtescu-2/+2
2019-03-15rustc: tie the 'tcx between Print and PrintCx in ty::print.Eduard-Mihai Burtescu-2/+2
2019-03-15rustc: start moving util::ppaux to ty::print.Eduard-Mihai Burtescu-0/+1
2019-03-13Use derive macro for HashStableJohn Kåre Alsaker-26/+38
2019-03-10Make the rustc driver and interface demand drivenJohn Kåre Alsaker-1/+1
2019-03-08expand unused doc comment diagnosticAndy Russell-35/+35
Report the diagnostic on macro expansions, and add a label indicating why the comment is unused.
2019-03-07HirIdification: replace NodeId method callsljedrz-7/+7
2019-03-05Add HAS_CT_INFERvarkor-2/+5
Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
2019-03-05Add Const generic param to tyvarkor-4/+24
Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
2019-03-02hir: HirIdify Impl&TraitItemIdljedrz-16/+12
2019-03-02hir: remove NodeId from Itemljedrz-4/+8
2019-02-27rename Substs to InternalSubstscsmoe-6/+6
Change-Id: I3fa00e999a2ee4eb72db1fdf53a8633b49176a18
2019-02-26replace &'tcx Substs with SubstsRefcsmoe-2/+2
2019-02-24hir: remove NodeId from Exprljedrz-2/+1
2019-02-19Auto merge of #57896 - oli-obk:permissive_existence, r=cramertjbors-1/+1
Be more permissive with required bounds on existential types fixes #54184 r? @pnkfelix
2019-02-15Always emit an error for a query cycleJohn Kåre Alsaker-17/+7
2019-02-13HirId-ify hir::BodyIdljedrz-8/+8
2019-02-10rustc: doc commentsAlexander Regueiro-65/+65
2019-02-10Auto merge of #58151 - ljedrz:HirIdify_rustc, r=Zoxcbors-6/+6
Partially HirId-ify rustc Another step towards https://github.com/rust-lang/rust/pull/57578.
2019-02-05rustc: partially HirIdifyljedrz-6/+6
2019-02-05move librustc to 2018Mark Mansi-25/+25
2019-02-01Restrict concrete types to equivalent typesOliver Scherer-1/+1
2019-01-25Auto merge of #57898 - Centril:rollup, r=Centrilbors-10/+0
Rollup of 5 pull requests Successful merges: - #56233 (Miri and miri-related code contains repetitions of `(n << amt) >> amt`) - #57645 (distinguish "no data" from "heterogeneous" in ABI) - #57734 (Fix evaluating trivial drop glue in constants) - #57886 (Add suggestion for moving type declaration before associated type bindings in generic arguments.) - #57890 (Fix wording in diagnostics page) Failed merges: r? @ghost
2019-01-25Rollup merge of #57734 - oli-obk:fixes_and_cleanups, r=pnkfelixMazdak Farrokhzad-10/+0
Fix evaluating trivial drop glue in constants ```rust struct A; impl Drop for A { fn drop(&mut self) {} } const FOO: Option<A> = None; const BAR: () = (FOO, ()).1; ``` was erroring with ``` error: any use of this value will cause an error --> src/lib.rs:9:1 | 9 | const BAR: () = (FOO, ()).1; | ^^^^^^^^^^^^^^^^^^^^^^^^^^-^ | | | calling non-const function `std::ptr::real_drop_in_place::<(std::option::Option<A>, ())> - shim(Some((std::option::Option<A>, ())))` | = note: #[deny(const_err)] on by default error: aborting due to previous error ``` before this PR. According to godbolt this last compiled successfully in 1.27
2019-01-25Auto merge of #57714 - matthewjasper:wellformed-unreachable, r=pnkfelixbors-2/+2
[NLL] Clean up handling of type annotations * Renames (Canonical)?UserTypeAnnotation -> (Canonical)?UserType so that the name CanonicalUserTypeAnnotation is free. * Keep the inferred type associated to user type annotations in the MIR, so that it can be compared against the annotated type, even when the annotated expression gets removed from the MIR. (#54943) * Use the inferred type to allow infallible handling of user type projections (#57531) * Uses revisions for the tests in #56993 * Check the types of `Unevaluated` constants with no annotations (#46702) * Some drive-by cleanup Closes #46702 Closes #54943 Closes #57531 Closes #57731 cc #56993 leaving this open to track the underlying issue: we are not running tests with full NLL enabled on CI at the moment r? @nikomatsakis
2019-01-19Use a struct for user type annotationsMatthew Jasper-1/+1