diff options
| author | Ben Kimock <kimockb@gmail.com> | 2025-04-27 13:24:08 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-04-27 13:24:08 +0000 |
| commit | fe89e798fdb4902dac4624639fac464931d3f298 (patch) | |
| tree | e1b9e72d01a4b8ed745330d2eca42e5353e319bc | |
| parent | 55872a19f9aa0cc9b6e8978c30758e8739ae5a17 (diff) | |
| parent | 15c4e4092817ee38c8235f3189d2644e1ac511ee (diff) | |
| download | rust-fe89e798fdb4902dac4624639fac464931d3f298.tar.gz rust-fe89e798fdb4902dac4624639fac464931d3f298.zip | |
Merge pull request #4293 from primoly/unsafe-attributes
Mark unsafe attributes as such
| -rw-r--r-- | src/tools/miri/README.md | 2 | ||||
| -rw-r--r-- | src/tools/miri/src/bin/miri.rs | 4 | ||||
| -rw-r--r-- | src/tools/miri/tests/fail/no_main.stderr | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/src/tools/miri/README.md b/src/tools/miri/README.md index e8ea988558c..95e1770aa7b 100644 --- a/src/tools/miri/README.md +++ b/src/tools/miri/README.md @@ -489,7 +489,7 @@ Miri knows where it is supposed to start execution: ```rust #[cfg(miri)] -#[no_mangle] +#[unsafe(no_mangle)] fn miri_start(argc: isize, argv: *const *const u8) -> isize { // Call the actual start function that your project implements, based on your target's conventions. } diff --git a/src/tools/miri/src/bin/miri.rs b/src/tools/miri/src/bin/miri.rs index 4e8fe0ca8ad..8ff1c9d6ff0 100644 --- a/src/tools/miri/src/bin/miri.rs +++ b/src/tools/miri/src/bin/miri.rs @@ -106,7 +106,7 @@ fn entry_fn(tcx: TyCtxt<'_>) -> (DefId, MiriEntryFnType) { } else { tcx.dcx().fatal( "`miri_start` must have the following signature:\n\ - fn miri_start(argc: isize, argv: *const *const u8) -> isize", + fn miri_start(argc: isize, argv: *const *const u8) -> isize", ); } } else { @@ -115,7 +115,7 @@ fn entry_fn(tcx: TyCtxt<'_>) -> (DefId, MiriEntryFnType) { Alternatively, you can export a `miri_start` function:\n\ \n\ #[cfg(miri)]\n\ - #[no_mangle]\n\ + #[unsafe(no_mangle)]\n\ fn miri_start(argc: isize, argv: *const *const u8) -> isize {\ \n // Call the actual start function that your project implements, based on your target's conventions.\n\ }" diff --git a/src/tools/miri/tests/fail/no_main.stderr b/src/tools/miri/tests/fail/no_main.stderr index e9b9e5d65b1..e7f63be794f 100644 --- a/src/tools/miri/tests/fail/no_main.stderr +++ b/src/tools/miri/tests/fail/no_main.stderr @@ -2,7 +2,7 @@ error: Miri can only run programs that have a main function. Alternatively, you can export a `miri_start` function: #[cfg(miri)] - #[no_mangle] + #[unsafe(no_mangle)] fn miri_start(argc: isize, argv: *const *const u8) -> isize { // Call the actual start function that your project implements, based on your target's conventions. } |
