mirror of
https://github.com/rust-lang/rust.git
synced 2025-06-04 19:29:07 +00:00
minor: add a test for derive macros in core
This commit is contained in:
parent
5af80d8372
commit
a88344152d
@ -20,6 +20,26 @@ impl < > core::marker::Copy for Foo< > {}"##]],
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_copy_expand_in_core() {
|
||||||
|
cov_mark::check!(test_copy_expand_in_core);
|
||||||
|
check(
|
||||||
|
r#"
|
||||||
|
#[rustc_builtin_macro]
|
||||||
|
macro Copy {}
|
||||||
|
#[derive(Copy)]
|
||||||
|
struct Foo;
|
||||||
|
"#,
|
||||||
|
expect![[r##"
|
||||||
|
#[rustc_builtin_macro]
|
||||||
|
macro Copy {}
|
||||||
|
#[derive(Copy)]
|
||||||
|
struct Foo;
|
||||||
|
|
||||||
|
impl < > crate ::marker::Copy for Foo< > {}"##]],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_copy_expand_with_type_params() {
|
fn test_copy_expand_with_type_params() {
|
||||||
check(
|
check(
|
||||||
|
@ -176,6 +176,7 @@ fn find_builtin_crate(db: &dyn AstDatabase, id: MacroCallId) -> tt::TokenTree {
|
|||||||
let tt = if cg[krate].dependencies.iter().any(|dep| &*dep.name == "core") {
|
let tt = if cg[krate].dependencies.iter().any(|dep| &*dep.name == "core") {
|
||||||
quote! { core }
|
quote! { core }
|
||||||
} else {
|
} else {
|
||||||
|
cov_mark::hit!(test_copy_expand_in_core);
|
||||||
quote! { crate }
|
quote! { crate }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user