Merge pull request #3638 from youknowone/derive · RustPython/RustPython@0b01e04 · GitHub
Skip to content

Commit 0b01e04

Browse files
authored
Merge pull request #3638 from youknowone/derive
rustpython-doc as external module
2 parents c44843f + e609aca commit 0b01e04

7 files changed

Lines changed: 17 additions & 2247 deletions

File tree

Cargo.lock

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

derive/Cargo.toml

Lines changed: 1 addition & 0 deletions

derive/docs.rsinc

Lines changed: 0 additions & 2213 deletions
This file was deleted.

derive/src/doc.rs

Lines changed: 0 additions & 30 deletions
This file was deleted.

derive/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ mod error;
1313
mod util;
1414

1515
mod compile_bytecode;
16-
mod doc;
1716
mod from_args;
1817
mod pyclass;
1918
mod pymodule;
@@ -23,6 +22,7 @@ mod pystructseq;
2322
use error::{extract_spans, Diagnostic};
2423
use proc_macro2::TokenStream;
2524
use quote::ToTokens;
25+
use rustpython_doc as doc;
2626
use syn::{parse_macro_input, AttributeArgs, DeriveInput, Item};
2727

2828
fn result_to_tokens(result: Result<TokenStream, impl Into<Diagnostic>>) -> proc_macro::TokenStream {

derive/src/pyclass.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,8 @@ fn generate_class_def(
191191
) -> Result<TokenStream> {
192192
let doc = attrs.doc().or_else(|| {
193193
let module_name = module_name.unwrap_or("builtins");
194-
crate::doc::try_module_item(module_name, name)
194+
crate::doc::Database::shared()
195+
.try_module_item(module_name, name)
195196
.ok()
196197
.flatten()
197198
.map(str::to_owned)

derive/src/pymodule.rs

Lines changed: 4 additions & 2 deletions

0 commit comments

Comments
 (0)