Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions tests/ui/issues/issue-18088.rs

This file was deleted.

12 changes: 0 additions & 12 deletions tests/ui/issues/issue-21950.rs

This file was deleted.

13 changes: 0 additions & 13 deletions tests/ui/issues/issue-2284.rs

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
//@ check-pass

//! Tests that it's possible to define an associated type in a trait
//! using an associated type from type parameter bound trait in a blanket implementation.
//!
//! # Context
//! Original issue: https://github.com/rust-lang/rust/issues/19479

trait Base {
fn dummy(&self) { }
}
Expand Down
19 changes: 19 additions & 0 deletions tests/ui/traits/cast-as-dyn-trait-wo-assoc-type-issue-21950.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
//! Tests that compiler yields error E0191 when value with existing trait implementation
//! is cast as same `dyn` trait without specifying associated type at the cast.
//!
//! # Context
//! Original issue: https://github.com/rust-lang/rust/issues/21950

trait Add<Rhs=Self> {
type Output;
}

impl Add for i32 {
type Output = i32;
}

fn main() {
let x = &10 as &dyn Add<i32, Output = i32>; //OK
let x = &10 as &dyn Add;
//~^ ERROR E0191
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0191]: the value of the associated type `Output` in `Add` must be specified
--> $DIR/issue-21950.rs:10:25
--> $DIR/cast-as-dyn-trait-wo-assoc-type-issue-21950.rs:17:25
|
LL | type Output;
| ----------- `Output` defined here
Expand Down
21 changes: 21 additions & 0 deletions tests/ui/traits/core-marker-name-shadowing-issue-2284.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
//@ run-pass
#![allow(dead_code)]

//! Tests that user-defined trait is prioritized in compile time over
//! the core::marker trait with the same name, allowing shadowing core traits.
//!
//! # Context
//! Original issue: https://github.com/rust-lang/rust/issues/2284
//! Original fix pull request: https://github.com/rust-lang/rust/pull/3792


trait Send {
fn f(&self);
}

fn f<T:Send>(t: T) {
t.f();
}

pub fn main() {
}
13 changes: 13 additions & 0 deletions tests/ui/traits/inheritance/supertrait-operator-issue-18088.rs
Original file line number Diff line number Diff line change
@@ -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() {}
Loading