Merge #11217
11217: minor: Move pretty-printing test out of assist r=lnicola a=lnicola bors r+ Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
This commit is contained in:
commit
31b41dade7
@ -306,6 +306,25 @@ fn main() {
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn macro_expand_with_dyn_absolute_path() {
|
||||
check(
|
||||
r#"
|
||||
macro_rules! foo {
|
||||
() => {fn f<T>(_: &dyn ::std::marker::Copy) {}};
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let res = fo$0o!();
|
||||
}
|
||||
"#,
|
||||
expect![[r#"
|
||||
foo
|
||||
fn f<T>(_: &dyn ::std::marker::Copy){}
|
||||
"#]],
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn macro_expand_derive() {
|
||||
check(
|
||||
|
@ -938,47 +938,6 @@ fn foo<'lt>(&'lt self) {}
|
||||
impl FooB for Foo {
|
||||
$0fn foo< 'lt>(& 'lt self){}
|
||||
|
||||
}
|
||||
"#,
|
||||
)
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn macro_trait_dyn_absolute_path() {
|
||||
// https://github.com/rust-analyzer/rust-analyzer/issues/11100
|
||||
check_assist(
|
||||
add_missing_impl_members,
|
||||
r#"
|
||||
macro_rules! foo {
|
||||
() => {
|
||||
trait MacroTrait {
|
||||
fn trait_method(_: &dyn ::core::marker::Sized);
|
||||
}
|
||||
}
|
||||
}
|
||||
foo!();
|
||||
struct Foo;
|
||||
|
||||
impl MacroTrait for Foo {
|
||||
$0
|
||||
}
|
||||
"#,
|
||||
r#"
|
||||
macro_rules! foo {
|
||||
() => {
|
||||
trait MacroTrait {
|
||||
fn trait_method(_: &dyn ::core::marker::Sized);
|
||||
}
|
||||
}
|
||||
}
|
||||
foo!();
|
||||
struct Foo;
|
||||
|
||||
impl MacroTrait for Foo {
|
||||
fn trait_method(_: &dyn ::core::marker::Sized) {
|
||||
${0:todo!()}
|
||||
}
|
||||
|
||||
}
|
||||
"#,
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user