rust/tests/ui/symbol-names/const-generics.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

86 lines
1.2 KiB
Rust
Raw Normal View History

// check-pass
// revisions: legacy v0
//[legacy]compile-flags: -Z unstable-options -C symbol-mangling-version=legacy --crate-type=lib
//[v0]compile-flags: -C symbol-mangling-version=v0 --crate-type=lib
2020-11-17 04:44:21 -06:00
// `char`
pub struct Char<const F: char>;
2020-11-17 04:44:21 -06:00
impl Char<'A'> {
pub fn foo() {}
}
2020-11-17 04:44:21 -06:00
impl<const F: char> Char<F> {
pub fn bar() {}
}
2020-11-17 04:44:21 -06:00
// `i8`
pub struct I8<const F: i8>;
2020-11-17 04:44:21 -06:00
impl I8<{i8::MIN}> {
pub fn foo() {}
}
2020-11-17 04:44:21 -06:00
impl I8<{i8::MAX}> {
pub fn foo() {}
}
2020-11-17 04:44:21 -06:00
impl<const F: i8> I8<F> {
pub fn bar() {}
}
2020-11-17 04:44:21 -06:00
// `i16`
pub struct I16<const F: i16>;
2020-11-17 04:44:21 -06:00
impl I16<{i16::MIN}> {
pub fn foo() {}
}
2020-11-17 04:44:21 -06:00
impl<const F: i16> I16<F> {
pub fn bar() {}
}
2020-11-17 04:44:21 -06:00
// `i32`
pub struct I32<const F: i32>;
2020-11-17 04:44:21 -06:00
impl I32<{i32::MIN}> {
pub fn foo() {}
}
2020-11-17 04:44:21 -06:00
impl<const F: i32> I32<F> {
pub fn bar() {}
}
2020-11-17 04:44:21 -06:00
// `i64`
pub struct I64<const F: i64>;
2020-11-17 04:44:21 -06:00
impl I64<{i64::MIN}> {
pub fn foo() {}
}
2020-11-17 04:44:21 -06:00
impl<const F: i64> I64<F> {
pub fn bar() {}
}
2020-11-17 04:44:21 -06:00
// `i128`
pub struct I128<const F: i128>;
2020-11-17 04:44:21 -06:00
impl I128<{i128::MIN}> {
pub fn foo() {}
}
2020-11-17 04:44:21 -06:00
impl<const F: i128> I128<F> {
pub fn bar() {}
}
2020-11-17 04:44:21 -06:00
// `isize`
pub struct ISize<const F: isize>;
2020-11-17 04:44:21 -06:00
impl ISize<3> {
pub fn foo() {}
}
2020-11-17 04:44:21 -06:00
impl<const F: isize> ISize<F> {
pub fn bar() {}
}