Skip to content

Commit 00e426a

Browse files
Fix builtin lints
1 parent e1aeb45 commit 00e426a

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
@@ -923,7 +923,7 @@ declare_lint! {
923923
/// ### Example
924924
///
925925
/// ```rust
926-
/// extern "C" {
926+
/// unsafe extern "C" {
927927
/// static STATIC: String;
928928
/// }
929929
/// ```

compiler/rustc_lint_defs/src/builtin.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -2881,7 +2881,7 @@ declare_lint! {
28812881
///
28822882
/// ```rust
28832883
/// enum Void {}
2884-
/// extern {
2884+
/// unsafe extern {
28852885
/// static EXTERN: Void;
28862886
/// }
28872887
/// ```
@@ -4147,7 +4147,7 @@ declare_lint! {
41474147
/// ```rust
41484148
/// #![warn(ffi_unwind_calls)]
41494149
///
4150-
/// extern "C-unwind" {
4150+
/// unsafe extern "C-unwind" {
41514151
/// fn foo();
41524152
/// }
41534153
///
@@ -4888,7 +4888,7 @@ declare_lint! {
48884888
///
48894889
/// ### Example
48904890
///
4891-
/// ```rust
4891+
/// ```rust,edition2021
48924892
/// #![warn(missing_unsafe_on_extern)]
48934893
/// #![allow(dead_code)]
48944894
///
@@ -4925,7 +4925,7 @@ declare_lint! {
49254925
///
49264926
/// ### Example
49274927
///
4928-
/// ```rust
4928+
/// ```rust,edition2021
49294929
/// #![warn(unsafe_attr_outside_unsafe)]
49304930
///
49314931
/// #[no_mangle]

0 commit comments

Comments
 (0)