2016-11-17 14:12:43 -06:00
|
|
|
// This test case tests the incremental compilation hash (ICH) implementation
|
|
|
|
// for let expressions.
|
|
|
|
|
|
|
|
// The general pattern followed here is: Change one thing between rev1 and rev2
|
|
|
|
// and make sure that the hash has changed, then change nothing between rev2 and
|
|
|
|
// rev3 and make sure that the hash has not changed.
|
|
|
|
|
2019-07-02 16:30:28 -05:00
|
|
|
//@ build-pass (FIXME(62277): could be check-pass?)
|
2021-04-22 14:33:16 -05:00
|
|
|
//@ revisions: cfail1 cfail2 cfail3 cfail4 cfail5 cfail6
|
2022-05-27 20:17:39 -05:00
|
|
|
//@ compile-flags: -Z query-dep-graph -O
|
2021-04-22 14:33:16 -05:00
|
|
|
//@ [cfail1]compile-flags: -Zincremental-ignore-spans
|
|
|
|
//@ [cfail2]compile-flags: -Zincremental-ignore-spans
|
|
|
|
//@ [cfail3]compile-flags: -Zincremental-ignore-spans
|
2016-11-17 14:12:43 -06:00
|
|
|
|
|
|
|
#![allow(warnings)]
|
|
|
|
#![feature(rustc_attrs)]
|
|
|
|
#![feature(specialization)]
|
|
|
|
#![crate_type="rlib"]
|
|
|
|
|
|
|
|
struct Foo;
|
|
|
|
|
|
|
|
// Change Method Name -----------------------------------------------------------
|
|
|
|
|
2021-04-22 14:33:16 -05:00
|
|
|
#[cfg(any(cfail1,cfail4))]
|
2016-11-17 14:12:43 -06:00
|
|
|
pub trait ChangeMethodNameTrait {
|
|
|
|
fn method_name();
|
|
|
|
}
|
|
|
|
|
2021-04-22 14:33:16 -05:00
|
|
|
#[cfg(any(cfail1,cfail4))]
|
2016-11-17 14:12:43 -06:00
|
|
|
impl ChangeMethodNameTrait for Foo {
|
|
|
|
fn method_name() { }
|
|
|
|
}
|
|
|
|
|
2021-04-22 14:33:16 -05:00
|
|
|
#[cfg(not(any(cfail1,cfail4)))]
|
2024-01-25 10:16:38 -06:00
|
|
|
#[rustc_clean(except="opt_hir_owner_nodes,associated_item_def_ids", cfg="cfail2")]
|
2021-05-15 06:20:42 -05:00
|
|
|
#[rustc_clean(cfg="cfail3")]
|
2024-01-25 10:16:38 -06:00
|
|
|
#[rustc_clean(except="opt_hir_owner_nodes,associated_item_def_ids", cfg="cfail5")]
|
2021-04-22 14:33:16 -05:00
|
|
|
#[rustc_clean(cfg="cfail6")]
|
2016-11-17 14:12:43 -06:00
|
|
|
pub trait ChangeMethodNameTrait {
|
2021-05-15 06:20:42 -05:00
|
|
|
#[rustc_clean(cfg="cfail3")]
|
2021-04-22 14:33:16 -05:00
|
|
|
#[rustc_clean(cfg="cfail6")]
|
2016-11-17 14:12:43 -06:00
|
|
|
fn method_name2();
|
|
|
|
}
|
|
|
|
|
2021-04-22 14:33:16 -05:00
|
|
|
#[cfg(not(any(cfail1,cfail4)))]
|
2024-01-25 10:16:38 -06:00
|
|
|
#[rustc_clean(except="opt_hir_owner_nodes,associated_item_def_ids", cfg="cfail2")]
|
2021-05-15 06:20:42 -05:00
|
|
|
#[rustc_clean(cfg="cfail3")]
|
2024-01-25 10:16:38 -06:00
|
|
|
#[rustc_clean(except="opt_hir_owner_nodes,associated_item_def_ids", cfg="cfail5")]
|
2021-04-22 14:33:16 -05:00
|
|
|
#[rustc_clean(cfg="cfail6")]
|
2016-11-17 14:12:43 -06:00
|
|
|
impl ChangeMethodNameTrait for Foo {
|
2021-05-15 06:20:42 -05:00
|
|
|
#[rustc_clean(cfg="cfail3")]
|
2021-04-22 14:33:16 -05:00
|
|
|
#[rustc_clean(cfg="cfail6")]
|
2016-11-17 14:12:43 -06:00
|
|
|
fn method_name2() { }
|
|
|
|
}
|
|
|
|
|
|
|
|
// Change Method Body -----------------------------------------------------------
|
|
|
|
//
|
2017-02-03 12:07:15 -06:00
|
|
|
// This should affect the method itself, but not the impl.
|
2016-11-17 14:12:43 -06:00
|
|
|
|
|
|
|
pub trait ChangeMethodBodyTrait {
|
|
|
|
fn method_name();
|
|
|
|
}
|
|
|
|
|
2021-04-22 14:33:16 -05:00
|
|
|
#[cfg(any(cfail1,cfail4))]
|
2016-11-17 14:12:43 -06:00
|
|
|
impl ChangeMethodBodyTrait for Foo {
|
2024-01-25 10:16:38 -06:00
|
|
|
// --------------------------------------------------------------
|
2021-04-22 14:33:16 -05:00
|
|
|
// -------------------------
|
2024-01-25 10:16:38 -06:00
|
|
|
// --------------------------------------------------------------
|
2021-04-22 14:33:16 -05:00
|
|
|
// -------------------------
|
|
|
|
fn method_name() {
|
|
|
|
//
|
|
|
|
}
|
2016-11-17 14:12:43 -06:00
|
|
|
}
|
|
|
|
|
2021-04-22 14:33:16 -05:00
|
|
|
#[cfg(not(any(cfail1,cfail4)))]
|
2021-05-15 06:20:42 -05:00
|
|
|
#[rustc_clean(cfg="cfail2")]
|
|
|
|
#[rustc_clean(cfg="cfail3")]
|
2021-04-22 14:33:16 -05:00
|
|
|
#[rustc_clean(cfg="cfail5")]
|
|
|
|
#[rustc_clean(cfg="cfail6")]
|
2016-11-17 14:12:43 -06:00
|
|
|
impl ChangeMethodBodyTrait for Foo {
|
2024-01-25 10:16:38 -06:00
|
|
|
#[rustc_clean(except="opt_hir_owner_nodes,typeck", cfg="cfail2")]
|
2021-05-15 06:20:42 -05:00
|
|
|
#[rustc_clean(cfg="cfail3")]
|
2024-01-25 10:16:38 -06:00
|
|
|
#[rustc_clean(except="opt_hir_owner_nodes,typeck", cfg="cfail5")]
|
2021-04-22 14:33:16 -05:00
|
|
|
#[rustc_clean(cfg="cfail6")]
|
2017-02-03 12:07:15 -06:00
|
|
|
fn method_name() {
|
|
|
|
()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Change Method Body (inlined fn) ---------------------------------------------
|
|
|
|
//
|
|
|
|
// This should affect the method itself, but not the impl.
|
|
|
|
|
|
|
|
pub trait ChangeMethodBodyTraitInlined {
|
|
|
|
fn method_name();
|
|
|
|
}
|
|
|
|
|
2021-04-22 14:33:16 -05:00
|
|
|
#[cfg(any(cfail1,cfail4))]
|
2017-02-03 12:07:15 -06:00
|
|
|
impl ChangeMethodBodyTraitInlined for Foo {
|
2024-01-25 10:16:38 -06:00
|
|
|
// ----------------------------------------------------------------------------
|
2021-04-22 14:33:16 -05:00
|
|
|
// -------------------------
|
2024-01-25 10:16:38 -06:00
|
|
|
// ----------------------------------------------------------------------------
|
2021-04-22 14:33:16 -05:00
|
|
|
// -------------------------
|
2017-02-03 12:07:15 -06:00
|
|
|
#[inline]
|
2021-04-22 14:33:16 -05:00
|
|
|
fn method_name() {
|
|
|
|
// -----
|
|
|
|
}
|
2017-02-03 12:07:15 -06:00
|
|
|
}
|
|
|
|
|
2021-04-22 14:33:16 -05:00
|
|
|
#[cfg(not(any(cfail1,cfail4)))]
|
2021-05-15 06:20:42 -05:00
|
|
|
#[rustc_clean(cfg="cfail2")]
|
|
|
|
#[rustc_clean(cfg="cfail3")]
|
2021-04-22 14:33:16 -05:00
|
|
|
#[rustc_clean(cfg="cfail5")]
|
|
|
|
#[rustc_clean(cfg="cfail6")]
|
2017-02-03 12:07:15 -06:00
|
|
|
impl ChangeMethodBodyTraitInlined for Foo {
|
2024-01-25 10:16:38 -06:00
|
|
|
#[rustc_clean(except="opt_hir_owner_nodes,typeck,optimized_mir", cfg="cfail2")]
|
2021-05-15 06:20:42 -05:00
|
|
|
#[rustc_clean(cfg="cfail3")]
|
2024-01-25 10:16:38 -06:00
|
|
|
#[rustc_clean(except="opt_hir_owner_nodes,typeck,optimized_mir", cfg="cfail5")]
|
2021-04-22 14:33:16 -05:00
|
|
|
#[rustc_clean(cfg="cfail6")]
|
2017-02-03 12:07:15 -06:00
|
|
|
#[inline]
|
2016-11-17 14:12:43 -06:00
|
|
|
fn method_name() {
|
2017-04-05 16:39:02 -05:00
|
|
|
panic!()
|
2016-11-17 14:12:43 -06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-02-03 12:07:15 -06:00
|
|
|
// Change Method Selfness ------------------------------------------------------
|
2016-11-17 14:12:43 -06:00
|
|
|
|
2021-04-22 14:33:16 -05:00
|
|
|
#[cfg(any(cfail1,cfail4))]
|
2016-11-17 14:12:43 -06:00
|
|
|
pub trait ChangeMethodSelfnessTrait {
|
|
|
|
fn method_name();
|
|
|
|
}
|
|
|
|
|
2021-04-22 14:33:16 -05:00
|
|
|
#[cfg(any(cfail1,cfail4))]
|
2016-11-17 14:12:43 -06:00
|
|
|
impl ChangeMethodSelfnessTrait for Foo {
|
|
|
|
fn method_name() { }
|
|
|
|
}
|
|
|
|
|
2021-04-22 14:33:16 -05:00
|
|
|
#[cfg(not(any(cfail1,cfail4)))]
|
2016-11-17 14:12:43 -06:00
|
|
|
pub trait ChangeMethodSelfnessTrait {
|
|
|
|
fn method_name(&self);
|
|
|
|
}
|
|
|
|
|
2021-04-22 14:33:16 -05:00
|
|
|
#[cfg(not(any(cfail1,cfail4)))]
|
2024-01-25 10:16:38 -06:00
|
|
|
#[rustc_clean(except="opt_hir_owner_nodes", cfg="cfail2")]
|
2021-05-15 06:20:42 -05:00
|
|
|
#[rustc_clean(cfg="cfail3")]
|
2024-01-25 10:16:38 -06:00
|
|
|
#[rustc_clean(except="opt_hir_owner_nodes", cfg="cfail5")]
|
2021-04-22 14:33:16 -05:00
|
|
|
#[rustc_clean(cfg="cfail6")]
|
2016-11-17 14:12:43 -06:00
|
|
|
impl ChangeMethodSelfnessTrait for Foo {
|
2021-05-15 07:38:32 -05:00
|
|
|
#[rustc_clean(
|
2024-01-25 10:16:38 -06:00
|
|
|
except="opt_hir_owner_nodes,associated_item,generics_of,fn_sig,typeck,optimized_mir",
|
2021-05-15 07:38:32 -05:00
|
|
|
cfg="cfail2",
|
|
|
|
)]
|
2021-05-15 06:20:42 -05:00
|
|
|
#[rustc_clean(cfg="cfail3")]
|
2021-04-22 14:33:16 -05:00
|
|
|
#[rustc_clean(
|
2024-01-25 10:16:38 -06:00
|
|
|
except="opt_hir_owner_nodes,associated_item,generics_of,fn_sig,typeck,optimized_mir",
|
2021-04-22 14:33:16 -05:00
|
|
|
cfg="cfail5",
|
|
|
|
)]
|
|
|
|
#[rustc_clean(cfg="cfail6")]
|
2016-11-17 14:12:43 -06:00
|
|
|
fn method_name(&self) {
|
|
|
|
()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Change Method Selfness -----------------------------------------------------------
|
|
|
|
|
2021-04-22 14:33:16 -05:00
|
|
|
#[cfg(any(cfail1,cfail4))]
|
2016-11-17 14:12:43 -06:00
|
|
|
pub trait RemoveMethodSelfnessTrait {
|
|
|
|
fn method_name(&self);
|
|
|
|
}
|
|
|
|
|
2021-04-22 14:33:16 -05:00
|
|
|
#[cfg(any(cfail1,cfail4))]
|
2016-11-17 14:12:43 -06:00
|
|
|
impl RemoveMethodSelfnessTrait for Foo {
|
|
|
|
fn method_name(&self) { }
|
|
|
|
}
|
|
|
|
|
2021-04-22 14:33:16 -05:00
|
|
|
#[cfg(not(any(cfail1,cfail4)))]
|
2016-11-17 14:12:43 -06:00
|
|
|
pub trait RemoveMethodSelfnessTrait {
|
|
|
|
fn method_name();
|
|
|
|
}
|
|
|
|
|
2021-04-22 14:33:16 -05:00
|
|
|
#[cfg(not(any(cfail1,cfail4)))]
|
2024-01-25 10:16:38 -06:00
|
|
|
#[rustc_clean(except="opt_hir_owner_nodes", cfg="cfail2")]
|
2021-05-15 06:20:42 -05:00
|
|
|
#[rustc_clean(cfg="cfail3")]
|
2024-01-25 10:16:38 -06:00
|
|
|
#[rustc_clean(except="opt_hir_owner_nodes", cfg="cfail5")]
|
2021-04-22 14:33:16 -05:00
|
|
|
#[rustc_clean(cfg="cfail6")]
|
2016-11-17 14:12:43 -06:00
|
|
|
impl RemoveMethodSelfnessTrait for Foo {
|
2021-05-15 07:38:32 -05:00
|
|
|
#[rustc_clean(
|
2024-01-25 10:16:38 -06:00
|
|
|
except="opt_hir_owner_nodes,associated_item,generics_of,fn_sig,typeck,optimized_mir",
|
2021-05-15 07:38:32 -05:00
|
|
|
cfg="cfail2",
|
|
|
|
)]
|
2021-05-15 06:20:42 -05:00
|
|
|
#[rustc_clean(cfg="cfail3")]
|
2021-04-22 14:33:16 -05:00
|
|
|
#[rustc_clean(
|
2024-01-25 10:16:38 -06:00
|
|
|
except="opt_hir_owner_nodes,associated_item,generics_of,fn_sig,typeck,optimized_mir",
|
2021-04-22 14:33:16 -05:00
|
|
|
cfg="cfail5",
|
|
|
|
)]
|
|
|
|
#[rustc_clean(cfg="cfail6")]
|
2017-04-05 16:39:02 -05:00
|
|
|
fn method_name() {}
|
2016-11-17 14:12:43 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
// Change Method Selfmutness -----------------------------------------------------------
|
|
|
|
|
2021-04-22 14:33:16 -05:00
|
|
|
#[cfg(any(cfail1,cfail4))]
|
2016-11-17 14:12:43 -06:00
|
|
|
pub trait ChangeMethodSelfmutnessTrait {
|
|
|
|
fn method_name(&self);
|
|
|
|
}
|
|
|
|
|
2021-04-22 14:33:16 -05:00
|
|
|
#[cfg(any(cfail1,cfail4))]
|
2016-11-17 14:12:43 -06:00
|
|
|
impl ChangeMethodSelfmutnessTrait for Foo {
|
2024-01-25 10:16:38 -06:00
|
|
|
// -----------------------------------------------------------------------------------
|
2021-04-22 14:33:16 -05:00
|
|
|
// -------------------------
|
2024-01-25 10:16:38 -06:00
|
|
|
// -----------------------------------------------------------------------------------
|
2021-04-22 14:33:16 -05:00
|
|
|
// -------------------------
|
|
|
|
fn method_name(& self) {}
|
2016-11-17 14:12:43 -06:00
|
|
|
}
|
|
|
|
|
2021-04-22 14:33:16 -05:00
|
|
|
#[cfg(not(any(cfail1,cfail4)))]
|
2016-11-17 14:12:43 -06:00
|
|
|
pub trait ChangeMethodSelfmutnessTrait {
|
|
|
|
fn method_name(&mut self);
|
|
|
|
}
|
|
|
|
|
2021-04-22 14:33:16 -05:00
|
|
|
#[cfg(not(any(cfail1,cfail4)))]
|
2021-05-15 06:20:42 -05:00
|
|
|
#[rustc_clean(cfg="cfail2")]
|
|
|
|
#[rustc_clean(cfg="cfail3")]
|
2021-04-22 14:33:16 -05:00
|
|
|
#[rustc_clean(cfg="cfail5")]
|
|
|
|
#[rustc_clean(cfg="cfail6")]
|
2016-11-17 14:12:43 -06:00
|
|
|
impl ChangeMethodSelfmutnessTrait for Foo {
|
2024-01-25 10:16:38 -06:00
|
|
|
#[rustc_clean(except="opt_hir_owner_nodes,fn_sig,typeck,optimized_mir", cfg="cfail2")]
|
2021-05-15 06:20:42 -05:00
|
|
|
#[rustc_clean(cfg="cfail3")]
|
2024-01-25 10:16:38 -06:00
|
|
|
#[rustc_clean(except="opt_hir_owner_nodes,fn_sig,typeck,optimized_mir", cfg="cfail5")]
|
2021-04-22 14:33:16 -05:00
|
|
|
#[rustc_clean(cfg="cfail6")]
|
2017-04-05 16:39:02 -05:00
|
|
|
fn method_name(&mut self) {}
|
2016-11-17 14:12:43 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
// Change item kind -----------------------------------------------------------
|
|
|
|
|
2021-04-22 14:33:16 -05:00
|
|
|
#[cfg(any(cfail1,cfail4))]
|
2016-11-17 14:12:43 -06:00
|
|
|
pub trait ChangeItemKindTrait {
|
|
|
|
fn name();
|
|
|
|
}
|
|
|
|
|
2021-04-22 14:33:16 -05:00
|
|
|
#[cfg(any(cfail1,cfail4))]
|
2016-11-17 14:12:43 -06:00
|
|
|
impl ChangeItemKindTrait for Foo {
|
|
|
|
fn name() { }
|
|
|
|
}
|
|
|
|
|
2021-04-22 14:33:16 -05:00
|
|
|
#[cfg(not(any(cfail1,cfail4)))]
|
2016-11-17 14:12:43 -06:00
|
|
|
pub trait ChangeItemKindTrait {
|
|
|
|
type name;
|
|
|
|
}
|
|
|
|
|
2021-04-22 14:33:16 -05:00
|
|
|
#[cfg(not(any(cfail1,cfail4)))]
|
2024-01-25 10:16:38 -06:00
|
|
|
#[rustc_clean(except="opt_hir_owner_nodes,associated_item_def_ids", cfg="cfail2")]
|
2021-05-15 06:20:42 -05:00
|
|
|
#[rustc_clean(cfg="cfail3")]
|
2024-01-25 10:16:38 -06:00
|
|
|
#[rustc_clean(except="opt_hir_owner_nodes,associated_item_def_ids", cfg="cfail5")]
|
2021-04-22 14:33:16 -05:00
|
|
|
#[rustc_clean(cfg="cfail6")]
|
2016-11-17 14:12:43 -06:00
|
|
|
impl ChangeItemKindTrait for Foo {
|
|
|
|
type name = ();
|
|
|
|
}
|
|
|
|
|
|
|
|
// Remove item -----------------------------------------------------------
|
|
|
|
|
2021-04-22 14:33:16 -05:00
|
|
|
#[cfg(any(cfail1,cfail4))]
|
2016-11-17 14:12:43 -06:00
|
|
|
pub trait RemoveItemTrait {
|
|
|
|
type TypeName;
|
|
|
|
fn method_name();
|
|
|
|
}
|
|
|
|
|
2021-04-22 14:33:16 -05:00
|
|
|
#[cfg(any(cfail1,cfail4))]
|
2016-11-17 14:12:43 -06:00
|
|
|
impl RemoveItemTrait for Foo {
|
|
|
|
type TypeName = ();
|
|
|
|
fn method_name() { }
|
|
|
|
}
|
|
|
|
|
2021-04-22 14:33:16 -05:00
|
|
|
#[cfg(not(any(cfail1,cfail4)))]
|
2016-11-17 14:12:43 -06:00
|
|
|
pub trait RemoveItemTrait {
|
|
|
|
type TypeName;
|
|
|
|
}
|
|
|
|
|
2021-04-22 14:33:16 -05:00
|
|
|
#[cfg(not(any(cfail1,cfail4)))]
|
2024-01-25 10:16:38 -06:00
|
|
|
#[rustc_clean(except="opt_hir_owner_nodes,associated_item_def_ids", cfg="cfail2")]
|
2021-05-15 06:20:42 -05:00
|
|
|
#[rustc_clean(cfg="cfail3")]
|
2024-01-25 10:16:38 -06:00
|
|
|
#[rustc_clean(except="opt_hir_owner_nodes,associated_item_def_ids", cfg="cfail5")]
|
2021-04-22 14:33:16 -05:00
|
|
|
#[rustc_clean(cfg="cfail6")]
|
2016-11-17 14:12:43 -06:00
|
|
|
impl RemoveItemTrait for Foo {
|
|
|
|
type TypeName = ();
|
|
|
|
}
|
|
|
|
|
|
|
|
// Add item -----------------------------------------------------------
|
|
|
|
|
2021-04-22 14:33:16 -05:00
|
|
|
#[cfg(any(cfail1,cfail4))]
|
2016-11-17 14:12:43 -06:00
|
|
|
pub trait AddItemTrait {
|
|
|
|
type TypeName;
|
|
|
|
}
|
|
|
|
|
2021-04-22 14:33:16 -05:00
|
|
|
#[cfg(any(cfail1,cfail4))]
|
2016-11-17 14:12:43 -06:00
|
|
|
impl AddItemTrait for Foo {
|
|
|
|
type TypeName = ();
|
|
|
|
}
|
|
|
|
|
2021-04-22 14:33:16 -05:00
|
|
|
#[cfg(not(any(cfail1,cfail4)))]
|
2016-11-17 14:12:43 -06:00
|
|
|
pub trait AddItemTrait {
|
|
|
|
type TypeName;
|
|
|
|
fn method_name();
|
|
|
|
}
|
|
|
|
|
2021-04-22 14:33:16 -05:00
|
|
|
#[cfg(not(any(cfail1,cfail4)))]
|
2024-01-25 10:16:38 -06:00
|
|
|
#[rustc_clean(except="opt_hir_owner_nodes,associated_item_def_ids", cfg="cfail2")]
|
2021-05-15 06:20:42 -05:00
|
|
|
#[rustc_clean(cfg="cfail3")]
|
2024-01-25 10:16:38 -06:00
|
|
|
#[rustc_clean(except="opt_hir_owner_nodes,associated_item_def_ids", cfg="cfail5")]
|
2021-04-22 14:33:16 -05:00
|
|
|
#[rustc_clean(cfg="cfail6")]
|
2016-11-17 14:12:43 -06:00
|
|
|
impl AddItemTrait for Foo {
|
|
|
|
type TypeName = ();
|
|
|
|
fn method_name() { }
|
|
|
|
}
|
|
|
|
|
|
|
|
// Change has-value -----------------------------------------------------------
|
|
|
|
|
2021-04-22 14:33:16 -05:00
|
|
|
#[cfg(any(cfail1,cfail4))]
|
2016-11-17 14:12:43 -06:00
|
|
|
pub trait ChangeHasValueTrait {
|
2024-01-25 10:16:38 -06:00
|
|
|
//--------------------------------------------------------
|
2022-07-30 11:43:37 -05:00
|
|
|
//--------------------------
|
2024-01-25 10:16:38 -06:00
|
|
|
//--------------------------------------------------------
|
2022-07-30 11:43:37 -05:00
|
|
|
//--------------------------
|
|
|
|
fn method_name() ;
|
2016-11-17 14:12:43 -06:00
|
|
|
}
|
|
|
|
|
2021-04-22 14:33:16 -05:00
|
|
|
#[cfg(any(cfail1,cfail4))]
|
2016-11-17 14:12:43 -06:00
|
|
|
impl ChangeHasValueTrait for Foo {
|
|
|
|
fn method_name() { }
|
|
|
|
}
|
|
|
|
|
2021-04-22 14:33:16 -05:00
|
|
|
#[cfg(not(any(cfail1,cfail4)))]
|
2024-01-16 17:46:07 -06:00
|
|
|
#[rustc_clean(cfg="cfail2")]
|
2021-05-15 06:20:42 -05:00
|
|
|
#[rustc_clean(cfg="cfail3")]
|
2024-01-16 17:46:07 -06:00
|
|
|
#[rustc_clean(cfg="cfail5")]
|
2021-04-22 14:33:16 -05:00
|
|
|
#[rustc_clean(cfg="cfail6")]
|
2016-11-17 14:12:43 -06:00
|
|
|
pub trait ChangeHasValueTrait {
|
2024-01-25 10:16:38 -06:00
|
|
|
#[rustc_clean(except="opt_hir_owner_nodes", cfg="cfail2")]
|
2021-05-15 06:20:42 -05:00
|
|
|
#[rustc_clean(cfg="cfail3")]
|
2024-01-25 10:16:38 -06:00
|
|
|
#[rustc_clean(except="opt_hir_owner_nodes", cfg="cfail5")]
|
2021-04-22 14:33:16 -05:00
|
|
|
#[rustc_clean(cfg="cfail6")]
|
2016-11-17 14:12:43 -06:00
|
|
|
fn method_name() { }
|
|
|
|
}
|
|
|
|
|
2021-04-22 14:33:16 -05:00
|
|
|
#[cfg(not(any(cfail1,cfail4)))]
|
2021-05-15 06:20:42 -05:00
|
|
|
#[rustc_clean(cfg="cfail2")]
|
|
|
|
#[rustc_clean(cfg="cfail3")]
|
2021-04-22 14:33:16 -05:00
|
|
|
#[rustc_clean(cfg="cfail5")]
|
|
|
|
#[rustc_clean(cfg="cfail6")]
|
2016-11-17 14:12:43 -06:00
|
|
|
impl ChangeHasValueTrait for Foo {
|
|
|
|
fn method_name() { }
|
|
|
|
}
|
|
|
|
|
|
|
|
// Add default
|
|
|
|
|
|
|
|
pub trait AddDefaultTrait {
|
|
|
|
fn method_name();
|
|
|
|
}
|
|
|
|
|
2021-04-22 14:33:16 -05:00
|
|
|
#[cfg(any(cfail1,cfail4))]
|
2016-11-17 14:12:43 -06:00
|
|
|
impl AddDefaultTrait for Foo {
|
2024-01-25 10:16:38 -06:00
|
|
|
// -------------------------------------------------------
|
2021-04-22 14:33:16 -05:00
|
|
|
// -------------------------
|
2024-01-25 10:16:38 -06:00
|
|
|
// -------------------------------------------------------
|
2022-02-02 05:44:51 -06:00
|
|
|
// -------------------------
|
|
|
|
fn method_name() { }
|
2016-11-17 14:12:43 -06:00
|
|
|
}
|
|
|
|
|
2021-04-22 14:33:16 -05:00
|
|
|
#[cfg(not(any(cfail1,cfail4)))]
|
2022-07-30 11:43:37 -05:00
|
|
|
#[rustc_clean(cfg="cfail2")]
|
2021-05-15 06:20:42 -05:00
|
|
|
#[rustc_clean(cfg="cfail3")]
|
2022-07-30 11:43:37 -05:00
|
|
|
#[rustc_clean(cfg="cfail5")]
|
2021-04-22 14:33:16 -05:00
|
|
|
#[rustc_clean(cfg="cfail6")]
|
2016-11-17 14:12:43 -06:00
|
|
|
impl AddDefaultTrait for Foo {
|
2024-01-25 10:16:38 -06:00
|
|
|
#[rustc_clean(except="opt_hir_owner_nodes", cfg="cfail2")]
|
2021-05-15 06:20:42 -05:00
|
|
|
#[rustc_clean(cfg="cfail3")]
|
2024-01-25 10:16:38 -06:00
|
|
|
#[rustc_clean(except="opt_hir_owner_nodes", cfg="cfail5")]
|
2021-04-22 14:33:16 -05:00
|
|
|
#[rustc_clean(cfg="cfail6")]
|
2016-11-17 14:12:43 -06:00
|
|
|
default fn method_name() { }
|
|
|
|
}
|
|
|
|
|
|
|
|
// Add arguments
|
|
|
|
|
2021-04-22 14:33:16 -05:00
|
|
|
#[cfg(any(cfail1,cfail4))]
|
2016-11-17 14:12:43 -06:00
|
|
|
pub trait AddArgumentTrait {
|
|
|
|
fn method_name(&self);
|
|
|
|
}
|
|
|
|
|
2021-04-22 14:33:16 -05:00
|
|
|
#[cfg(any(cfail1,cfail4))]
|
2016-11-17 14:12:43 -06:00
|
|
|
impl AddArgumentTrait for Foo {
|
2024-01-25 10:16:38 -06:00
|
|
|
// -----------------------------------------------------------------------------------
|
2021-04-22 14:33:16 -05:00
|
|
|
// -------------------------
|
2024-01-25 10:16:38 -06:00
|
|
|
// -----------------------------------------------------------------------------------
|
2021-04-22 14:33:16 -05:00
|
|
|
// -------------------------
|
|
|
|
fn method_name(&self ) { }
|
2016-11-17 14:12:43 -06:00
|
|
|
}
|
|
|
|
|
2021-04-22 14:33:16 -05:00
|
|
|
#[cfg(not(any(cfail1,cfail4)))]
|
2016-11-17 14:12:43 -06:00
|
|
|
pub trait AddArgumentTrait {
|
|
|
|
fn method_name(&self, x: u32);
|
|
|
|
}
|
|
|
|
|
2021-04-22 14:33:16 -05:00
|
|
|
#[cfg(not(any(cfail1,cfail4)))]
|
2021-05-15 06:20:42 -05:00
|
|
|
#[rustc_clean(cfg="cfail2")]
|
|
|
|
#[rustc_clean(cfg="cfail3")]
|
2021-04-22 14:33:16 -05:00
|
|
|
#[rustc_clean(cfg="cfail5")]
|
|
|
|
#[rustc_clean(cfg="cfail6")]
|
2016-11-17 14:12:43 -06:00
|
|
|
impl AddArgumentTrait for Foo {
|
2024-01-25 10:16:38 -06:00
|
|
|
#[rustc_clean(except="opt_hir_owner_nodes,fn_sig,typeck,optimized_mir", cfg="cfail2")]
|
2021-05-15 06:20:42 -05:00
|
|
|
#[rustc_clean(cfg="cfail3")]
|
2024-01-25 10:16:38 -06:00
|
|
|
#[rustc_clean(except="opt_hir_owner_nodes,fn_sig,typeck,optimized_mir", cfg="cfail5")]
|
2021-04-22 14:33:16 -05:00
|
|
|
#[rustc_clean(cfg="cfail6")]
|
2016-11-17 14:12:43 -06:00
|
|
|
fn method_name(&self, _x: u32) { }
|
|
|
|
}
|
|
|
|
|
|
|
|
// Change argument type
|
|
|
|
|
2021-04-22 14:33:16 -05:00
|
|
|
#[cfg(any(cfail1,cfail4))]
|
2016-11-17 14:12:43 -06:00
|
|
|
pub trait ChangeArgumentTypeTrait {
|
|
|
|
fn method_name(&self, x: u32);
|
|
|
|
}
|
|
|
|
|
2021-04-22 14:33:16 -05:00
|
|
|
#[cfg(any(cfail1,cfail4))]
|
2016-11-17 14:12:43 -06:00
|
|
|
impl ChangeArgumentTypeTrait for Foo {
|
2024-01-25 10:16:38 -06:00
|
|
|
// -----------------------------------------------------------------------------------
|
2021-04-22 14:33:16 -05:00
|
|
|
// -------------------------
|
2024-01-25 10:16:38 -06:00
|
|
|
// -----------------------------------------------------------------------------------
|
2021-04-22 14:33:16 -05:00
|
|
|
// -------------------------
|
|
|
|
fn method_name(&self, _x: u32 ) { }
|
2016-11-17 14:12:43 -06:00
|
|
|
}
|
|
|
|
|
2021-04-22 14:33:16 -05:00
|
|
|
#[cfg(not(any(cfail1,cfail4)))]
|
2016-11-17 14:12:43 -06:00
|
|
|
pub trait ChangeArgumentTypeTrait {
|
|
|
|
fn method_name(&self, x: char);
|
|
|
|
}
|
|
|
|
|
2021-04-22 14:33:16 -05:00
|
|
|
#[cfg(not(any(cfail1,cfail4)))]
|
2021-05-15 06:20:42 -05:00
|
|
|
#[rustc_clean(cfg="cfail2")]
|
|
|
|
#[rustc_clean(cfg="cfail3")]
|
2021-04-22 14:33:16 -05:00
|
|
|
#[rustc_clean(cfg="cfail5")]
|
|
|
|
#[rustc_clean(cfg="cfail6")]
|
2016-11-17 14:12:43 -06:00
|
|
|
impl ChangeArgumentTypeTrait for Foo {
|
2024-01-25 10:16:38 -06:00
|
|
|
#[rustc_clean(except="opt_hir_owner_nodes,fn_sig,typeck,optimized_mir", cfg="cfail2")]
|
2021-05-15 06:20:42 -05:00
|
|
|
#[rustc_clean(cfg="cfail3")]
|
2024-01-25 10:16:38 -06:00
|
|
|
#[rustc_clean(except="opt_hir_owner_nodes,fn_sig,typeck,optimized_mir", cfg="cfail5")]
|
2021-04-22 14:33:16 -05:00
|
|
|
#[rustc_clean(cfg="cfail6")]
|
2016-11-17 14:12:43 -06:00
|
|
|
fn method_name(&self, _x: char) { }
|
|
|
|
}
|
|
|
|
|
2017-01-05 09:53:29 -06:00
|
|
|
|
|
|
|
|
|
|
|
struct Bar<T>(T);
|
|
|
|
|
|
|
|
// Add Type Parameter To Impl --------------------------------------------------
|
|
|
|
trait AddTypeParameterToImpl<T> {
|
|
|
|
fn id(t: T) -> T;
|
|
|
|
}
|
|
|
|
|
2021-04-22 14:33:16 -05:00
|
|
|
#[cfg(any(cfail1,cfail4))]
|
2017-01-05 09:53:29 -06:00
|
|
|
impl AddTypeParameterToImpl<u32> for Bar<u32> {
|
|
|
|
fn id(t: u32) -> u32 { t }
|
|
|
|
}
|
|
|
|
|
2021-04-22 14:33:16 -05:00
|
|
|
#[cfg(not(any(cfail1,cfail4)))]
|
2024-02-10 15:26:48 -06:00
|
|
|
#[rustc_clean(except="opt_hir_owner_nodes,generics_of,impl_trait_header", cfg="cfail2")]
|
2021-05-15 06:20:42 -05:00
|
|
|
#[rustc_clean(cfg="cfail3")]
|
2024-02-10 15:26:48 -06:00
|
|
|
#[rustc_clean(except="opt_hir_owner_nodes,generics_of,impl_trait_header", cfg="cfail5")]
|
2021-04-22 14:33:16 -05:00
|
|
|
#[rustc_clean(cfg="cfail6")]
|
|
|
|
impl<TTT> AddTypeParameterToImpl<TTT> for Bar<TTT> {
|
2021-05-15 07:38:32 -05:00
|
|
|
#[rustc_clean(
|
2024-01-25 10:16:38 -06:00
|
|
|
except="opt_hir_owner_nodes,generics_of,fn_sig,type_of,typeck,optimized_mir",
|
2021-05-15 07:38:32 -05:00
|
|
|
cfg="cfail2",
|
|
|
|
)]
|
2021-05-15 06:20:42 -05:00
|
|
|
#[rustc_clean(cfg="cfail3")]
|
2021-04-22 14:33:16 -05:00
|
|
|
#[rustc_clean(
|
2024-01-25 10:16:38 -06:00
|
|
|
except="opt_hir_owner_nodes,generics_of,fn_sig,type_of,typeck,optimized_mir",
|
2021-04-22 14:33:16 -05:00
|
|
|
cfg="cfail5",
|
|
|
|
)]
|
|
|
|
#[rustc_clean(cfg="cfail6")]
|
|
|
|
fn id(t: TTT) -> TTT { t }
|
2017-01-05 09:53:29 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Change Self Type of Impl ----------------------------------------------------
|
|
|
|
trait ChangeSelfTypeOfImpl {
|
|
|
|
fn id(self) -> Self;
|
|
|
|
}
|
|
|
|
|
2021-04-22 14:33:16 -05:00
|
|
|
#[cfg(any(cfail1,cfail4))]
|
2017-01-05 09:53:29 -06:00
|
|
|
impl ChangeSelfTypeOfImpl for u32 {
|
|
|
|
fn id(self) -> Self { self }
|
|
|
|
}
|
|
|
|
|
2021-04-22 14:33:16 -05:00
|
|
|
#[cfg(not(any(cfail1,cfail4)))]
|
2024-02-10 15:26:48 -06:00
|
|
|
#[rustc_clean(except="opt_hir_owner_nodes,impl_trait_header", cfg="cfail2")]
|
2021-05-15 06:20:42 -05:00
|
|
|
#[rustc_clean(cfg="cfail3")]
|
2024-02-10 15:26:48 -06:00
|
|
|
#[rustc_clean(except="opt_hir_owner_nodes,impl_trait_header", cfg="cfail5")]
|
2021-04-22 14:33:16 -05:00
|
|
|
#[rustc_clean(cfg="cfail6")]
|
2017-01-05 09:53:29 -06:00
|
|
|
impl ChangeSelfTypeOfImpl for u64 {
|
2021-05-15 07:38:32 -05:00
|
|
|
#[rustc_clean(except="fn_sig,typeck,optimized_mir", cfg="cfail2")]
|
2021-05-15 06:20:42 -05:00
|
|
|
#[rustc_clean(cfg="cfail3")]
|
2021-04-22 14:33:16 -05:00
|
|
|
#[rustc_clean(except="fn_sig,typeck,optimized_mir", cfg="cfail5")]
|
|
|
|
#[rustc_clean(cfg="cfail6")]
|
2017-01-05 09:53:29 -06:00
|
|
|
fn id(self) -> Self { self }
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Add Lifetime Bound to Impl --------------------------------------------------
|
|
|
|
trait AddLifetimeBoundToImplParameter {
|
|
|
|
fn id(self) -> Self;
|
|
|
|
}
|
|
|
|
|
2021-04-22 14:33:16 -05:00
|
|
|
#[cfg(any(cfail1,cfail4))]
|
2017-01-05 09:53:29 -06:00
|
|
|
impl<T> AddLifetimeBoundToImplParameter for T {
|
|
|
|
fn id(self) -> Self { self }
|
|
|
|
}
|
|
|
|
|
2021-04-22 14:33:16 -05:00
|
|
|
#[cfg(not(any(cfail1,cfail4)))]
|
2024-01-25 10:16:38 -06:00
|
|
|
#[rustc_clean(except="opt_hir_owner_nodes", cfg="cfail2")]
|
2021-05-15 06:20:42 -05:00
|
|
|
#[rustc_clean(cfg="cfail3")]
|
2024-01-25 10:16:38 -06:00
|
|
|
#[rustc_clean(except="opt_hir_owner_nodes", cfg="cfail5")]
|
2021-04-22 14:33:16 -05:00
|
|
|
#[rustc_clean(cfg="cfail6")]
|
2017-01-05 09:53:29 -06:00
|
|
|
impl<T: 'static> AddLifetimeBoundToImplParameter for T {
|
2021-05-15 06:20:42 -05:00
|
|
|
#[rustc_clean(cfg="cfail2")]
|
|
|
|
#[rustc_clean(cfg="cfail3")]
|
2021-04-22 14:33:16 -05:00
|
|
|
#[rustc_clean(cfg="cfail5")]
|
|
|
|
#[rustc_clean(cfg="cfail6")]
|
2017-01-05 09:53:29 -06:00
|
|
|
fn id(self) -> Self { self }
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Add Trait Bound to Impl Parameter -------------------------------------------
|
|
|
|
trait AddTraitBoundToImplParameter {
|
|
|
|
fn id(self) -> Self;
|
|
|
|
}
|
|
|
|
|
2021-04-22 14:33:16 -05:00
|
|
|
#[cfg(any(cfail1,cfail4))]
|
2017-01-05 09:53:29 -06:00
|
|
|
impl<T> AddTraitBoundToImplParameter for T {
|
|
|
|
fn id(self) -> Self { self }
|
|
|
|
}
|
|
|
|
|
2021-04-22 14:33:16 -05:00
|
|
|
#[cfg(not(any(cfail1,cfail4)))]
|
2024-01-25 10:16:38 -06:00
|
|
|
#[rustc_clean(except="opt_hir_owner_nodes", cfg="cfail2")]
|
2021-05-15 06:20:42 -05:00
|
|
|
#[rustc_clean(cfg="cfail3")]
|
2024-01-25 10:16:38 -06:00
|
|
|
#[rustc_clean(except="opt_hir_owner_nodes", cfg="cfail5")]
|
2021-04-22 14:33:16 -05:00
|
|
|
#[rustc_clean(cfg="cfail6")]
|
2017-01-05 09:53:29 -06:00
|
|
|
impl<T: Clone> AddTraitBoundToImplParameter for T {
|
2021-05-15 06:20:42 -05:00
|
|
|
#[rustc_clean(cfg="cfail2")]
|
|
|
|
#[rustc_clean(cfg="cfail3")]
|
2021-04-22 14:33:16 -05:00
|
|
|
#[rustc_clean(cfg="cfail5")]
|
|
|
|
#[rustc_clean(cfg="cfail6")]
|
2017-01-05 09:53:29 -06:00
|
|
|
fn id(self) -> Self { self }
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Add #[no_mangle] to Method --------------------------------------------------
|
|
|
|
trait AddNoMangleToMethod {
|
|
|
|
fn add_no_mangle_to_method(&self) { }
|
|
|
|
}
|
|
|
|
|
2021-04-22 14:33:16 -05:00
|
|
|
#[cfg(any(cfail1,cfail4))]
|
2017-01-05 09:53:29 -06:00
|
|
|
impl AddNoMangleToMethod for Foo {
|
2021-04-22 14:33:16 -05:00
|
|
|
// -------------------------
|
|
|
|
// -------------------------
|
|
|
|
// -------------------------
|
|
|
|
// -------------------------
|
|
|
|
// ---------
|
2017-01-05 09:53:29 -06:00
|
|
|
fn add_no_mangle_to_method(&self) { }
|
|
|
|
}
|
|
|
|
|
2021-04-22 14:33:16 -05:00
|
|
|
#[cfg(not(any(cfail1,cfail4)))]
|
2021-05-15 06:20:42 -05:00
|
|
|
#[rustc_clean(cfg="cfail2")]
|
|
|
|
#[rustc_clean(cfg="cfail3")]
|
2021-04-22 14:33:16 -05:00
|
|
|
#[rustc_clean(cfg="cfail5")]
|
|
|
|
#[rustc_clean(cfg="cfail6")]
|
2017-01-05 09:53:29 -06:00
|
|
|
impl AddNoMangleToMethod for Foo {
|
2021-05-15 06:20:42 -05:00
|
|
|
#[rustc_clean(cfg="cfail2")]
|
|
|
|
#[rustc_clean(cfg="cfail3")]
|
2021-04-22 14:33:16 -05:00
|
|
|
#[rustc_clean(cfg="cfail5")]
|
|
|
|
#[rustc_clean(cfg="cfail6")]
|
2017-01-05 09:53:29 -06:00
|
|
|
#[no_mangle]
|
|
|
|
fn add_no_mangle_to_method(&self) { }
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Make Method #[inline] -------------------------------------------------------
|
|
|
|
trait MakeMethodInline {
|
|
|
|
fn make_method_inline(&self) -> u8 { 0 }
|
|
|
|
}
|
|
|
|
|
2021-04-22 14:33:16 -05:00
|
|
|
#[cfg(any(cfail1,cfail4))]
|
2017-01-05 09:53:29 -06:00
|
|
|
impl MakeMethodInline for Foo {
|
2021-04-22 14:33:16 -05:00
|
|
|
// -------------------------
|
|
|
|
// -------------------------
|
|
|
|
// -------------------------
|
|
|
|
// -------------------------
|
|
|
|
// ------
|
2017-01-05 09:53:29 -06:00
|
|
|
fn make_method_inline(&self) -> u8 { 0 }
|
|
|
|
}
|
|
|
|
|
2021-04-22 14:33:16 -05:00
|
|
|
#[cfg(not(any(cfail1,cfail4)))]
|
2021-05-15 06:20:42 -05:00
|
|
|
#[rustc_clean(cfg="cfail2")]
|
|
|
|
#[rustc_clean(cfg="cfail3")]
|
2021-04-22 14:33:16 -05:00
|
|
|
#[rustc_clean(cfg="cfail5")]
|
|
|
|
#[rustc_clean(cfg="cfail6")]
|
2017-01-05 09:53:29 -06:00
|
|
|
impl MakeMethodInline for Foo {
|
2021-05-15 06:20:42 -05:00
|
|
|
#[rustc_clean(cfg="cfail2")]
|
|
|
|
#[rustc_clean(cfg="cfail3")]
|
2021-04-22 14:33:16 -05:00
|
|
|
#[rustc_clean(cfg="cfail5")]
|
|
|
|
#[rustc_clean(cfg="cfail6")]
|
2017-01-05 09:53:29 -06:00
|
|
|
#[inline]
|
|
|
|
fn make_method_inline(&self) -> u8 { 0 }
|
|
|
|
}
|