about summary refs log tree commit diff
path: root/src/test/ui/closures
AgeCommit message (Collapse)AuthorLines
2023-01-11Move /src/test to /testsAlbert Larsan-13446/+0
2023-01-05Detect closures assigned to binding in blockEsteban Küber-13/+16
Fix #58497.
2023-01-05Auto merge of #105409 - compiler-errors:closure-infer-cycle, r=jackh726bors-0/+99
Don't deduce a signature that makes a closure cyclic Sometimes when elaborating supertrait bounds for closure signature inference, we end up deducing a closure signature that is cyclical because either a parameter or the return type references a projection mentioning `Self` that also has escaping bound vars, which means that it's not eagerly replaced with an inference variable. Interestingly, this is not *just* related to my PR that elaborates supertrait bounds for closure signature deduction. The committed test `supertrait-hint-cycle-3.rs` shows **stable** code that is fixed by this PR: ```rust trait Foo<'a> { type Input; } impl<F: Fn(u32)> Foo<'_> for F { type Input = u32; } fn needs_super<F: for<'a> Fn(<F as Foo<'a>>::Input) + for<'a> Foo<'a>>(_: F) {} fn main() { needs_super(|_: u32| {}); } ``` Fixes #105401 Fixes #105396 r? types
2023-01-01Verbose suggestionsEsteban Küber-16/+36
2022-12-28Use verbose suggestions for mutability errorsEsteban Küber-3/+5
2022-12-27More testsMichael Goulet-0/+34
2022-12-27Don't deduce a signature that makes a closure cyclicMichael Goulet-0/+65
2022-12-14Rollup merge of #105523 - estebank:suggest-collect-vec, r=compiler-errorsMatthias Krüger-2/+2
Suggest `collect`ing into `Vec<_>` Fix #105510.
2022-12-13Auto merge of #105667 - matthiaskrgr:rollup-fexlc0b, r=matthiaskrgrbors-29/+4
Rollup of 7 pull requests Successful merges: - #105147 (Allow unsafe through inline const) - #105438 (Move some codegen-y methods from `rustc_hir_analysis::collect` -> `rustc_codegen_ssa`) - #105464 (Support #[track_caller] on async closures) - #105476 (Change pattern borrowing suggestions to be verbose and remove invalid suggestion) - #105500 (Make some diagnostics not depend on the source of what they reference being available) - #105628 (Small doc fixes) - #105659 (Don't require owned data in `MaybeStorageLive`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-12-13review commentsEsteban Küber-3/+3
2022-12-13Suggest `: Type` instead of `: _`Esteban Küber-3/+3
2022-12-13Suggest `collect`ing into `Vec<_>`Esteban Küber-1/+1
2022-12-13reduce to single suggestion for all argumentsakida31-6/+4
2022-12-13change error messageakida31-0/+4
2022-12-13Avoid rendering empty annotationsOli Scherer-14/+0
2022-12-13Make some diagnostics not depend on the source of what they reference being ↵Oli Scherer-29/+18
available
2022-12-10Introduce `with_forced_trimmed_paths`Esteban Küber-3/+3
2022-11-19Use `type_ascribe!` in many UI testsNilstrieb-10/+17
Use it in all UI tests that are about the semantics and not the syntax of type ascription.
2022-11-10Tweak span for `#[must_use]`Esteban Küber-2/+2
Do not point at whole statement, only at the expression (skip pointing at `;`)
2022-11-07Rollup merge of #104038 - compiler-errors:super-norm-closure-sig, r=lcnrDylan DPC-0/+17
Normalize types when deducing closure signature from supertraits Elaborated supertraits should be normalized, since there's no guarantee they don't contain projections :sweat_smile: Fixes #104025 r? types
2022-11-06Normalize signature when deducing closure signature from supertraitsMichael Goulet-0/+17
2022-11-05Adjust diagnostics, bless testsMichael Goulet-2/+2
2022-11-05Specify that `break` cannot be used outside of loop *or* labeled blockclubby789-2/+2
2022-11-04Rollup merge of #103780 - compiler-errors:bound-closure-lifetimes, r=jackh726Matthias Krüger-0/+63
Fix late-bound lifetime closure ICEs in HIR typeck and MIR borrowck During HIR typeck, we need to teach astconv to treat late-bound regions within a closure body as free, fixing escaping bound vars ICEs in both of the issues below. However, this then gets us to MIR borrowck, which itself needs to be taught how to instantiate free region vids for late-bound regions that come from items that _aren't_ the typeck root (for now, just closures). Fixes #103771 Fixes #103736
2022-11-03Elaborate supertrait obligations when deducing closure signatureMichael Goulet-0/+29
2022-10-31Collect late-bound regions from all closure parents in `closure_mapping`Michael Goulet-0/+47
2022-10-31testsMichael Goulet-0/+16
2022-10-21add test for issue 97607Rageking8-0/+12
2022-10-19Generalize call suggestion for unsatisfied predicateMichael Goulet-0/+4
2022-10-10Rollup merge of #101360 - compiler-errors:multiple-closure-bounds, ↵Matthias Krüger-0/+39
r=petrochenkov Point out incompatible closure bounds Fixes #100295
2022-10-10Point out incompatible closure boundsMichael Goulet-0/+39
2022-10-09Skip chained OpaqueCast when building captures.Camille GILLOT-0/+17
2022-10-07make const_err a hard errorRalf Jung-2/+0
2022-10-05add test for issue 82633Rageking8-0/+173
2022-10-04slightly improve no return for returning function errorRageking8-3/+3
2022-10-01bless ui testsMaybe Waffle-19/+19
2022-09-26Rollup merge of #101996 - b-naber:binder-print, r=lcnrMatthias Krüger-1/+1
Don't duplicate region names for late-bound regions in print of Binder Fixes https://github.com/rust-lang/rust/issues/101280
2022-09-26address reviewb-naber-1/+1
2022-09-26Auto merge of #102184 - chenyukang:fix-102087-add-binding-sugg, r=nagisabors-0/+5
Suggest Default::default() when binding isn't initialized Fixes #102087
2022-09-26fix #102087, Suggest Default::default() when binding isn't initializedyukang-0/+5
2022-09-23Adapt test resultsFlorian Bartels-2/+1
2022-09-23Restore ignore tagFlorian Bartels-1/+0
This test case actually requires std::process.
2022-09-12Normalize closure signature after constructionMichael Goulet-0/+36
2022-09-08Remove ReEmptyJack Huey-1/+1
2022-09-08stop evaluating constants in `Relate`lcnr-12/+2
2022-09-06Rollup merge of #101357 - compiler-errors:variant-sugg-tweak, r=oli-obkGuillaume Gomez-5/+5
Include enum path in variant suggestion (except for `Result` and `Option`, which we should have via the prelude) Fixes #101356
2022-09-04Rollup merge of #100647 - obeis:issue-99875, r=nagisaMatthias Krüger-1/+1
Make trait bound not satisfied specify kind Closes #99875
2022-09-03Include enum path in variant suggestionMichael Goulet-5/+5
2022-08-31Fix a bunch of typoDezhi Wu-10/+10
This PR will fix some typos detected by [typos]. I only picked the ones I was sure were spelling errors to fix, mostly in the comments. [typos]: https://github.com/crate-ci/typos
2022-08-29Make the trait bound is not satisfied specify kindObei Sideg-1/+1