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#77039 - ecstatic-morse:rollup-qv3jj4a, r=ecst…
…atic-morse Rollup of 13 pull requests Successful merges: - rust-lang#72734 (Reduce duplicate in liballoc reserve error handling) - rust-lang#76131 (Don't use `zip` to compare iterators during pretty-print hack) - rust-lang#76150 (Don't recommend ManuallyDrop to customize drop order) - rust-lang#76275 (Implementation of Write for some immutable ref structs) - rust-lang#76489 (Add explanation for E0756) - rust-lang#76581 (do not ICE on bound variables, return `TooGeneric` instead) - rust-lang#76655 (Make some methods of `Pin` unstable const) - rust-lang#76783 (Only get ImplKind::Impl once) - rust-lang#76807 (Use const-checking to forbid use of unstable features in const-stable functions) - rust-lang#76888 (use if let instead of single match arm expressions) - rust-lang#76914 (extend `Ty` and `TyCtxt` lints to self types) - rust-lang#77022 (Reduce boilerplate for BytePos and CharPos) - rust-lang#77032 (lint missing docs for extern items) Failed merges: r? `@ghost`
- Loading branch information
Showing
49 changed files
with
762 additions
and
322 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,29 @@ | ||
The `ffi_const` attribute was used on something other than a foreign function | ||
declaration. | ||
|
||
Erroneous code example: | ||
|
||
```compile_fail,E0756 | ||
#![feature(ffi_const)] | ||
#[ffi_const] // error! | ||
pub fn foo() {} | ||
# fn main() {} | ||
``` | ||
|
||
The `ffi_const` attribute can only be used on foreign function declarations | ||
which have no side effects except for their return value: | ||
|
||
``` | ||
#![feature(ffi_const)] | ||
extern "C" { | ||
#[ffi_const] // ok! | ||
pub fn strlen(s: *const i8) -> i32; | ||
} | ||
# fn main() {} | ||
``` | ||
|
||
You can get more information about it in the [unstable Rust Book]. | ||
|
||
[unstable Rust Book]: https://doc.rust-lang.org/nightly/unstable-book/language-features/ffi-const.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
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.