mirror of https://github.com/rust-lang/rust.git
102 lines
2.9 KiB
Rust
102 lines
2.9 KiB
Rust
//@ revisions: ascii unicode
|
|
//@[ascii] compile-flags: --diagnostic-width=60 -Zwrite-long-types-to-disk=yes
|
|
//@[unicode] compile-flags: -Zunstable-options --json=diagnostic-unicode --diagnostic-width=60 -Zwrite-long-types-to-disk=yes
|
|
|
|
// The regex below normalizes the long type file name to make it suitable for compare-modes.
|
|
//@ normalize-stderr: "'\$TEST_BUILD_DIR/.*\.long-type-\d+.txt'" -> "'$$TEST_BUILD_DIR/$$FILE.long-type-hash.txt'"
|
|
|
|
mod a {
|
|
// Force the "short path for unique types" machinery to trip up
|
|
pub struct Atype;
|
|
pub struct Btype;
|
|
pub struct Ctype;
|
|
}
|
|
|
|
mod b {
|
|
pub struct Atype<T, K>(T, K);
|
|
pub struct Btype<T, K>(T, K);
|
|
pub struct Ctype<T, K>(T, K);
|
|
}
|
|
|
|
use b::*;
|
|
|
|
fn main() {
|
|
let x: Atype<
|
|
Btype<
|
|
Ctype<
|
|
Atype<
|
|
Btype<
|
|
Ctype<
|
|
Atype<
|
|
Btype<
|
|
Ctype<i32, i32>,
|
|
i32
|
|
>,
|
|
i32
|
|
>,
|
|
i32
|
|
>,
|
|
i32
|
|
>,
|
|
i32
|
|
>,
|
|
i32
|
|
>,
|
|
i32
|
|
>,
|
|
i32
|
|
> = Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(
|
|
Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(
|
|
Ok("")
|
|
))))))))))))))))))))))))))))))
|
|
))))))))))))))))))))))))))))));
|
|
//~^^^^^ ERROR E0308
|
|
|
|
let _ = Some(Ok(Some(Some(Some(Some(Some(Some(Some(Some(Some(Some(Some(Some(Some(Some(Some(
|
|
Some(Some(Some(Some(Some(Some(Some(Some(Some(Some(Some(Some(Some(Some(Some(Some(Some(Some(
|
|
Some(Some(Some(Some(Some(Some(Some(Some(Some(Some(Some(Some(Some(Some(Some(Some(Some(
|
|
Some(Some(Some(Some(Some(Some(Some(Some(Some("")))))))))
|
|
)))))))))))))))))
|
|
))))))))))))))))))
|
|
))))))))))))))))) == Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(
|
|
Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(
|
|
Ok(Ok(Ok(Ok(Ok(Ok(Ok("")))))))
|
|
))))))))))))))))))))))))))))))
|
|
))))))))))))))))))))))));
|
|
//~^^^^^ ERROR E0308
|
|
|
|
let x: Atype<
|
|
Btype<
|
|
Ctype<
|
|
Atype<
|
|
Btype<
|
|
Ctype<
|
|
Atype<
|
|
Btype<
|
|
Ctype<i32, i32>,
|
|
i32
|
|
>,
|
|
i32
|
|
>,
|
|
i32
|
|
>,
|
|
i32
|
|
>,
|
|
i32
|
|
>,
|
|
i32
|
|
>,
|
|
i32
|
|
>,
|
|
i32
|
|
> = ();
|
|
//~^ ERROR E0308
|
|
|
|
let _: () = Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(
|
|
Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(
|
|
Ok(Ok(Ok(Ok(Ok(Ok(Ok("")))))))
|
|
))))))))))))))))))))))))))))))
|
|
))))))))))))))))))))))));
|
|
//~^^^^^ ERROR E0308
|
|
}
|