about summary refs log tree commit diff
path: root/src/test/ui/const-generics
AgeCommit message (Collapse)AuthorLines
2023-01-11Move /src/test to /testsAlbert Larsan-15169/+0
2023-01-09Clean upkadmin-2/+124
Simplify match statement Add multiple tests - 1 test for checking `N + 1 + 1` does not unify with `N+1` - 2 tests for checking that a function that uses two parameters only returns the parameter that is actually used. - Check exact repeat predicates
2023-01-09Set !const_evaluatable if ambig. and not inferredkadmin-0/+38
This prevents an ICE due to a value not actually being evaluatable later.
2023-01-09Change based on commentskadmin-1/+12
Instead of just switching to a probe, check for different matches, and see how many there are. If one, unify it, otherwise return true and let it be unified later.
2023-01-09Change commit_if_ok to probekadmin-13/+37
2023-01-07Auto merge of #106283 - JulianKnodt:enum_err, r=cjgillotbors-0/+51
Add help diag. for `const = Enum` missing braces around `Enum` Previously it was not clear why this errored or if it was even supported, as there was no diagnostic that suggested wrapping it in braces. Thus, add a simple diagnostic that suggests wrapping enum variants in braces. Fixes #105927
2023-01-05Tweak wording of fn call with wrong number of argsEsteban Küber-3/+3
2023-01-03Add note about wrapping in braceskadmin-0/+51
Previously it was not clear why this errored or if it was even supported, as there was no diagnostic that suggested wrapping it in braces. Thus, add a simple diagnostic that suggests wrapping enum variants in braces.
2022-12-27Rollup merge of #105994 - JohnTitor:issue-99647, r=compiler-errorsMatthias Krüger-0/+15
Add regression test for #99647 Closes #99647 r? `@compiler-errors` Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2022-12-22Add regression test for #94293Yuki Okushi-0/+31
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2022-12-22Add regression test for #99647Yuki Okushi-0/+15
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2022-12-16remove unused stderr filesTakayuki Maeda-16/+0
2022-12-15Rollup merge of #105694 - ouz-a:issue_105689, r=estebankMatthias Krüger-0/+14
Don't create dummy if val has escaping bounds var Skips creating/pushing obligations if val has escaping bounds vars. Fixes #105689
2022-12-14Highlight conflicting param-env candidates, againMichael Goulet-4/+22
2022-12-14skip if val has ecaping bound varsouz-a-0/+14
2022-12-14Rollup merge of #105611 - BoxyUwU:more_granular_placeholderification, ↵Matthias Krüger-0/+29
r=wesleywiser fold instead of obliterating args Fixes #105608 we call `const_eval_resolve` on the following constant: ``` def: playground::{impl#0}::and::{constant#0}, substs: [ ConstKind::Unevaluated { def: playground::{impl#0}::and::{constant#0}, substs: [ ConstKind::Value(0x0), _, ] } _, ], ``` when expanded out to `ConstKind::Expr` there are no infer vars so we attempt to evaluate it after replacing infer vars with garbage, however the current logic for replacing with garbage replaces _the whole arg containing the infer var_ rather than just the infer var. This means that after garbage replacement has occured we attempt to evaluate: ``` def: playground::{impl#0}::and::{constant#0}, substs: [ PLACEHOLDER, PLACEHOLDER, ], ``` Which then leads to ctfe being unable to evaluate the const. With this PR we attempt to evaluate: ``` def: playground::{impl#0}::and::{constant#0}, substs: [ ConstKind::Unevaluated { def: playground::{impl#0}::and::{constant#0}, substs: [ ConstKind::Value(0x0), PLACEHOLDER, ] } PLACEHOLDER, ], ``` which ctfe _can_ handle. I am not entirely sure why this function is supposed to replace params with placeholders rather than just inference vars :thinking:
2022-12-14Rollup merge of #105523 - estebank:suggest-collect-vec, r=compiler-errorsMatthias Krüger-2/+10
Suggest `collect`ing into `Vec<_>` Fix #105510.
2022-12-13review commentsEsteban Küber-3/+3
2022-12-13Suggest `: Type` instead of `: _`Esteban Küber-3/+3
2022-12-13Mention implementations that satisfy the traitEsteban Küber-0/+8
2022-12-13Make some diagnostics not depend on the source of what they reference being ↵Oli Scherer-28/+4
available
2022-12-12what is `unstable_features` lolBoxy-1/+1
2022-12-12fold instead of obliterating argsBoxy-0/+29
2022-12-10Introduce `with_forced_trimmed_paths`Esteban Küber-12/+12
2022-12-10Rollup merge of #105410 - TaKO8Ki:fix-105257, r=BoxyUwUMatthias Krüger-0/+23
Consider `parent_count` for const param defaults Fixes #105257
2022-12-10Rollup merge of #105192 - estebank:point-at-lhs-on-binop, r=fee1-deadMatthias Krüger-1/+3
Point at LHS on binop type err if relevant
2022-12-09Auto merge of #104449 - oli-obk:unhide_unknown_spans, r=estebank,RalfJungbors-17/+28
Start emitting labels even if their pointed to file is not available locally r? `@estebank` cc `@RalfJung` fixes #97699
2022-12-08Point at LHS on binop type err if relevantEsteban Küber-1/+3
2022-12-08add a test case for `generic_const_exprs` in trait itemsTakayuki Maeda-1/+8
2022-12-07consider `parent_count` for const param defaultsTakayuki Maeda-0/+16
2022-12-06normalize before matching on `ConstKind`Boxy-0/+12
2022-12-06Change CTFE backtraces to use `note` instead of `label` to preserve their orderOli Scherer-17/+28
labels are reordered within the file in which they are reported, which can mess up the stack trace
2022-12-06Remove now-redundant file/line info from const backtracesOli Scherer-6/+6
2022-12-06Rollup merge of #105339 - BoxyUwU:wf_ct_kind_expr, r=TaKO8KiMatthias Krüger-0/+42
support `ConstKind::Expr` in `is_const_evaluatable` and `WfPredicates::compute` Fixes #105205 Currently we haven't implemented a way to evaluate `ConstKind::Expr(Expr::Binop(Add, 1, 2))` so I just left that with a `FIXME` and a `delay_span_bug` since I have no idea how to do that and it would make this a much larger (and more complicated) PR :P
2022-12-06Rollup merge of #105338 - estebank:other-impls, r=compiler-errorsYuki Okushi-6/+2
Tweak "the following other types implement trait" When *any* of the suggested impls is an exact match, *only* show the exact matches. This is particularly relevant for integer types. r? `@compiler-errors`
2022-12-05support `Expr` in `is_const_evaluatable` and `compute`Boxy-0/+42
2022-12-05Tweak "the following other types implement trait"Esteban Küber-6/+2
When *any* of the suggested impls is an exact match, *only* show the exact matches. This is particularly relevant for integer types. fix fmt
2022-12-03Skip recording resolution for duplicated generic params.Camille GILLOT-0/+15
2022-11-27Auto merge of #104048 - cjgillot:split-lifetime, r=compiler-errorsbors-1/+1
Separate lifetime ident from lifetime resolution in HIR Drive-by: change how suggested generic args are computed. Fixes https://github.com/rust-lang/rust/issues/103815 I recommend reviewing commit-by-commit.
2022-11-25`super_relate_consts` do not spurriously fail on assoc constsBoxy-0/+20
2022-11-25fmtBoxy-1/+1
2022-11-25handle assoc consts in fulfill `ConstEquate`Boxy-151/+61
2022-11-25handle nested obligations in `satisfied_from_param_env`Boxy-8/+79
2022-11-25Add expand_abstract_constkadmin-21/+1
Adds the ability to directly expand a const to an expr without having to deal with intermediate steps.
2022-11-25Add empty ConstKind::Abstractkadmin-33/+175
Initial pass at expr/abstract const/s Address comments Switch to using a list instead of &[ty::Const], rm `AbstractConst` Remove try_unify_abstract_consts Update comments Add edits Recurse more More edits Prevent equating associated consts Move failing test to ui Changes this test from incremental to ui, and mark it as failing and a known bug. Does not cause the compiler to ICE, so should be ok.
2022-11-24Change how suggested lifetime args are computed.Camille GILLOT-1/+1
2022-11-22Add failing test for projections used as const genericGuillaume Gomez-0/+31
2022-11-20Factor out conservative_is_privately_uninhabitedCameron Steffen-2/+2
2022-11-14Show a note where a macro failed to matchNilstrieb-0/+6
This shows a small note on what the macro matcher was currently processing to aid with "no rules expected the token X" errors.
2022-11-11Visit opaque types during type collection too.Camille GILLOT-26/+5