mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 06:44:35 +00:00
Handle a few more simple tests
This commit is contained in:
parent
e0632d7cec
commit
18b0a07d49
@ -1,8 +1,8 @@
|
||||
#![feature(rustc_private)]
|
||||
#![feature(test)]
|
||||
|
||||
extern crate alloc;
|
||||
|
||||
extern crate libc as alloc;
|
||||
extern crate test as alloc;
|
||||
//~^ ERROR E0259
|
||||
|
||||
fn main() {}
|
||||
|
@ -4,13 +4,13 @@ error[E0259]: the name `alloc` is defined multiple times
|
||||
LL | extern crate alloc;
|
||||
| ------------------- previous import of the extern crate `alloc` here
|
||||
LL |
|
||||
LL | extern crate libc as alloc;
|
||||
LL | extern crate test as alloc;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ `alloc` reimported here
|
||||
|
|
||||
= note: `alloc` must be defined only once in the type namespace of this module
|
||||
help: you can use `as` to change the binding name of the import
|
||||
|
|
||||
LL | extern crate libc as other_alloc;
|
||||
LL | extern crate test as other_alloc;
|
||||
|
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
|
@ -1,4 +1,4 @@
|
||||
fn main() {
|
||||
extern crate libc; //~ ERROR use of unstable
|
||||
use libc::*; //~ ERROR unresolved import
|
||||
extern crate test; //~ ERROR use of unstable
|
||||
use test::*; //~ ERROR unresolved import
|
||||
}
|
||||
|
@ -1,19 +1,19 @@
|
||||
error[E0432]: unresolved import `libc`
|
||||
error[E0432]: unresolved import `test`
|
||||
--> $DIR/issue-37887.rs:3:9
|
||||
|
|
||||
LL | use libc::*;
|
||||
| ^^^^ maybe a missing crate `libc`?
|
||||
LL | use test::*;
|
||||
| ^^^^ maybe a missing crate `test`?
|
||||
|
|
||||
= help: consider adding `extern crate libc` to use the `libc` crate
|
||||
= help: consider adding `extern crate test` to use the `test` crate
|
||||
|
||||
error[E0658]: use of unstable library feature 'rustc_private': this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via `Cargo.toml` instead?
|
||||
error[E0658]: use of unstable library feature 'test'
|
||||
--> $DIR/issue-37887.rs:2:5
|
||||
|
|
||||
LL | extern crate libc;
|
||||
LL | extern crate test;
|
||||
| ^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: see issue #27812 <https://github.com/rust-lang/rust/issues/27812> for more information
|
||||
= help: add `#![feature(rustc_private)]` to the crate attributes to enable
|
||||
= note: see issue #50297 <https://github.com/rust-lang/rust/issues/50297> for more information
|
||||
= help: add `#![feature(test)]` to the crate attributes to enable
|
||||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
@ -1,12 +1,12 @@
|
||||
//@ edition:2018
|
||||
|
||||
#![deny(unused_extern_crates)]
|
||||
#![feature(test, rustc_private)]
|
||||
#![feature(test)]
|
||||
|
||||
extern crate libc;
|
||||
extern crate core;
|
||||
//~^ ERROR unused extern crate
|
||||
//~| HELP remove
|
||||
extern crate libc as x;
|
||||
extern crate core as x;
|
||||
//~^ ERROR unused extern crate
|
||||
//~| HELP remove
|
||||
|
||||
@ -28,11 +28,11 @@ mod foo {
|
||||
|
||||
pub(super) extern crate alloc as d;
|
||||
|
||||
extern crate libc;
|
||||
extern crate core;
|
||||
//~^ ERROR unused extern crate
|
||||
//~| HELP remove
|
||||
|
||||
extern crate libc as x;
|
||||
extern crate core as x;
|
||||
//~^ ERROR unused extern crate
|
||||
//~| HELP remove
|
||||
|
||||
@ -41,11 +41,11 @@ mod foo {
|
||||
pub extern crate test as y;
|
||||
|
||||
mod bar {
|
||||
extern crate libc;
|
||||
extern crate core;
|
||||
//~^ ERROR unused extern crate
|
||||
//~| HELP remove
|
||||
|
||||
extern crate libc as x;
|
||||
extern crate core as x;
|
||||
//~^ ERROR unused extern crate
|
||||
//~| HELP remove
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
error: unused extern crate
|
||||
--> $DIR/unnecessary-extern-crate.rs:6:1
|
||||
|
|
||||
LL | extern crate libc;
|
||||
LL | extern crate core;
|
||||
| ^^^^^^^^^^^^^^^^^^ help: remove it
|
||||
|
|
||||
note: the lint level is defined here
|
||||
@ -13,31 +13,31 @@ LL | #![deny(unused_extern_crates)]
|
||||
error: unused extern crate
|
||||
--> $DIR/unnecessary-extern-crate.rs:9:1
|
||||
|
|
||||
LL | extern crate libc as x;
|
||||
LL | extern crate core as x;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^ help: remove it
|
||||
|
||||
error: unused extern crate
|
||||
--> $DIR/unnecessary-extern-crate.rs:31:5
|
||||
|
|
||||
LL | extern crate libc;
|
||||
LL | extern crate core;
|
||||
| ^^^^^^^^^^^^^^^^^^ help: remove it
|
||||
|
||||
error: unused extern crate
|
||||
--> $DIR/unnecessary-extern-crate.rs:35:5
|
||||
|
|
||||
LL | extern crate libc as x;
|
||||
LL | extern crate core as x;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^ help: remove it
|
||||
|
||||
error: unused extern crate
|
||||
--> $DIR/unnecessary-extern-crate.rs:44:9
|
||||
|
|
||||
LL | extern crate libc;
|
||||
LL | extern crate core;
|
||||
| ^^^^^^^^^^^^^^^^^^ help: remove it
|
||||
|
||||
error: unused extern crate
|
||||
--> $DIR/unnecessary-extern-crate.rs:48:9
|
||||
|
|
||||
LL | extern crate libc as x;
|
||||
LL | extern crate core as x;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^ help: remove it
|
||||
|
||||
error: aborting due to 6 previous errors
|
||||
|
@ -1,5 +1,6 @@
|
||||
// Test that `download-rustc` doesn't put duplicate copies of libc in the sysroot.
|
||||
//@ check-pass
|
||||
//@ ignore-windows doesn't necessarily have the libc crate
|
||||
#![crate_type = "lib"]
|
||||
#![no_std]
|
||||
#![feature(rustc_private)]
|
||||
|
@ -5,11 +5,13 @@
|
||||
|
||||
#![feature(rustc_private)]
|
||||
|
||||
#[cfg(unix)]
|
||||
extern crate libc;
|
||||
|
||||
use std::process::{Command, Stdio};
|
||||
use std::env;
|
||||
use std::ffi::c_int;
|
||||
use std::io::{self, Read, Write};
|
||||
use std::process::{Command, Stdio};
|
||||
|
||||
#[cfg(unix)]
|
||||
unsafe fn without_stdio<R, F: FnOnce() -> R>(f: F) -> R {
|
||||
@ -36,14 +38,14 @@ unsafe fn without_stdio<R, F: FnOnce() -> R>(f: F) -> R {
|
||||
}
|
||||
|
||||
#[cfg(unix)]
|
||||
fn assert_fd_is_valid(fd: libc::c_int) {
|
||||
fn assert_fd_is_valid(fd: c_int) {
|
||||
if unsafe { libc::fcntl(fd, libc::F_GETFD) == -1 } {
|
||||
panic!("file descriptor {} is not valid: {}", fd, io::Error::last_os_error());
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(windows)]
|
||||
fn assert_fd_is_valid(_fd: libc::c_int) {}
|
||||
fn assert_fd_is_valid(_fd: c_int) {}
|
||||
|
||||
#[cfg(windows)]
|
||||
unsafe fn without_stdio<R, F: FnOnce() -> R>(f: F) -> R {
|
||||
|
@ -7,8 +7,6 @@
|
||||
|
||||
#![feature(rustc_private)]
|
||||
|
||||
extern crate libc;
|
||||
|
||||
use std::process::Command;
|
||||
|
||||
// The output from "ps -A -o pid,ppid,args" should look like this:
|
||||
@ -28,6 +26,7 @@ use std::process::Command;
|
||||
|
||||
#[cfg(unix)]
|
||||
fn find_zombies() {
|
||||
extern crate libc;
|
||||
let my_pid = unsafe { libc::getpid() };
|
||||
|
||||
// https://pubs.opengroup.org/onlinepubs/9699919799/utilities/ps.html
|
||||
|
Loading…
Reference in New Issue
Block a user