-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
57 additions
and
134 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
5 changes: 1 addition & 4 deletions
5
tests/ui/abi/cross-crate/auxiliary/anon-extern-mod-cross-crate-1.rs
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 |
---|---|---|
@@ -1,9 +1,6 @@ | ||
#![crate_name = "anonexternmod"] | ||
#![feature(rustc_private)] | ||
|
||
extern crate libc; | ||
|
||
#[link(name = "rust_test_helpers", kind = "static")] | ||
extern "C" { | ||
pub fn rust_get_test_int() -> libc::intptr_t; | ||
pub fn rust_get_test_int() -> isize; | ||
} |
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 |
---|---|---|
@@ -1,28 +1,23 @@ | ||
#![crate_name = "externcallback"] | ||
#![crate_type = "lib"] | ||
#![feature(rustc_private)] | ||
|
||
extern crate libc; | ||
|
||
pub mod rustrt { | ||
extern crate libc; | ||
|
||
#[link(name = "rust_test_helpers", kind = "static")] | ||
extern "C" { | ||
pub fn rust_dbg_call( | ||
cb: extern "C" fn(libc::uintptr_t) -> libc::uintptr_t, | ||
data: libc::uintptr_t, | ||
) -> libc::uintptr_t; | ||
cb: extern "C" fn(usize) -> usize, | ||
data: usize, | ||
) -> usize; | ||
} | ||
} | ||
|
||
pub fn fact(n: libc::uintptr_t) -> libc::uintptr_t { | ||
pub fn fact(n: usize) -> usize { | ||
unsafe { | ||
println!("n = {}", n); | ||
println!("n = {:?}", n); | ||
rustrt::rust_dbg_call(cb, n) | ||
} | ||
} | ||
|
||
pub extern "C" fn cb(data: libc::uintptr_t) -> libc::uintptr_t { | ||
pub extern "C" fn cb(data: usize) -> usize { | ||
if data == 1 { data } else { fact(data - 1) * data } | ||
} |
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
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.