2020-09-13 22:55:06 -05:00
|
|
|
// run-rustfix
|
|
|
|
|
|
|
|
#[allow(unused)]
|
|
|
|
use std::fmt::Debug;
|
|
|
|
// Rustfix should add this, or use `std::fmt::Debug` instead.
|
|
|
|
|
|
|
|
#[allow(dead_code)]
|
|
|
|
struct ConstrainedStruct<X: Copy> {
|
|
|
|
x: X
|
|
|
|
}
|
|
|
|
|
|
|
|
#[allow(dead_code)]
|
2021-03-30 04:56:39 -05:00
|
|
|
trait InsufficientlyConstrainedGeneric<X=()> where X: std::marker::Copy {
|
2020-09-13 22:55:06 -05:00
|
|
|
fn return_the_constrained_type(&self, x: X) -> ConstrainedStruct<X> {
|
|
|
|
//~^ ERROR the trait bound `X: Copy` is not satisfied
|
|
|
|
ConstrainedStruct { x }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn main() { }
|