diff options
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/ui/stats/hir-stats.rs | 1 | ||||
| -rw-r--r-- | src/test/ui/type/issue-101866.rs | 15 | ||||
| -rw-r--r-- | src/test/ui/type/issue-101866.stderr | 18 |
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`. |
