Skip to content

Commit 7cd1aeb

Browse files
author
Yoshiki Takashima
authored
Fixed cargo doc failing to compile (#1331)
* Resolved link formatting issue. * Fixed escaping of brackets. * Fixed intra dock links. * Fixed broken link to rustc_middle::ty::layout::LayoutCx. * More hyperlink formatting warning fixed. * Fixed typo in struct. Mismatched curly braces. * fixed links and brackets. * Added gh action to build docs automatically. * Added gh action to build docs automatically. * Moved docs check to regressions script.
1 parent 2cd44dd commit 7cd1aeb

File tree

22 files changed

+80
-73
lines changed

22 files changed

+80
-73
lines changed

cprover_bindings/src/env.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
//! the current compilation instance's session information.
77
//!
88
//! c.f. CBMC code [src/ansi-c/ansi_c_internal_additions.cpp].
9-
//! One possible invocation of this insertion in CBMC can be found in [ansi_c_languaget::parse].
9+
//! One possible invocation of this insertion in CBMC can be found in \[ansi_c_languaget::parse\].
1010
1111
use super::goto_program::{Expr, Location, Symbol, Type};
1212
use super::MachineModel;

cprover_bindings/src/goto_program/expr.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ pub enum ExprValue {
118118
op: SelfOperand,
119119
e: Expr,
120120
},
121-
/// https://gcc.gnu.org/onlinedocs/gcc/Statement-Exprs.html
121+
/// <https://gcc.gnu.org/onlinedocs/gcc/Statement-Exprs.html>
122122
/// e.g. `({ int y = foo (); int z; if (y > 0) z = y; else z = - y; z; })`
123123
/// `({ op1; op2; ...})`
124124
StatementExpression {
@@ -326,7 +326,7 @@ impl Expr {
326326

327327
/// What typecasts are legal. Based off the C standard, plus some additional types
328328
/// that don't appear in the standard, like `bool`
329-
/// https://docs.microsoft.com/en-us/cpp/c-language/type-cast-conversions?view=msvc-160
329+
/// <https://docs.microsoft.com/en-us/cpp/c-language/type-cast-conversions?view=msvc-160>
330330
pub fn can_cast_from(source: &Type, target: &Type) -> bool {
331331
let source = source.unwrap_typedef();
332332
let target = target.unwrap_typedef();
@@ -544,7 +544,7 @@ impl Expr {
544544
{
545545
assert!(typ.is_integer());
546546
let i = i.into();
547-
// TODO: https://github.com/model-checking/kani/issues/996
547+
// TODO: <https://github.com/model-checking/kani/issues/996>
548548
// if i != 0 && i != 1 {
549549
// assert!(
550550
// typ.min_int() <= i && i <= typ.max_int(),
@@ -622,7 +622,7 @@ impl Expr {
622622
expr!(PointerConstant(c), typ)
623623
}
624624

625-
/// https://gcc.gnu.org/onlinedocs/gcc/Statement-Exprs.html
625+
/// <https://gcc.gnu.org/onlinedocs/gcc/Statement-Exprs.html>
626626
/// e.g. `({ int y = foo (); int z; if (y > 0) z = y; else z = - y; z; })`
627627
/// `({ op1; op2; ...})`
628628
pub fn statement_expression(ops: Vec<Stmt>, typ: Type) -> Self {

cprover_bindings/src/goto_program/symbol.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use super::{DatatypeComponent, Expr, Location, Parameter, Stmt, Type};
55
use crate::{InternStringOption, InternedString};
66

77
/// Based off the CBMC symbol implementation here:
8-
/// https://github.com/diffblue/cbmc/blob/develop/src/util/symbol.h
8+
/// <https://github.com/diffblue/cbmc/blob/develop/src/util/symbol.h>
99
#[derive(Clone, Debug)]
1010
pub struct Symbol {
1111
/// Unique identifier. Mangled name from compiler `foo12_bar17_x@1`
@@ -45,7 +45,7 @@ pub struct Symbol {
4545
}
4646

4747
/// Currently, only C is understood by CBMC.
48-
// TODO: https://github.com/model-checking/kani/issues/1
48+
// TODO: <https://github.com/model-checking/kani/issues/1>
4949
#[derive(Clone, Debug)]
5050
pub enum SymbolModes {
5151
C,

cprover_bindings/src/goto_program/symbol_table.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use super::{BuiltinFn, Stmt, Symbol};
55
use crate::InternedString;
66
use std::collections::BTreeMap;
77
/// This is a typesafe implementation of the CBMC symbol table, based on the CBMC code at:
8-
/// https://github.com/diffblue/cbmc/blob/develop/src/util/symbol_table.h
8+
/// <https://github.com/diffblue/cbmc/blob/develop/src/util/symbol_table.h>
99
/// Since the field is kept private, with only immutable references handed out, elements can only
1010
#[derive(Clone, Debug)]
1111
pub struct SymbolTable {

cprover_bindings/src/goto_program/typ.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ pub enum Type {
3232
/// `return_type x(parameters)`
3333
Code { parameters: Vec<Parameter>, return_type: Box<Type> },
3434
/// `__attribute__(constructor)`. Only valid as a function return type.
35-
/// https://gcc.gnu.org/onlinedocs/gcc-4.7.0/gcc/Function-Attributes.html
35+
/// <https://gcc.gnu.org/onlinedocs/gcc-4.7.0/gcc/Function-Attributes.html>
3636
Constructor,
3737
/// `double`
3838
Double,
@@ -185,7 +185,7 @@ impl DatatypeComponent {
185185
}
186186

187187
pub fn field<T: Into<InternedString>>(name: T, typ: Type) -> Self {
188-
// TODO https://github.com/model-checking/kani/issues/1243
188+
// TODO <https://github.com/model-checking/kani/issues/1243>
189189
// assert!(
190190
// Self::typecheck_datatype_field(&typ),
191191
// "Illegal field.\n\tName: {}\n\tType: {:?}",
@@ -813,13 +813,13 @@ impl Type {
813813
/// But, `struct foo` is not structurally equivalent to:
814814
/// ```
815815
/// __attribute__((packed))
816-
/// struct baz {}
816+
/// struct baz {
817817
/// char x;
818818
/// int y;
819819
/// }
820820
/// ```
821821
/// Since they have different padding.
822-
/// https://github.com/diffblue/cbmc/blob/develop/src/solvers/lowering/byte_operators.cpp#L1093..L1136
822+
/// <https://github.com/diffblue/cbmc/blob/develop/src/solvers/lowering/byte_operators.cpp#L1093..L1136>
823823
pub fn is_structurally_equivalent_to(&self, other: &Type, st: &SymbolTable) -> bool {
824824
let concrete_other = other.unwrap_typedef();
825825
let concrete_self = self.unwrap_typedef();
@@ -898,7 +898,7 @@ impl Type {
898898
}
899899
}
900900

901-
/// elem_t[size]
901+
/// elem_t\[size\]
902902
pub fn array_of<T>(self, size: T) -> Self
903903
where
904904
T: TryInto<u64>,
@@ -959,7 +959,7 @@ impl Type {
959959
CInteger(CIntType::SSizeT)
960960
}
961961

962-
/// corresponds to [code_typet] in CBMC, representing a function type
962+
/// corresponds to \[code_typet\] in CBMC, representing a function type
963963
/// ret (params ..)
964964
pub fn code(parameters: Vec<Parameter>, return_type: Type) -> Self {
965965
Code { parameters, return_type: Box::new(return_type) }
@@ -1155,7 +1155,7 @@ impl Type {
11551155
Unsignedbv { width }
11561156
}
11571157

1158-
/// corresponds to [code_typet] in CBMC, representing a function type
1158+
/// corresponds to \[code_typet\] in CBMC, representing a function type
11591159
/// ret (params, ... )
11601160
pub fn variadic_code(parameters: Vec<Parameter>, return_type: Type) -> Self {
11611161
VariadicCode { parameters, return_type: Box::new(return_type) }

cprover_bindings/src/irep/irep.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use std::fmt::Debug;
1212

1313
/// The CBMC serialization format for goto-programs.
1414
/// CBMC implementation code is at:
15-
/// https://github.com/diffblue/cbmc/blob/develop/src/util/irep.h
15+
/// <https://github.com/diffblue/cbmc/blob/develop/src/util/irep.h>
1616
#[derive(Clone, Debug, PartialEq)]
1717
pub struct Irep {
1818
pub id: IrepId,
@@ -85,7 +85,7 @@ impl Irep {
8585
/// Constructors
8686
impl Irep {
8787
/// `__attribute__(constructor)`. Only valid as a function return type.
88-
/// https://gcc.gnu.org/onlinedocs/gcc-4.7.0/gcc/Function-Attributes.html
88+
/// <https://gcc.gnu.org/onlinedocs/gcc-4.7.0/gcc/Function-Attributes.html>
8989
pub fn constructor() -> Irep {
9090
Irep::just_id(IrepId::Constructor)
9191
}

cprover_bindings/src/irep/irep_id.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -831,7 +831,7 @@ impl IrepId {
831831
}
832832

833833
/// CBMC expects two's complement for negative numbers.
834-
/// https://github.com/diffblue/cbmc/blob/develop/src/util/arith_tools.cpp#L401..L424
834+
/// <https://github.com/diffblue/cbmc/blob/develop/src/util/arith_tools.cpp#L401..L424>
835835
/// The bignum crate instead does sign/magnitude when making hex.
836836
/// So for negatives, do the two's complement ourselves.
837837
pub fn bitpattern_from_int<T>(i: T, width: u64, _signed: bool) -> IrepId

cprover_bindings/src/irep/symbol.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
use super::Irep;
44
use crate::InternedString;
55
/// A direct implementation of the CBMC serilization format for symbols implemented in
6-
/// https://github.com/diffblue/cbmc/blob/develop/src/util/symbol.h
6+
/// <https://github.com/diffblue/cbmc/blob/develop/src/util/symbol.h>
77
// TODO: do we want these members to be public?
88
#[derive(Clone, Debug, PartialEq)]
99
pub struct Symbol {
@@ -19,7 +19,7 @@ pub struct Symbol {
1919
/// Almost always the same as base_name, but with name mangling can be relevant
2020
pub pretty_name: InternedString,
2121
/// Currently set to C. Consider creating a "rust" mode and using it in cbmc
22-
/// https://github.com/model-checking/kani/issues/1
22+
/// <https://github.com/model-checking/kani/issues/1>
2323
pub mode: InternedString,
2424

2525
// global properties

cprover_bindings/src/irep/symbol_table.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use crate::InternedString;
55
use std::collections::BTreeMap;
66

77
/// A direct implementation of the CBMC serilization format for symbol tables implemented in
8-
/// https://github.com/diffblue/cbmc/blob/develop/src/util/symbol_table.h
8+
/// <https://github.com/diffblue/cbmc/blob/develop/src/util/symbol_table.h>
99
#[derive(Debug, PartialEq)]
1010
pub struct SymbolTable {
1111
pub symbol_table: BTreeMap<InternedString, Symbol>,

cprover_bindings/src/lib.rs

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,28 @@
66
//! in CBMC's documentation. All these representations precisely replicate ones in CBMC.
77
//!
88
//! In short, CBMC's AST has three levels:
9-
//! 1. [SymbolTable] is the top level symbol table.
10-
//! 2. [Symbol] is a symbol in the symbol table.
11-
//! 3. [Irep] represents all trees (code, expression, metadata, etc).
9+
//! 1. [irep::SymbolTable] is the top level symbol table.
10+
//! 2. [irep::Symbol] is a symbol in the symbol table.
11+
//! 3. [irep::Irep] represents all trees (code, expression, metadata, etc).
1212
//!
13-
//! Each tree represented by [Irep] has three nodes:
14-
//! 1. [id] for identity,
15-
//! 2. [sub] for a (potentially empty) list of unnamed subtrees as [Irep],
16-
//! 3. [named_sub] for a (potentially empty) map of named subtrees as [Irep].
13+
//! Each tree represented by [irep::Irep] has three nodes:
14+
//! 1. [irep::Irep::id] for identity,
15+
//! 2. [irep::Irep::sub] for a (potentially empty) list of unnamed subtrees as [irep::Irep],
16+
//! 3. [irep::Irep::named_sub] for a (potentially empty) map of named subtrees as [irep::Irep].
1717
//!
18-
//! The function of a tree is usually (but not always) recognized by its [id], and thus the aggregation
19-
//! of all recognized [id]s are represented by [IrepId]. [sub] usually contains operands and [named_sub]
20-
//! usually contains other flags or metadata. For example, for a binary operation [a + b], the [id] of
21-
//! this tree is ["plus"] denoting the tree being a plus operation. [sub] contains two [Irep]s
22-
//! representing [a] and [b] respectively. [named_sub] contains other information include the type of
23-
//! the expression, location information, and so on.
18+
//! The function of a tree is usually (but not always) recognized by
19+
//! its [irep::Irep::id], and thus the aggregation of all recognized
20+
//! [irep::Irep::id]s are represented by [irep::IrepId]. [irep::Irep::sub] usually
21+
//! contains operands and [irep::Irep::named_sub] usually contains
22+
//! other flags or metadata. For example, for a binary operation [a +
23+
//! b], the [irep::Irep::id] of this tree is ["plus"] denoting the
24+
//! tree being a plus operation. [irep::Irep::sub] contains two [irep::Irep]s
25+
//! representing \[a\] and \[b\] respectively. [irep::Irep::named_sub]
26+
//! contains other information include the type of the expression,
27+
//! location information, and so on.
2428
//!
25-
//! Speical [id]s include:
26-
//! 1. [Empty] and [Nil] behaves like [null].
29+
//! Speical [irep::Irep::id]s include:
30+
//! 1. [irep::IrepId::Empty] and [irep::IrepId::Nil] behaves like \[null\].
2731
2832
mod env;
2933
pub mod goto_program;

0 commit comments

Comments
 (0)