about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-09-30 17:47:57 +0000
committerbors <bors@rust-lang.org>2022-09-30 17:47:57 +0000
commit877877a19a408421486a5077d36e1bfef090e42e (patch)
treedfb80c5ba5a707d55dd72ce8cb2e09b3cfc4f834 /src/test
parent75d3027fb5ce1af6712e4503c9574802212101bd (diff)
parenta8777580ee83c84a95d06f17439174a4e5913667 (diff)
downloadrust-877877a19a408421486a5077d36e1bfef090e42e.tar.gz
rust-877877a19a408421486a5077d36e1bfef090e42e.zip
Auto merge of #102520 - matthiaskrgr:rollup-7nreat0, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - #102276 (Added more const_closure functionality)
 - #102382 (Manually order `DefId` on 64-bit big-endian)
 - #102421 (remove the unused :: between trait and type to give user correct diag…)
 - #102495 (Reinstate `hir-stats.rs` test for stage 1.)
 - #102505 (rustdoc: remove no-op CSS `h3.variant, .sub-variant h4 { border-bottom: none }`)
 - #102506 (Specify `DynKind::Dyn`)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'src/test')
-rw-r--r--src/test/ui/stats/hir-stats.rs1
-rw-r--r--src/test/ui/type/issue-101866.rs15
-rw-r--r--src/test/ui/type/issue-101866.stderr18
3 files changed, 33 insertions, 1 deletions
diff --git a/src/test/ui/stats/hir-stats.rs b/src/test/ui/stats/hir-stats.rs
index 5102574d4be..a24b3ada57e 100644
--- a/src/test/ui/stats/hir-stats.rs
+++ b/src/test/ui/stats/hir-stats.rs
@@ -1,7 +1,6 @@
 // check-pass
 // compile-flags: -Zhir-stats
 // only-x86_64
-// ignore-stage1
 
 // The aim here is to include at least one of every different type of top-level
 // AST/HIR node reported by `-Zhir-stats`.
diff --git a/src/test/ui/type/issue-101866.rs b/src/test/ui/type/issue-101866.rs
new file mode 100644
index 00000000000..d332c4adb00
--- /dev/null
+++ b/src/test/ui/type/issue-101866.rs
@@ -0,0 +1,15 @@
+trait TraitA<T> {
+    fn func();
+}
+
+struct StructA {}
+
+impl TraitA<i32> for StructA {
+    fn func() {}
+}
+
+fn main() {
+    TraitA::<i32>::func();
+    //~^ ERROR: cannot call associated function on trait without specifying the corresponding `impl` type [E0790]
+    //~| help: use the fully-qualified path to the only available implementation
+}
diff --git a/src/test/ui/type/issue-101866.stderr b/src/test/ui/type/issue-101866.stderr
new file mode 100644
index 00000000000..788e54b9381
--- /dev/null
+++ b/src/test/ui/type/issue-101866.stderr
@@ -0,0 +1,18 @@
+error[E0790]: cannot call associated function on trait without specifying the corresponding `impl` type
+  --> $DIR/issue-101866.rs:12:5
+   |
+LL |     fn func();
+   |     ---------- `TraitA::func` defined here
+...
+LL |     TraitA::<i32>::func();
+   |     ^^^^^^^^^^^^^^^^^^^ cannot call associated function of trait
+   |
+help: use the fully-qualified path to the only available implementation
+   |
+LL -     TraitA::<i32>::func();
+LL +     <::StructA as TraitA<i32>>::func();
+   |
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0790`.