component bindgen: accept strs as well as identifiers for wit identifiers (#5600)

This is required because not all wit identifiers are Rust identifiers,
so we can smuggle the invalid ones inside quotes.
This commit is contained in:
Pat Hickey
2023-01-20 07:53:04 -08:00
committed by GitHub
parent f3418b760e
commit 92de180d7d
2 changed files with 19 additions and 3 deletions

View File

@@ -373,7 +373,9 @@ mod record_error {
record-error: func(a: float64) -> result<float64, e2>
}
}",
trappable_error_type: { imports::e2: TrappableE2 }
// Literal strings can be used for the interface and typename fields instead of
// identifiers, because wit identifiers arent always Rust identifiers.
trappable_error_type: { "imports"::"e2": TrappableE2 }
});
#[test]