diff --git a/compiler/generator/rust/rust_code_container.cpp b/compiler/generator/rust/rust_code_container.cpp index e5537dcff7..ce9f2b651e 100644 --- a/compiler/generator/rust/rust_code_container.cpp +++ b/compiler/generator/rust/rust_code_container.cpp @@ -511,6 +511,17 @@ void RustCodeContainer::produceClass() // Parameter getter/setter produceParameterGetterSetter(n + 1, parameterLookup); + // Control + if (gGlobal->gExtControl) { + tab(n + 1, *fOut); + tab(n + 1, *fOut); + *fOut << "fn control(&mut self) {"; + tab(n + 2, *fOut); + generateControlDeclarations(&fCodeProducer); + back(1, *fOut); + *fOut << "}"; + } + // Compute generateCompute(n + 1); generateComputeInterface(n + 1); diff --git a/compiler/global.cpp b/compiler/global.cpp index aff3593d5d..62e658ed57 100644 --- a/compiler/global.cpp +++ b/compiler/global.cpp @@ -1684,9 +1684,9 @@ bool global::processCmdline(int argc, const char* argv[]) "backends\n"); } - if (gExtControl && gOutputLang != "cpp" && gOutputLang != "c" && gOutputLang != "cmajor") { + if (gExtControl && gOutputLang != "cpp" && gOutputLang != "c" && gOutputLang != "cmajor" && gOutputLang != "rust") { throw faustexception( - "ERROR : '-ec' option can only be used with 'cpp', 'c' or 'cmajor' " + "ERROR : '-ec' option can only be used with 'cpp', 'c', 'cmajor' or 'rust' " "backends\n"); }