diff options
| author | omskscream <golovkov93@gmail.com> | 2025-09-13 23:56:55 +0300 |
|---|---|---|
| committer | omskscream <golovkov93@gmail.com> | 2025-09-14 12:16:21 +0300 |
| commit | 8ee3a08b871f8b24075f67eda06330f7005cd435 (patch) | |
| tree | e05dec2c472670f42f0ebd4206442f55097fc934 /tests | |
| parent | 05a5c7d0a104d3c3efbccb0aaf01b51495ad3080 (diff) | |
| download | rust-8ee3a08b871f8b24075f67eda06330f7005cd435.tar.gz rust-8ee3a08b871f8b24075f67eda06330f7005cd435.zip | |
clean up issue-18088 (operator from supertrait)
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() {} |
