1 // Copyright 2015 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
11 // Regression test for issue #21010: Normalize associated types in
12 // various special paths in the `type_is_immediate` function.
15 pub trait OffsetState: Sized {}
17 type State: OffsetState;
21 #[derive(Copy)] pub struct X;
22 impl Offset for X { type State = Y; }
24 #[derive(Copy)] pub struct Y;
25 impl OffsetState for Y {}
27 pub fn now() -> DateTime<X> { from_utc(Y) }
29 pub struct DateTime<Off: Offset> { pub offset: Off::State }
30 pub fn from_utc<Off: Offset>(offset: Off::State) -> DateTime<Off> { DateTime { offset: offset } }