Skip to content

Commit 4e67110

Browse files
committed
Convert some module-level // and /// comments to //!.
This makes their intent and expected location clearer. We see some examples where these comments were not clearly separate from `use` declarations, which made it hard to understand what the comment is describing.
1 parent 2a5e5b8 commit 4e67110

File tree

4 files changed

+20
-18
lines changed

4 files changed

+20
-18
lines changed

alloc/src/boxed/thin.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
// Based on
2-
// https://github.com/matthieu-m/rfc2580/blob/b58d1d3cba0d4b5e859d3617ea2d0943aaa31329/examples/thin.rs
3-
// by matthieu-m
1+
//! Based on
2+
//! <https://github.com/matthieu-m/rfc2580/blob/b58d1d3cba0d4b5e859d3617ea2d0943aaa31329/examples/thin.rs>
3+
//! by matthieu-m
4+
45
use crate::alloc::{self, Layout, LayoutError};
56
use core::error::Error;
67
use core::fmt::{self, Debug, Display, Formatter};

portable-simd/crates/core_simd/examples/dot_product.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
// Code taken from the `packed_simd` crate
2-
// Run this code with `cargo test --example dot_product`
3-
//use std::iter::zip;
1+
//! Code taken from the `packed_simd` crate.
2+
//! Run this code with `cargo test --example dot_product`.
43
54
#![feature(array_chunks)]
65
#![feature(slice_as_chunks)]

std/src/io/buffered/bufreader/buffer.rs

+11-10
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1-
///! An encapsulation of `BufReader`'s buffer management logic.
2-
///
3-
/// This module factors out the basic functionality of `BufReader` in order to protect two core
4-
/// invariants:
5-
/// * `filled` bytes of `buf` are always initialized
6-
/// * `pos` is always <= `filled`
7-
/// Since this module encapsulates the buffer management logic, we can ensure that the range
8-
/// `pos..filled` is always a valid index into the initialized region of the buffer. This means
9-
/// that user code which wants to do reads from a `BufReader` via `buffer` + `consume` can do so
10-
/// without encountering any runtime bounds checks.
1+
//! An encapsulation of `BufReader`'s buffer management logic.
2+
//!
3+
//! This module factors out the basic functionality of `BufReader` in order to protect two core
4+
//! invariants:
5+
//! * `filled` bytes of `buf` are always initialized
6+
//! * `pos` is always <= `filled`
7+
//! Since this module encapsulates the buffer management logic, we can ensure that the range
8+
//! `pos..filled` is always a valid index into the initialized region of the buffer. This means
9+
//! that user code which wants to do reads from a `BufReader` via `buffer` + `consume` can do so
10+
//! without encountering any runtime bounds checks.
11+
1112
use crate::cmp;
1213
use crate::io::{self, BorrowedBuf, Read};
1314
use crate::mem::MaybeUninit;

std/src/sys/os_str/wtf8.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
/// The underlying OsString/OsStr implementation on Windows is a
2-
/// wrapper around the "WTF-8" encoding; see the `wtf8` module for more.
1+
//! The underlying OsString/OsStr implementation on Windows is a
2+
//! wrapper around the "WTF-8" encoding; see the `wtf8` module for more.
3+
34
use crate::borrow::Cow;
45
use crate::collections::TryReserveError;
56
use crate::fmt;

0 commit comments

Comments
 (0)