Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide-completion/src/completions/dot.rs')
-rw-r--r--crates/ide-completion/src/completions/dot.rs37
1 files changed, 37 insertions, 0 deletions
diff --git a/crates/ide-completion/src/completions/dot.rs b/crates/ide-completion/src/completions/dot.rs
index 77246379e7..ba76634016 100644
--- a/crates/ide-completion/src/completions/dot.rs
+++ b/crates/ide-completion/src/completions/dot.rs
@@ -173,6 +173,43 @@ fn foo(s: S) { s.$0 }
}
#[test]
+ fn no_unstable_method_on_stable() {
+ check(
+ r#"
+//- /main.rs crate:main deps:std
+fn foo(s: std::S) { s.$0 }
+//- /std.rs crate:std
+pub struct S;
+impl S {
+ #[unstable]
+ pub fn bar(&self) {}
+}
+"#,
+ expect![""],
+ );
+ }
+
+ #[test]
+ fn unstable_method_on_nightly() {
+ check(
+ r#"
+//- toolchain:nightly
+//- /main.rs crate:main deps:std
+fn foo(s: std::S) { s.$0 }
+//- /std.rs crate:std
+pub struct S;
+impl S {
+ #[unstable]
+ pub fn bar(&self) {}
+}
+"#,
+ expect![[r#"
+ me bar() fn(&self)
+ "#]],
+ );
+ }
+
+ #[test]
fn test_struct_field_completion_self() {
check(
r#"