summary refs log tree commit diff
path: root/src/test/ui/issues
AgeCommit message (Collapse)AuthorLines
2022-08-29regression tests for problems that are exposed by mir-inlining policy that ↵Felix S. Klock II-0/+39
we are reverting for 1.64-beta.
2022-08-05Auto merge of #95977 - FabianWolff:issue-92790-dead-tuple, r=estebankbors-32/+39
Warn about dead tuple struct fields Continuation of #92972. Fixes #92790. The language team has already commented on this in https://github.com/rust-lang/rust/pull/92972#issuecomment-1021511970; I have incorporated their requests here. Specifically, there is now a new allow-by-default `unused_tuple_struct_fields` lint (name bikesheddable), and fields of unit type are ignored (https://github.com/rust-lang/rust/pull/92972#issuecomment-1021815408), so error messages look like this: ``` error: field is never read: `1` --> $DIR/tuple-struct-field.rs:6:21 | LL | struct Wrapper(i32, [u8; LEN], String); | ^^^^^^^^^ | help: change the field to unit type to suppress this warning while preserving the field numbering | LL | struct Wrapper(i32, (), String); | ~~ ``` r? `@joshtriplett`
2022-08-03Auto merge of #100064 - RalfJung:disaligned, r=petrochenkovbors-0/+40
fix is_disaligned logic for nested packed structs https://github.com/rust-lang/rust/pull/83605 broke the `is_disaligned` logic by bailing out of the loop in `is_within_packed` early. This PR fixes that problem and adds suitable tests. Fixes https://github.com/rust-lang/rust/issues/99838
2022-08-03fix is_disaligned logic for nested packed structsRalf Jung-0/+40
2022-08-03Warn about dead tuple struct fieldsFabian Wolff-32/+39
2022-07-28Remove guess_head_span.Camille GILLOT-2/+4
2022-07-26Rollup merge of #99758 - WaffleLapkin:remove_useless_allow, r=Dylan-DPCMatthias Krüger-1/+0
remove useless `#[allow]` in a test The mentioned issue, https://github.com/rust-lang/rust/issues/54586 was fixed 4 years ago :)
2022-07-26remove useless `#[allow]` in a testMaybe Waffle-1/+0
2022-07-25Auto merge of #97313 - cjgillot:ast-lifetimes-anon, r=petrochenkovbors-8/+7
Resolve function lifetime elision on the AST ~Based on https://github.com/rust-lang/rust/pull/97720~ Lifetime elision for functions is purely syntactic in nature, so can be resolved on the AST. This PR replicates the elision logic and diagnostics on the AST, and replaces HIR-based resolution by a `delay_span_bug`. This refactor allows for more consistent diagnostics, which don't have to guess the original code from HIR. r? `@petrochenkov`
2022-07-25Report elision failures on the AST.Camille GILLOT-8/+7
2022-07-23Rollup merge of #99449 - compiler-errors:assoc-const-missing-item, r=lcnrGuillaume Gomez-13/+4
Do not resolve associated const when there is no provided value Fixes #98629, since now we just delay a bug when we're not able to evaluate a const item due to the value not actually being provided by anything. This means compilation proceeds forward to where the "missing item in impl" error is emitted. ---- The root issue here is that when we're looking for the defining `LeafDef` in `resolve_associated_item`, we end up getting the trait's AssocItem instead of the impl's AssocItem (which does not exist). This resolution "succeeds" even if the trait's item has no default value, and then since this item has no value to evaluate, it turns into a const eval error. This root issue becomes problematic (as in #98629) when this const eval error happens in wfcheck (for example, due to normalizing the param-env of something that references this const). Since this happens sooner than the check that an impl actually provides all of the items that a trait requires (which happens during later typecheck), we end up aborting compilation early with only this un-informative message. I'm not exactly sure _why_ this bug arises due to #96591 -- perhaps valtrees are evaluated more eagerly than in the old system? r? ``@oli-obk`` or ``@lcnr`` since y'all are familiar with const eval and reviewed #96591, though feel free to reassign. This is a regression from stable to beta, so I would be open to considering this for beta backport. It seems correct to me, especially given the improvements in the other UI tests this PR touches, but may have some side-effects that I'm unaware of...?
2022-07-23Rollup merge of #99580 - fmease:fix-issue-99565, r=estebankMatthias Krüger-2/+2
Don't suggest unnameable generic arguments Fixes #99565. `@rustbot` label T-compiler A-diagnostics r? `@rust-lang/wg-diagnostics`
2022-07-22Do not resolve associated const when there is no provided valueMichael Goulet-13/+4
2022-07-22Rollup merge of #99539 - compiler-errors:bidirectional-block-suggestions, ↵Dylan DPC-2/+0
r=fee1-dead Improve suggestions for returning binding Fixes #99525 Also reworks the cause codes for match and if a bit, I think cleaning them up in a positive way. We no longer need to call `could_remove_semicolon` in successful code, which might save a few cycles?
2022-07-22Don't suggest unnameable generic argumentsLeón Orell Valerian Liehr-2/+2
2022-07-21Rollup merge of #99413 - steffahn:btree_dropck, r=m-ou-seMatthias Krüger-3/+21
Add `PhantomData` marker for dropck to `BTreeMap` closes #99408
2022-07-21Generalize same_type_modulo_inferMichael Goulet-2/+0
2022-07-19Auto merge of #98180 - notriddle:notriddle/rustdoc-fn, ↵bors-2/+2
r=petrochenkov,GuillaumeGomez Improve the function pointer docs This is #97842 but for function pointers instead of tuples. The concept is basically the same. * Reduce duplicate impls; show `fn (T₁, T₂, …, Tₙ)` and include a sentence saying that there exists up to twelve of them. * Show `Copy` and `Clone`. * Show auto traits like `Send` and `Sync`, and blanket impls like `Any`. https://notriddle.com/notriddle-rustdoc-test/std/primitive.fn.html
2022-07-19Improve the function pointer docsMichael Howell-2/+2
* Reduce duplicate impls; show only the `fn (T)` and include a sentence saying that there exists up to twelve of them. * Show `Copy` and `Clone`. * Show auto traits like `Send` and `Sync`, and blanket impls like `Any`.
2022-07-19Rollup merge of #98028 - aticu:master, r=estebankMatthias Krüger-18/+19
Add E0790 as more specific variant of E0283 Fixes #81701 I think this should be good to go, there are only two things where I am somewhat unsure: - Is there a better way to get the fully-qualified path for the suggestion? I tried `self.tcx.def_path_str`, but that didn't seem to always give a correct path for the context. - Should all this be extracted into it's own method or is it fine where it is? r? `@estebank`
2022-07-19Add E0790 as more specific variant of E0283aticu-18/+19
2022-07-19Mention first and last macro in backtraceMichael Goulet-4/+4
2022-07-18Add `PhantomData` marker for dropck to `BTreeMap`Frank Steffahn-3/+21
closes #99408
2022-07-18Auto merge of #99137 - jackh726:wf-no-infcx, r=estebankbors-3/+8
Don't pass InferCtxt to WfPredicates Simple cleanup. Infer vars will get passed up as obligations and shallowed resolved later. This actually improves one test output.
2022-07-18Rollup merge of #99350 - compiler-errors:issue-99240, r=fee1-deadYuki Okushi-6/+18
Be more precise when suggesting removal of parens on unit ctor * Fixes #99240 by only suggesting to remove parens on path exprs, not arbitrary expressions with enum type * Generalizes by suggesting removal of parens on unit struct, too, because why not?
2022-07-16Be more precise when suggesting removal of parens on unit adt ctorMichael Goulet-6/+18
2022-07-16Rollup merge of #99290 - compiler-errors:revert-98794, r=lcnrMatthias Krüger-12/+2
Revert "Highlight conflicting param-env candidates" This reverts #98794, commit 08135254dcf22be0d5661ea8f75e703b29a83514. Seems to have caused an incremental compilation bug. The root cause of the incr comp bug is somewhat unrelated but is triggered by this PR, so I don't feel comfortable with having this PR in the codebase until it can be investigated further. Fixes #99233.
2022-07-16Rollup merge of #99258 - estebank:suggest-let, r=wesleywiserMatthias Krüger-53/+0
Provide structured suggestion for dropped temp value
2022-07-15Move tests to fit in limitEsteban Küber-89/+0
2022-07-15Provide structured suggestion for dropped temp valueEsteban Küber-8/+44
2022-07-15Revert "Highlight conflicting param-env candidates"Michael Goulet-12/+2
This reverts commit 08135254dcf22be0d5661ea8f75e703b29a83514.
2022-07-15passes: migrate half of `check_attr`David Wood-10/+10
Migrate half of the `rustc_passes::check_attr` diagnostics to using diagnostic derives and being translatable.
2022-07-15Rollup merge of #98869 - compiler-errors:stop_guessing_head_span, r=cjgillotDylan DPC-40/+26
Remove some usages of `guess_head_span` No need to pass things through `guess_head_span` if they already point to the head span. Only major change is that we point to the head span of `enum`s on some errors now, which I prefer. r? `@cjgillot`
2022-07-15Rollup merge of #99131 - compiler-errors:label-fn, r=cjgillotDylan DPC-4/+4
Add label for generic arg (+ APIT) and RPIT callables in `label_fn_like` Fixes #98308
2022-07-15Remove some usages of guess_head_span from typeckMichael Goulet-1/+1
2022-07-15Make item spans more consistentMichael Goulet-39/+25
2022-07-15Auto merge of #98203 - kckeiks:gather-body-owners-in-hir-item-queries, ↵bors-6/+6
r=cjgillot gather body owners Issue #96341
2022-07-14Add support for APIT and RPIT callables in label_fn_likeMichael Goulet-4/+4
2022-07-13use gathered body_owners in par_body_ownersMiguel Guarniz-6/+6
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
2022-07-13Always use CreateParameter mode for function definitions.Camille GILLOT-1/+1
2022-07-11Do not suggest same trait over againMichael Goulet-5/+0
2022-07-10Don't try to resolve inference variables in WF computation, just registerJack Huey-3/+8
2022-07-09Do not call `check_expr` in `check_compatible`, since it has side-effects ↵Michael Goulet-18/+5
and we've already checked all args
2022-07-08Auto merge of #98816 - estebank:implicit-sized, r=oli-obkbors-12/+12
Track implicit `Sized` obligations in type params When we evaluate `ty::GenericPredicates` we introduce the implicit `Sized` predicate of type params, but we do so with only the `Predicate` its `Span` as context, we don't have an `Obligation` or `ObligationCauseCode` we could influence. To try and carry this information through, we add a new field to `ty::GenericPredicates` that tracks both which predicates come from a type param and whether that param has any bounds already (to use in suggestions). We also suggest adding a `?Sized` bound if appropriate on E0599. Address part of #98539.
2022-07-08Rollup merge of #98794 - compiler-errors:conflicting-param-env, ↵Dylan DPC-2/+12
r=michaelwoerister Highlight conflicting param-env candidates This could probably be further improved by noting _why_ equivalent param-env candidates (modulo regions) leads to ambiguity. Fixes #98786
2022-07-08Highlight conflicting param-env candidatesMichael Goulet-2/+12
2022-07-07Track implicit `Sized` obligations in type paramsEsteban Küber-12/+12
Suggest adding a `?Sized` bound if appropriate on E0599 by inspecting the HIR Generics. (Fix #98539)
2022-07-07Fix borrowck closure span.Camille GILLOT-3/+6
2022-07-07Shorten span for closures.Camille GILLOT-36/+31
2022-07-06replace `guess_head_span` with `def_span`Takayuki Maeda-9/+4