about summary refs log tree commit diff
path: root/src/test/ui/async-await
AgeCommit message (Collapse)AuthorLines
2022-09-15enclose else block in terminating scopeDing Xiang Fei-2/+1
2022-09-15reorder nesting scopes and declare bindings without drop scheduleDing Xiang Fei-1/+2
2022-09-14Remove noop from test that expects no noopAndrew Pollack-3/+1
2022-09-13Update partial-drop-partial-reinit.rsEric Holk-7/+45
2022-09-13Update issue-65436-raw-ptr-not-send.rsEric Holk-6/+10
2022-09-13Update issue-70935-complex-spans.rsEric Holk-10/+11
2022-09-13Update issue-68114.rsEric Holk-16/+103
2022-09-13Update issue-64130-4-async-move.rsEric Holk-6/+36
2022-09-13Update async-await-let-else for drop trackingEric Holk-17/+130
2022-09-12Impove diagnostic for .await-ing non-futuresLukas Markeffsky-12/+41
2022-09-09Adjust pretty printing of RPITITsMichael Goulet-8/+8
2022-09-09Tweak feature error, add testMichael Goulet-1/+1
2022-09-09Bless tests, fix ICE with ImplTraitPlaceholderMichael Goulet-21/+92
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-08-30[drop tracking] Use parent expression for scopeEric Holk-0/+3
Previously we were just using the parent node as the scope for a temporary value, but it turns out this is too narrow. For example, in an expression like Foo { b: &42, a: async { 0 }.await, } the scope for the &42 was set to the ExprField node for `b: &42`, when we actually want to use the Foo struct expression. We fix this by recursively searching through parent nodes until we find a Node::Expr. It may be that we don't find one, and if so that's okay, we will just fall back on the enclosing temporary scope which is always sufficient.
2022-08-29Make the trait bound is not satisfied specify kindObei Sideg-1/+1
2022-08-21Account for relative pathsMichael Goulet-4/+8
2022-08-21Rework point-at-argMichael Goulet-20/+26
2022-08-18Reword "Required because of the requirements on the impl of ..."Andy Wang-5/+5
2022-08-16Rollup merge of #100590 - TaKO8Ki:suggest-adding-array-length, r=compiler-errorsMatthias Krüger-6/+6
Suggest adding an array length if possible fixes #100448
2022-08-16suggest adding an array length if possibleTakayuki Maeda-6/+6
2022-08-12Point out a single arg if we have a single arg incompatibilityMichael Goulet-2/+2
2022-08-08Adjust wordingMichael Goulet-7/+9
2022-08-07Implement special-cased projection error message for some common traitsMichael Goulet-4/+4
2022-08-03Warn about dead tuple struct fieldsFabian Wolff-2/+2
2022-07-28Remove guess_head_span.Camille GILLOT-1/+1
2022-07-26Use real opaque type instead of just saying impl TraitMichael Goulet-1/+1
2022-07-25Auto merge of #97313 - cjgillot:ast-lifetimes-anon, r=petrochenkovbors-3/+17
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-3/+17
2022-07-21Do if-expression obligation stuff less eagerlyMichael Goulet-9/+9
2022-07-20Suggest returning binding from block or enclosing scope on ↵Michael Goulet-9/+9
coerce_forced_unit error
2022-07-14Auto merge of #98754 - jyn514:non-trivial-drop, r=compiler-errorsbors-21/+86
Fix drop-tracking ICE when a struct containing a field with a significant drop is used across an await Previously, drop-tracking would incorrectly assume the struct would be dropped immediately, which was not true. Fixes #98476. Also fixes https://github.com/rust-lang/rust/issues/98477, I think because the parent HIR node for type variables is the whole function instead of the expression where the variable is used. r? `@eholk`
2022-07-13Rollup merge of #98574 - dingxiangfei2009:let-else-thir, r=oli-obkDylan DPC-0/+147
Lower let-else in MIR This MR will switch to lower let-else statements in MIR building instead. To lower let-else in MIR, we build a mini-switch two branches. One branch leads to the matching case, and the other leads to the `else` block. This arrangement will allow temporary lifetime analysis running as-is so that the temporaries are properly extended according to the same rule applied to regular `let` statements. cc https://github.com/rust-lang/rust/issues/87335 Fix #98672
2022-07-11add tests for async awaitDing Xiang Fei-0/+147
2022-07-11compiletest: trim edition before passing as flagDeadbeef-1/+1
This makes `edition: 2021` work instead of the ugly `edition:2021` one has to write.
2022-07-10Fix drop-tracking ICE when a struct containing a field with a `Drop` impl is ↵Joshua Nelson-21/+86
used across an await Previously, drop-tracking would incorrectly assume the struct would be dropped immediately, which was not true: when the field had a type with a manual `Drop` impl, the drop becomes observable and has to be dropped after the await instead. For reasons I don't understand, this also fixes another error crater popped up related to type parameters. #98476
2022-07-08Auto merge of #98816 - estebank:implicit-sized, r=oli-obkbors-1/+1
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 #98718 - yoshuawuyts:stabilize-into-future, r=yaahcMatthias Krüger-2/+0
Stabilize `into_future` https://github.com/rust-lang/rust/issues/67644 has been labeled with [S-tracking-ready-to-stabilize](https://github.com/rust-lang/rust/labels/S-tracking-ready-to-stabilize) - which mentions someone needs to file a stabilization PR. So hence this PR! :sparkles: Thanks! Closes https://github.com/rust-lang/rust/issues/67644 r? ``@joshtriplett``
2022-07-08Auto merge of #98482 - cjgillot:short-struct-span-closure, r=estebankbors-11/+8
Shorten def_span of closures to just their header Continuation of https://github.com/rust-lang/rust/pull/93967.
2022-07-07Review comments: wordingEsteban Küber-4/+6
2022-07-07Tweak wording and spansEsteban Küber-12/+12
2022-07-07On partial uninit error point at where we need initEsteban Küber-18/+31
When a binding is declared without a value, borrowck verifies that all codepaths have *one* assignment to them to initialize them fully. If there are any cases where a condition can be met that leaves the binding uninitialized or we attempt to initialize a field of an unitialized binding, we emit E0381. We now look at all the statements that initialize the binding, and use them to explore branching code paths that *don't* and point at them. If we find *no* potential places where an assignment to the binding might be missing, we display the spans of all the existing initializers to provide some context.
2022-07-07Track implicit `Sized` obligations in type paramsEsteban Küber-1/+1
Suggest adding a `?Sized` bound if appropriate on E0599 by inspecting the HIR Generics. (Fix #98539)
2022-07-07Shorten span for closures.Camille GILLOT-11/+8
2022-06-30Stabilize `into_future`Yoshua Wuyts-2/+0
2022-06-29Make RPIT and TAIT work exactly the sameOli Scherer-2/+15
2022-06-28Note concrete type being coerced into objectMichael Goulet-3/+3
2022-06-26Rollup merge of #98371 - compiler-errors:better-opaque-printing, r=oli-obkYuki Okushi-1/+1
Fix printing `impl trait` under binders Before, we would render `impl for<'a> Trait<'a>` like `impl Trait<for<'a> 'a>`, lol.
2022-06-25Rollup merge of #98298 - TaKO8Ki:point-to-type-param-definition, ↵Matthias Krüger-1/+1
r=compiler-errors Point to type parameter definition when not finding variant, method and associated item fixes #77391
2022-06-24Use write! instead of p! to avoid having to use weird scopingMichael Goulet-1/+1