1
Fork 0

Auto merge of #117415 - matthiaskrgr:rollup-jr2p1t2, r=matthiaskrgr

Rollup of 7 pull requests

Successful merges:

 - #116862 (Detect when trait is implemented for type and suggest importing it)
 - #117389 (Some diagnostics improvements of `gen` blocks)
 - #117396 (Don't treat closures/coroutine types as part of the public API)
 - #117398 (Correctly handle nested or-patterns in exhaustiveness)
 - #117403 (Poison check_well_formed if method receivers are invalid to prevent typeck from running on it)
 - #117411 (Improve some diagnostics around `?Trait` bounds)
 - #117414 (Don't normalize to an un-revealed opaque when we hit the recursion limit)

r? `@ghost`
`@rustbot` modify labels: rollup
This commit is contained in:
bors 2023-10-30 20:50:14 +00:00
commit 31bc7e2c47
31 changed files with 288 additions and 151 deletions

View file

@ -278,8 +278,8 @@ parse_found_expr_would_be_stmt = expected expression, found `{$token}`
parse_function_body_equals_expr = function body cannot be `= expression;`
.suggestion = surround the expression with `{"{"}` and `{"}"}` instead of `=` and `;`
parse_gen_block = `gen` blocks are not yet implemented
.help = only the keyword is reserved for now
parse_gen_fn = `gen` functions are not yet implemented
.help = for now you can use `gen {"{}"}` blocks and return `impl Iterator` instead
parse_generic_args_in_pat_require_turbofish_syntax = generic args in patterns require the turbofish syntax

View file

@ -521,9 +521,9 @@ pub(crate) struct CatchAfterTry {
}
#[derive(Diagnostic)]
#[diag(parse_gen_block)]
#[diag(parse_gen_fn)]
#[help]
pub(crate) struct GenBlock {
pub(crate) struct GenFn {
#[primary_span]
pub span: Span,
}

View file

@ -2372,7 +2372,7 @@ impl<'a> Parser<'a> {
}
if let Gen::Yes { span, .. } = genness {
self.sess.emit_err(errors::GenBlock { span });
self.sess.emit_err(errors::GenFn { span });
}
if !self.eat_keyword_case(kw::Fn, case) {