summary refs log tree commit diff
path: root/src/test/ui/const-generics
AgeCommit message (Collapse)AuthorLines
2021-06-12Rollup merge of #86205 - JohnTitor:full-test-for-72293, r=oli-obkYuki Okushi-11/+17
Run full const-generics test for issue-72293 Closes #72293 r? ```@oli-obk```
2021-06-12Rollup merge of #85800 - BoxyUwU:const-param-default-diagnostics, r=oli-obkYuki Okushi-12/+40
Fix some diagnostic issues with const_generics_defaults feature gate This PR makes a few changes: - print out const param defaults in "lifetime ordering" errors rather than discarding them - update `is_simple_text` to account for const params when checking if a type has no generics, this was causing a note to be failed to add to an error message - fixes some diagnostic wording that incorrectly said there was ordering restrictions between type/const params despite the `const_generics_defaults` feature gate is active
2021-06-11Run full const-generics test for issue-72293Yuki Okushi-11/+17
2021-06-07note :sparkles: uwuuuEllen-8/+13
2021-06-06Rollup merge of #85930 - mominul:array_into_iter, r=m-ou-seYuki Okushi-14/+14
Update standard library for IntoIterator implementation of arrays This PR partially resolves issue #84513 of updating the standard library part. I haven't found any remaining doctest examples which are using iterators over e.g. &i32 instead of just i32 in the standard library. Can anyone point me to them if there's remaining any? Thanks! r? ```@m-ou-se```
2021-06-02Replace IntoIter::new with IntoIterator::into_iter in stdMuhammad Mominul Huque-14/+14
2021-06-01Add test for forward declared const param defaultsEllen-0/+42
2021-05-29Fix missing note on type mismatch error diagnosticsEllen-4/+14
2021-05-29Make lifetime ordering error pretty print const param defaultsEllen-2/+15
2021-05-28const eval errors: display the current item instance if there are generics ↵Rémy Rakic-8/+9
involved
2021-05-25Auto merge of #85481 - lcnr:const-equate, r=matthewjasperbors-3/+46
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-3/+46
2021-05-18Rollup merge of #85251 - BoxyUwU:constparamdefaultsany%, r=lcnrRalf Jung-9/+2
Make `const_generics_defaults` not an incomplete feature r? `@lcnr`
2021-05-13wowEllen-2/+2
2021-05-13completion uwuEllen-7/+0
2021-05-13Auto merge of #85041 - mibac138:suggest-generics, r=estebankbors-2/+20
Suggest adding a type parameter for impls Add a new suggestion upon encountering an unknown type in a `impl` that suggests adding a new type parameter. This diagnostic suggests to add a new type parameter even though it may be a const parameter, however after adding the parameter and running rustc again a follow up error steers the user to change the type parameter to a const parameter. ```rust struct X<const C: ()>(); impl X<C> {} ``` suggests ``` error[E0412]: cannot find type `C` in this scope --> bar.rs:2:8 | 1 | struct X<const C: ()>(); | ------------------------ similarly named struct `X` defined here 2 | impl X<C> {} | ^ | help: a struct with a similar name exists | 2 | impl X<X> {} | ^ help: you might be missing a type parameter | 2 | impl<C> X<C> {} | ^^^ ``` After adding a type parameter the code now becomes ```rust struct X<const C: ()>(); impl<C> X<C> {} ``` and the error now fully steers the user towards the correct code ``` error[E0747]: type provided when a constant was expected --> bar.rs:2:11 | 2 | impl<C> X<C> {} | ^ | help: consider changing this type parameter to be a `const` generic | 2 | impl<const C: ()> X<C> {} | ^^^^^^^^^^^ ``` r? `@estebank` Somewhat related #84946
2021-05-12Show macro name in 'this error originates in macro' messageAaron Hill-7/+7
When there are multiple macros in use, it can be difficult to tell which one was responsible for producing an error.
2021-05-11improve diagnosts for GATsb-naber-31/+31
2021-05-07Fix impl type parameter suggestion involving constsmibac138-2/+2
2021-05-05Suggest adding a type parameter for implsmibac138-2/+20
2021-05-04Auto merge of #83213 - rylev:update-lints-to-errors, r=nikomatsakisbors-10/+13
Update BARE_TRAIT_OBJECT and ELLIPSIS_INCLUSIVE_RANGE_PATTERNS to errors in Rust 2021 This addresses https://github.com/rust-lang/rust/pull/81244 by updating two lints to errors in the Rust 2021 edition. r? `@estebank`
2021-05-03Rollup merge of #84784 - JulianKnodt:suggest_const, r=lcnrDylan DPC-0/+24
Add help message to suggest const for unused type param r? `@lcnr`
2021-05-01Add help message for unused type paramkadmin-0/+24
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-21supply substs to anon consts in defaultslcnr-49/+37
2021-04-21improve wf check for const param defaultslcnr-5/+54
2021-04-21loosen ordering restricts for `const_generics_defaults`lcnr-76/+132
2021-04-21fix name resolution for param defaultslcnr-13/+84
2021-04-16Fix testsRyan Levick-10/+13
2021-04-12Fix typo in error messageCamelid-3/+6
Also tweaked the message a bit by - removing the hyphen, because in my opinion the hyphen makes the message a bit harder to read, especially combined with the backticks; - adding the word "be", because I think it's a bit clearer that way.
2021-04-06Remove trailing `:` from E0119 messageEsteban Küber-1/+1
2021-04-02Auto merge of #83790 - Dylan-DPC:rollup-p6ep8jo, r=Dylan-DPCbors-11/+11
Rollup of 7 pull requests Successful merges: - #83065 (Rework `std::sys::windows::alloc`) - #83478 (rustdoc: Add unstable option to only emit shared/crate-specific files) - #83629 (Fix double-drop in `Vec::from_iter(vec.into_iter())` specialization when items drop during panic) - #83673 (give full path of constraint in suggest_constraining_type_param) - #83755 (Simplify coverage tests) - #83757 (2229: Support migration via rustfix) - #83771 (Fix stack overflow detection on FreeBSD 11.1+) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-03-31Add 32bit.stderr files.Hameer Abbasi-0/+72
2021-03-31Rename stderr->64bit.stderr where needed.Hameer Abbasi-8/+9
2021-03-31Add allocation information to undefined behaviour errors.Hameer Abbasi-0/+12
2021-03-31give full path of constraint in suggest_constraining_type_paramhi-rustin-11/+11
revert file bless with nll mode
2021-03-29Prefer 4 spacesJohnTitor-52/+52
2021-03-29Add a regression test for issue-82792JohnTitor-0/+14
2021-03-27Rollup merge of #81351 - lcnr:big-money-big-prices, r=oli-obkDylan DPC-9/+85
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-9/+85
2021-03-27Add regression tests for #56445Simon Jakobi-3/+48
Closes #56445.
2021-03-23Update to not have extra matchkadmin-0/+75
2021-03-23Update with commentskadmin-3/+33
2021-03-23Update with commentskadmin-0/+53
A bunch of nits fixed, and a new test for pretty printing the AST.
2021-03-23Add query for const_param_defaultkadmin-0/+56
2021-03-23progress, stuff compiles nowlcnr-16/+33