diff options
| author | Folkert de Vries <folkert@folkertdev.nl> | 2025-01-29 11:57:37 +0100 |
|---|---|---|
| committer | Folkert de Vries <folkert@folkertdev.nl> | 2025-01-29 12:15:12 +0100 |
| commit | fbd30ea35fb79d73faa9d5b3feae391fed5336c8 (patch) | |
| tree | 43bf93169a47f84e8443e1937f915a47e1a63da7 /compiler/rustc_target/src/asm/mod.rs | |
| parent | cf577f34c47937ccb9983186eca5f8719da585f4 (diff) | |
| download | rust-fbd30ea35fb79d73faa9d5b3feae391fed5336c8.tar.gz rust-fbd30ea35fb79d73faa9d5b3feae391fed5336c8.zip | |
show supported register classes
in inline assembly, show the supported register classes when an invalid one is found
Diffstat (limited to 'compiler/rustc_target/src/asm/mod.rs')
| -rw-r--r-- | compiler/rustc_target/src/asm/mod.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_target/src/asm/mod.rs b/compiler/rustc_target/src/asm/mod.rs index 1292f46f0c9..45a67b10b63 100644 --- a/compiler/rustc_target/src/asm/mod.rs +++ b/compiler/rustc_target/src/asm/mod.rs @@ -39,12 +39,12 @@ macro_rules! def_reg_class { } } - pub fn parse(name: rustc_span::Symbol) -> Result<Self, &'static str> { + pub fn parse(name: rustc_span::Symbol) -> Result<Self, &'static [rustc_span::Symbol]> { match name { $( rustc_span::sym::$class => Ok(Self::$class), )* - _ => Err("unknown register class"), + _ => Err(&[$(rustc_span::sym::$class),*]), } } } @@ -635,7 +635,7 @@ impl InlineAsmRegClass { } } - pub fn parse(arch: InlineAsmArch, name: Symbol) -> Result<Self, &'static str> { + pub fn parse(arch: InlineAsmArch, name: Symbol) -> Result<Self, &'static [rustc_span::Symbol]> { Ok(match arch { InlineAsmArch::X86 | InlineAsmArch::X86_64 => { Self::X86(X86InlineAsmRegClass::parse(name)?) |
