about summary refs log tree commit diff
path: root/src/test/ui/async-await/issues
AgeCommit message (Collapse)AuthorLines
2021-12-05Pretty print async block without redundant spaceDavid Tolnay-5/+5
2021-12-05Rollup merge of #91437 - dtolnay:emptybrace, r=nagisaMatthias Krüger-3/+3
Pretty print empty blocks as {} **Example:** ```rust macro_rules! p { ($e:expr) => { println!("{}", stringify!($e)); }; ($i:item) => { println!("{}", stringify!($i)); }; } fn main() { p!(if true {}); p!(struct S {}); } ``` **Before:** ```console if true { } struct S { } ``` **After:** ```console if true {} struct S {} ``` This affects [`dbg!`](https://doc.rust-lang.org/std/macro.dbg.html), as well as ecosystem uses of stringify such as in [`anyhow::ensure!`](https://docs.rs/anyhow/1/anyhow/macro.ensure.html). Printing a `{ }` in today's heavily rustfmt'd world comes out looking jarring/sloppy.
2021-12-03Auto merge of #90737 - eholk:intofuture, r=tmandrybors-0/+2
Reintroduce `into_future` in `.await` desugaring This is a reintroduction of the remaining parts from https://github.com/rust-lang/rust/pull/65244 that have not been relanded yet. This isn't quite ready to merge yet. The last attempt was reverting due to performance regressions, so we need to make sure this does not introduce those issues again. Issues #67644, #67982 /cc `@yoshuawuyts`
2021-12-02Code review feedbackEric Holk-0/+1
Add a note about `IntoFuture` in error messages where T is not a future. Change await-into-future.rs to be a run-pass test.
2021-12-01Pretty print empty blocks as {}David Tolnay-3/+3
2021-11-23Update test outputsMichael Goulet-1/+1
2021-11-22Update stderr filesEric Holk-0/+1
2021-11-20Do not mention associated items when they introduce an obligationEsteban Kuber-5/+0
2021-11-18Print output ty for opaque future tyMichael Goulet-1/+1
2021-10-25fix(rustc_typeck): report function argument errors on matching typeMichael Howell-2/+2
Fixes #90101
2021-10-24Use the "nice E0277 errors"[1] for `!Send` `impl Future` from foreign crateEsteban Kuber-14/+3
Partly address #78543 by making the error quieter. We don't have access to the `typeck` tables from foreign crates, so we used to completely skip the new code when checking foreign crates. Now, we carry on and don't provide as nice output (we don't clarify *what* is making the `Future: !Send`), but at least we no longer emit a sea of derived obligations in the output. [1]: https://blog.rust-lang.org/inside-rust/2019/10/11/AsyncAwait-Not-Send-Error-Improvements.html
2021-10-05Note specific regions involved in 'borrowed data escapes' errorAaron Hill-2/+8
Fixes #67007 Currently, a 'borrowed data escapes' error does not mention the specific lifetime involved (except indirectly through a suggestion about adding a lifetime bound). We now explain the specific lifetime relationship that failed to hold, which improves otherwise vague error messages.
2021-09-30Auto merge of #89110 - Aaron1011:adjustment-span, r=estebankbors-1/+1
Use larger span for adjustment THIR expressions Currently, we use a relatively 'small' span for THIR expressions generated by an 'adjustment' (e.g. an autoderef, autoborrow, unsizing). As a result, if a borrow generated by an adustment ends up causing a borrowcheck error, for example: ```rust let mut my_var = String::new(); let my_ref = &my_var my_var.push('a'); my_ref; ``` then the span for the mutable borrow may end up referring to only the base expression (e.g. `my_var`), rather than the method call which triggered the mutable borrow (e.g. `my_var.push('a')`) Due to a quirk of the MIR borrowck implementation, this doesn't always get exposed in migration mode, but it does in many cases. This commit makes THIR building consistently use 'larger' spans for adjustment expressions. These spans are recoded when we first create the adjustment during typecheck. For example, an autoref adjustment triggered by a method call will record the span of the entire method call. The intent of this change it make it clearer to users when it's the specific way in which a variable is used (for example, in a method call) that produdes a borrowcheck error. For example, an error message claiming that a 'mutable borrow occurs here' might be confusing if it just points at a usage of a variable (e.g. `my_var`), when no `&mut` is in sight. Pointing at the entire expression should help to emphasize that the method call itself is responsible for the mutable borrow. In several cases, this makes the `#![feature(nll)]` diagnostic output match up exactly with the default (migration mode) output. As a result, several `.nll.stderr` files end up getting removed entirely.
2021-09-25Use larger span for adjustments on method callsAaron Hill-1/+1
Currently, we use a relatively 'small' span for THIR expressions generated by an 'adjustment' (e.g. an autoderef, autoborrow, unsizing). As a result, if a borrow generated by an adustment ends up causing a borrowcheck error, for example: ```rust let mut my_var = String::new(); let my_ref = &my_var my_var.push('a'); my_ref; ``` then the span for the mutable borrow may end up referring to only the base expression (e.g. `my_var`), rather than the method call which triggered the mutable borrow (e.g. `my_var.push('a')`) Due to a quirk of the MIR borrowck implementation, this doesn't always get exposed in migration mode, but it does in many cases. This commit makes THIR building consistently use 'larger' spans for adjustment expressions The intent of this change it make it clearer to users when it's the specific way in which a variable is used (for example, in a method call) that produdes a borrowcheck error. For example, an error message claiming that a 'mutable borrow occurs here' might be confusing if it just points at a usage of a variable (e.g. `my_var`), when no `&mut` is in sight. Pointing at the entire expression should help to emphasize that the method call itself is responsible for the mutable borrow. In several cases, this makes the `#![feature(nll)]` diagnostic output match up exactly with the default (migration mode) output. As a result, several `.nll.stderr` files end up getting removed entirely.
2021-09-23Support incremental in compiletest for non-incremental modes.Eric Huss-1/+2
2021-09-20Use `ty::Error` for opaque types with errors in its bounds.Oli Scherer-10/+2
This reduces unhelpful diagnostics down the road.
2021-09-09Use more accurate spans for "unused delimiter" lintEsteban Kuber-1/+6
2021-08-30`feature(const_param_types)` -> `feature(adt_const_params)`lcnr-1/+1
2021-08-30`feature(const_generics)` -> `feature(const_param_types)`lcnr-1/+1
2021-08-22Fix more “a”/“an” typosFrank Steffahn-1/+1
2021-08-22Fix typos “a”→“an”Frank Steffahn-1/+1
2021-08-16Use note to point at bound introducing requirementEsteban Küber-6/+10
2021-08-11Modify structured suggestion outputEsteban Küber-4/+4
* On suggestions that include deletions, use a diff inspired output format * When suggesting addition, use `+` as underline * Color highlight modified span
2021-08-04Remove trailing whitespace from error messagesFabian Wolff-1/+1
2021-07-30Use multispan suggestions more oftenEsteban Küber-4/+2
* Use more accurate span for `async move` suggestion * Use more accurate span for deref suggestion * Use `multipart_suggestion` more often
2021-07-27Make all tests use type_alias_impl_trait feature instead of minSantiago Pastorino-3/+1
2021-07-27Use type_alias_impl_trait instead of min in compiler and libSantiago Pastorino-12/+0
2021-07-19Various diagnostics clean ups/tweaksEsteban Küber-1/+5
* Always point at macros, including derive macros * Point at non-local items that introduce a trait requirement * On private associated item, point at definition
2021-06-12Pretty print generator witness only in `-Zverbose` modeTomasz Miąsko-2/+2
In release build of deeply-nested-async benchmark the size of `no-opt.bc` file is reduced from 46MB to 62kB.
2021-05-11improve diagnosts for GATsb-naber-6/+6
2021-03-30Fix tests.Camille GILLOT-1/+1
Avoid invoking queries inside `check_paths`, since we are holding a lock to the reconstructed graph.
2021-03-15Replace `type_alias_impl_trait` by `min_type_alias_impl_trait` with no ↵Oli Scherer-1/+15
actual changes in behaviour This makes `type_alias_impl_trait` not actually do anything anymore
2021-02-13spell the real selftypecsmoe-1/+1
2021-02-12spell out nested self typecsmoe-0/+11
2021-02-12add testcase for issue 78600csmoe-0/+12
2021-02-06path trimming: ignore type aliasesDan Aloni-3/+3
2021-02-02Update ui tests (nll)Jesus Rubio-1/+2
2021-01-16Rollup merge of #80614 - 1000teslas:issue-78938-fix, r=tmandryMara Bos-0/+54
Explain why borrows can't be held across yield point in async blocks For https://github.com/rust-lang/rust/issues/78938.
2021-01-14Fix error E0373 documentation1000teslas-1/+1
2021-01-14Bless test output1000teslas-1/+0
2021-01-12Update src/test/ui/async-await/issues/issue-78938-async-block.stderr1000teslas-1/+1
Co-authored-by: Esteban Kuber <estebank@users.noreply.github.com>
2021-01-10Rework diagnostics for wrong number of generic argsPatryk Wychowaniec-4/+17
2021-01-10Revise async block error message1000teslas-9/+1
2021-01-10Update issue-78938-async-block.rs1000teslas-1/+1
Fix whitespace
2021-01-10Fix location of error message explanation1000teslas-5/+5
2021-01-10Explain why borrows can't be held across yield point in async blocks1000teslas-0/+63
2020-12-26update testsBastian Kauschke-5/+4
2020-11-10Rollup merge of #76765 - guswynn:async_return, r=tmandryJonas Schievink-2/+4
Make it more clear what an about async fn's returns when referring to what it returns see #76547 This is *likely* not the ONLY place that this happens to be unclear, but we can move this fn to rustc_middle or something like that and reuse it if need be, to apply it to more diagnostics One outstanding question I have is, if the fn returns (), should I make the message more clear (what about `fn f()` vs `fn f() -> ()`, can you tell those apart in the hir?) R? `@tmandry` `@rustbot` modify labels +A-diagnostics +T-compiler
2020-11-04Fix issue 78654.Hameer Abbasi-0/+54
2020-11-02Only separate notes if span is multilineYuki Okushi-6/+3