about summary refs log tree commit diff
path: root/tests/ui/traits/inheritance/supertrait-operator-issue-18088.rs
blob: 8bd45cd54a445a3dc2be45c7458964936bbc233f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
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() {}