Skip to content
Prev Previous commit
Next Next commit
Add new tests.
  • Loading branch information
gnzlbg authored and crlf0710 committed Jul 20, 2019
commit 91f0d58058bc24ef880d9a0e4c7f479592dd69fb
4 changes: 4 additions & 0 deletions src/test/ui/feature-gates/feature-gate-rustc_private-libc.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
fn main() {
extern crate libc; //~ ERROR use of unstable
use libc::*; //~ ERROR unresolved import
}
18 changes: 18 additions & 0 deletions src/test/ui/feature-gates/feature-gate-rustc_private-libc.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
error[E0432]: unresolved import `libc`
--> $DIR/feature-gate-rustc_private-libc.rs:3:9
|
LL | use libc::*;
| ^^^^ maybe a missing `extern crate libc;`?

error[E0658]: use of unstable library feature 'rustc_private': crate "libc" is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via `Cargo.toml` instead? (see issue #27812)
--> $DIR/feature-gate-rustc_private-libc.rs:2:5
|
LL | extern crate libc;
| ^^^^^^^^^^^^^^^^^^
|
= help: add #![feature(rustc_private)] to the crate attributes to enable

error: aborting due to 2 previous errors

Some errors occurred: E0432, E0658.
For more information about an error, try `rustc --explain E0432`.
4 changes: 4 additions & 0 deletions src/test/ui/feature-gates/feature-gate-test.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
fn main() {
extern crate test; //~ ERROR use of unstable
use test::*; //~ ERROR unresolved import
}
18 changes: 18 additions & 0 deletions src/test/ui/feature-gates/feature-gate-test.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
error[E0432]: unresolved import `test`
--> $DIR/feature-gate-test.rs:3:9
|
LL | use test::*;
| ^^^^ maybe a missing `extern crate test;`?

error[E0658]: use of unstable library feature 'test' (see issue #27812)
--> $DIR/feature-gate-test.rs:2:5
|
LL | extern crate test;
| ^^^^^^^^^^^^^^^^^^
|
= help: add #![feature(test)] to the crate attributes to enable

error: aborting due to 2 previous errors

Some errors occurred: E0432, E0658.
For more information about an error, try `rustc --explain E0432`.
2 changes: 1 addition & 1 deletion src/test/ui/issues/issue-37887.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ error[E0432]: unresolved import `libc`
LL | use libc::*;
| ^^^^ maybe a missing `extern crate libc;`?

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 'rustc_private': crate "libc" is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via `Cargo.toml` instead? (see issue #27812)
--> $DIR/issue-37887.rs:2:5
|
LL | extern crate libc;
Expand Down