diff options
| author | Dylan DPC <99973273+Dylan-DPC@users.noreply.github.com> | 2023-05-09 12:33:45 +0530 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-05-09 12:33:45 +0530 |
| commit | dbd090c655b4a4389fe51cbd3ad6f401e2953dbe (patch) | |
| tree | 6de355c93e791dc65923c0cf69e80c267a799e33 /compiler/rustc_parse/src/errors.rs | |
| parent | ff30b8cb7bcf3eaee7a5222c8ec35adba4a0d243 (diff) | |
| parent | 83b4df4e611961373ffaf4bfcd9f8940a4f37c09 (diff) | |
| download | rust-dbd090c655b4a4389fe51cbd3ad6f401e2953dbe.tar.gz rust-dbd090c655b4a4389fe51cbd3ad6f401e2953dbe.zip | |
Rollup merge of #110694 - est31:builtin, r=petrochenkov
Implement builtin # syntax and use it for offset_of!(...) Add `builtin #` syntax to the parser, as well as a generic infrastructure to support both item and expression position builtin syntaxes. The PR also uses this infrastructure for the implementation of the `offset_of!` macro, added by #106934. cc `@petrochenkov` `@DrMeepster` cc #110680 `builtin #` tracking issue cc #106655 `offset_of!` tracking issue
Diffstat (limited to 'compiler/rustc_parse/src/errors.rs')
| -rw-r--r-- | compiler/rustc_parse/src/errors.rs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/compiler/rustc_parse/src/errors.rs b/compiler/rustc_parse/src/errors.rs index 010a13aefa4..0810f0efef9 100644 --- a/compiler/rustc_parse/src/errors.rs +++ b/compiler/rustc_parse/src/errors.rs @@ -2644,3 +2644,18 @@ pub(crate) struct MalformedCfgAttr { pub span: Span, pub sugg: &'static str, } + +#[derive(Diagnostic)] +#[diag(parse_unknown_builtin_construct)] +pub(crate) struct UnknownBuiltinConstruct { + #[primary_span] + pub span: Span, + pub name: Symbol, +} + +#[derive(Diagnostic)] +#[diag(parse_expected_builtin_ident)] +pub(crate) struct ExpectedBuiltinIdent { + #[primary_span] + pub span: Span, +} |
