Declarative modules: make sure to emit doc comments and other attributes (#4236)
* Declarative modules: make sure to emmit doc comments and other attributes * Adds a test * Apply suggestions from code review --------- Co-authored-by: David Hewitt <mail@davidhewitt.dev>
This commit is contained in:
parent
c644c0b0b8
commit
74619143b6
|
@ -0,0 +1 @@
|
|||
Declarative modules: do not discard doc comments on the `mod` node.
|
|
@ -287,6 +287,7 @@ pub fn pymodule_module_impl(mut module: syn::ItemMod) -> Result<TokenStream> {
|
|||
|
||||
let initialization = module_initialization(&name, ctx);
|
||||
Ok(quote!(
|
||||
#(#attrs)*
|
||||
#vis mod #ident {
|
||||
#(#items)*
|
||||
|
||||
|
|
|
@ -9,4 +9,9 @@ pub fn python_module(_m: &Bound<'_, PyModule>) -> PyResult<()> {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
#[cfg(feature = "experimental-declarative-modules")]
|
||||
/// Some module documentation
|
||||
#[pymodule]
|
||||
pub mod declarative_python_module {}
|
||||
|
||||
fn main() {}
|
||||
|
|
Loading…
Reference in New Issue