Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-ty/src/tests/macros.rs')
-rw-r--r--crates/hir-ty/src/tests/macros.rs30
1 files changed, 21 insertions, 9 deletions
diff --git a/crates/hir-ty/src/tests/macros.rs b/crates/hir-ty/src/tests/macros.rs
index d16e0eb013..622b4f56d4 100644
--- a/crates/hir-ty/src/tests/macros.rs
+++ b/crates/hir-ty/src/tests/macros.rs
@@ -987,15 +987,12 @@ fn infer_builtin_macros_env() {
fn infer_builtin_macros_option_env() {
check_types(
r#"
- //- minicore: option
- //- /main.rs env:foo=bar
- #[rustc_builtin_macro]
- macro_rules! option_env {() => {}}
-
- fn main() {
- let x = option_env!("foo");
- //^ Option<&str>
- }
+//- minicore: env
+//- /main.rs env:foo=bar
+fn main() {
+ let x = option_env!("foo");
+ //^ Option<&str>
+}
"#,
);
}
@@ -1015,6 +1012,21 @@ fn test() {
}
#[test]
+fn infer_builtin_derive_resolves_with_core_module() {
+ check_types(
+ r#"
+//- minicore: derive, clone
+mod core {}
+#[derive(Clone)]
+struct S;
+fn test() {
+ S.clone();
+} //^^^^^^^^^ S
+"#,
+ );
+}
+
+#[test]
fn infer_derive_clone_with_params() {
check_types(
r#"