diff options
author | bors <bors@rust-lang.org> | 2023-05-16 18:43:04 +0000 |
---|---|---|
committer | bors <bors@rust-lang.org> | 2023-05-16 18:43:04 +0000 |
commit | e77366b57b799dfa3ce1fcb850c068723a3213ee (patch) | |
tree | ede7c5b5c1272a50cf067778a62eafc957629416 /tests/ui/generator/drop-tracking-error-body.rs | |
parent | b652d9a0fd5c5a7eeacd1ae8299166941c221230 (diff) | |
parent | 54a49769fa106b0732dcc15f68e59f4a07ffa909 (diff) | |
download | rust-e77366b57b799dfa3ce1fcb850c068723a3213ee.tar.gz |
Auto merge of #111650 - matthiaskrgr:rollup-n7w17v4, r=matthiaskrgr
Rollup of 7 pull requests
Successful merges:
- #107680 (Hide repr attribute from doc of types without guaranteed repr)
- #111488 (Use error term in projection if missing associated item in new solver)
- #111533 (Handle error body in generator layout)
- #111573 (Erase `ReError` properly)
- #111592 (Change Vec examples to not assert exact capacity except where it is guaranteed)
- #111610 (fix(diagnostic): wrap parens for ref impl trait param)
- #111642 ([rustdoc] Only keep impl blocks from bodies)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'tests/ui/generator/drop-tracking-error-body.rs')
-rw-r--r-- | tests/ui/generator/drop-tracking-error-body.rs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/ui/generator/drop-tracking-error-body.rs b/tests/ui/generator/drop-tracking-error-body.rs new file mode 100644 index 00000000000..f99d9ab6bf8 --- /dev/null +++ b/tests/ui/generator/drop-tracking-error-body.rs @@ -0,0 +1,18 @@ +// compile-flags: -Zdrop-tracking-mir --edition=2021 + +#![feature(generators)] + +pub async fn async_bad_body() { + match true {} //~ ERROR non-exhaustive patterns: type `bool` is non-empty +} + +pub fn generator_bad_body() { + || { + // 'non-exhaustive pattern' only seems to be reported once, so this annotation doesn't work + // keep the function around so we can make sure it doesn't ICE + match true {}; // ERROR non-exhaustive patterns: type `bool` is non-empty + yield (); + }; +} + +fn main() {} |