Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type names in generated Rust code can't contain hyphens #137

Merged
merged 2 commits into from
May 12, 2021

Conversation

Michael-F-Bryan
Copy link
Contributor

@Michael-F-Bryan Michael-F-Bryan commented May 7, 2021

@meelislootus this fixes your issue where the noise-filtering proc block has a hyphen and our rune-codegen tries using that as the proc block's namespace.

Meeliss-MacBook-Pro-3:rune meelislootus$ ./target/debug/rune build ./examples/microspeech/Runefile 
[2021-05-07T14:28:38.890Z DEBUG rune::build] Parsing "./examples/microspeech/Runefile"
[2021-05-07T14:28:38.891Z DEBUG rune::build] Compiling microspeech in "/Users/meelislootus/Library/Caches/runes/microspeech"
[2021-05-07T14:28:38.913Z DEBUG rune_codegen] Executing "cargo" "+nightly" "build" "--target=wasm32-unknown-unknown" "--quiet" "--release"
error[E0425]: cannot find value `noise` in this scope
 --> lib.rs:22:31
   |
22 |   let mut noise_filtering = noise-filtering::NoiseFiltering::default();
   |                ^^^^^ not found in this scopeerror[E0433]: failed to resolve: use of undeclared crate or module `filtering`
 --> lib.rs:22:48
   |
22 |   let mut noise_filtering = noise-filtering::NoiseFiltering::default();
   |                         ^^^^^^^^^^^^^^ not found in `filtering`
   |
help: consider importing this struct
   |
8  | use noise_filtering::NoiseFiltering;
   |error: aborting due to 2 previous errorsSome errors have detailed explanations: E0425, E0433.
For more information about an error, try `rustc --explain E0425`.
error: could not compile `microspeech`To learn more, run the command again with --verbose.
Error: Rune compilation failedCaused by:
  Compilation failed

Closes #145.

@Michael-F-Bryan Michael-F-Bryan force-pushed the codegen_snake_case branch 2 times, most recently from e7708f0 to adbe56f Compare May 12, 2021 00:05
@Michael-F-Bryan Michael-F-Bryan merged commit 99059c2 into master May 12, 2021
@Michael-F-Bryan Michael-F-Bryan deleted the codegen_snake_case branch May 12, 2021 02:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

{may-launch} Rune Compilation Failing if the Directory Name Contains -
1 participant