Skip to content

Commit d22fb9a

Browse files
Fix builtin lints
1 parent 93ea92c commit d22fb9a

File tree

4 files changed

+9
-11
lines changed

4 files changed

+9
-11
lines changed

compiler/rustc_lint/src/builtin.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -998,10 +998,8 @@ declare_lint! {
998998
/// ### Example
999999
///
10001000
/// ```rust
1001-
/// #[no_mangle]
1002-
/// fn foo<T>(t: T) {
1003-
///
1004-
/// }
1001+
/// #[unsafe(no_mangle)]
1002+
/// fn foo<T>(t: T) {}
10051003
/// ```
10061004
///
10071005
/// {{produces}}

compiler/rustc_lint/src/foreign_modules.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@ declare_lint! {
3535
///
3636
/// ```rust
3737
/// mod m {
38-
/// extern "C" {
38+
/// unsafe extern "C" {
3939
/// fn foo();
4040
/// }
4141
/// }
4242
///
43-
/// extern "C" {
43+
/// unsafe extern "C" {
4444
/// fn foo(_: u32);
4545
/// }
4646
/// ```

compiler/rustc_lint/src/types.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,7 @@ declare_lint! {
527527
/// ### Example
528528
///
529529
/// ```rust
530-
/// extern "C" {
530+
/// unsafe extern "C" {
531531
/// static STATIC: String;
532532
/// }
533533
/// ```

compiler/rustc_lint_defs/src/builtin.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -2829,7 +2829,7 @@ declare_lint! {
28292829
///
28302830
/// ```rust
28312831
/// enum Void {}
2832-
/// extern {
2832+
/// unsafe extern {
28332833
/// static EXTERN: Void;
28342834
/// }
28352835
/// ```
@@ -4095,7 +4095,7 @@ declare_lint! {
40954095
/// ```rust
40964096
/// #![warn(ffi_unwind_calls)]
40974097
///
4098-
/// extern "C-unwind" {
4098+
/// unsafe extern "C-unwind" {
40994099
/// fn foo();
41004100
/// }
41014101
///
@@ -4836,7 +4836,7 @@ declare_lint! {
48364836
///
48374837
/// ### Example
48384838
///
4839-
/// ```rust
4839+
/// ```rust,edition2021
48404840
/// #![warn(missing_unsafe_on_extern)]
48414841
/// #![allow(dead_code)]
48424842
///
@@ -4873,7 +4873,7 @@ declare_lint! {
48734873
///
48744874
/// ### Example
48754875
///
4876-
/// ```rust
4876+
/// ```rust,edition2021
48774877
/// #![warn(unsafe_attr_outside_unsafe)]
48784878
///
48794879
/// #[no_mangle]

0 commit comments

Comments
 (0)