summary refs log tree commit diff
path: root/src/test/ui/const-generics
AgeCommit message (Collapse)AuthorLines
2020-10-02resolve: prohibit anon const non-static lifetimesDavid Wood-0/+48
This commit modifies name resolution to emit an error when non-static lifetimes are used in anonymous constants when the `min_const_generics` feature is enabled. Signed-off-by: David Wood <david@davidtw.co>
2020-10-01Rollup merge of #77303 - lcnr:const-evaluatable-TooGeneric, r=oli-obk,varkorDylan DPC-41/+49
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-30Rollup merge of #77331 - hameerabbasi:issue-74906, r=lcnrJonas Schievink-0/+25
Add test for async/await combined with const-generics. Fixes #74906.
2020-09-29Auto merge of #76754 - varkor:diagnostic-cleanup-ii, r=ecstatic-morsebors-2/+2
Clean up diagnostics for arithmetic operation errors Plus a small tweak to a range pattern error message.
2020-09-29Add test for async/await combined with const-generics.Hameer Abbasi-0/+25
2020-09-28const evaluatable: improve `TooGeneric` handlingBastian Kauschke-41/+49
2020-09-26Fix UI test falloutvarkor-1/+1
2020-09-26Make invalid integer operation messages consistentvarkor-1/+1
2020-09-26Rollup merge of #77093 - lcnr:const-generics-infer-warning, r=varkorRalf Jung-18/+31
merge `need_type_info_err(_const)` I hoped that this would automatically solve #76737 but it doesn't quite seem like it fixes #77092 r? @varkor
2020-09-25Move from {{closure}}#0 syntax to {closure#0} for (def) path componentsmarmeladema-2/+2
2020-09-25Rollup merge of #77073 - lcnr:ty-trait-param, r=matthewjasperJonas Schievink-0/+21
dead_code: look at trait impls even if they don't contain items fixes #70225
2020-09-24update testsBastian Kauschke-3/+5
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-23Rollup merge of #76939 - lcnr:const-evaluatable-cont, r=oli-obkDylan DPC-10/+32
emit errors during AbstractConst building There changes are currently still untested, so I don't expect this to pass CI :laughing: It seems to me like this is the direction we want to go in, though we didn't have too much of a discussion about this. r? @oli-obk
2020-09-23use the correct span when dealing with inference variablesBastian Kauschke-6/+31
2020-09-23merge `need_type_info_err(_const)`Bastian Kauschke-18/+6
2020-09-22dead_code: look at trait impls even if they don't contain itemsBastian Kauschke-0/+21
2020-09-21Rollup merge of #76581 - lcnr:bound-too-generic, r=eddybecstatic-morse-0/+124
do not ICE on bound variables, return `TooGeneric` instead fixes #73260, fixes #74634, fixes #76595 r? @nikomatsakis
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
2020-09-21add testsBastian Kauschke-0/+205
2020-09-20update stderr fileBastian Kauschke-2/+1
2020-09-20do not ICE on `ty::Bound` in Layout::computeBastian Kauschke-0/+39
2020-09-20miri: correctly deal with `ConstKind::Bound`Bastian Kauschke-0/+86
2020-09-18support const_evaluatable_checked across crate boundariesBastian Kauschke-0/+73
2020-09-18add test for let-bindingsBastian Kauschke-0/+33
2020-09-18add function callsBastian Kauschke-0/+30
2020-09-18allow unary operations and ignore StorageLive/Dead stmtsBastian Kauschke-0/+14
2020-09-18use abstract consts when unifying ConstKind::UnevaluatedBastian Kauschke-8/+15
2020-09-18initial working stateBastian Kauschke-0/+14
2020-09-16Rollup merge of #76719 - hameerabbasi:min-const-generics-ty, r=lcnrTyler Mandry-5/+59
Change error message for ty param in const This PR introduces the following changes: * Change error message for type param in a const expression when using `min_const_generics` * Change `ParamInNonTrivialAnonConst` to contain an extra `bool` used for distinguishing whether the passed-in symbol is a type or a value. Fixes #76701
2020-09-16Rollup merge of #75026 - JulianKnodt:array_windows, r=AmanieuTyler Mandry-6/+6
Add array_windows fn This mimicks the functionality added by array_chunks, and implements a const-generic form of `windows`. It makes egregious use of `unsafe`, but by necessity because the array must be re-interpreted as a slice of arrays, and unlike array_chunks this cannot be done by casting the original array once, since each time the index is advanced it needs to move one element, not `N`. I'm planning on adding more tests, but this should be good enough as a premise for the functionality. Notably: should there be more functions overwritten for the iterator implementation/in general? ~~I've marked the issue as #74985 as there is no corresponding exact issue for `array_windows`, but it's based of off `array_chunks`.~~ Edit: See Issue #75027 created by @lcnr for tracking issue ~~Do not merge until I add more tests, please.~~ r? @lcnr
2020-09-16Add array window fnkadmin-6/+6
Updated issue to #75027 Update to rm oob access And hopefully fix docs as well Fixed naming conflict in test Fix test which used 1-indexing Nth starts from 0, woops Fix a bunch of off by 1 errors See https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=757b311987e3fae1ca47122969acda5a Add even more off by 1 errors And also write `next` and `next_back` in terms of `nth` and `nth_back`. Run fmt Fix forgetting to change fn name in test add nth_back test & document unsafe Remove as_ref().unwrap() Documented occurrences of unsafe, noting what invariants are maintained
2020-09-15This commit introduces the following changes:Hameer Abbasi-5/+59
* Change error message for type param in a const expression when using min_const_generics * Change ParamInNonTrivialAnonConst to contain an extra bool used for distinguishing whether the passed-in symbol is a type or a value.
2020-09-14improve const infer errBastian Kauschke-7/+7
2020-09-14shrink const infer errorBastian Kauschke-4/+48
2020-09-13bless testsBastian Kauschke-4/+8
2020-09-13review, improve note spanBastian Kauschke-12/+6
2020-09-13allow concrete self types in constsBastian Kauschke-0/+90
2020-09-12Rollup merge of #76599 - hameerabbasi:const-generics-revs, r=lcnrRalf Jung-11/+53
Finish off revisions for const generics UI tests. This time it really does fix it. 😅 The only ones left are `min-and-full-same-time.rs`, which doesn't need it, and `array-impls/` which check the feature indirectly. Fixes #75279. r? @lcnr
2020-09-11Add revisions to const generic type-dependent UI tests.Hameer Abbasi-2/+3
2020-09-11Add revisions to const generic const_evaluatable_checked tests.Hameer Abbasi-9/+50
2020-09-11Auto merge of #75611 - JulianKnodt:cg_enum_err, r=lcnrbors-0/+138
Add help note when using type in place of const This adds a small help note when it might be possible that wrapping a parameter in braces might resolve the issue of having a type where a const was expected. Currently, I am displaying the `HirId`, and I'm not particularly sure where to get the currently displayed path(?). r? `@lcnr`
2020-09-10Rollup merge of #76559 - lcnr:const-evaluatable, r=oli-obkTyler Mandry-0/+59
add the `const_evaluatable_checked` feature Implements a rather small subset of https://github.com/rust-lang/compiler-team/issues/340 Unlike the MCP, this does not try to compare different constant, but instead only adds the constants found in where clauses to the predicates of a function. This PR adds the feature gate `const_evaluatable_checked`, without which nothing should change. r? @oli-obk @eddyb
2020-09-10fix tidy, small cleanupBastian Kauschke-0/+24
2020-09-10Add revisions to const generic UI tests.Hameer Abbasi-4/+25