feat: add a histrical wit-bindgen
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
// parse-fail
|
||||
a: async
|
||||
@@ -0,0 +1,5 @@
|
||||
expected keyword `func`, found eof
|
||||
--> tests/ui/parse-fail/async.wit:3:1
|
||||
|
|
||||
3 |
|
||||
| ^
|
||||
@@ -0,0 +1,3 @@
|
||||
// parse-fail
|
||||
a: async()
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
expected keyword `func`, found '('
|
||||
--> tests/ui/parse-fail/async1.wit:2:9
|
||||
|
|
||||
2 | a: async()
|
||||
| ^
|
||||
@@ -0,0 +1,5 @@
|
||||
// parse-fail
|
||||
|
||||
type x = list<u32
|
||||
|
||||
type y = u32
|
||||
@@ -0,0 +1,5 @@
|
||||
expected '>', found keyword `type`
|
||||
--> tests/ui/parse-fail/bad-list.wit:5:1
|
||||
|
|
||||
5 | type y = u32
|
||||
| ^
|
||||
@@ -0,0 +1,5 @@
|
||||
// parse-fail
|
||||
|
||||
resource x {
|
||||
x: s32
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
globals not allowed in resources
|
||||
--> tests/ui/parse-fail/bad-resource.wit:4:3
|
||||
|
|
||||
4 | x: s32
|
||||
| ^
|
||||
@@ -0,0 +1,6 @@
|
||||
// parse-fail
|
||||
|
||||
resource x {
|
||||
x: func()
|
||||
x: func()
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
"x" defined twice in this resource
|
||||
--> tests/ui/parse-fail/bad-resource2.wit:5:3
|
||||
|
|
||||
5 | x: func()
|
||||
| ^
|
||||
@@ -0,0 +1,2 @@
|
||||
// parse-fail
|
||||
use {} from foo
|
||||
@@ -0,0 +1,5 @@
|
||||
expected an identifier or string, found '}'
|
||||
--> tests/ui/parse-fail/bad-use.wit:2:6
|
||||
|
|
||||
2 | use {} from foo
|
||||
| ^
|
||||
@@ -0,0 +1,4 @@
|
||||
// parse-fail
|
||||
use { a } from
|
||||
|
||||
type foo = u32
|
||||
@@ -0,0 +1,5 @@
|
||||
expected an identifier or string, found keyword `type`
|
||||
--> tests/ui/parse-fail/bad-use2.wit:4:1
|
||||
|
|
||||
4 | type foo = u32
|
||||
| ^---
|
||||
@@ -0,0 +1,2 @@
|
||||
// parse-fail
|
||||
use * from type
|
||||
@@ -0,0 +1,5 @@
|
||||
expected an identifier or string, found keyword `type`
|
||||
--> tests/ui/parse-fail/bad-use3.wit:2:12
|
||||
|
|
||||
2 | use * from type
|
||||
| ^---
|
||||
@@ -0,0 +1,2 @@
|
||||
// parse-fail
|
||||
use { foo } from bar:
|
||||
@@ -0,0 +1,5 @@
|
||||
expected ':', found whitespace
|
||||
--> tests/ui/parse-fail/bad-use4.wit:2:22
|
||||
|
|
||||
2 | use { foo } from bar:
|
||||
| ^
|
||||
@@ -0,0 +1,2 @@
|
||||
// parse-fail
|
||||
use { foo } from bar:baz
|
||||
@@ -0,0 +1,5 @@
|
||||
expected ':', found an identifier
|
||||
--> tests/ui/parse-fail/bad-use5.wit:2:22
|
||||
|
|
||||
2 | use { foo } from bar:baz
|
||||
| ^
|
||||
@@ -0,0 +1,3 @@
|
||||
// parse-fail
|
||||
|
||||
use { foo } from import-me::bar
|
||||
@@ -0,0 +1,5 @@
|
||||
`bar` not defined in `import-me`
|
||||
--> tests/ui/parse-fail/bad-use6.wit:3:29
|
||||
|
|
||||
3 | use { foo } from import-me::bar
|
||||
| ^--
|
||||
@@ -0,0 +1,3 @@
|
||||
// parse-fail
|
||||
|
||||
use from import-me
|
||||
@@ -0,0 +1,5 @@
|
||||
expected '{', found keyword `from`
|
||||
--> tests/ui/parse-fail/bad-use7.wit:3:5
|
||||
|
|
||||
3 | use from import-me
|
||||
| ^
|
||||
@@ -0,0 +1,2 @@
|
||||
// parse-fail
|
||||
type foo = foo
|
||||
@@ -0,0 +1,5 @@
|
||||
type can recursively refer to itself
|
||||
--> tests/ui/parse-fail/cycle.wit:2:6
|
||||
|
|
||||
2 | type foo = foo
|
||||
| ^--
|
||||
@@ -0,0 +1,3 @@
|
||||
// parse-fail
|
||||
type foo = bar
|
||||
type bar = foo
|
||||
@@ -0,0 +1,5 @@
|
||||
type can recursively refer to itself
|
||||
--> tests/ui/parse-fail/cycle2.wit:2:6
|
||||
|
|
||||
2 | type foo = bar
|
||||
| ^--
|
||||
@@ -0,0 +1,3 @@
|
||||
// parse-fail
|
||||
type foo = bar
|
||||
type bar = option<foo>
|
||||
@@ -0,0 +1,5 @@
|
||||
type can recursively refer to itself
|
||||
--> tests/ui/parse-fail/cycle3.wit:2:6
|
||||
|
|
||||
2 | type foo = bar
|
||||
| ^--
|
||||
@@ -0,0 +1,3 @@
|
||||
// parse-fail
|
||||
type foo = bar
|
||||
record bar { x: foo }
|
||||
@@ -0,0 +1,5 @@
|
||||
type can recursively refer to itself
|
||||
--> tests/ui/parse-fail/cycle4.wit:2:6
|
||||
|
|
||||
2 | type foo = bar
|
||||
| ^--
|
||||
@@ -0,0 +1,3 @@
|
||||
// parse-fail
|
||||
type foo = bar
|
||||
type bar = list<foo>
|
||||
@@ -0,0 +1,5 @@
|
||||
type can recursively refer to itself
|
||||
--> tests/ui/parse-fail/cycle5.wit:2:6
|
||||
|
|
||||
2 | type foo = bar
|
||||
| ^--
|
||||
@@ -0,0 +1,3 @@
|
||||
// parse-fail
|
||||
|
||||
type
|
||||
@@ -0,0 +1,5 @@
|
||||
expected an identifier or string, found eof
|
||||
--> tests/ui/parse-fail/dangling-type.wit:4:1
|
||||
|
|
||||
4 |
|
||||
| ^
|
||||
@@ -0,0 +1,4 @@
|
||||
// parse-fail
|
||||
|
||||
foo: func()
|
||||
foo: func()
|
||||
@@ -0,0 +1,5 @@
|
||||
"foo" defined twice
|
||||
--> tests/ui/parse-fail/duplicate-functions.wit:4:1
|
||||
|
|
||||
4 | foo: func()
|
||||
| ^--
|
||||
@@ -0,0 +1,4 @@
|
||||
// parse-fail
|
||||
|
||||
resource a
|
||||
resource a
|
||||
@@ -0,0 +1,5 @@
|
||||
resource "a" defined twice
|
||||
--> tests/ui/parse-fail/duplicate-resource.wit:4:10
|
||||
|
|
||||
4 | resource a
|
||||
| ^
|
||||
@@ -0,0 +1,4 @@
|
||||
// parse-fail
|
||||
|
||||
type foo = s32
|
||||
type foo = s32
|
||||
@@ -0,0 +1,5 @@
|
||||
type "foo" defined twice
|
||||
--> tests/ui/parse-fail/duplicate-type.wit:4:6
|
||||
|
|
||||
4 | type foo = s32
|
||||
| ^--
|
||||
@@ -0,0 +1,3 @@
|
||||
// parse-fail
|
||||
a: s32
|
||||
a: u32
|
||||
@@ -0,0 +1,5 @@
|
||||
"a" defined twice
|
||||
--> tests/ui/parse-fail/duplicate-value.wit:3:1
|
||||
|
|
||||
3 | a: u32
|
||||
| ^
|
||||
@@ -0,0 +1,2 @@
|
||||
// parse-fail
|
||||
enum t {}
|
||||
@@ -0,0 +1,5 @@
|
||||
empty enum
|
||||
--> tests/ui/parse-fail/empty-enum.wit:2:6
|
||||
|
|
||||
2 | enum t {}
|
||||
| ^
|
||||
@@ -0,0 +1,2 @@
|
||||
// parse-fail
|
||||
union t {}
|
||||
@@ -0,0 +1,5 @@
|
||||
empty union
|
||||
--> tests/ui/parse-fail/empty-union.wit:2:7
|
||||
|
|
||||
2 | union t {}
|
||||
| ^
|
||||
@@ -0,0 +1,2 @@
|
||||
// parse-fail
|
||||
variant t {}
|
||||
@@ -0,0 +1,5 @@
|
||||
empty variant
|
||||
--> tests/ui/parse-fail/empty-variant1.wit:2:9
|
||||
|
|
||||
2 | variant t {}
|
||||
| ^
|
||||
@@ -0,0 +1,2 @@
|
||||
// parse-fail
|
||||
type foo = handle foo
|
||||
@@ -0,0 +1,5 @@
|
||||
no resource named `foo`
|
||||
--> tests/ui/parse-fail/handle-no-resource.wit:2:19
|
||||
|
|
||||
2 | type foo = handle foo
|
||||
| ^--
|
||||
@@ -0,0 +1,2 @@
|
||||
// parse-fail
|
||||
use { nonexistent } from import-me
|
||||
@@ -0,0 +1,5 @@
|
||||
name not defined in submodule
|
||||
--> tests/ui/parse-fail/import-bad.wit:2:7
|
||||
|
|
||||
2 | use { nonexistent } from import-me
|
||||
| ^----------
|
||||
@@ -0,0 +1,3 @@
|
||||
// parse-fail
|
||||
use { foo } from import-me
|
||||
use { foo } from import-me
|
||||
@@ -0,0 +1,5 @@
|
||||
type "foo" defined twice
|
||||
--> tests/ui/parse-fail/import-bad2.wit:3:7
|
||||
|
|
||||
3 | use { foo } from import-me
|
||||
| ^--
|
||||
@@ -0,0 +1,3 @@
|
||||
// parse-fail
|
||||
use { bar } from import-me
|
||||
use { bar } from import-me
|
||||
@@ -0,0 +1,5 @@
|
||||
resource "bar" defined twice
|
||||
--> tests/ui/parse-fail/import-bad3.wit:3:7
|
||||
|
|
||||
3 | use { bar } from import-me
|
||||
| ^--
|
||||
@@ -0,0 +1,2 @@
|
||||
// parse-fail
|
||||
use { bar, bar } from import-me
|
||||
@@ -0,0 +1,5 @@
|
||||
resource "bar" defined twice
|
||||
--> tests/ui/parse-fail/import-bad4.wit:2:12
|
||||
|
|
||||
2 | use { bar, bar } from import-me
|
||||
| ^--
|
||||
@@ -0,0 +1,3 @@
|
||||
// parse-fail
|
||||
use { foo } from import-me
|
||||
use * from import-me
|
||||
@@ -0,0 +1,5 @@
|
||||
type "foo" defined twice
|
||||
--> tests/ui/parse-fail/import-bad5.wit:3:12
|
||||
|
|
||||
3 | use * from import-me
|
||||
| ^--------
|
||||
@@ -0,0 +1,2 @@
|
||||
// parse-fail
|
||||
use { foo } from import-cycle2-v2
|
||||
@@ -0,0 +1 @@
|
||||
file `tests/ui/parse-fail/import-cycle2-v1.wit` recursively imports itself
|
||||
@@ -0,0 +1,2 @@
|
||||
// parse-fail
|
||||
use { foo } from import-cycle2-v1
|
||||
@@ -0,0 +1 @@
|
||||
file `tests/ui/parse-fail/import-cycle2-v2.wit` recursively imports itself
|
||||
@@ -0,0 +1,2 @@
|
||||
type foo = u32
|
||||
resource bar
|
||||
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"resources": [
|
||||
{
|
||||
"name": "bar"
|
||||
}
|
||||
],
|
||||
"types": [
|
||||
{
|
||||
"idx": 0,
|
||||
"name": "foo",
|
||||
"primitive": "u32"
|
||||
},
|
||||
{
|
||||
"idx": 1,
|
||||
"primitive": "handle-0"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
// parse-fail
|
||||
use { foo } from import1
|
||||
@@ -0,0 +1 @@
|
||||
file `tests/ui/parse-fail/import1.wit` recursively imports itself
|
||||
@@ -0,0 +1,7 @@
|
||||
// parse-fail
|
||||
|
||||
hello
|
||||
|
||||
```wit
|
||||
type foo = bar
|
||||
```
|
||||
@@ -0,0 +1,5 @@
|
||||
no type named `bar`
|
||||
--> tests/ui/parse-fail/invalid-md.md:6:12
|
||||
|
|
||||
6 | type foo = bar
|
||||
| ^--
|
||||
@@ -0,0 +1,2 @@
|
||||
// parse-fail
|
||||
abcd
|
||||
@@ -0,0 +1,5 @@
|
||||
expected ':', found eof
|
||||
--> tests/ui/parse-fail/invalid-toplevel.wit:3:1
|
||||
|
|
||||
3 |
|
||||
| ^
|
||||
@@ -0,0 +1,3 @@
|
||||
// parse-fail
|
||||
|
||||
type option = u32
|
||||
@@ -0,0 +1,5 @@
|
||||
expected an identifier or string, found keyword `option`
|
||||
--> tests/ui/parse-fail/keyword.wit:3:6
|
||||
|
|
||||
3 | type option = u32
|
||||
| ^-----
|
||||
@@ -0,0 +1,3 @@
|
||||
// parse-fail
|
||||
|
||||
type foo = bar
|
||||
@@ -0,0 +1,5 @@
|
||||
no type named `bar`
|
||||
--> tests/ui/parse-fail/undefined-typed.wit:3:12
|
||||
|
|
||||
3 | type foo = bar
|
||||
| ^--
|
||||
@@ -0,0 +1,5 @@
|
||||
unterminated string literal
|
||||
--> tests/ui/parse-fail/unterminated-string.wit:3:1
|
||||
|
|
||||
3 | "
|
||||
| ^
|
||||
Reference in New Issue
Block a user