diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/ui/issues/issue-18088.rs | 8 | ||||
| -rw-r--r-- | tests/ui/traits/inheritance/supertrait-operator-issue-18088.rs | 13 |
2 files changed, 13 insertions, 8 deletions
diff --git a/tests/ui/issues/issue-18088.rs b/tests/ui/issues/issue-18088.rs deleted file mode 100644 index ba198884c63..00000000000 --- a/tests/ui/issues/issue-18088.rs +++ /dev/null @@ -1,8 +0,0 @@ -//@ check-pass - -pub trait Indexable<T>: std::ops::Index<usize, Output = T> { - fn index2(&self, i: usize) -> &T { - &self[i] - } -} -fn main() {} diff --git a/tests/ui/traits/inheritance/supertrait-operator-issue-18088.rs b/tests/ui/traits/inheritance/supertrait-operator-issue-18088.rs new file mode 100644 index 00000000000..8bd45cd54a4 --- /dev/null +++ b/tests/ui/traits/inheritance/supertrait-operator-issue-18088.rs @@ -0,0 +1,13 @@ +//@ check-pass + +//! Tests that operators from supertrait are available directly on `self` for an inheritor trait. +//! +//! # Context +//! Original issue: https://github.com/rust-lang/rust/issues/18088 + +pub trait Indexable<T>: std::ops::Index<usize, Output = T> { + fn index2(&self, i: usize) -> &T { + &self[i] + } +} +fn main() {} |
