-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add error explanation for E0755 #76439
Add error explanation for E0755 #76439
Conversation
extern "C" { | ||
#[ffi_pure] // ok! | ||
pub fn strlen(s: *const i8) -> isize; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this also work right? Or maybe a better example of this.
#[ffi_pure]
extern "C" pub fn foo() {}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's better to have a bigger contrast. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I was just suggesting to show both methods so the readers know. Personally I know the second more.
effects except for their return value. You can find more information about it in | ||
the [unstable Rust Book]. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
effects except for their return value. You can find more information about it in | |
the [unstable Rust Book]. | |
side effects or infinite loops. You can find more information about it in the | |
[unstable Rust Book]. |
Returning value is probably not counted as side effects.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I quoted the book.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I took from the book too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then perfect. :)
3451bd8
to
69ffed7
Compare
Updated! |
@bors: r=pickfire,jyn514 rollup |
📌 Commit 69ffed7 has been approved by |
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`
r? @pickfire