Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions crates/c/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,10 @@ impl WorldGenerator for C {
}

fn finish(&mut self, resolve: &Resolve, id: WorldId, files: &mut Files) -> Result<()> {
// Error about unused async configuration to help catch configuration
// errors.
self.opts.async_.ensure_all_used()?;

let linking_symbol = component_type_object::linking_symbol(&self.world);
self.c_include("<stdlib.h>");
let snake = self.world.to_snake_case();
Expand Down
3 changes: 3 additions & 0 deletions crates/go/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -877,6 +877,9 @@ impl WorldGenerator for Go {

fn finish(&mut self, resolve: &Resolve, id: WorldId, files: &mut Files) -> Result<()> {
_ = (resolve, id);
// Error about unused async configuration to help catch configuration
// errors.
self.opts.async_.ensure_all_used()?;

let version = env!("CARGO_PKG_VERSION");
let packages = resolve
Expand Down
13 changes: 12 additions & 1 deletion crates/moonbit/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,10 @@ impl WorldGenerator for MoonBit {
}

fn finish(&mut self, _resolve: &Resolve, _id: WorldId, files: &mut Files) -> Result<()> {
// Error about unused async configuration to help catch configuration
// errors.
self.opts.async_.ensure_all_used()?;

// If async is used, export async utils
self.async_support.emit_runtime_files(files, VERSION);

Expand Down Expand Up @@ -3249,9 +3253,16 @@ mod tests {

#[test]
fn async_filters_respect_import_export_direction() {
// The world both imports and exports `run` so that each directional
// filter below matches something; an unmatched filter is now an error
// (see `AsyncFilterSet::ensure_all_used`), which would mask what this
// test is actually checking.
let wit = r#"
package a:b;
world runner { import run: func(); }
world runner {
import run: func();
export run: func();
}
"#;

let mut import_opts = Opts {
Expand Down
Loading