Fix all doc warnings

This commit is contained in:
Zhang Junyang
2024-03-15 10:27:14 +08:00
committed by Tate, Hongliang Tian
parent 160cb9cdb5
commit b49e11a25e
15 changed files with 29 additions and 25 deletions

View File

@ -22,7 +22,7 @@ pub fn _print(args: Arguments) {
VirtioConsolesPrinter.write_fmt(args).unwrap();
}
/// Copy from Rust std: https://github.com/rust-lang/rust/blob/master/library/std/src/macros.rs
/// Copied from Rust std: <https://github.com/rust-lang/rust/blob/master/library/std/src/macros.rs>
#[macro_export]
macro_rules! print {
($($arg:tt)*) => {{
@ -30,7 +30,7 @@ macro_rules! print {
}};
}
/// Copy from Rust std: https://github.com/rust-lang/rust/blob/master/library/std/src/macros.rs
/// Copied from Rust std: <https://github.com/rust-lang/rust/blob/master/library/std/src/macros.rs>
#[macro_export]
macro_rules! println {
() => {

View File

@ -39,7 +39,7 @@ pub trait Iface: internal::IfaceInternal + Send + Sync {
/// Bind a socket to the iface. So the packet for this socket will be dealt with by the interface.
/// If port is None, the iface will pick up an empheral port for the socket.
/// FIXME: The reason for binding socket and interface together is because there are limitations inside smoltcp.
/// See discussion at https://github.com/smoltcp-rs/smoltcp/issues/779.
/// See discussion at <https://github.com/smoltcp-rs/smoltcp/issues/779>.
fn bind_socket(
&self,
socket: Box<AnyUnboundSocket>,

View File

@ -3,7 +3,7 @@
use crate::prelude::*;
/// Shutdown types
/// From https://elixir.bootlin.com/linux/v6.0.9/source/include/linux/net.h
/// From <https://elixir.bootlin.com/linux/v6.0.9/source/include/linux/net.h>
#[repr(i32)]
#[derive(Debug, Clone, Copy, PartialEq, Eq, TryFromInt)]
#[allow(non_camel_case_types)]

View File

@ -2,7 +2,7 @@
//! This module defines the process initial stack.
//! The process initial stack, contains arguments, environmental variables and auxiliary vectors
//! The data layout of init stack can be seen in Figure 3.9 in https://uclibc.org/docs/psABI-x86_64.pdf
//! The data layout of init stack can be seen in Figure 3.9 in <https://uclibc.org/docs/psABI-x86_64.pdf>
use core::mem;

View File

@ -24,7 +24,7 @@
//!
//! First, the option should be added in the net module for the TCP socket.
//!
//! ```rust norun
//! ```rust no_run
//! impl_socket_option!(TcpNodelay(bool));
//! ```
//!
@ -32,15 +32,19 @@
//! in the utils module. These util functions can be shared if multiple options have the value
//! of same type.
//!
//! ```rust norun
//! impl ReadFromUser for bool { // content omitted here }
//! impl WriteFromUser for bool { // content omitted here }
//! ```rust compile_fail
//! impl ReadFromUser for bool {
//! // content omitted here
//! }
//! impl WriteFromUser for bool {
//! // content omitted here
//! }
//! ```
//!
//! At last, we can implement `RawSocketOption` for `TcpNodelay` so that it can be read/from
//! user space.
//!
//! ```rust norun
//! ```rust no_run
//! impl_raw_socket_option!(TcpNodeley);
//! ```
//!

View File

@ -35,7 +35,7 @@ use crate::transport::VirtioTransport;
pub static DEVICE_NAME: &str = "Virtio-Input";
/// Select value used for [`VirtIOInput::query_config_select()`].
/// Select value used for [`device::InputDevice::query_config_select()`].
#[repr(u8)]
#[derive(Debug, Clone, Copy)]
pub enum InputConfigSelect {

View File

@ -4,11 +4,11 @@
//! When use this crate, typeflags and typeflags-util should also be added as dependency.
//!
//! The require macro are used to ensure that an object has the enough capability to call the function.
//! The **require** macro can accept constraint [SomeRightSet] > [SomeRight],
//! which means the SomeRightSet should **contain** the SomeRight.
//! The **require** macro can also accept constraint [SomeRightSet] > [AnotherRightSet],
//! which means the SomeRightSet should **include** the AnotherRightSet. In this case, AnotherRightSet should be a **generic parameter**.
//! i.e., AnotherRightSet should occur the the generic param list of the function.
//! The **require** macro can accept constraint `SomeRightSet` > `SomeRight`,
//! which means the `SomeRightSet` should **contain** the `SomeRight`.
//! The **require** macro can also accept constraint `SomeRightSet` > `AnotherRightSet`,
//! which means the `SomeRightSet` should **include** the `AnotherRightSet`. In this case, `AnotherRightSet` should be a **generic parameter**.
//! i.e., `AnotherRightSet` should occur the the generic param list of the function.
//!
//! If there are multiple constraits, they can be seperated with `|`, which means all constraits should be satisfied.
//!

View File

@ -55,7 +55,7 @@ pub type WriteOp = TRights![Write];
pub type FullOp = TRights![Read, Write, Dup];
/// Wrapper for TRights, used to bypass an error message from the Rust compiler,
/// the relevant issue is: https://github.com/rust-lang/rfcs/issues/2758
/// the relevant issue is: <https://github.com/rust-lang/rfcs/issues/2758>
///
/// Example:
///