Skip to content

Commit

Permalink
Add extern crate rustc_driver
Browse files Browse the repository at this point in the history
This fixes the build on nightly.
  • Loading branch information
tamird committed Apr 26, 2023
1 parent a7c6d01 commit 324bd7e
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
run: rustup component add rustc-dev

- name: Run tests
run: cargo +nightly build --features rustc
run: cargo +nightly test --features rustc

- name: Run test-project tests with `rustc` feature
run: cd test-project && cargo +nightly test --features rustc
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ To use `compiletest-rs` in your application, add the following to `Cargo.toml`

```toml
[dev-dependencies]
compiletest_rs = "0.9"
compiletest_rs = "0.10.0"
```

By default, `compiletest-rs` should be able to run on both stable, beta and
Expand All @@ -28,7 +28,7 @@ crate.

```toml
[dev-dependencies]
compiletest_rs = { version = "0.9", features = [ "rustc" ] }
compiletest_rs = { version = "0.10.0", features = [ "rustc" ] }
```

Create a `tests` folder in the root folder of your project. Create a test file
Expand Down
2 changes: 0 additions & 2 deletions src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ use std::fmt;
use std::fs::{read_dir, remove_file};
use std::str::FromStr;
use std::path::PathBuf;
#[cfg(feature = "rustc")]
use rustc_session;

use test::ColorConfig;
use runtest::dylib_env_var;
Expand Down
2 changes: 2 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
#![cfg_attr(feature = "rustc", feature(test))]
#![deny(unused_imports)]

#[cfg(feature = "rustc")]
extern crate rustc_driver;
#[cfg(feature = "rustc")]
extern crate rustc_session;

Expand Down
6 changes: 3 additions & 3 deletions test-project/tests/pretty/macro.pp
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
use ::std::prelude::rust_2015::*;
#[macro_use]
extern crate std;
// pretty-compare-only
// pretty-mode:expanded
// pp-exact:macro.pp
//@pretty-compare-only
//@pretty-mode:expanded
//@pp-exact:macro.pp

macro_rules! square { ($x : expr) => { $x * $x } ; }

Expand Down

0 comments on commit 324bd7e

Please sign in to comment.