2015-11-02 07:46:39 -06:00
|
|
|
// Copyright 2012-2015 The Rust Project Developers. See the COPYRIGHT
|
|
|
|
// file at the top-level directory of this distribution and at
|
|
|
|
// http://rust-lang.org/COPYRIGHT.
|
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
|
|
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
|
|
|
// option. This file may not be copied, modified, or distributed
|
|
|
|
// except according to those terms.
|
|
|
|
|
|
|
|
// ignore-tidy-linelength
|
2018-05-08 08:10:16 -05:00
|
|
|
// compile-flags:-Zprint-mono-items=eager
|
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;
|
|
|
|
|
2018-05-08 08:10:16 -05:00
|
|
|
//~ MONO_ITEM fn cross_crate_trait_method::start[0]
|
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
|
|
|
|
// implemenations, unless they are actually called from somewhere. Therefore
|
|
|
|
// we cannot import the implementations and have to create our own inline.
|
2018-05-08 08:10:16 -05:00
|
|
|
//~ MONO_ITEM fn cgu_export_trait_method::Trait[0]::with_default_impl[0]<u32>
|
2015-11-02 07:46:39 -06:00
|
|
|
let _ = Trait::with_default_impl(0u32);
|
2018-05-08 08:10:16 -05:00
|
|
|
//~ MONO_ITEM fn cgu_export_trait_method::Trait[0]::with_default_impl[0]<char>
|
2015-11-02 07:46:39 -06:00
|
|
|
let _ = Trait::with_default_impl('c');
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-05-08 08:10:16 -05:00
|
|
|
//~ MONO_ITEM fn cgu_export_trait_method::Trait[0]::with_default_impl_generic[0]<u32, &str>
|
2015-11-02 07:46:39 -06:00
|
|
|
let _ = Trait::with_default_impl_generic(0u32, "abc");
|
2018-05-08 08:10:16 -05:00
|
|
|
//~ MONO_ITEM fn cgu_export_trait_method::Trait[0]::with_default_impl_generic[0]<u32, bool>
|
2015-11-02 07:46:39 -06:00
|
|
|
let _ = Trait::with_default_impl_generic(0u32, false);
|
|
|
|
|
2018-05-08 08:10:16 -05:00
|
|
|
//~ MONO_ITEM fn cgu_export_trait_method::Trait[0]::with_default_impl_generic[0]<char, i16>
|
2015-11-02 07:46:39 -06:00
|
|
|
let _ = Trait::with_default_impl_generic('x', 1i16);
|
2018-05-08 08:10:16 -05:00
|
|
|
//~ MONO_ITEM fn cgu_export_trait_method::Trait[0]::with_default_impl_generic[0]<char, i32>
|
2015-11-02 07:46:39 -06:00
|
|
|
let _ = Trait::with_default_impl_generic('y', 0i32);
|
|
|
|
|
2018-05-08 08:10:16 -05:00
|
|
|
//~ MONO_ITEM fn cgu_export_trait_method::{{impl}}[1]::without_default_impl_generic[0]<char>
|
2015-11-02 07:46:39 -06:00
|
|
|
let _: (u32, char) = Trait::without_default_impl_generic('c');
|
2018-05-08 08:10:16 -05:00
|
|
|
//~ MONO_ITEM fn cgu_export_trait_method::{{impl}}[1]::without_default_impl_generic[0]<bool>
|
2015-11-02 07:46:39 -06:00
|
|
|
let _: (u32, bool) = Trait::without_default_impl_generic(false);
|
|
|
|
|
2018-05-08 08:10:16 -05:00
|
|
|
//~ MONO_ITEM fn cgu_export_trait_method::{{impl}}[0]::without_default_impl_generic[0]<char>
|
2015-11-02 07:46:39 -06:00
|
|
|
let _: (char, char) = Trait::without_default_impl_generic('c');
|
2018-05-08 08:10:16 -05:00
|
|
|
//~ MONO_ITEM fn cgu_export_trait_method::{{impl}}[0]::without_default_impl_generic[0]<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
|
|
|
}
|