Format and codegen for attr
This commit is contained in:
parent
1141259a23
commit
ecac8e3514
@ -344,7 +344,7 @@ pub(crate) fn all() -> &'static [Handler] {
|
||||
unqualify_method_call::unqualify_method_call,
|
||||
wrap_return_type_in_result::wrap_return_type_in_result,
|
||||
wrap_unwrap_cfg_attr::wrap_unwrap_cfg_attr,
|
||||
|
||||
|
||||
// These are manually sorted for better priorities. By default,
|
||||
// priority is determined by the size of the target range (smaller
|
||||
// target wins). If the ranges are equal, position in this list is
|
||||
|
@ -3151,3 +3151,22 @@ fn foo() -> Result<i32, ${0:_}> { Ok(42i32) }
|
||||
"#####,
|
||||
)
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn doctest_wrap_unwrap_cfg_attr() {
|
||||
check_doc_test(
|
||||
"wrap_unwrap_cfg_attr",
|
||||
r#####"
|
||||
#[derive$0(Debug)]
|
||||
struct S {
|
||||
field: i32
|
||||
}
|
||||
"#####,
|
||||
r#####"
|
||||
#[cfg_attr($0, derive(Debug))]
|
||||
struct S {
|
||||
field: i32
|
||||
}
|
||||
"#####,
|
||||
)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user