Merge pull request #3142 from topecongiro/issue-3139
Do not remove path disambiugator inside macro
This commit is contained in:
commit
42780f0b39
3 changed files with 19 additions and 1 deletions
|
|
@ -229,7 +229,9 @@ fn rewrite_segment(
|
|||
.chain(data.bindings.iter().map(|x| SegmentParam::Binding(&*x)))
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
let separator = if path_context == PathContext::Expr {
|
||||
let force_separator =
|
||||
context.inside_macro() && context.snippet(data.span).starts_with("::");
|
||||
let separator = if path_context == PathContext::Expr || force_separator {
|
||||
"::"
|
||||
} else {
|
||||
""
|
||||
|
|
|
|||
|
|
@ -121,3 +121,11 @@ fn issue3117() {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
// #3139
|
||||
fn issue3139() {
|
||||
assert_eq!(
|
||||
to_json_value(&None :: <i32>).unwrap(),
|
||||
json!( { "test": None :: <i32> } )
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -120,3 +120,11 @@ fn issue3117() {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
// #3139
|
||||
fn issue3139() {
|
||||
assert_eq!(
|
||||
to_json_value(&None::<i32>).unwrap(),
|
||||
json!({ "test": None::<i32> })
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue