Files
rust/tests/ui/traits/inheritance/supertrait-operator-issue-18088.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

14 lines
338 B
Rust
Raw Normal View History

//@ 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() {}