summary refs log tree commit diff
path: root/src/test/ui/const-generics/issues
AgeCommit message (Collapse)AuthorLines
2021-12-10Rollup merge of #91678 - b-naber:tests-for-postpone-const-eval, r=jackh726Matthias Krüger-0/+387
Add tests fixed by #90023 The following issues were fixed by https://github.com/rust-lang/rust/pull/90023 Fixes https://github.com/rust-lang/rust/issues/79674 Fixes https://github.com/rust-lang/rust/issues/83765 Fixes https://github.com/rust-lang/rust/issues/86033 Fixes https://github.com/rust-lang/rust/issues/90318 Fixes https://github.com/rust-lang/rust/issues/88468 The following issues were duplicates of https://github.com/rust-lang/rust/issues/90654 Fixes https://github.com/rust-lang/rust/issues/86850 Fixes https://github.com/rust-lang/rust/issues/89022 r? ````@jackh726````
2021-12-08add testsb-naber-0/+387
2021-12-08Rollup merge of #91551 - b-naber:const-eval-normalization-ice, r=oli-obkMatthias Krüger-0/+61
Allow for failure of subst_normalize_erasing_regions in const_eval Fixes https://github.com/rust-lang/rust/issues/72845 Using associated types that cannot be normalized previously resulted in an ICE. We now allow for normalization failure and return a "TooGeneric" error in that case. r? ```@RalfJung``` maybe?
2021-12-05Rollup merge of #90529 - b-naber:reborrows-consts, r=lcnrMatthias Krüger-0/+22
Skip reborrows in AbstractConstBuilder Fixes https://github.com/rust-lang/rust/issues/90455 Temporary fix to prevent confusing diagnostics that refer to implicit borrows and derefs until we allow borrows and derefs on constant expressions. r? `@oli-obk`
2021-12-05add test and bless existing onesb-naber-0/+61
2021-12-05add testb-naber-0/+22
2021-12-05Rollup merge of #90023 - b-naber:postpone_const_eval_infer_vars, r=nikomatsakisMatthias Krüger-0/+201
Postpone the evaluation of constant expressions that depend on inference variables Previously `delay_span_bug` calls were triggered once an inference variable was included in the substs of a constant that was to be evaluated. Some of these would merely have resulted in trait candidates being rejected, hence no real error was ever encountered, but the triggering of the `delay_span_bug` then caused an ICE in later stages of the compiler due to no error ever occurring. We now postpone the evaluation of these constants, so any trait obligation fulfillment will simply stall on this constant and the existing type inference machinery of the compiler handles any type errors if present. Fixes https://github.com/rust-lang/rust/issues/89320 Fixes https://github.com/rust-lang/rust/issues/89146 Fixes https://github.com/rust-lang/rust/issues/87964 Fixes https://github.com/rust-lang/rust/issues/87470 Fixes https://github.com/rust-lang/rust/issues/83288 Fixes https://github.com/rust-lang/rust/issues/83249 Fixes https://github.com/rust-lang/rust/issues/90654 I want to thank `@BoxyUwU` for cooperating on this and for providing some help. r? `@lcnr` maybe?
2021-11-14Fix span for non-satisfied trivial trait boundsNilstrieb-41/+28
The spans for "trait bound not satisfied" errors in trivial trait bounds referenced the entire item (fn, impl, struct) before. Now they only reference the obligation itself (`String: Copy`) Address #90869
2021-11-07consider unevaluated consts in extract_inference_diagnostics_datab-naber-13/+2
2021-11-05add testsb-naber-0/+212
2021-10-30Rollup merge of #90396 - b-naber:type_flags_ices_default_anon_consts, r=lcnrMatthias Krüger-0/+47
Prevent type flags assertions being thrown in default_anon_const_substs if errors occurred Fixes https://github.com/rust-lang/rust/issues/90364 Fixes https://github.com/rust-lang/rust/issues/88997 r? ``@lcnr``
2021-10-29ignore type flags insertion in default_anon_const_substs if error occurredb-naber-0/+47
2021-10-29add testb-naber-0/+20
2021-10-25Rollup merge of #90266 - b-naber:uneval_substs, r=lcnrMatthias Krüger-0/+16
Prevent duplicate caller bounds candidates by exposing default substs in Unevaluated Fixes https://github.com/rust-lang/rust/issues/89334 The changes introduced in https://github.com/rust-lang/rust/pull/87280 allowed for "duplicate" caller bounds candidates to be assembled that only differed in their default substs having been "exposed" or not and resulted in an ambiguity error during trait selection. To fix this we expose the defaults substs during the creation of the ParamEnv. r? `@lcnr`
2021-10-25add testsb-naber-0/+16
2021-10-12Bless testsDominik Stolz-25/+5
2021-10-05Rollup merge of #89317 - JulianKnodt:precise_errors, r=BoxyUwUManish Goregaokar-2/+3
Move generic error message to separate branches This decomposes an error message in generic constants into more specific branches, for better readability. r? ``@lcnr``
2021-10-04Move generic error message to separate brancheskadmin-2/+3
This decomposes an error message in generic constants into more specific branches, for better readability.
2021-09-25Use larger span for adjustments on method callsAaron Hill-1/+1
Currently, we use a relatively 'small' span for THIR expressions generated by an 'adjustment' (e.g. an autoderef, autoborrow, unsizing). As a result, if a borrow generated by an adustment ends up causing a borrowcheck error, for example: ```rust let mut my_var = String::new(); let my_ref = &my_var my_var.push('a'); my_ref; ``` then the span for the mutable borrow may end up referring to only the base expression (e.g. `my_var`), rather than the method call which triggered the mutable borrow (e.g. `my_var.push('a')`) Due to a quirk of the MIR borrowck implementation, this doesn't always get exposed in migration mode, but it does in many cases. This commit makes THIR building consistently use 'larger' spans for adjustment expressions The intent of this change it make it clearer to users when it's the specific way in which a variable is used (for example, in a method call) that produdes a borrowcheck error. For example, an error message claiming that a 'mutable borrow occurs here' might be confusing if it just points at a usage of a variable (e.g. `my_var`), when no `&mut` is in sight. Pointing at the entire expression should help to emphasize that the method call itself is responsible for the mutable borrow. In several cases, this makes the `#![feature(nll)]` diagnostic output match up exactly with the default (migration mode) output. As a result, several `.nll.stderr` files end up getting removed entirely.
2021-09-17Apply review commentsYuki Okushi-4/+6
2021-09-17Recover invalid assoc type bounds using `==`Yuki Okushi-0/+40
2021-09-16fix rebaseEsteban Kuber-1/+3
2021-09-09bless stderrEllen-5/+4
2021-09-02tidyEllen-2/+2
2021-09-02E-not-needs-testEllen-0/+153
2021-08-30`feature(const_param_types)` -> `feature(adt_const_params)`lcnr-34/+34
2021-08-30`feature(const_generics)` -> `feature(const_param_types)`lcnr-1690/+169
2021-08-30rename const_evaluatable_checked to generic_const_exprsEllen-33/+33
:sparkles:
2021-08-16Use note to point at bound introducing requirementEsteban Küber-58/+82
2021-08-11Modify structured suggestion outputEsteban Küber-29/+5
* On suggestions that include deletions, use a diff inspired output format * When suggesting addition, use `+` as underline * Color highlight modified span
2021-07-26Actually infer args in visitorskadmin-1/+1
2021-07-25Add generic arg inferkadmin-7/+7
2021-07-19move const-generic issues into seperate directoryMarcel Hellwig-0/+641
2021-07-19add testcase for 87076Marcel Hellwig-0/+20
using https://github.com/rust-lang/rust/issues/87076#issuecomment-878090143 as testcase
2021-07-03Fix const-generics ICE related to bindingYuki Okushi-0/+142
2021-06-18Lint for unused borrows as part of UNUSED_MUST_USEhi-rustin-2/+2
2021-05-25Auto merge of #85481 - lcnr:const-equate, r=matthewjasperbors-2/+12
deal with `const_evaluatable_checked` in `ConstEquate` Failing to evaluate two constants which do not contain inference variables should not result in ambiguity.
2021-05-19deal with `const_evaluatable_checked` in `ConstEquate`lcnr-2/+12
2021-05-11improve diagnosts for GATsb-naber-2/+2
2021-05-01Auto merge of #84410 - BoxyUwU:blue, r=varkorbors-0/+39
Fix generic arg mismatch errors being ignored with explicit late bound lifetimes Fixes #83466 r? `@varkor`
2021-05-01test: *sneezes*Ellen-0/+39
2021-04-27Rename a test for consistencyYuki Okushi-0/+0
2021-04-27Add a regression test for issue-84408Yuki Okushi-0/+38
2021-04-06Remove trailing `:` from E0119 messageEsteban Küber-1/+1
2021-03-31give full path of constraint in suggest_constraining_type_paramhi-rustin-8/+8
revert file bless with nll mode
2021-03-27Rollup merge of #81351 - lcnr:big-money-big-prices, r=oli-obkDylan DPC-3/+32
combine: stop eagerly evaluating consts `super_relate_consts` eagerly evaluates constants which doesn't seem too great. I now also finally understand why all of the unused substs test passed. The reason being that we just evaluated the constants in `super_relate_consts` :laughing: While this change isn't strictly necessary as evaluating consts here doesn't hurt, it still feels a lot cleaner to do it this way r? `@oli-obk` `@nikomatsakis`
2021-03-27update testslcnr-8/+8
2021-03-27combine: stop eagerly evaluating constsBastian Kauschke-3/+32
2021-03-27Add regression tests for #56445Simon Jakobi-3/+48
Closes #56445.
2021-03-05Bump mir-opt-level from 3 to 4 in testsSantiago Pastorino-1/+1