2023-10-06 19:29:42 -05:00
|
|
|
// compile-flags:-Zprint-mono-items=eager -Zinline-mir=no -Copt-level=0
|
2015-11-02 07:46:39 -06:00
|
|
|
|
|
|
|
#![deny(dead_code)]
|
2017-12-22 08:31:51 -06:00
|
|
|
#![feature(start)]
|
2015-11-02 07:46:39 -06:00
|
|
|
|
|
|
|
// aux-build:cgu_export_trait_method.rs
|
|
|
|
extern crate cgu_export_trait_method;
|
|
|
|
|
|
|
|
use cgu_export_trait_method::Trait;
|
|
|
|
|
2020-08-28 08:31:03 -05:00
|
|
|
//~ MONO_ITEM fn start
|
2017-12-22 08:31:51 -06:00
|
|
|
#[start]
|
|
|
|
fn start(_: isize, _: *const *const u8) -> isize {
|
2015-11-02 07:46:39 -06:00
|
|
|
// The object code of these methods is contained in the external crate, so
|
|
|
|
// calling them should *not* introduce codegen items in the current crate.
|
|
|
|
let _: (u32, u32) = Trait::without_default_impl(0);
|
|
|
|
let _: (char, u32) = Trait::without_default_impl(0);
|
|
|
|
|
|
|
|
// Currently, no object code is generated for trait methods with default
|
2018-08-19 08:30:23 -05:00
|
|
|
// implementations, unless they are actually called from somewhere. Therefore
|
2015-11-02 07:46:39 -06:00
|
|
|
// we cannot import the implementations and have to create our own inline.
|
2020-08-28 08:31:03 -05:00
|
|
|
//~ MONO_ITEM fn <u32 as cgu_export_trait_method::Trait>::with_default_impl
|
2015-11-02 07:46:39 -06:00
|
|
|
let _ = Trait::with_default_impl(0u32);
|
2020-08-28 08:31:03 -05:00
|
|
|
//~ MONO_ITEM fn <char as cgu_export_trait_method::Trait>::with_default_impl
|
2015-11-02 07:46:39 -06:00
|
|
|
let _ = Trait::with_default_impl('c');
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-08-28 08:31:03 -05:00
|
|
|
//~ MONO_ITEM fn <u32 as cgu_export_trait_method::Trait>::with_default_impl_generic::<&str>
|
2015-11-02 07:46:39 -06:00
|
|
|
let _ = Trait::with_default_impl_generic(0u32, "abc");
|
2020-08-28 08:31:03 -05:00
|
|
|
//~ MONO_ITEM fn <u32 as cgu_export_trait_method::Trait>::with_default_impl_generic::<bool>
|
2015-11-02 07:46:39 -06:00
|
|
|
let _ = Trait::with_default_impl_generic(0u32, false);
|
|
|
|
|
2020-08-28 08:31:03 -05:00
|
|
|
//~ MONO_ITEM fn <char as cgu_export_trait_method::Trait>::with_default_impl_generic::<i16>
|
2015-11-02 07:46:39 -06:00
|
|
|
let _ = Trait::with_default_impl_generic('x', 1i16);
|
2020-08-28 08:31:03 -05:00
|
|
|
//~ MONO_ITEM fn <char as cgu_export_trait_method::Trait>::with_default_impl_generic::<i32>
|
2015-11-02 07:46:39 -06:00
|
|
|
let _ = Trait::with_default_impl_generic('y', 0i32);
|
|
|
|
|
2020-08-28 08:31:03 -05:00
|
|
|
//~ MONO_ITEM fn <u32 as cgu_export_trait_method::Trait>::without_default_impl_generic::<char>
|
2015-11-02 07:46:39 -06:00
|
|
|
let _: (u32, char) = Trait::without_default_impl_generic('c');
|
2020-08-28 08:31:03 -05:00
|
|
|
//~ MONO_ITEM fn <u32 as cgu_export_trait_method::Trait>::without_default_impl_generic::<bool>
|
2015-11-02 07:46:39 -06:00
|
|
|
let _: (u32, bool) = Trait::without_default_impl_generic(false);
|
|
|
|
|
2020-08-28 08:31:03 -05:00
|
|
|
//~ MONO_ITEM fn <char as cgu_export_trait_method::Trait>::without_default_impl_generic::<char>
|
2015-11-02 07:46:39 -06:00
|
|
|
let _: (char, char) = Trait::without_default_impl_generic('c');
|
2020-08-28 08:31:03 -05:00
|
|
|
//~ MONO_ITEM fn <char as cgu_export_trait_method::Trait>::without_default_impl_generic::<bool>
|
2015-11-02 07:46:39 -06:00
|
|
|
let _: (char, bool) = Trait::without_default_impl_generic(false);
|
2017-12-22 08:31:51 -06:00
|
|
|
|
|
|
|
0
|
2015-11-02 07:46:39 -06:00
|
|
|
}
|