Skip to content

Commit e4a7a5f

Browse files
committed
Fix CI
1 parent ea55d6d commit e4a7a5f

4 files changed

Lines changed: 16 additions & 15 deletions

File tree

macro/src/lib.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,9 @@ pub fn bounded_integer(input: proc_macro::TokenStream) -> proc_macro::TokenStrea
8686
continue;
8787
}
8888
}
89-
new_attrs.extend(quote!(# #attr));
89+
// Just using `quote!` sometimes triggers a false positive in the `clippy::doc_markdown`
90+
// lint when `#[cfg_attr(cond, doc = "SomeCode")]` is used inside a code block.
91+
new_attrs.extend(quote_spanned!(group.span()=> # #attr));
9092
}
9193
attrs = new_attrs;
9294

src/examples.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ bounded_integer! {
3535
bounded_integer! {
3636
/// A bounded enum with named variants.
3737
///
38+
/// This was generated from:
3839
/// ```
3940
#[cfg_attr(feature = "step_trait", doc = "# #![feature(step_trait)]")]
4041
/// # use bounded_integer::bounded_integer;

src/prim_int.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#![expect(clippy::must_use_candidate)]
2-
31
use core::fmt::{self, Display, Formatter};
42
use core::num::NonZero;
53

ui/not_zeroable.stderr

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
error[E0080]: evaluation panicked: used `zero` on a type whose range does not include zero
22
--> ui/not_zeroable.rs:4:1
33
|
4-
4 | / bounded_integer::unsafe_api! {
5-
5 | | for A,
6-
6 | | unsafe repr: u8,
7-
7 | | min: 1,
8-
8 | | max: 1,
9-
9 | | zero,
4+
4 | / bounded_integer::unsafe_api! {
5+
5 | | for A,
6+
6 | | unsafe repr: u8,
7+
7 | | min: 1,
8+
8 | | max: 1,
9+
9 | | zero,
1010
10 | | }
1111
| |_^ evaluation of `_::<impl std::default::Default for A>::default::{constant#0}` failed here
1212
|
@@ -15,12 +15,12 @@ error[E0080]: evaluation panicked: used `zero` on a type whose range does not in
1515
note: erroneous constant encountered
1616
--> ui/not_zeroable.rs:4:1
1717
|
18-
4 | / bounded_integer::unsafe_api! {
19-
5 | | for A,
20-
6 | | unsafe repr: u8,
21-
7 | | min: 1,
22-
8 | | max: 1,
23-
9 | | zero,
18+
4 | / bounded_integer::unsafe_api! {
19+
5 | | for A,
20+
6 | | unsafe repr: u8,
21+
7 | | min: 1,
22+
8 | | max: 1,
23+
9 | | zero,
2424
10 | | }
2525
| |_^
2626
|

0 commit comments

Comments
 (0)