2024-02-16 20:02:50 +00:00
|
|
|
//@ run-pass
|
2018-09-25 23:51:35 +02:00
|
|
|
#![allow(dead_code)]
|
2015-03-22 13:13:15 -07:00
|
|
|
|
2013-05-23 19:05:57 -07:00
|
|
|
|
|
|
|
pub struct X<T> {
|
2014-01-18 17:08:23 +11:00
|
|
|
a: T,
|
2013-05-23 19:05:57 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
// reordering these bounds stops the ICE
|
2014-08-27 21:46:52 -04:00
|
|
|
//
|
|
|
|
// nmatsakis: This test used to have the bounds Default + PartialEq +
|
|
|
|
// Default, but having duplicate bounds became illegal.
|
|
|
|
impl<T: Default + PartialEq> Default for X<T> {
|
2014-01-18 17:08:23 +11:00
|
|
|
fn default() -> X<T> {
|
|
|
|
X { a: Default::default() }
|
2013-05-23 19:05:57 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
macro_rules! constants {
|
2014-01-18 17:08:23 +11:00
|
|
|
() => {
|
2015-03-25 17:06:52 -07:00
|
|
|
let _ : X<isize> = Default::default();
|
2014-01-18 17:08:23 +11:00
|
|
|
}
|
2013-05-23 19:05:57 -07:00
|
|
|
}
|
|
|
|
|
2013-05-28 13:43:10 -07:00
|
|
|
pub fn main() {
|
2014-01-18 17:08:23 +11:00
|
|
|
constants!();
|
2013-05-23 19:05:57 -07:00
|
|
|
}
|