Do not propose to simplify a not expression coming from a macro
This commit is contained in:
parent
6cebe58dfe
commit
b138bb587b
2 changed files with 42 additions and 12 deletions
|
|
@ -63,3 +63,32 @@ fn issue9428() {
|
|||
println!("foo");
|
||||
}
|
||||
}
|
||||
|
||||
fn issue_10523() {
|
||||
macro_rules! a {
|
||||
($v:expr) => {
|
||||
$v.is_some()
|
||||
};
|
||||
}
|
||||
let x: Option<u32> = None;
|
||||
if !a!(x) {}
|
||||
}
|
||||
|
||||
fn issue_10523_1() {
|
||||
macro_rules! a {
|
||||
($v:expr) => {
|
||||
!$v.is_some()
|
||||
};
|
||||
}
|
||||
let x: Option<u32> = None;
|
||||
if a!(x) {}
|
||||
}
|
||||
|
||||
fn issue_10523_2() {
|
||||
macro_rules! a {
|
||||
() => {
|
||||
!None::<u32>.is_some()
|
||||
};
|
||||
}
|
||||
if a!() {}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue