about summary refs log tree commit diff
path: root/src/test/ui/const-generics/const_evaluatable_checked
AgeCommit message (Collapse)AuthorLines
2021-08-30rename const_evaluatable_checked to generic_const_exprsEllen-1292/+0
:sparkles:
2021-08-16Use note to point at bound introducing requirementEsteban Küber-31/+42
2021-08-04dropckEllen-0/+16
2021-08-04Remove trailing whitespace from error messagesFabian Wolff-4/+4
2021-07-20Support HIR wf checking for function signaturesAaron Hill-2/+2
During function type-checking, we normalize any associated types in the function signature (argument types + return type), and then create WF obligations for each of the normalized types. The HIR wf code does not currently support this case, so any errors that we get have imprecise spans. This commit extends `ObligationCauseCode::WellFormed` to support recording a function parameter, allowing us to get the corresponding HIR type if an error occurs. Function typechecking is modified to pass this information during signature normalization and WF checking. The resulting code is fairly verbose, due to the fact that we can no longer normalize the entire signature with a single function call. As part of the refactoring, we now perform HIR-based WF checking for several other 'typed items' (statics, consts, and inherent impls). As a result, WF and projection errors in a function signature now have a precise span, which points directly at the responsible type. If a function signature is constructed via a macro, this will allow the error message to point at the code 'most responsible' for the error (e.g. a user-supplied macro argument).
2021-07-08only check cg defaults wf once instantiatedlcnr-0/+6
2021-06-10support `as _` and add testsEllen-2/+217
2021-06-09Add more tests + visit_ty in some placesEllen-5/+37
2021-06-08Support as casts in abstract constsEllen-0/+32
2021-05-28const eval errors: display the current item instance if there are generics ↵Rémy Rakic-8/+9
involved
2021-05-19deal with `const_evaluatable_checked` in `ConstEquate`lcnr-1/+34
2021-03-02errooaaar~Ellen-21/+38
2021-02-03Miscellaneous small diagnostics cleanupCamelid-5/+5
2021-02-02Rollup merge of #81544 - JulianKnodt:sat_where, r=lcnrJack Huey-5/+5
Add better diagnostic for unbounded Abst. Const ~~In the case where a generic abst. const requires a trivial where bound: `where TypeWithConst<const_fn(N)>: ,`, instead of requiring a where bound, just check that only consts are being substituted in to skip over where check.~~ ~~This is pretty sketchy, but I think it works. Presumably, if there is checking for type bounds added later, it can first check nested requirements, and see if they're satisfied by the current `ParamEnv`.~~ Changed the diagnostic to add a better example, which is more practical than what was previously proposed. r? ```@lcnr```
2021-02-02Add better diagnostic for missing where clausekadmin-5/+5
Previously, it's not clear what exactly should be added in the suggested where clause, so this adds an example to demonstrate.
2021-02-01more things are const evaluatable *sparkles*Ellen-1/+17
2021-02-01Rollup merge of #79291 - JulianKnodt:ce_priv, r=petrochenkovJonas Schievink-0/+74
Add error message for private fn Attempts to add a more detailed error when a `const_evaluatable` fn from another scope is used inside of a scope which cannot access it. r? ````@lcnr````
2021-01-31Add error message for private fnkadmin-0/+74
Bless tests Update with changes from comments
2021-01-28Rollup merge of #81433 - lcnr:stop-looking-into-ty-alias, r=oli-obkYuki Okushi-4/+35
const_evaluatable: stop looking into type aliases see https://rust-lang.zulipchat.com/#narrow/stream/260443-project-const-generics/topic/const_evaluatable.3A.20type.20alias r? ````@oli-obk````
2021-01-28Rollup merge of #81430 - lcnr:elaborate-const-eval, r=oli-obkYuki Okushi-0/+24
add const_evaluatable_checked test cc `````@oli-obk`````
2021-01-27fix tidy errorsEllen-3/+6
2021-01-27commentsEllen-0/+8
2021-01-27const_evaluatable: stop looking into type aliasesBastian Kauschke-4/+35
2021-01-27add const_evaluatable_checked testBastian Kauschke-0/+24
2021-01-27boop, ur abstract consts are now expandedEllen-0/+112
2020-12-26update testsBastian Kauschke-9/+6
2020-11-29Update tests to remove old numeric constantsbstrie-1/+1
Part of #68490. Care has been taken to leave the old consts where appropriate, for testing backcompat regressions, module shadowing, etc. The intrinsics docs were accidentally referring to some methods on f64 as std::f64, which I changed due to being contrary with how we normally disambiguate the shadow module from the primitive. In one other place I changed std::u8 to std::ops since it was just testing path handling in macros. For places which have legitimate uses of the old consts, deprecated attributes have been optimistically inserted. Although currently unnecessary, they exist to emphasize to any future deprecation effort the necessity of these specific symbols and prevent them from being accidentally removed.
2020-11-24Swap note for helpmendess-4/+4
2020-11-24Requested changesmendess-4/+4
2020-11-24Add note to use nightly when using expr in const genericsmendess-0/+4
2020-11-07look at assoc ct, check the type of nodesBastian Kauschke-0/+61
2020-10-26add fixmeBastian Kauschke-1/+2
2020-10-25check for object safety violations in constantsBastian Kauschke-0/+139
2020-10-23reviewBastian Kauschke-3/+9
2020-10-23const_eval_checked: deal with unused nodes + divBastian Kauschke-0/+62
2020-10-12Bless expected errorsEthan Brierley-10/+10
2020-10-11`min_const_generics` diagnostics improvementsEthan Brierley-14/+14
2 3
2020-10-03Replace "non trivial" with "non-trivial"varkor-6/+6
2020-10-01Rollup merge of #77303 - lcnr:const-evaluatable-TooGeneric, r=oli-obk,varkorDylan DPC-28/+48
const evaluatable: improve `TooGeneric` handling Instead of emitting an error in `fulfill`, we now correctly stall on inference variables. As `const_eval_resolve` returns `ErrorHandled::TooGeneric` when encountering generic parameters on which we actually do want to error, we check for inference variables and eagerly emit an error if they don't exist, returning `ErrorHandled::Reported` instead. Also contains a small bugfix for `ConstEquate` where we previously only stalled on type variables. This is probably a leftover from when we did not yet support stalling on const inference variables. r? @oli-obk cc @varkor @eddyb
2020-09-28const evaluatable: improve `TooGeneric` handlingBastian Kauschke-28/+48
2020-09-26Fix UI test falloutvarkor-1/+1
2020-09-26Make invalid integer operation messages consistentvarkor-1/+1
2020-09-24update testsBastian Kauschke-2/+4
2020-09-24visit impl self ty + traitBastian Kauschke-0/+25
2020-09-24assign the correct `DefId` in `nominal_obligations`Bastian Kauschke-3/+3
2020-09-24walk hir to get const evaluatable predicatesBastian Kauschke-14/+12
2020-09-24const_evaluatable_checked: collect predicates from fn_sigBastian Kauschke-1/+54
2020-09-21reviewBastian Kauschke-18/+9
2020-09-21add test for closures in abstract constsBastian Kauschke-0/+21
2020-09-21bless testsBastian Kauschke-10/+20