about summary refs log tree commit diff
path: root/src/test/ui/const-generics
AgeCommit message (Collapse)AuthorLines
2020-02-07Merge branch 'master' of https://github.com/jwhite927/rust into E0637Josh White-0/+3
2020-02-07performed --bless of 15 ui tests affectedJosh White-0/+1
2020-02-06rustc_macros: don't limit the -Zmacro-backtrace suggestion to extern macros.Eduard-Mihai Burtescu-0/+3
2020-01-31Auto merge of #68080 - varkor:declared-here, r=petrochenkovbors-1/+1
Address inconsistency in using "is" with "declared here" "is" was generally used for NLL diagnostics, but not other diagnostics. Using "is" makes the diagnostics sound more natural and readable, so it seems sensible to commit to them throughout. r? @Centril
2020-01-24Normalise notes with the/isvarkor-1/+1
2020-01-24Print constants in `type_name` for const genericsvarkor-0/+19
2020-01-21Make `TooGeneric` error in WF checking a proper errorvarkor-5/+22
`TooGeneric` is encountered during WF checking when we cannot determine that a constant involving a generic parameter will always be evaluated successfully (rather than resulting in an error). In these cases, the burden of proof should be with the caller, so that we can avoid post-monomorphisation tim errors (which was the previous previous behaviour). This commit ensures that this situation produces a proper compiler error, rather than silently ignoring it or ICEing.
2020-01-17Rollup merge of #68312 - varkor:issue-67753-regression, r=CentrilTyler Mandry-0/+26
Add regression test for integer literals in generic arguments in where clauses Closes https://github.com/rust-lang/rust/issues/67753.
2020-01-17Add regression test for integer literals in generic arguments in where clausesvarkor-0/+26
2020-01-16review commentsEsteban Küber-7/+7
2020-01-16When trait bounds are missing for return values, point at themEsteban Küber-0/+36
2020-01-12Update test benchmark fileBen Lewis-6/+6
2020-01-12Added comment about behaviour.Ben Lewis-0/+5
2020-01-12Forbid elided lifetimes within const generic parameter types.Ben Lewis-0/+59
2020-01-08Unify output of "variant not found" errorsEsteban Küber-1/+1
2020-01-05Silence `TooGeneric` errorvarkor-0/+31
This error may be produced during intermediate failed attempts at evaluation of a generic const, which may nevertheless succeed later.
2019-12-26Relax bounds on HashSet to match hashbrownMark Rousskov-15/+5
No functional changes are made, and all APIs are moved to strictly less restrictive bounds. These APIs changed from the old bound listed to the new bound: T: Hash + Eq -> T * new * with_capacity T: Eq + Hash, S: BuildHasher -> T * with_hasher * with_capacity_and_hasher * hasher T: Eq + Hash + Debug -> T: Debug S: BuildHasher -> S <HashSet as Debug> T: Eq + Hash -> T S: BuildHasher + Default -> S: Default <HashSet as Default>
2019-12-24Rollup merge of #67543 - JohnTitor:regression-tests, r=CentrilMazdak Farrokhzad-0/+34
Add regression tests for fixed ICEs Closes #61747 (fixed from 1.41.0-nightly (4007d4ef2 2019-12-01)) Closes #66205 (fixed from 1.41.0-nightly (4007d4ef2 2019-12-01)) Closes #66270 (fixed by #66246) Closes #67424 (fixed by #67160) Also picking a minor nit up from #67071 with 101dd7bad9432730fa2f625ae43afcc2929457d4 r? @Centril
2019-12-24Apply suggestion from CentrilYuki Okushi-1/+1
Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com>
2019-12-22Remove mem::uninitalized from testsMark Rousskov-0/+12
This purges uses of uninitialized where possible from test cases. Some are merely moved over to the equally bad pattern of MaybeUninit::uninit().assume_init() but with an annotation that this is "the best we can do".
2019-12-23Add test for issue-66205Yuki Okushi-0/+10
2019-12-23Add test for issue-61747Yuki Okushi-0/+24
2019-12-20Rollup merge of #67354 - VirrageS:blame-wrong-line, r=estebankMazdak Farrokhzad-5/+15
Fix pointing at arg when cause is outside of call Follow up after: #66933 Closes: #66923 r? @estebank
2019-12-14Indicate origin of where type parameter for uninferred typesOhad Ravid-1/+1
2019-12-11Add more context for type parametersEsteban Küber-2/+2
2019-12-07Rename tests and add short test descriptionJanusz Marcinkiewicz-5/+15
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