about summary refs log tree commit diff
path: root/src/test/ui/polymorphization
AgeCommit message (Collapse)AuthorLines
2023-01-11Move /src/test to /testsAlbert Larsan-1357/+0
2022-10-01bless ui testsMaybe Waffle-4/+4
2022-09-23Always print '_, even for erased lifetimes.Camille GILLOT-1/+1
2022-07-07Shorten span for closures.Camille GILLOT-59/+36
2022-06-30Specialize a few tests depending on opt-level.Camille GILLOT-20/+21
2022-06-30Allow inlining `#[inline]` functions.Camille GILLOT-14/+14
2022-06-30Test enabling MIR inlinerWesley Wiser-1/+1
2022-04-30Also report the call site of PME errors locally.Oli Scherer-0/+18
Note this does not produce a full stack all the way to the first call that specifies all monomorphic parameters, it's just shallowly mentioning the last call site.
2022-04-04diagnostics: use correct span for const genericsMichael Howell-6/+6
Fixes #95616
2022-03-28Revert "Auto merge of #93893 - oli-obk:sad_revert, r=oli-obk"Oli Scherer-19/+3
This reverts commit 6499c5e7fc173a3f55b7a3bd1e6a50e9edef782d, reversing changes made to 78450d2d602b06d9b94349aaf8cece1a4acaf3a8.
2022-02-11Revert "Auto merge of #92007 - oli-obk:lazy_tait2, r=nikomatsakis"Oli Scherer-3/+19
This reverts commit e7cc3bddbe0d0e374d05e7003e662bba1742dbae, reversing changes made to 734368a200904ef9c21db86c595dc04263c87be0.
2022-02-02Lazily resolve type-alias-impl-trait defining usesOli Scherer-19/+3
by using an opaque type obligation to bubble up comparisons between opaque types and other types Also uses proper obligation causes so that the body id works, because out of some reason nll uses body ids for logic instead of just diagnostics.
2022-01-01Update references to `-Z symbol-mangling-version` to use `-C`Josh Triplett-5/+5
Replace `-Z symbol-mangling-version=v0` with `-C symbol-mangling-version=v0`. Replace `-Z symbol-mangling-version=legacy` with `-Z unstable-options -C symbol-mangling-version=legacy`.
2021-10-01polymorphize: remove predicate logicDavid Wood-1/+43
This commit removes all logic which marks parameters as used based on their presence in predicates - given rust-lang/rust#75675, this will enable more polymorphization and avoid the symbol clashes that predicate logic previously sidestepped. Signed-off-by: David Wood <david@davidtw.co>
2021-09-15Move some tests to more reasonable directoriesCaio-0/+18
2021-08-30`feature(const_generics)` -> `feature(const_param_types)`lcnr-18/+18
2021-08-30remove lazy_normalization_constsEllen-6/+6
2021-03-05Bump mir-opt-level from 3 to 4 in testsSantiago Pastorino-1/+1
2020-12-26update testsBastian Kauschke-3/+0
2020-10-17Suggest minimal subset features in `incomplete_features` lintYuki Okushi-0/+3
2020-08-17polymorphize: ∃ used param ∈ predicate → all usedDavid Wood-0/+17
This commit modifies polymorphization's handling of predicates so that if any generic parameter is used in a predicate then all parameters in that predicate are used. Signed-off-by: David Wood <david@davidtw.co>
2020-08-14polymorphize: `I` used if `T` used in `I: Foo<T>`David Wood-0/+70
This commit adjusts polymorphization's handling of predicates so that after ensuring that `T` is used in `I: Foo<T>` if `I` is used, it now ensures that `I` is used if `T` is used in `I: Foo<T>`. This is necessary to mark generic parameters that only exist in impl parameters as used - thereby avoiding symbol clashes when using the new mangling scheme. Signed-off-by: David Wood <david@davidtw.co>
2020-08-10polymorphize: constrain unevaluated const handlingDavid Wood-0/+14
This commit constrains the support added for handling unevaluated consts in polymorphization (introduced in #75260) by: - Skipping associated constants as this causes cycle errors. - Skipping promoted constants when they contain `Self` as this ensures `T` is used in constants of the form `<Self as Foo<T>>`. Signed-off-by: David Wood <david@davidtw.co>
2020-08-08Auto merge of #75260 - davidtwco:polymorphization-promoted-substs, r=lcnrbors-2/+72
polymorphize: unevaluated constants This PR makes polymorphization visit the promoted MIR of unevaluated constants with available promoted MIR instead of visiting the substitutions of that constant - which will mark all of the generic parameters as used; in addition polymorphization will now visit non-promoted unevaluated constants rather than visit their substs. r? @lcnr
2020-08-07instance: polymorphize upvar closures/generatorsDavid Wood-0/+135
This commit modifies how instances are polymorphized so that closures and generators have any closures or generators captured within their upvars also polymorphized - this avoids symbol clashes with the new symbol mangling scheme. Signed-off-by: David Wood <david@davidtw.co>
2020-08-07polymorphize: non-promoted unevaluated constantsDavid Wood-0/+33
This commit makes polymorphization visit non-promoted unevaluated constants rather than visit their substs directly. Signed-off-by: David Wood <david@davidtw.co>
2020-08-07polymorphize: visit promoted MIRDavid Wood-2/+39
This commit makes polymorphization visited the MIR of unevaluated constants with available promoted MIR instead of visiting the substitutions of that constant - which will mark all of the generic parameters as used. Signed-off-by: David Wood <david@davidtw.co>
2020-08-01Auto merge of #74717 - ↵bors-0/+16
davidtwco:issue-74636-polymorphized-closures-inherited-params, r=oli-obk mir: add `used_generic_parameters_needs_subst` Fixes #74636. This PR adds a `used_generic_parameters_needs_subst` helper function which checks whether a type needs substitution, but only for parameters that the `unused_generic_params` query considers used. This is used in the MIR interpreter to make the check for some pointer casts and for reflection intrinsics more precise. I've opened this as a draft PR because this might not be the approach we want to fix this issue and we have to decide what to do about the reflection case. r? @eddyb cc @lcnr @wesleywiser
2020-07-31interp: needs_subst -> ensure_monomorphic_enoughDavid Wood-0/+16
This commit adds a `ensure_monomorphic_enough` utility function which checks whether a type needs substitution, but only for parameters that the `unused_generic_params` query considers used. `ensure_monomorphic_enough` is then used throughout interpret where `needs_subst` checks previously existed (in particular, for some pointer casts and for reflection intrinsics more precise). Signed-off-by: David Wood <david@davidtw.co>
2020-07-24Rollup merge of #74623 - lcnr:polymorphize-functions, r=eddybYuki Okushi-0/+13
polymorphize GlobalAlloc::Function this sadly does not change #74614 r? @eddyb
2020-07-22polymorphize GlobalAlloc::FunctionBastian Kauschke-0/+13
2020-07-22sess: disable polymorphisationDavid Wood-31/+42
This commit disables polymorphisation to resolve regressions related to closures which inherit unused generic parameters and are then used in casts or reflection. Signed-off-by: David Wood <david@davidtw.co>
2020-07-20index: introduce and use `FiniteBitSet`David Wood-2/+10
This commit introduces a `FiniteBitSet` type which replaces the manual bit manipulation which was being performed in polymorphization. Signed-off-by: David Wood <david@davidtw.co>
2020-07-20mir: use attribute over `-Z polymorphize-errors`David Wood-70/+117
This commit replaces the `-Z polymorphize-errors` debugging flag with a `#[rustc_polymorphize_error]` attribute for use on functions. Signed-off-by: David Wood <david@davidtw.co>
2020-07-20ty: normalize fn sigs before substDavid Wood-0/+25
This commit normalizes function signatures for instances before substituting, a workaround for polymorphization considering parameters unused when they show up in the signature, but not the body (due to being normalized). Unfortunately, this causes test output to change with the parallel compiler only. Signed-off-by: David Wood <david@davidtw.co>
2020-07-20mir: `unused_generic_params` queryDavid Wood-0/+891
This commit implements the `unused_generic_params` query, an initial version of polymorphization which detects when an item does not use generic parameters and is being needlessly monomorphized as a result. Signed-off-by: David Wood <david@davidtw.co>