summary refs log tree commit diff
path: root/src/test/ui/const-generics
AgeCommit message (Collapse)AuthorLines
2019-08-05Add implementations for converting boxed slices into boxed arraysJake Goulding-0/+101
This mirrors the implementations of reference slices into arrays.
2019-07-30--bless tests due to INCOMPLETE_FEATURES being a lint.Mazdak Farrokhzad-31/+90
2019-07-28Add tests for Vec(Deque) array PartialEq impls.Mazdak Farrokhzad-0/+131
2019-07-18Auto merge of #61749 - davidtwco:rfc-2203-const-array-repeat-exprs, r=eddybbors-16/+22
rustc/rustc_mir: Implement RFC 2203. This PR implements RFC 2203, allowing constants in array repeat expressions. Part of #49147. r? @eddyb
2019-07-09normalize use of backticks in compiler messages for libsyntax/feature_gateSamy Kacimi-3/+3
https://github.com/rust-lang/rust/issues/60532
2019-07-07rustc/rustc_mir: Implement RFC 2203.David Wood-16/+22
This commit implements RFC 2203, allowing constants in array repeat expressions. Firstly, the check that the array repeat expression implements `Copy` is removed and re-implemented in `rustc_mir::borrow_check::nll::type_check` by emitting an error when the MIR contains a `Operand::Move` and the type does not implement `Copy`. Next, the `qualify_consts` pass is modified to construct a `Candidate::Repeat` when it would be correct to promote a array repeat expression. Finally, the `promote_consts` pass is modified to promote the candidates previously identified.
2019-07-07Use const generics for array impls, restricted to 0..=32Scott McMurray-8/+158
- uses a never-stable core::array::LengthAtMost32 to bound the impls - includes a custom error message to avoid mentioning LengthAtMost32 too often - doesn't use macros for the slice implementations to avoid #62433
2019-07-04Permit use of mem::uninitialized via allow(deprecated)Mark Rousskov-0/+1
2019-07-03Migrate compile-pass annotations to build-passYuki Okushi-2/+2
2019-06-13typeck: Fix ICE for blocks in repeat expr count.David Wood-0/+34
This commit extends the work in #61698 to get the `DefId` of const parameters from block that resolve to a const parameter (as well as const parameters directly, as it was previously).
2019-06-11Rollup merge of #61698 - davidtwco:ice-const-generic-length, r=varkorMazdak Farrokhzad-0/+60
typeck: Fix const generic in repeat param ICE. Fixes #61336. Turns out this wasn't related to #49147 after all. r? @varkor
2019-06-10typeck: Fix const generic in repeat param ICE.David Wood-0/+60
This commit fixes an ICE that occured when a const generic was used in a repeat expression. This was due to the code expecting the length of the repeat expression to be const evaluatable to a constant, but a const generic parameter is not (however, it can be made into a constant).
2019-06-07Add test for deriving Debug for const genericsvarkor-0/+28
2019-06-07Add test for const generics struct constructorvarkor-0/+21
2019-06-04Rollup merge of #61409 - varkor:condition-trait-param-ice, r=oli-obkMazdak Farrokhzad-0/+18
Fix an ICE with a const argument in a trait This goes some way towards fixing https://github.com/rust-lang/rust/issues/61383 (the reduced test case is fixed).
2019-06-03Allow `true` and `false` in const generic argumentsvarkor-0/+2
2019-06-02Rollup merge of #61380 - varkor:expected-usize-got-param, r=eddybMazdak Farrokhzad-0/+63
Fix some issues with `unwrap_usize` instead of `assert_usize` Fixes https://github.com/rust-lang/rust/issues/61337. Fixes https://github.com/rust-lang/rust/issues/61341. Fixes https://github.com/rust-lang/rust/issues/61422. r? @eddyb
2019-06-02Add regression test for #61422varkor-0/+21
2019-06-02Fix unwrapping usize issue with transparent MaybeUnit array wrappervarkor-0/+17
2019-05-31Add test for condition in trait const paramvarkor-0/+16
2019-05-31Rollup merge of #61344 - varkor:const-failed-to-life-ice, r=CentrilPietro Albini-0/+24
Add regression test for const generics ICE Closes https://github.com/rust-lang/rust/issues/60879.
2019-05-31Fix unwrapping usize issue in HasMutInteriorvarkor-0/+25
2019-05-30Add regression test for const generics ICEvarkor-0/+24
Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com>
2019-05-30Rollup merge of #61333 - varkor:apit-const-param-ice, r=estebankMazdak Farrokhzad-0/+16
Fix ICE with APIT in a function with a const parameter Fixes https://github.com/rust-lang/rust/issues/60953.
2019-05-30Add a regression test for const parameters with impl Traitvarkor-0/+16
2019-05-29Fix ICE with struct ctors and const generics.David Wood-22/+20
This commit fixes a ICE where struct constructors were resulting in an ICE with const generics. Previously, a `match` in `type_of` did not have an arm for the `DefKind::Ctor` resolutions and therefore would assume that the type did not have generics.
2019-05-28Use assert_eq! instead of println! in testsvarkor-2/+2
2019-05-28Use Display rather than Debug printing for const mismatchvarkor-1/+1
2019-05-28Update tests after pretty printingvarkor-6/+6
2019-05-28Fix test after rebasevarkor-2/+13
2019-05-28Add broken MIR regression testsvarkor-0/+51
2019-05-28Add tests for uninferred consts during codegenvarkor-0/+48
2019-05-28Add a test for a function taking a const param array as an argumentvarkor-0/+22
2019-05-25Fix rebase falloutOliver Scherer-1/+1
2019-05-13Rollup merge of #60710 - varkor:delay_span_bug-const-parent, r=matthewjasperMazdak Farrokhzad-0/+60
Use `delay_span_bug` for error cases when checking `AnonConst` parent Fixes #60704. Fixes #60650.
2019-05-11Add test for const implvarkor-0/+22
2019-05-10Add a test for failed inference of const typesvarkor-0/+26
2019-05-10Add a test for invalid const argumentsvarkor-0/+34
2019-05-09Rollup merge of #60550 - skinny121:concrete_const_tests, r=varkorMazdak Farrokhzad-0/+50
Add tests for concrete const types In response to the request for help in https://github.com/rust-lang/rust/issues/44580#issuecomment-488819344, I have added several ui tests around the use of concrete const types, i.e. A<2>. r? @varkor
2019-05-08Add tests for concrete const typesben-0/+50
2019-05-07Auto merge of #60612 - Centril:rollup-61drhqt, r=Centrilbors-8/+2
Rollup of 5 pull requests Successful merges: - #60489 (Remove hamburger button from source code page) - #60535 (Correct handling of arguments in async fn) - #60579 (Rename `ParamTy::idx` to `ParamTy::index`) - #60583 (Fix parsing issue with negative literals as const generic arguments) - #60609 (Be a bit more explicit asserting over the vec rather than the len) Failed merges: r? @ghost
2019-05-07Auto merge of #60277 - estebank:relate-ice, r=varkorbors-0/+21
Don't ICE when relating const type args Fix #60263. r? @varkor
2019-05-06`token::LArrow` can begin argumentsvarkor-8/+2
`<-` may indicate the start of a negative const argument.
2019-05-04Early error for mixing order of const and type parametersvarkor-10/+10
2019-05-04Add testsvarkor-0/+29
2019-05-02Don't ICE when relating const type argsEsteban Küber-0/+21
2019-05-01Add a test for const args that cannot be inferredvarkor-0/+25
Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
2019-05-01Add a test for incorrect numbers of const argsvarkor-0/+32
2019-05-01Add a test for const argumentsvarkor-0/+19
2019-05-01Add `const-types` testvarkor-0/+22