Skip to content

Commit e0a35e4

Browse files
authored
Merge pull request #5661 from arihant2math/doc
Fix doc warnings
2 parents c2665e3 + ab4dffb commit e0a35e4

23 files changed

Lines changed: 61 additions & 44 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,8 @@ jobs:
325325
python-version: ${{ env.PYTHON_VERSION }}
326326
- name: install ruff
327327
run: python -m pip install ruff==0.0.291 # astral-sh/ruff#7778
328+
- name: Ensure docs generate no warnings
329+
run: cargo doc
328330
- name: run python lint
329331
run: ruff extra_tests wasm examples --exclude='./.*',./Lib,./vm/Lib,./benches/ --select=E9,F63,F7,F82 --show-source
330332
- name: install prettier

common/src/linked_list.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//! This module is modified from tokio::util::linked_list: https://github.com/tokio-rs/tokio/blob/master/tokio/src/util/linked_list.rs
1+
//! This module is modified from tokio::util::linked_list: <https://github.com/tokio-rs/tokio/blob/master/tokio/src/util/linked_list.rs>
22
//! Tokio is licensed under the MIT license:
33
//!
44
//! Copyright (c) 2021 Tokio Contributors

src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
//! This is the `rustpython` binary. If you're looking to embed RustPython into your application,
2-
//! you're likely looking for the [`rustpython-vm`](https://docs.rs/rustpython-vm) crate.
2+
//! you're likely looking for the [`rustpython_vm`] crate.
33
//!
44
//! You can install `rustpython` with `cargo install rustpython`, or if you'd like to inject your
55
//! own native modules you can make a binary crate that depends on the `rustpython` crate (and
6-
//! probably `rustpython-vm`, too), and make a `main.rs` that looks like:
6+
//! probably [`rustpython_vm`], too), and make a `main.rs` that looks like:
77
//!
88
//! ```no_run
99
//! use rustpython_vm::{pymodule, py_freeze};

src/settings.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@ pub enum RunMode {
1313
}
1414

1515
pub enum InstallPipMode {
16+
/// Install pip using the ensurepip pip module. This has a higher chance of
17+
/// success, but may not install the latest version of pip.
1618
Ensurepip,
19+
/// Install pip using the get-pip.py script, which retrieves the latest pip version.
20+
/// This can be broken due to incompatibilities with cpython.
1721
GetPip,
1822
}
1923

src/shell.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ fn shell_exec(
7171
}
7272
}
7373

74+
/// Enter a repl loop
7475
pub fn run_shell(vm: &VirtualMachine, scope: Scope) -> PyResult<()> {
7576
let mut repl = Readline::new(helper::ShellHelper::new(vm, scope.globals.clone()));
7677
let mut full_input = String::new();

stdlib/src/pystruct.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
//! Python struct module.
22
//!
3-
//! Docs: https://docs.python.org/3/library/struct.html
3+
//! Docs: <https://docs.python.org/3/library/struct.html>
44
//!
55
//! Use this rust module to do byte packing:
6-
//! https://docs.rs/byteorder/1.2.6/byteorder/
6+
//! <https://docs.rs/byteorder/1.2.6/byteorder/>
77
88
pub(crate) use _struct::make_module;
99

vm/src/builtins/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! This package contains the python basic/builtin types
2-
//! 7 common PyRef type aliases are exposed - PyBytesRef, PyDictRef, PyIntRef, PyListRef, PyStrRef, PyTypeRef, PyTupleRef
3-
//! Do not add more PyRef type aliases. They will be rare enough to use directly PyRef<T>.
2+
//! 7 common PyRef type aliases are exposed - [`PyBytesRef`], [`PyDictRef`], [`PyIntRef`], [`PyListRef`], [`PyStrRef`], [`PyTypeRef`], [`PyTupleRef`]
3+
//! Do not add more PyRef type aliases. They will be rare enough to use directly `PyRef<T>`.
44
55
pub(crate) mod asyncgenerator;
66
pub use asyncgenerator::PyAsyncGen;

vm/src/dict_inner.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! Ordered dictionary implementation.
2-
//! Inspired by: https://morepypy.blogspot.com/2015/01/faster-more-memory-efficient-and-more.html
3-
//! And: https://www.youtube.com/watch?v=p33CVV29OG8
4-
//! And: http://code.activestate.com/recipes/578375/
2+
//! Inspired by: <https://morepypy.blogspot.com/2015/01/faster-more-memory-efficient-and-more.html>
3+
//! And: <https://www.youtube.com/watch?v=p33CVV29OG8>
4+
//! And: <http://code.activestate.com/recipes/578375/>
55
66
use crate::{
77
AsObject, Py, PyExact, PyObject, PyObjectRef, PyRefExact, PyResult, VirtualMachine,

vm/src/function/builtin.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ const fn zst_ref_out_of_thin_air<T: 'static>(x: T) -> &'static T {
6565
}
6666
}
6767

68-
/// Get the [`STATIC_FUNC`](IntoPyNativeFn::STATIC_FUNC) of the passed function. The same
68+
/// Get the STATIC_FUNC of the passed function. The same
6969
/// requirements of zero-sizedness apply, see that documentation for details.
7070
///
7171
/// Equivalent to [`IntoPyNativeFn::into_func()`], but usable in a const context. This is only

vm/src/import.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
/*
2-
* Import mechanics
3-
*/
1+
//! Import mechanics
2+
43
use crate::{
54
AsObject, PyObjectRef, PyPayload, PyRef, PyResult, TryFromObject,
65
builtins::{PyBaseExceptionRef, PyCode, list, traceback::PyTraceback},

0 commit comments

Comments
 (0)