2018-08-30 12:18:55 +00:00
|
|
|
// run-pass
|
2018-09-25 21:51:35 +00:00
|
|
|
#![allow(dead_code)]
|
2015-03-22 20:13:15 +00:00
|
|
|
// pretty-expanded FIXME #23616
|
|
|
|
|
2014-01-18 06:08:23 +00:00
|
|
|
use std::default::Default;
|
2013-05-24 02:05:57 +00:00
|
|
|
|
|
|
|
pub struct X<T> {
|
2014-01-18 06:08:23 +00:00
|
|
|
a: T,
|
2013-05-24 02:05:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// reordering these bounds stops the ICE
|
2014-08-28 01:46:52 +00: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 06:08:23 +00:00
|
|
|
fn default() -> X<T> {
|
|
|
|
X { a: Default::default() }
|
2013-05-24 02:05:57 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
macro_rules! constants {
|
2014-01-18 06:08:23 +00:00
|
|
|
() => {
|
2015-03-26 00:06:52 +00:00
|
|
|
let _ : X<isize> = Default::default();
|
2014-01-18 06:08:23 +00:00
|
|
|
}
|
2013-05-24 02:05:57 +00:00
|
|
|
}
|
|
|
|
|
2013-05-28 20:43:10 +00:00
|
|
|
pub fn main() {
|
2014-01-18 06:08:23 +00:00
|
|
|
constants!();
|
2013-05-24 02:05:57 +00:00
|
|
|
}
|