summary refs log tree commit diff
path: root/src/test/ui/const-generics
AgeCommit message (Collapse)AuthorLines
2019-12-11Add more context for type parametersEsteban Küber-2/+2
2019-11-25Auto merge of #66682 - estebank:fn-type-err, r=davidtwcobors-2/+2
Highlight parts of fn in type errors When a type error arises between two fn items, fn pointers or tuples, highlight only the differing parts of each. Examples: <img width="699" alt="" src="https://user-images.githubusercontent.com/1606434/69487597-ab561600-0e11-11ea-9b4e-d4fd9e91d5dc.png"> <img width="528" alt="" src="https://user-images.githubusercontent.com/1606434/69487207-9033d800-0e0a-11ea-93e3-8c4d002411a5.png"> <img width="468" alt="" src="https://user-images.githubusercontent.com/1606434/69487208-9033d800-0e0a-11ea-92e3-2b2cee120335.png"> <img width="775" alt="" src="https://user-images.githubusercontent.com/1606434/69487209-9033d800-0e0a-11ea-9e68-7f6ed5c8cb08.png">
2019-11-23Highlight parts of fn in type errorsEsteban Küber-2/+2
When a type error arises between two fn items, fn pointers or tuples, highlight only the differing parts of each.
2019-11-21Point at type in `let` assignment on type errorsEsteban Küber-8/+24
2019-11-21Auto merge of #66389 - estebank:type-err-labels, r=petrochenkovbors-26/+20
Specific labels when referring to "expected" and "found" types
2019-11-18test: const-generics: Update tests removing unrequired bracesGabriel Smith-19/+19
Braces were left in cases where generic args were in the generic const paths.
2019-11-18Surround types with backticks in type errorsEsteban Küber-2/+2
2019-11-18Remove E0308 note when primary label has all infoEsteban Küber-6/+0
2019-11-18Specific labels when referring to "expected" and "found" typesEsteban Küber-22/+22
2019-11-06Remove "here" from "expected one of X here"Esteban Küber-1/+1
2019-11-03Auto merge of #65759 - tmiasko:ui, r=petrochenkovbors-3/+2
Validate error patterns and error annotation in ui tests when present Previously, when compilation succeeded, neither error patterns nor error annotation would be validated. Additionally, when compilation failed, only error patterns would be validated if both error patterns and error annotation were present. Now both error patterns and error annotation are validated when present, regardless of compilation status. Furthermore, for test that should run, the error patterns are matched against executable output, which is what some of tests already expect to happen, and when #65506 is merged even more ui tests will. Fixes #56277
2019-11-02Update error annotations in tests that successfully compileTomasz Miąsko-3/+2
Those annotation are silently ignored rather than begin validated against compiler output. Update them before validation is enabled, to avoid test failures.
2019-10-31Revert "pre-expansion gate const_generics"Eduard-Mihai Burtescu-6/+6
This reverts commit 49cbfa1a6f6469ddbc0e88161e52104cc87aea9b.
2019-10-27Point at local similarly named element and tweak references to variantsEsteban Küber-1/+4
Point at the span for the definition of ADTs internal to the current crate. Look at the leading char of the ident to determine whether we're expecting a likely fn or any of a fn, a tuple struct or a tuple variant. Turn fn `add_typo_suggestion` into a `Resolver` method.
2019-10-25Rollup merge of #65742 - Centril:gate-pre-expansion-subset, r=davidtwcoMazdak Farrokhzad-6/+6
Pre-expansion gate most of the things This is a subset of https://github.com/rust-lang/rust/pull/64672. A crater run has already been done and this PR implements conclusions according to https://github.com/rust-lang/rust/pull/64672#issuecomment-542703363. r? @davidtwco cc @petrochenkov
2019-10-25Rollup merge of #62959 - LukasKalbertodt:array-value-iter, r=scottmcmMazdak Farrokhzad-0/+216
Add by-value iterator for arrays This adds an iterator that can iterate over arrays by value, yielding all elements by value. However, **this PR does _not_ add a corresponding `IntoIterator` impl for arrays**. The `IntoIterator` impl needs some discussion about backwards-compatibility that should take place in a separate PR. With this patch, this code should work (but there is currently still a bug): ```rust #![feature(array_value_iter)] use std::array::IntoIter; let arr = [1, 2, 3]; for x in IntoIter::new(arr) { println!("{}", x); } ``` **TODO**: - [x] Get initial feedback - [x] Add tests - [x] Figure out why stage1 produces weird bugs ([comment](https://github.com/rust-lang/rust/pull/62959#issuecomment-516016524)) - [x] Add UI tests as mentioned [here](https://github.com/rust-lang/rust/pull/62959#discussion_r307061894) (will do that soon-ish) - [x] Fix [this new bug](https://github.com/rust-lang/rust/pull/62959#issuecomment-544732159) **Notes for reviewers** - Is the use of `MaybeUninit` correct here? I think it has to be used due to the `Clone` impl which has to fill the dead array elements with something, but cannot fill it with a correct instance. - Are the unit tests sufficient? CC #25725
2019-10-24Rollup merge of #65627 - varkor:const-generics-forbid-non-structural_match, ↵Mazdak Farrokhzad-24/+44
r=petrochenkov Forbid non-`structural_match` types in const generics Fixes https://github.com/rust-lang/rust/issues/60286.
2019-10-24Add UI tests for `array::IntoIter` implsLukas Kalbertodt-0/+216
This it to make sure traits are implemented for arrays with length 32 and below, while they are not implemented for >= 33.
2019-10-24pre-expansion gate const_genericsMazdak Farrokhzad-6/+6
2019-10-23Add regression test for #62579varkor-0/+23
2019-10-22Add regression test for #65675varkor-0/+18
2019-10-22Use E0741 for structural match errorvarkor-6/+6
2019-10-22Remove "type parameter depends on const parameter" error from resolutionvarkor-24/+14
2019-10-22Search for generic parameters when finding non-`structural_match` typesvarkor-2/+2
2019-10-22Forbid non-`structural_match` types in const genericsvarkor-0/+30
2019-10-20Fix resolve_type_vars_with_obligations not resolving const inferenceben-8/+8
variables.
2019-10-16update ui testsGuillaume Gomez-0/+1
2019-10-14Rollup merge of #65398 - estebank:capitalization-only, r=varkorTyler Mandry-1/+1
Bring attention to suggestions when the only difference is capitalization CC #65386.
2019-10-15Include const generic arguments in metadata.ben-0/+52
2019-10-13Bring attention to suggestions when the only difference is capitalizationEsteban Küber-1/+1
2019-10-11Rollup merge of #65191 - varkor:const-generics-test-cases, r=nikomatsakisTyler Mandry-0/+32
Add some regression tests - Add a test for #62187. - Clean up the directory structure in `src/test/ui/const-generics` - Closes #64792. - Closes #57399. - Closes #57271.
2019-10-10Pretty print raw pointers in consts as '{pointer}'.ben-3/+3
2019-10-09Update ui testsben-6/+6
2019-10-09Refactor pretty print const to use a big match statementben-2/+2
2019-10-09Gate use of raw and function pointers in const generics behindben-4/+60
const_compare_raw_pointers.
2019-10-09Pretty print function pointer const values.ben-4/+4
2019-10-09Fix calling function pointer const parameters. Also fixes inference ofben-0/+99
function pointer const parameters.
2019-10-07Add a regression test for issue 62187varkor-0/+32
2019-10-07Move const generic regression tests to their old foldervarkor-0/+0
2019-10-07Test diagnostic output of type mismatches for types that have constben-0/+48
generics arguments.
2019-10-06Fix const arguments not displaying in types mismatch diagnostic.ben-6/+6
2019-10-03typo: fix typo in E0392Ben Boeckel-1/+1
See #64931.
2019-10-03Rollup merge of #64931 - estebank:missing-param-ref, r=matthewjasper,CentrilMazdak Farrokhzad-1/+1
Reword E0392 slightly Make it clearer that a type or lifetime argument not being used can be fixed by referencing it in a struct's fields, not just using `PhathomData`. CC #53589.
2019-10-02review commentEsteban Küber-1/+1
2019-09-30Reword E0392 slightlyEsteban Küber-1/+1
Make it clearer that a type or lifetime argument not being used can be fixed by referencing it in a struct's fields, not just using `PhathomData`.
2019-09-29Add a couple more test cases, including non-ascii strings.ben-3/+16
2019-09-28Added test for mismatched slices, and byte slices.ben-1/+47
2019-09-28Add support for relating slices in `super_relate_consts`.ben-0/+20
2019-09-23Rollup merge of #64679 - skinny121:const-infer, r=varkorMazdak Farrokhzad-0/+29
Infer consts more consistently Moved some duplicated logic in `TypeRelation` methods into `super_combined_consts`. Before some `TypeRelation`s like `Lub` wasn't using `replace_if_possible`, meaning some inference types were staying around longer than they should be. Fixes https://github.com/rust-lang/rust/issues/64519 r? @varkor
2019-09-22Infer consts consistently. Moved some logic into super_combined_consts,ben-0/+29
also removed some duplicated logic from TypeRelation methods.