Skip to content

Commit 7358eda

Browse files
Merge #63
63: Fix unescaped "[]"s in doc comment r=Disasm a=longfangsong When running `cargo doc` on this crate and crates depends on this crate, cargo will always raise `unresolved link` warnings for those `[h]` and `[x]`, which is annoying. This pr escaped the `[` and `]` in these code to silence these warning. Co-authored-by: longfangsong <longfangsong@icloud.com>
2 parents 197386e + c5c5621 commit 7358eda

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/register/mcounteren.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,25 @@ pub struct Mcounteren {
99
}
1010

1111
impl Mcounteren {
12-
/// Supervisor "cycle[h]" Enable
12+
/// Supervisor "cycle\[h\]" Enable
1313
#[inline]
1414
pub fn cy(&self) -> bool {
1515
self.bits.get_bit(0)
1616
}
1717

18-
/// Supervisor "time[h]" Enable
18+
/// Supervisor "time\[h\]" Enable
1919
#[inline]
2020
pub fn tm(&self) -> bool {
2121
self.bits.get_bit(1)
2222
}
2323

24-
/// Supervisor "instret[h]" Enable
24+
/// Supervisor "instret\[h\]" Enable
2525
#[inline]
2626
pub fn ir(&self) -> bool {
2727
self.bits.get_bit(2)
2828
}
2929

30-
/// Supervisor "hpm[x]" Enable (bits 3-31)
30+
/// Supervisor "hpm\[x\]" Enable (bits 3-31)
3131
#[inline]
3232
pub fn hpm(&self, index: usize) -> bool {
3333
assert!(3 <= index && index < 32);

src/register/scounteren.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,25 @@ pub struct Scounteren {
99
}
1010

1111
impl Scounteren {
12-
/// User "cycle[h]" Enable
12+
/// User "cycle\[h\]" Enable
1313
#[inline]
1414
pub fn cy(&self) -> bool {
1515
self.bits.get_bit(0)
1616
}
1717

18-
/// User "time[h]" Enable
18+
/// User "time\[h\]" Enable
1919
#[inline]
2020
pub fn tm(&self) -> bool {
2121
self.bits.get_bit(1)
2222
}
2323

24-
/// User "instret[h]" Enable
24+
/// User "instret\[h]\" Enable
2525
#[inline]
2626
pub fn ir(&self) -> bool {
2727
self.bits.get_bit(2)
2828
}
2929

30-
/// User "hpm[x]" Enable (bits 3-31)
30+
/// User "hpm\[x\]" Enable (bits 3-31)
3131
#[inline]
3232
pub fn hpm(&self, index: usize) -> bool {
3333
assert!(3 <= index && index < 32);

0 commit comments

Comments
 (0)