Skip to content

Commit

Permalink
Patch up foreign-fn-linkname.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
saethlin committed Apr 18, 2024
1 parent 7c274a3 commit 6f3550a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
10 changes: 2 additions & 8 deletions tests/ui/foreign/foreign-fn-linkname.rs
Original file line number Diff line number Diff line change
@@ -1,20 +1,14 @@
//@ run-pass
//@ ignore-sgx no libc

// Ensure no false positive on "unused extern crate" lint
#![deny(unused_extern_crates)]

#![feature(rustc_private)]

extern crate libc;
use std::ffi::CString;

mod mlibc {
use libc::{c_char, size_t};
use std::ffi::c_char;

extern "C" {
#[link_name = "strlen"]
pub fn my_strlen(str: *const c_char) -> size_t;
pub fn my_strlen(str: *const c_char) -> usize;
}
}

Expand Down
2 changes: 1 addition & 1 deletion tests/ui/foreign/foreign2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ mod zed {
#[cfg(not(windows))]
mod mlibc {
extern crate libc;
use libc::{c_int, c_void, size_t, ssize_t};
use self::libc::{c_int, c_void, size_t, ssize_t};

extern "C" {
pub fn write(fd: c_int, buf: *const c_void, count: size_t) -> ssize_t;
Expand Down

0 comments on commit 6f3550a

Please sign in to comment.