From 1b77cb517329c178d2a169855a2f00ff169acb24 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Mon, 20 May 2024 07:48:56 -0700 Subject: [PATCH] Remove support for `relative-url=<...>` Follows suit from WebAssembly/component-model#353 --- crates/wasmparser/src/validator/names.rs | 14 +------------- tests/local/component-model/export.wast | 2 +- tests/local/component-model/import.wast | 18 ++++++++++-------- 3 files changed, 12 insertions(+), 22 deletions(-) diff --git a/crates/wasmparser/src/validator/names.rs b/crates/wasmparser/src/validator/names.rs index 66f9c31180..b9bcaf2e91 100644 --- a/crates/wasmparser/src/validator/names.rs +++ b/crates/wasmparser/src/validator/names.rs @@ -568,8 +568,7 @@ impl<'a> DependencyName<'a> { } } -/// A dependency on an implementation either as `url=...` or -/// `relative-url=...` +/// A dependency on an implementation either as `url=...` #[derive(Debug, Clone, Hash, Eq, PartialEq, Ord, PartialOrd)] pub struct UrlName<'a>(&'a str); @@ -649,17 +648,6 @@ impl<'a> ComponentNameParser<'a> { self.eat_optional_hash()?; return Ok(ParsedComponentNameKind::Url); } - // 'relative-url=<' '>' (',' )? - if self.eat_str("relative-url=") { - self.expect_str("<")?; - let url = self.take_up_to('>')?; - if url.contains('<') { - bail!(self.offset, "relative-url cannot contain `<`"); - } - self.expect_str(">")?; - self.eat_optional_hash()?; - return Ok(ParsedComponentNameKind::Url); - } // 'integrity=<' '>' if self.eat_str("integrity=") { diff --git a/tests/local/component-model/export.wast b/tests/local/component-model/export.wast index 614f913335..20e07bec04 100644 --- a/tests/local/component-model/export.wast +++ b/tests/local/component-model/export.wast @@ -61,7 +61,7 @@ "not a valid export name") (assert_invalid (component (type (component (export "relative-url=" (func))))) - "not a valid export name") + "not a valid extern name") (assert_invalid (component (type (component (export "locked-dep=" (func))))) "not a valid export name") diff --git a/tests/local/component-model/import.wast b/tests/local/component-model/import.wast index d95bfec727..a04823cf55 100644 --- a/tests/local/component-model/import.wast +++ b/tests/local/component-model/import.wast @@ -287,21 +287,23 @@ (component (import "url=<<>" (func))) "url cannot contain `<`") -(component - (import "relative-url=<>" (func)) - (import "relative-url=" (func)) - (import "relative-url=,integrity=" (func)) -) +(assert_invalid + (component + (import "relative-url=<>" (func)) + (import "relative-url=" (func)) + (import "relative-url=,integrity=" (func)) + ) + "not a valid extern name") (assert_invalid (component (import "relative-url=" (func))) - "expected `<` at ``") + "not a valid extern name") (assert_invalid (component (import "relative-url=<" (func))) - "failed to find `>`") + "not a valid extern name") (assert_invalid (component (import "relative-url=<<>" (func))) - "relative-url cannot contain `<`") + "not a valid extern name") (component (import "integrity=" (func))