diff options
| author | bors <bors@rust-lang.org> | 2023-05-02 09:41:35 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-05-02 09:41:35 +0000 |
| commit | 98c33e47a495fbd7b22bce9ce32f2815991bc414 (patch) | |
| tree | 5a29fad853f7fe163f7d7c70e31d0993039da2eb /compiler/rustc_builtin_macros/src | |
| parent | 7b99493492ad59c7a44c65373558175db42b4151 (diff) | |
| parent | 5d1796a608d387be784f17c28ec7c81f178a81eb (diff) | |
| download | rust-98c33e47a495fbd7b22bce9ce32f2815991bc414.tar.gz rust-98c33e47a495fbd7b22bce9ce32f2815991bc414.zip | |
Auto merge of #109128 - chenyukang:yukang/remove-type-ascription, r=estebank
Remove type ascription from parser and diagnostics Mostly based on https://github.com/rust-lang/rust/pull/106826 Part of #101728 r? `@estebank`
Diffstat (limited to 'compiler/rustc_builtin_macros/src')
| -rw-r--r-- | compiler/rustc_builtin_macros/src/asm.rs | 4 | ||||
| -rw-r--r-- | compiler/rustc_builtin_macros/src/assert.rs | 1 | ||||
| -rw-r--r-- | compiler/rustc_builtin_macros/src/assert/context.rs | 1 | ||||
| -rw-r--r-- | compiler/rustc_builtin_macros/src/edition_panic.rs | 1 |
4 files changed, 1 insertions, 6 deletions
diff --git a/compiler/rustc_builtin_macros/src/asm.rs b/compiler/rustc_builtin_macros/src/asm.rs index c066512b09e..0ea8454db08 100644 --- a/compiler/rustc_builtin_macros/src/asm.rs +++ b/compiler/rustc_builtin_macros/src/asm.rs @@ -68,9 +68,7 @@ pub fn parse_asm_args<'a>( if !p.eat(&token::Comma) { if allow_templates { // After a template string, we always expect *only* a comma... - let mut err = diag.create_err(errors::AsmExpectedComma { span: p.token.span }); - p.maybe_annotate_with_ascription(&mut err, false); - return Err(err); + return Err(diag.create_err(errors::AsmExpectedComma { span: p.token.span })); } else { // ...after that delegate to `expect` to also include the other expected tokens. return Err(p.expect(&token::Comma).err().unwrap()); diff --git a/compiler/rustc_builtin_macros/src/assert.rs b/compiler/rustc_builtin_macros/src/assert.rs index 0de424be2f1..ab4ea9c8c20 100644 --- a/compiler/rustc_builtin_macros/src/assert.rs +++ b/compiler/rustc_builtin_macros/src/assert.rs @@ -61,7 +61,6 @@ pub fn expand_assert<'cx>( delim: MacDelimiter::Parenthesis, tokens, }), - prior_type_ascription: None, })), ); expr_if_not(cx, call_site_span, cond_expr, then, None) diff --git a/compiler/rustc_builtin_macros/src/assert/context.rs b/compiler/rustc_builtin_macros/src/assert/context.rs index bd3f148c9a7..ea830a0ce60 100644 --- a/compiler/rustc_builtin_macros/src/assert/context.rs +++ b/compiler/rustc_builtin_macros/src/assert/context.rs @@ -182,7 +182,6 @@ impl<'cx, 'a> Context<'cx, 'a> { delim: MacDelimiter::Parenthesis, tokens: initial.into_iter().chain(captures).collect::<TokenStream>(), }), - prior_type_ascription: None, })), ) } diff --git a/compiler/rustc_builtin_macros/src/edition_panic.rs b/compiler/rustc_builtin_macros/src/edition_panic.rs index b2a21611db7..ef0db23ff2f 100644 --- a/compiler/rustc_builtin_macros/src/edition_panic.rs +++ b/compiler/rustc_builtin_macros/src/edition_panic.rs @@ -63,7 +63,6 @@ fn expand<'cx>( delim: MacDelimiter::Parenthesis, tokens: tts, }), - prior_type_ascription: None, })), ), ) |
