-
Notifications
You must be signed in to change notification settings - Fork 246
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(wit-parser): improve checking for stable feature gates
This commit introduces some extra checking (and panicking) for feature gates that are stable (i.e. `Stability::Stable`) AKA `@since` with a version and/or features specified. There are two primary changes: - Make referring to a *future* version of the package an error (for now) - Ensure that if a feature is specified that it is checked before inclusion In the past `Stability::Stable` feature gates were simply treated as `Unknown`, which hides the information necessary for downstream crates/consumers to use (and created the question around whether referring to future package versions is valid). Signed-off-by: Victor Adossi <vadossi@cosmonic.com>
- Loading branch information
1 parent
311abc7
commit 417399c
Showing
15 changed files
with
197 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
package foo:%from; | ||
|
||
interface a { | ||
use foo:foo/only-from.{r}; | ||
use foo:foo/only-from@1.0.0.{r}; | ||
|
||
foo: func(); | ||
} |
2 changes: 1 addition & 1 deletion
2
crates/wit-component/tests/merge/success/from/deps/foo/shared.wit
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package foo:foo; | ||
package foo:foo@1.0.0; | ||
|
||
interface shared-only-from { | ||
variant v { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
package foo:into; | ||
|
||
interface b { | ||
use foo:foo/only-into.{r}; | ||
use foo:foo/only-into@1.0.0.{r}; | ||
|
||
foo: func(); | ||
} |
2 changes: 1 addition & 1 deletion
2
crates/wit-component/tests/merge/success/into/deps/foo/shared.wit
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package foo:foo; | ||
package foo:foo@1.0.0; | ||
|
||
interface shared-only-into { | ||
variant v { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package foo:foo; | ||
package foo:foo@1.0.0; | ||
|
||
interface only-into { | ||
record r { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
package foo:%from; | ||
|
||
interface a { | ||
use foo:foo/only-from.{r}; | ||
use foo:foo/only-from@1.0.0.{r}; | ||
|
||
foo: func(); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
package foo:into; | ||
|
||
interface b { | ||
use foo:foo/only-into.{r}; | ||
use foo:foo/only-into@1.0.0.{r}; | ||
|
||
foo: func(); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.