about summary refs log tree commit diff
path: root/src/test/ui
AgeCommit message (Collapse)AuthorLines
2022-12-27Note alternative import candidates in nested use treeMichael Goulet-4/+38
2022-12-27Suppress suggestions for nested use treeMichael Goulet-0/+23
2022-12-27fix #105788, Remove unreasonable help message for auto traityukang-14/+5
2022-12-26Detect likely `.` -> `..` typo in method callsEsteban Küber-0/+67
Fix #65015.
2022-12-26Suggest `impl Iterator` when possible for `_` return typeEsteban Küber-1/+30
Address #106096.
2022-12-26Auto merge of #103020 - lyming2007:issue-102598-fix, r=jackh726bors-0/+51
error parsing lifetime following by Sized and message + between them Fixes #102598
2022-12-26Fix suggestion when there are arguments in the methodEsteban Küber-0/+48
2022-12-26Tweak wordingEsteban Küber-2/+5
2022-12-26Detect when method call on LHS might be shadowedEsteban Küber-0/+43
Address #39232.
2022-12-26address review comments + better testsLukas Markeffsky-43/+322
2022-12-26Auto merge of #103828 - cassaundra:fix-format-args-span2, r=cjgillotbors-0/+28
Fix incorrect span when using byte-escaped rbrace Fix #103826, a format args span issue introduced in #102214. The current solution for tracking skipped characters made it so that certain situations were ambiguous enough that the original span couldn't be worked out later. This PR improves on the original solution by keeping track of groups of skipped characters using a map, and fixes the previous bug. See an example of this ambiguity in the [previous PR's discussion](https://github.com/rust-lang/rust/pull/102214#issuecomment-1258711015).
2022-12-26Auto merge of #105605 - inquisitivecrystal:attr-validation, r=cjgillotbors-0/+39
Don't perform invalid checks in `codegen_attrs` The attributes `#[track_caller]` and `#[cmse_nonsecure_entry]` are only valid on functions. When validating one of these attributes, codegen_attrs previously called `fn_sig`, [which can only be used on functions](https://github.com/rust-lang/rust/pull/105201), on the item the attribute was attached to, assuming that the item was a function without checking. This led to [ICEs in situations where the attribute was incorrectly used on non-functions](https://github.com/rust-lang/rust/issues/105594). With this change, we skip calling `fn_sig` if the item the attribute is attached to must be a function but isn't, because `check_attr` will reject such cases without codegen_attrs's intervention. As a side note, some of the attributes in codegen_attrs are only valid on functions, but that property isn't actually checked. I'm planning to fix that in a follow up PR since it's a behavior change that will need to be validated rather than an obvious bugfix. Thankfully, all the attributes like that I've found so far are unstable. Fixes #105594. r? `@cjgillot`
2022-12-25Remove redundant clone suggestionEsteban Küber-24/+0
2022-12-25Create new inference contextEsteban Küber-1/+61
2022-12-25Auto merge of #105997 - RalfJung:immediate-abort, r=eholkbors-16/+36
abort immediately on bad mem::zeroed/uninit Now that we have non-unwinding panics, let's use them for these assertions. This re-establishes the property that `mem::uninitialized` and `mem::zeroed` will never unwind -- the earlier approach of causing panics here sometimes led to hard-to-debug segfaults when the surrounding code was not able to cope with the unexpected unwinding. Cc `@bjorn3` I did not touch cranelift but I assume it needs a similar patch. However it has a `codegen_panic` abstraction that I did not want to touch since I didn't know how else it is used.
2022-12-25Give the correct track-caller location with MIR inlining.Camille GILLOT-0/+4
2022-12-25Move SimplifyLocals before ConstProp.Camille GILLOT-12/+0
2022-12-25Auto merge of #105701 - RedDocMD:bug-105634, r=cjgillotbors-0/+8
Allow .. to be parsed as let initializer .. and ..= are valid expressions, however when used in a let statement it is not parsed. Fixes #105634
2022-12-25fix some typosKaDiWa-4/+4
2022-12-24Bubble up ErrorGuaranteed from region constraints in method item compareMichael Goulet-25/+4
2022-12-24Auto merge of #105085 - oli-obk:stop_promoting_all_the_things, r=RalfJungbors-0/+413
Stop promoting all the things fixes #91009 r? `@RalfJung`
2022-12-24Rollup merge of #105872 - chenyukang:yukang/fix-105494-remove-method-call, ↵Matthias Krüger-0/+76
r=eholk Suggest remove last method call when type coerce with expected type Fixes #105494
2022-12-24ignore some targetsRalf Jung-0/+2
2022-12-24Rollup merge of #105970 - Ezrashaw:add-docs+test-e0462, r=GuillaumeGomezMatthias Krüger-0/+28
docs/test: add UI test and long-form error docs for E0462 Another UI test/ docs combo. r? ``@GuillaumeGomez``
2022-12-23Verify receiver is of `self: Pin<&mut Self>`Esteban Küber-4/+0
2022-12-23Suggest `.clone()` on method call move errorsEsteban Küber-0/+44
2022-12-23Suggest `Pin::as_mut` when encountering borrow errorEsteban Küber-0/+57
2022-12-23Rollup merge of #106055 - compiler-errors:too-many-calls, r=estebanknils-0/+95
Check arg expressions properly on error in `confirm_builtin_call` Makes sure we don't regress diagnostic output when we have an expr error nested inside of a bad fn call: https://github.com/rust-lang/rust/pull/105973#issuecomment-1363152232 Fixes #106030 Fixes #105244
2022-12-23Rollup merge of #106043 - c410-f3r:moar-errors, r=petrochenkovnils-17/+0
Move tests r? ``@petrochenkov`` * 6470 is an ancient LLVM compilation bug * 22375 to typeck because of https://github.com/rust-lang/rust/pull/23013
2022-12-23Rollup merge of #105661 - lcnr:evaluate-new, r=compiler-errorsnils-0/+54
implement the skeleton of the updated trait solver cc ```@rust-lang/initiative-trait-system-refactor``` This is mostly following the architecture discussed in the types team meetup. After discussing the desired changes for the trait solver, we encountered cyclic dependencies between them. Most notably between changing evaluate to be canonical and returning inference constraints. We cannot canonicalize evaluate without returning inference constraints due to coinductive cycles. However, caching inference constraints also relies on canonicalization. Implementing both of these changes at once in-place is not feasible. This somewhat closely mirrors the current `evaluate` implementation with the following notable differences: - it moves `project` into the core solver, allowing us to correctly deal with coinductive projections (will be required for implied bounds, perfect derive) - it changes trait solver overflow to be non-fatal (required to backcompat breakage from changes to the iteration order of nested goals, deferred projection equality, generally very useful) - it returns inference constraints and canonicalizes inputs and outputs (required for a lot things, most notably merging fulfill and evaluate, and deferred projection equality) - it is implemented to work with lazy normalization A lot of things aren't yet implemented, but the remaining FIXMEs should all be fairly self-contained and parallelizable. If the architecture looks correct and is what we want here, I would like to quickly merge this and then split the work. r? ```@compiler-errors``` / ```@rust-lang/types``` :3
2022-12-23Move testsCaio-17/+0
2022-12-23Add testsMichael Goulet-0/+43
2022-12-23Rollup merge of #105978 - jyn514:unused_proc_macro_decl, r=tmiaskoMatthias Krüger-0/+1
Mark `proc_macro_decls_static` as always used This would have avoided a bug in https://github.com/rust-lang/rust/pull/104860. In practice this shouldn't matter since nothing uses the query other than the `dead_code` lint, but this isn't documented as an internal-only query so it seems nice for it to be accurate. I think for `dead_code` it doesn't matter because the relevant code is generated by `rustc_builtin_macros` and isn't linted. I think `@tmiasko` or `@bjorn3` would be a good reviewer? r? `@tmiasko`
2022-12-23Always suggest as `MachineApplicable` in `recover_intersection_pat`Yuki Okushi-23/+75
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2022-12-23docs/test: add UI test and long-form error docs for E0462Ezra Shaw-0/+28
2022-12-22Fix `explicit_outlives_requirements` lint in macrosLukas Markeffsky-3/+66
Show the suggestion if and only if the bounds are from the same source context.
2022-12-22Rollup merge of #106037 - JohnTitor:issue-94293, r=lcnrMatthias Krüger-0/+31
Add regression test for #94293 Closes #94293 r? ```@lcnr``` Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2022-12-22Rollup merge of #105983 - compiler-errors:issue-105981, r=tmiaskoMatthias Krüger-0/+93
Add a missing early return in drop tracking `handle_uninhabited_return` This return is needed so we don't call `Ty::is_inhabited_from` from a type with ty/ct vars in it. Fixes #105981
2022-12-22Rollup merge of #105847 - compiler-errors:issue-104396, r=oli-obkMatthias Krüger-0/+47
Ensure param-env is const before calling `eval_to_valtree` Other queries call `ParamEnv::with_const` *inside* of the query itself (e.g. `const_eval_global_id_for_typeck`), so this could alternatively be moved into the provider of `eval_to_valtree` instead. I don't have a particularly strong opinion, though *theoretically* caching is better if we make the query keys more constrained. I'm not exactly sure how this is an effect of the `-Zmir-opt-level=3` flag. Maybe something about the inliner causes us to inline an unevaluated const into a body where it can be evaluated, but where it has not yet been normalized. This seems likely, since we're inlining `from_fn_1::<{ N / 2 }, _>` in `from_fn_2`, which means that we will need to evaluate that constant during the const prop pass after inlining. Fixes #104396
2022-12-22Deduplicate check_expr in builtin calls with errorMichael Goulet-0/+52
2022-12-22Mark `proc_macro_decls_static` as always usedJoshua Nelson-0/+1
This would have avoided a bug in https://github.com/rust-lang/rust/pull/104860. In practice this shouldn't matter since nothing uses the query other than the `dead_code` lint, but this isn't documented as an internal-only query so it seems nice for it to be accurate. I think for `dead_code` it doesn't matter because the relevant code is generated by `rustc_builtin_macros` and isn't linted.
2022-12-22Use separate files instead of revisionsMichael Goulet-24/+37
2022-12-22abort immediately on bad mem::zeroed/uninitRalf Jung-16/+34
2022-12-22Add regression test for #94293Yuki Okushi-0/+31
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2022-12-22Rollup merge of #106010 - oli-obk:tait_coherence_diagnostic, r=compiler-errorsMatthias Krüger-1/+1
Give opaque types a better coherence error
2022-12-22Rollup merge of #105966 - compiler-errors:issue-105936, r=eholkMatthias Krüger-0/+26
Re-enable `Fn` trait call notation error for non-tuple argument I have no idea why I delayed this bug... but also there doesn't seem to be a UI test that actually shows a change, so maybe that's why. Fixes #105936
2022-12-22Rollup merge of #105843 - compiler-errors:sugg-const, r=lcnrMatthias Krüger-0/+72
Suggest associated const on possible capitalization mistake Suggest `i32::MAX` if we typed `i32::max` without making a function call. Fixes #93844
2022-12-22Rollup merge of #105769 - lyming2007:issue-105177-fix, r=eholkMatthias Krüger-54/+8
add function to tell the identical errors for ambiguity_errors if 2 errors of the kind and ident and span of the ident, b1, b2 and misc1 misc2 are the same we call these 2 ambiguity errors identical prevent identical ambiguity error from pushing into vector of ambiguity_errors this will fix #105177
2022-12-22Rollup merge of #104741 - bryangarza:bug-104588-async-track-caller, ↵Matthias Krüger-22/+52
r=compiler-errors Switch `#[track_caller]` back to a no-op unless feature gate is enabled This patch fixes a regression, in which `#[track_caller]`, which was previously a no-op, was changed to actually turn on the behavior. This should instead only happen behind the `closure_track_caller` feature gate. Also, add a warning for the user to understand how their code will compile depending on the feature gate being turned on or not. Fixes #104588
2022-12-22fix #105494, Suggest remove last method call when type coerce with expectedyukang-0/+76