rustdoc: Fix many rustdoc errors (#31147)

This fixes many rustdoc errors that occur due to raw URLs in rustdoc
comments as well as unescaped Rust code that should be in backticks.
This commit is contained in:
Martin Robinson 2024-01-22 14:13:48 +01:00 committed by GitHub
parent d7de206dbd
commit 5c1723c983
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
185 changed files with 939 additions and 942 deletions

View file

@ -13,17 +13,17 @@
//! "CSS 2.1" or "CSS 2.2" refers to the editor's draft of the W3C "Cascading Style Sheets Level 2
//! Revision 2 (CSS 2.2) Specification" available here:
//!
//! http://dev.w3.org/csswg/css2/
//! <http://dev.w3.org/csswg/css2/>
//!
//! "INTRINSIC" refers to L. David Baron's "More Precise Definitions of Inline Layout and Table
//! Layout" available here:
//!
//! http://dbaron.org/css/intrinsic/
//! <http://dbaron.org/css/intrinsic/>
//!
//! "CSS-SIZING" refers to the W3C "CSS Intrinsic & Extrinsic Sizing Module Level 3" document
//! available here:
//!
//! http://dev.w3.org/csswg/css-sizing/
//! <http://dev.w3.org/csswg/css-sizing/>
use std::cmp::{max, min};
use std::fmt;

View file

@ -40,7 +40,7 @@ pub struct BackgroundPlacement {
/// Obviously it does not work with empty arrays.
///
/// This is used for multiple layered background images.
/// See: https://drafts.csswg.org/css-backgrounds-3/#layering
/// See: <https://drafts.csswg.org/css-backgrounds-3/#layering>
pub fn get_cyclic<T>(arr: &[T], index: usize) -> &T {
&arr[index % arr.len()]
}

View file

@ -103,7 +103,7 @@ impl<'a> ClipScrollState<'a> {
}
/// Contentful paint, for the purpose of
/// https://w3c.github.io/paint-timing/#first-contentful-paint
/// <https://w3c.github.io/paint-timing/#first-contentful-paint>
/// (i.e. the display list contains items of type text,
/// image, non-white canvas or SVG). Used by metrics.
pub struct IsContentful(pub bool);

View file

@ -5,8 +5,8 @@
//! Reference-counted pointers to flows.
//!
//! Eventually, with dynamically sized types in Rust, much of this code will
//! be superfluous. This design is largely duplicating logic of Arc<T> and
//! Weak<T>; please see comments there for details.
//! be superfluous. This design is largely duplicating logic of `Arc<T>` and
//! `Weak<T>`; please see comments there for details.
use std::ops::Deref;
use std::sync::{Arc, Weak};
@ -25,7 +25,7 @@ impl Deref for FlowRef {
impl FlowRef {
/// `FlowRef`s can only be made available to the traversal code.
/// See https://github.com/servo/servo/issues/14014 for more details.
/// See <https://github.com/servo/servo/issues/14014> for more details.
pub fn new(mut r: Arc<dyn Flow>) -> Self {
// This assertion checks that this `FlowRef` does not alias normal `Arc`s.
// If that happens, we're in trouble.
@ -46,7 +46,7 @@ impl FlowRef {
}
/// WARNING: This should only be used when there is no aliasing:
/// when the traversal ensures that no other threads accesses the same flow at the same time.
/// See https://github.com/servo/servo/issues/6503
/// See <https://github.com/servo/servo/issues/6503>.
/// Use Arc::get_mut instead when possible (e.g. on an Arc that was just created).
#[allow(unsafe_code)]
pub fn deref_mut(this: &mut FlowRef) -> &mut dyn Flow {

View file

@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
//! CSS Multi-column layout http://dev.w3.org/csswg/css-multicol/
//! CSS Multi-column layout <http://dev.w3.org/csswg/css-multicol/>
use std::cmp::{max, min};
use std::fmt;

View file

@ -726,7 +726,7 @@ pub fn process_node_scroll_id_request<'dom>(
layout_node.generate_scroll_id(id)
}
/// https://drafts.csswg.org/cssom-view/#scrolling-area
/// <https://drafts.csswg.org/cssom-view/#scrolling-area>
pub fn process_scrolling_area_request(
requested_node: Option<OpaqueNode>,
layout_root: &mut dyn Flow,

View file

@ -1167,7 +1167,7 @@ impl<'a> Iterator for TableRowIterator<'a> {
/// for each cell
///
/// Used for correctly handling table layers from
/// https://drafts.csswg.org/css2/tables.html#table-layers
/// <https://drafts.csswg.org/css2/tables.html#table-layers>
struct TableCellStyleIterator<'table> {
column_styles: Vec<ColumnStyle<'table>>,
row_iterator: TableRowAndGroupIterator<'table>,

View file

@ -7,7 +7,7 @@
//! This follows the "More Precise Definitions of Inline Layout and Table Layout" proposal written
//! by L. David Baron (Mozilla) here:
//!
//! http://dbaron.org/css/intrinsic/
//! <http://dbaron.org/css/intrinsic/>
//!
//! Hereafter this document is referred to as INTRINSIC.