about summary refs log tree commit diff
path: root/src/test/ui/nll/user-annotations
AgeCommit message (Collapse)AuthorLines
2018-12-30Guarantee `rustc_dump_user_substs` error order.David Wood-8/+8
This commit buffers the errors output by the `rustc_dump_user_substs` attribute so that they can be output in order of span and would therefore be consistent.
2018-12-30Refactor `UserTypeAnnotation`.David Wood-11/+11
This commit refactors the `UserTypeAnnotation` type to be referred to by an index within `UserTypeProjection`. `UserTypeAnnotation` is instead kept in an `IndexVec` within the `Mir` struct. Further, instead of `UserTypeAnnotation` containing canonicalized types, it now contains normal types and the entire `UserTypeAnnotation` is canonicalized. To support this, the type was moved from the `rustc::mir` module to `rustc::ty` module.
2018-12-25Remove licensesMark Rousskov-203/+42
2018-12-04Update testsOliver Scherer-5/+6
2018-11-26Put all existential ty vars in the `ROOT` universescalexm-1/+1
2018-11-24Fix NLL ui testscalexm-2/+2
2018-11-13Fix ui testsscalexm-6/+6
2018-10-27allow canonicalized regions to carry universe and track max-universeNiko Matsakis-5/+5
But.. we don't really use it for anything right now.
2018-10-26Add test for normalization during field-lookup on patterns with ascribed types.Felix S. Klock II-14/+50
As a drive-by, also added test analogous to existing static_to_a_to_static_through_tuple, but now apply to a struct instead of a tuple.
2018-10-26regression test for ICE I encountered in my patch.Felix S. Klock II-0/+31
2018-10-26Add the actual chain of projections to `UserTypeProjection`.Felix S. Klock II-17/+46
Update the existing NLL `patterns.rs` test accordingly. includes changes addressing review feedback: * Added example to docs for `UserTypeProjections` illustrating how we build up multiple projections when descending into a pattern with type ascriptions. * Adapted niko's suggested docs for `UserTypeProjection`. * Factored out `projection_ty` from more general `projection_ty_core` (as a drive-by, made its callback an `FnMut`, as I discovered later that I need that). * Add note to docs that `PlaceTy.field_ty(..)` does not normalize its result. * Normalize as we project out `field_ty`.
2018-10-24port the relate-types code from NLL type-check into a type-opNiko Matsakis-0/+48
Add regression tests for #55219 and #55241 Also another test where a duplicate-like error appears to have been suppressed; I'm not 100% sure why this output changes, though I could imagine that some duplicate suppression is enabled by this PR.
2018-10-23check the self type is well-formedNiko Matsakis-0/+37
This fixes `issue-28848.rs` -- it also handles another case that the AST region checker gets wrong (`wf-self-type.rs`). I don't actually think that this is the *right way* to be enforcing this constraint -- I think we should probably do it more generally, perhaps by editing `predicates_of` for the impl itself. The chalk-style implied bounds setup ought to fix this.
2018-10-22stop reporting "unsatisfied lifetime bounds" errors after the firstNiko Matsakis-56/+7
In particular, after the first for a given region variable. This suppresses a lot of duplicate errors.
2018-10-22flesh out closure-substs testNiko Matsakis-8/+66
2018-10-22add regression test for #54124Niko Matsakis-0/+29
Fixes #54124
2018-10-22start enforcing closure typesNiko Matsakis-0/+71
2018-10-21Use new region infer errors for explaining borrowsMatthew Jasper-281/+294
This gives at least some explanation for why a borrow is expected to last for a certain free region. Also: * Reports E0373: "closure may outlive the current function" with NLL. * Special cases the case of returning a reference to (or value referencing) a local variable or temporary (E0515). * Special case assigning a reference to a local variable in a closure to a captured variable.
2018-10-19normalize the self-type that we extract from implNiko Matsakis-0/+25
2018-10-19add a test that we enforce '`static` errors post normalizationNiko Matsakis-0/+26
2018-10-19create type ascription for any castNiko Matsakis-0/+13
Also, avoid shadowing of the `ty` variable by giving the `cast_ty` and `var_ty` variables different names. We want to get the user-provided type from `cast_ty.hir_id`.
2018-10-19Wrap cast expressions inside of ValueTypeAscriptionKeith Yeung-0/+17
2018-10-19normalize and prove predicatesNiko Matsakis-0/+26
Also include a test that was not working previously.
2018-10-19normalize after substitutionNiko Matsakis-0/+34
2018-10-19propagate user-type annotation for constants in expressionsNiko Matsakis-0/+77
2018-10-16add ~ERROR annotationsNiko Matsakis-0/+12
2018-10-15update testsNiko Matsakis-5/+178
2018-10-10Use the span of the user type for `AscribeUserType`Matthew Jasper-2/+2
Also change the order of the fake read for let and the AscribeUserType, so that we use the better span and message from the fake read in errors.
2018-10-08add pattern type ascriptions for tuple/brace structs/enumsNiko Matsakis-0/+192
2018-10-04Auto merge of #54447 - KiChjang:issue-54331, r=nikomatsakisbors-0/+32
Lower type ascriptions to HAIR and MIR Fixes #54331. r? @nikomatsakis
2018-09-29Add UI test for preserving user types in type ascriptionsKeith Yeung-0/+32
2018-09-25Change the diagnostic number from 714 to 716.Felix S. Klock II-7/+7
2018-09-25add "temporary value dropped while borrowed" errorMikhail Modin-13/+14
Issue #54131
2018-09-19Update ui testsMatthew Jasper-2/+2
2018-09-10add FIXME related to `ref x` bindingsNiko Matsakis-13/+2
2018-09-10propagate user-ascribes types down onto resulting bindingsNiko Matsakis-18/+79
But only in very simple cases.
2018-09-10expand the patterns test with a bunch more scenariosNiko Matsakis-5/+172
2018-09-10insert `AscribeUserType` for ascriptionsNiko Matsakis-0/+47
2018-08-24address pnkfelix nitsNiko Matsakis-4/+9
2018-08-24pacify the mercilous tidy: adt-nullary-enums testNiko Matsakis-17/+32
2018-08-24ufcs with annot in position 1 and 2Niko Matsakis-0/+240
2018-08-24rename test caseNiko Matsakis-5/+5
the 3 is because the type arguments are in the 3rd position
2018-08-24add test for method ufcs notationNiko Matsakis-0/+122
2018-08-24support user-given types in adtsNiko Matsakis-0/+556
2018-08-24support user annotations in fns, methodsNiko Matsakis-0/+223
2018-08-24add a `user_substs` table and store the annotations in thereNiko Matsakis-0/+80