mirror of
https://gitee.com/openharmony/third_party_rust_cfg-if
synced 2024-11-27 01:03:13 +00:00
Add a test for the body of an impl
This commit is contained in:
parent
33a8869d16
commit
a625fbe0ac
21
src/lib.rs
21
src/lib.rs
@ -152,4 +152,25 @@ mod tests {
|
||||
assert_eq!(10, 5+5);
|
||||
}}
|
||||
}
|
||||
|
||||
trait Trait {
|
||||
fn blah(&self);
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
struct Struct;
|
||||
|
||||
impl Trait for Struct {
|
||||
cfg_if! {
|
||||
if #[cfg(feature = "blah")] {
|
||||
fn blah(&self) {
|
||||
unimplemented!();
|
||||
}
|
||||
} else {
|
||||
fn blah(&self) {
|
||||
unimplemented!();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user