Skip to content

Commit a774f4e

Browse files
authored
Merge pull request #574 from asomers/unexpected_cfgs
Fix unexpected_cfgs lints with the latest rustc
2 parents 06b7bd9 + a806b0c commit a774f4e

File tree

4 files changed

+11
-2
lines changed

4 files changed

+11
-2
lines changed

mockall/tests/automock_attrs.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// vim: tw=80
22
//! Attributes are applied to the mock object, too.
33
#![deny(warnings)]
4+
#![allow(unexpected_cfgs)] // multics is deliberately always false
45

56
use mockall::*;
67

mockall/tests/cfg_attr_concretize.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
// vim: tw=80
22
//! #[concretize] can be used inside of #[cfg_attr()]`
33
#![deny(warnings)]
4+
#![allow(unexpected_cfgs)] // multics is deliberately always false
45

56
use std::path::{Path, PathBuf};
67

78
use mockall::{automock, concretize};
89

910
#[automock]
1011
trait Foo {
11-
#[cfg_attr(not(target_os = "ia64-unknown-multics"), concretize)]
12+
#[cfg_attr(not(target_os = "multics"), concretize)]
1213
fn foo<P: AsRef<Path>>(&self, p: P);
1314
}
1415

mockall/tests/mock_refmut_arguments.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,6 @@ fn static_mut() {
4747
.withf(|x| *x == 5)
4848
.returning(|x| { *x = 42;} );
4949
// Safe because mock leaves scope before x
50-
unsafe { mock.bar(mem::transmute::<&mut u32, &mut u32>(&mut x)); }
50+
unsafe { mock.bar(mem::transmute::<&mut u32, &'static mut u32>(&mut x)); }
5151
assert_eq!(x, 42);
5252
}

mockall_derive/build.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
fn main() {
2+
// Avoid unnecessary re-building.
3+
println!("cargo:rerun-if-changed=build.rs");
4+
5+
// Quiet rustc's helpful lint. reprocheck is defined in CI.
6+
println!("cargo::rustc-check-cfg=cfg(reprocheck)");
7+
}

0 commit comments

Comments
 (0)