File tree Expand file tree Collapse file tree 2 files changed +47
-0
lines changed Expand file tree Collapse file tree 2 files changed +47
-0
lines changed Original file line number Diff line number Diff line change
1
+ fn good1 ( ) -> String {
2
+ wasm_bindgen:: link_to!( inline_js = "console.log('Hello world!');" )
3
+ }
4
+
5
+ fn good2 ( ) -> String {
6
+ wasm_bindgen:: link_to!( raw_module = "package/foo.js" )
7
+ }
8
+
9
+ fn bad1 ( ) -> String {
10
+ wasm_bindgen:: link_to!( module = "/src/not-found.js" )
11
+ }
12
+
13
+ fn bad2 ( ) -> String {
14
+ wasm_bindgen:: link_to!( )
15
+ }
16
+
17
+ fn bad3 ( ) -> String {
18
+ wasm_bindgen:: link_to!(
19
+ inline_js = "console.log('Hello world!');" ,
20
+ js_namespace = foo
21
+ )
22
+ }
Original file line number Diff line number Diff line change
1
+ error: failed to read file `$WORKSPACE/target/tests/wasm-bindgen-macro/src/not-found.js`: No such file or directory (os error 2)
2
+ --> ui-tests/link-to.rs:10:37
3
+ |
4
+ 10 | wasm_bindgen::link_to!(module = "/src/not-found.js")
5
+ | ^^^^^^^^^^^^^^^^^^^
6
+
7
+ error: `link_to!` requires a module.
8
+ --> ui-tests/link-to.rs:14:5
9
+ |
10
+ 14 | wasm_bindgen::link_to!()
11
+ | ^^^^^^^^^^^^^^^^^^^^^^^^
12
+ |
13
+ = note: this error originates in the macro `wasm_bindgen::link_to` (in Nightly builds, run with -Z macro-backtrace for more info)
14
+
15
+ error: unused #[wasm_bindgen] attribute
16
+ --> ui-tests/link-to.rs:20:9
17
+ |
18
+ 20 | js_namespace = foo
19
+ | ^^^^^^^^^^^^
20
+
21
+ error[E0601]: `main` function not found in crate `$CRATE`
22
+ --> ui-tests/link-to.rs:22:2
23
+ |
24
+ 22 | }
25
+ | ^ consider adding a `main` function to `$DIR/ui-tests/link-to.rs`
You can’t perform that action at this time.
0 commit comments