Skip to content

Commit 7f6873f

Browse files
Fix builtin lints
1 parent 76d341f commit 7f6873f

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
@@ -975,10 +975,8 @@ declare_lint! {
975975
/// ### Example
976976
///
977977
/// ```rust
978-
/// #[no_mangle]
979-
/// fn foo<T>(t: T) {
980-
///
981-
/// }
978+
/// #[unsafe(no_mangle)]
979+
/// fn foo<T>(t: T) {}
982980
/// ```
983981
///
984982
/// {{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
@@ -696,7 +696,7 @@ declare_lint! {
696696
/// ### Example
697697
///
698698
/// ```rust
699-
/// extern "C" {
699+
/// unsafe extern "C" {
700700
/// static STATIC: String;
701701
/// }
702702
/// ```

compiler/rustc_lint_defs/src/builtin.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -2780,7 +2780,7 @@ declare_lint! {
27802780
///
27812781
/// ```rust
27822782
/// enum Void {}
2783-
/// extern {
2783+
/// unsafe extern {
27842784
/// static EXTERN: Void;
27852785
/// }
27862786
/// ```
@@ -4011,7 +4011,7 @@ declare_lint! {
40114011
/// ```rust
40124012
/// #![warn(ffi_unwind_calls)]
40134013
///
4014-
/// extern "C-unwind" {
4014+
/// unsafe extern "C-unwind" {
40154015
/// fn foo();
40164016
/// }
40174017
///
@@ -4755,7 +4755,7 @@ declare_lint! {
47554755
///
47564756
/// ### Example
47574757
///
4758-
/// ```rust
4758+
/// ```rust,edition2021
47594759
/// #![warn(missing_unsafe_on_extern)]
47604760
/// #![allow(dead_code)]
47614761
///
@@ -4792,7 +4792,7 @@ declare_lint! {
47924792
///
47934793
/// ### Example
47944794
///
4795-
/// ```rust
4795+
/// ```rust,edition2021
47964796
/// #![warn(unsafe_attr_outside_unsafe)]
47974797
///
47984798
/// #[no_mangle]

0 commit comments

Comments
 (0)