Skip to content

Commit f0f275d

Browse files
committed
---
yaml --- r: 95376 b: refs/heads/dist-snap c: 16fc6a6 h: refs/heads/master v: v3
1 parent 474f6f5 commit f0f275d

36 files changed

+362
-436
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: c274a6888410ce3e357e014568b43310ed787d36
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9-
refs/heads/dist-snap: b571039021e031888cea4e0b53d8f9b4e81c6d31
9+
refs/heads/dist-snap: 16fc6a694cac35ce962e98e180354cbce6a72f54
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1212
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/doc/tutorial-ffi.md

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -415,21 +415,18 @@ fn main() {
415415

416416
Most foreign code exposes a C ABI, and Rust uses the platform's C calling convention by default when
417417
calling foreign functions. Some foreign functions, most notably the Windows API, use other calling
418-
conventions. Rust provides the `abi` attribute as a way to hint to the compiler which calling
419-
convention to use:
418+
conventions. Rust provides a way to tell the compiler which convention to use:
420419

421420
~~~~
422421
#[cfg(target_os = "win32")]
423-
#[abi = "stdcall"]
424422
#[link_name = "kernel32"]
425-
extern {
423+
extern "stdcall" {
426424
fn SetEnvironmentVariableA(n: *u8, v: *u8) -> int;
427425
}
428426
~~~~
429427

430-
The `abi` attribute applies to a foreign module (it cannot be applied to a single function within a
431-
module), and must be either `"cdecl"` or `"stdcall"`. The compiler may eventually support other
432-
calling conventions.
428+
This applies to the entire `extern` block, and must be either `"cdecl"` or
429+
`"stdcall"`. The compiler may eventually support other calling conventions.
433430

434431
# Interoperability with foreign code
435432

branches/dist-snap/src/libextra/time.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ static NSEC_PER_SEC: i32 = 1_000_000_000_i32;
1919
pub mod rustrt {
2020
use super::Tm;
2121

22-
#[abi = "cdecl"]
23-
extern {
22+
extern "cdecl" {
2423
pub fn get_time(sec: &mut i64, nsec: &mut i32);
2524
pub fn precise_time_ns(ns: &mut u64);
2625
pub fn rust_tzset();

branches/dist-snap/src/libextra/unicode.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,7 @@ pub mod icu {
162162

163163
// #[link_name = "icuuc"]
164164
#[link_args = "-licuuc"]
165-
#[abi = "cdecl"]
166-
extern {
165+
extern "cdecl" {
167166
pub fn u_hasBinaryProperty(c: UChar32, which: UProperty) -> UBool;
168167
pub fn u_isdigit(c: UChar32) -> UBool;
169168
pub fn u_islower(c: UChar32) -> UBool;

branches/dist-snap/src/librustc/lib/llvm.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,8 +300,7 @@ pub mod llvm {
300300

301301
#[link_args = "-Lrustllvm -lrustllvm"]
302302
#[link_name = "rustllvm"]
303-
#[abi = "cdecl"]
304-
extern {
303+
extern "cdecl" {
305304
/* Create and destroy contexts. */
306305
pub fn LLVMContextCreate() -> ContextRef;
307306
pub fn LLVMContextDispose(C: ContextRef);

branches/dist-snap/src/libstd/io.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,8 @@ pub type fd_t = c_int;
7676
pub mod rustrt {
7777
use libc;
7878

79-
#[abi = "cdecl"]
8079
#[link_name = "rustrt"]
81-
extern {
80+
extern "cdecl" {
8281
pub fn rust_get_stdin() -> *libc::FILE;
8382
pub fn rust_get_stdout() -> *libc::FILE;
8483
pub fn rust_get_stderr() -> *libc::FILE;

0 commit comments

Comments
 (0)