forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of rust-lang#77013 - RalfJung:rollup-84ut0xq, r=RalfJung
Rollup of 10 pull requests Successful merges: - rust-lang#76439 (Add error explanation for E0755) - rust-lang#76521 (Fix segfault if pthread_getattr_np fails) - rust-lang#76835 (make replace_prefix only take &str as arguments ) - rust-lang#76967 (Revert adding Atomic::from_mut.) - rust-lang#76977 (Add a regression test for copy propagation miscompilation) - rust-lang#76981 (liballoc bench use imported path Bencher) - rust-lang#76983 (BTreeMap: extra testing & fixed comments) - rust-lang#76996 (Fix typo in rustc_lexer docs) - rust-lang#77009 (Dogfood total_cmp in the test crate) - rust-lang#77012 (update Miri for another bugfix) Failed merges: - rust-lang#76489 (Add explanation for E0756) r? `@ghost`
- Loading branch information
Showing
14 changed files
with
120 additions
and
148 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
The `ffi_pure` attribute was used on a non-foreign function. | ||
|
||
Erroneous code example: | ||
|
||
```compile_fail,E0755 | ||
#![feature(ffi_pure)] | ||
#[ffi_pure] // error! | ||
pub fn foo() {} | ||
# fn main() {} | ||
``` | ||
|
||
The `ffi_pure` attribute can only be used on foreign functions which do not have | ||
side effects or infinite loops: | ||
|
||
``` | ||
#![feature(ffi_pure)] | ||
extern "C" { | ||
#[ffi_pure] // ok! | ||
pub fn strlen(s: *const i8) -> isize; | ||
} | ||
# fn main() {} | ||
``` | ||
|
||
You can find more information about it in the [unstable Rust Book]. | ||
|
||
[unstable Rust Book]: https://doc.rust-lang.org/unstable-book/language-features/ffi-pure.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.