-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
implement constant power-of-two check
- Loading branch information
1 parent
7925252
commit 64803e6
Showing
4 changed files
with
34 additions
and
7 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
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
extern crate ringbuffer; | ||
|
||
use ringbuffer::ConstGenericRingBuffer; | ||
|
||
fn main() { | ||
let _ = ConstGenericRingBuffer::<i32, 0>::new(); | ||
//~^ note: the above error was encountered while instantiating `fn ringbuffer::ConstGenericRingBuffer::<i32, 0>::new` | ||
// ringbuffer can't be zero length | ||
} |
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
extern crate compiletest_rs as compiletest; | ||
|
||
use std::path::PathBuf; | ||
|
||
fn run_mode(mode: &'static str) { | ||
let mut config = compiletest::Config::default(); | ||
|
||
config.mode = mode.parse().expect("Invalid mode"); | ||
config.src_base = PathBuf::from(format!("tests/{}", mode)); | ||
config.link_deps(); // Populate config.target_rustcflags with dependencies on the path | ||
config.clean_rmeta(); // If your tests import the parent crate, this helps with E0464 | ||
|
||
compiletest::run_tests(&config); | ||
} | ||
|
||
#[test] | ||
fn compile_test() { | ||
run_mode("compile-fail"); | ||
} |