Fix box_default behaviour with empty vec![] coming from macro arg
This commit is contained in:
parent
7af811b6c4
commit
23d533264f
3 changed files with 33 additions and 5 deletions
|
|
@ -90,3 +90,17 @@ fn issue_10381() {
|
|||
|
||||
assert!(maybe_get_bar(2).is_some());
|
||||
}
|
||||
|
||||
#[allow(unused)]
|
||||
fn issue_11868() {
|
||||
fn foo(_: &mut Vec<usize>) {}
|
||||
|
||||
macro_rules! bar {
|
||||
($baz:expr) => {
|
||||
Box::leak(Box::new($baz))
|
||||
};
|
||||
}
|
||||
|
||||
foo(bar!(vec![]));
|
||||
foo(bar!(vec![1]));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -90,3 +90,17 @@ fn issue_10381() {
|
|||
|
||||
assert!(maybe_get_bar(2).is_some());
|
||||
}
|
||||
|
||||
#[allow(unused)]
|
||||
fn issue_11868() {
|
||||
fn foo(_: &mut Vec<usize>) {}
|
||||
|
||||
macro_rules! bar {
|
||||
($baz:expr) => {
|
||||
Box::leak(Box::new($baz))
|
||||
};
|
||||
}
|
||||
|
||||
foo(bar!(vec![]));
|
||||
foo(bar!(vec![1]));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue