about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--tests/ui/copy-a-resource.rs21
-rw-r--r--tests/ui/macros/no-matching-rule.rs (renamed from tests/ui/fail-simple.rs)0
-rw-r--r--tests/ui/macros/no-matching-rule.stderr (renamed from tests/ui/fail-simple.stderr)2
-rw-r--r--tests/ui/methods/clone-missing.rs19
-rw-r--r--tests/ui/methods/clone-missing.stderr (renamed from tests/ui/copy-a-resource.stderr)2
-rw-r--r--tests/ui/modules/mod-pub-access.rs11
-rw-r--r--tests/ui/path.rs7
-rw-r--r--tests/ui/resolve/fn-item-cant-capture-dynamic-env.rs (renamed from tests/ui/capture1.rs)0
-rw-r--r--tests/ui/resolve/fn-item-cant-capture-dynamic-env.stderr (renamed from tests/ui/capture1.stderr)2
-rw-r--r--tests/ui/type-alias/type-param.rs11
-rw-r--r--tests/ui/type-param.rs10
11 files changed, 44 insertions, 41 deletions
diff --git a/tests/ui/copy-a-resource.rs b/tests/ui/copy-a-resource.rs
deleted file mode 100644
index 55f2dd4ee6d..00000000000
--- a/tests/ui/copy-a-resource.rs
+++ /dev/null
@@ -1,21 +0,0 @@
-#[derive(Debug)]
-struct Foo {
-  i: isize,
-}
-
-impl Drop for Foo {
-    fn drop(&mut self) {}
-}
-
-fn foo(i:isize) -> Foo {
-    Foo {
-        i: i
-    }
-}
-
-fn main() {
-    let x = foo(10);
-    let _y = x.clone();
-    //~^ ERROR no method named `clone` found
-    println!("{:?}", x);
-}
diff --git a/tests/ui/fail-simple.rs b/tests/ui/macros/no-matching-rule.rs
index 55e547ee72b..55e547ee72b 100644
--- a/tests/ui/fail-simple.rs
+++ b/tests/ui/macros/no-matching-rule.rs
diff --git a/tests/ui/fail-simple.stderr b/tests/ui/macros/no-matching-rule.stderr
index 50c350b3ef5..a6312a843f3 100644
--- a/tests/ui/fail-simple.stderr
+++ b/tests/ui/macros/no-matching-rule.stderr
@@ -1,5 +1,5 @@
 error: no rules expected `@`
-  --> $DIR/fail-simple.rs:2:12
+  --> $DIR/no-matching-rule.rs:2:12
    |
 LL |     panic!(@);
    |            ^ no rules expected this token in macro call
diff --git a/tests/ui/methods/clone-missing.rs b/tests/ui/methods/clone-missing.rs
new file mode 100644
index 00000000000..f2e4ad268c6
--- /dev/null
+++ b/tests/ui/methods/clone-missing.rs
@@ -0,0 +1,19 @@
+// This test checks that calling `.clone()` on a type that does not implement the `Clone` trait
+// results in a compilation error. The `Foo` struct does not derive or implement `Clone`,
+// so attempting to clone it should fail.
+
+struct Foo {
+  i: isize,
+}
+
+fn foo(i:isize) -> Foo {
+    Foo {
+        i: i
+    }
+}
+
+fn main() {
+    let x = foo(10);
+    let _y = x.clone();
+    //~^ ERROR no method named `clone` found
+}
diff --git a/tests/ui/copy-a-resource.stderr b/tests/ui/methods/clone-missing.stderr
index ff1e28bf961..4ab1aae4934 100644
--- a/tests/ui/copy-a-resource.stderr
+++ b/tests/ui/methods/clone-missing.stderr
@@ -1,5 +1,5 @@
 error[E0599]: no method named `clone` found for struct `Foo` in the current scope
-  --> $DIR/copy-a-resource.rs:18:16
+  --> $DIR/clone-missing.rs:17:16
    |
 LL | struct Foo {
    | ---------- method `clone` not found for this struct
diff --git a/tests/ui/modules/mod-pub-access.rs b/tests/ui/modules/mod-pub-access.rs
new file mode 100644
index 00000000000..c07e7a2ff30
--- /dev/null
+++ b/tests/ui/modules/mod-pub-access.rs
@@ -0,0 +1,11 @@
+//@ run-pass
+// This is a name resolution smoke test that ensures paths with more than one
+// segment (e.g., `foo::bar`) resolve correctly.
+// It also serves as a basic visibility test — confirming that a `pub` item
+// inside a private module can still be accessed from outside that module.
+
+mod foo {
+    pub fn bar(_offset: usize) {}
+}
+
+fn main() { foo::bar(0); }
diff --git a/tests/ui/path.rs b/tests/ui/path.rs
deleted file mode 100644
index bd7b99ac01a..00000000000
--- a/tests/ui/path.rs
+++ /dev/null
@@ -1,7 +0,0 @@
-//@ run-pass
-
-mod foo {
-    pub fn bar(_offset: usize) { }
-}
-
-pub fn main() { foo::bar(0); }
diff --git a/tests/ui/capture1.rs b/tests/ui/resolve/fn-item-cant-capture-dynamic-env.rs
index 4f8c04e3fa9..4f8c04e3fa9 100644
--- a/tests/ui/capture1.rs
+++ b/tests/ui/resolve/fn-item-cant-capture-dynamic-env.rs
diff --git a/tests/ui/capture1.stderr b/tests/ui/resolve/fn-item-cant-capture-dynamic-env.stderr
index 8027430de52..6b3e8792011 100644
--- a/tests/ui/capture1.stderr
+++ b/tests/ui/resolve/fn-item-cant-capture-dynamic-env.stderr
@@ -1,5 +1,5 @@
 error[E0434]: can't capture dynamic environment in a fn item
-  --> $DIR/capture1.rs:3:32
+  --> $DIR/fn-item-cant-capture-dynamic-env.rs:3:32
    |
 LL |     fn foo() -> isize { return bar; }
    |                                ^^^
diff --git a/tests/ui/type-alias/type-param.rs b/tests/ui/type-alias/type-param.rs
new file mode 100644
index 00000000000..f8e73518bad
--- /dev/null
+++ b/tests/ui/type-alias/type-param.rs
@@ -0,0 +1,11 @@
+//@ run-pass
+// This is a smoke test to ensure that type aliases with type parameters
+// are accepted by the compiler and that the parameters are correctly
+// resolved in the aliased item type.
+
+#![allow(dead_code)]
+
+type Foo<T> = extern "C" fn(T) -> bool;
+type Bar<T> = fn(T) -> bool;
+
+fn main() {}
diff --git a/tests/ui/type-param.rs b/tests/ui/type-param.rs
deleted file mode 100644
index e7cf0e5446b..00000000000
--- a/tests/ui/type-param.rs
+++ /dev/null
@@ -1,10 +0,0 @@
-//@ run-pass
-
-#![allow(non_camel_case_types)]
-#![allow(dead_code)]
-
-
-
-type lteq<T> = extern "C" fn(T) -> bool;
-
-pub fn main() { }