2016-10-03 15:59:16 -05:00
|
|
|
// This test case tests the incremental compilation hash (ICH) implementation
|
|
|
|
// for trait definitions.
|
|
|
|
|
|
|
|
// 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.
|
|
|
|
|
|
|
|
// We also test the ICH for trait definitions exported in metadata. Same as
|
|
|
|
// above, we want to make sure that the change between rev1 and rev2 also
|
|
|
|
// results in a change of the ICH for the trait's metadata, and that it stays
|
|
|
|
// the same between rev2 and rev3.
|
|
|
|
|
2019-07-02 16:30:28 -05:00
|
|
|
// build-pass (FIXME(62277): could be check-pass?)
|
2016-10-03 15:59:16 -05:00
|
|
|
// revisions: cfail1 cfail2 cfail3
|
2017-12-04 05:47:16 -06:00
|
|
|
// compile-flags: -Z query-dep-graph -Zincremental-ignore-spans
|
2016-10-03 15:59:16 -05:00
|
|
|
|
|
|
|
#![allow(warnings)]
|
|
|
|
#![feature(rustc_attrs)]
|
|
|
|
#![crate_type="rlib"]
|
|
|
|
#![feature(associated_type_defaults)]
|
|
|
|
|
|
|
|
|
2019-08-19 16:31:46 -05:00
|
|
|
// Change trait visibility
|
2016-10-03 15:59:16 -05:00
|
|
|
#[cfg(cfail1)]
|
|
|
|
trait TraitVisibility { }
|
|
|
|
|
|
|
|
#[cfg(not(cfail1))]
|
|
|
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
|
|
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
|
|
|
pub trait TraitVisibility { }
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-08-19 16:31:46 -05:00
|
|
|
// Change trait unsafety
|
2016-10-10 10:57:49 -05:00
|
|
|
#[cfg(cfail1)]
|
|
|
|
trait TraitUnsafety { }
|
2016-10-03 15:59:16 -05:00
|
|
|
|
2016-10-10 10:57:49 -05:00
|
|
|
#[cfg(not(cfail1))]
|
|
|
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
|
|
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
|
|
|
unsafe trait TraitUnsafety { }
|
2016-10-03 15:59:16 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
2019-08-19 16:31:46 -05:00
|
|
|
// Add method
|
2016-10-03 15:59:16 -05:00
|
|
|
#[cfg(cfail1)]
|
|
|
|
trait TraitAddMethod {
|
|
|
|
}
|
|
|
|
|
|
|
|
#[cfg(not(cfail1))]
|
|
|
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
|
|
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
|
|
|
pub trait TraitAddMethod {
|
|
|
|
fn method();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-08-19 16:31:46 -05:00
|
|
|
// Change name of method
|
2016-10-03 15:59:16 -05:00
|
|
|
#[cfg(cfail1)]
|
|
|
|
trait TraitChangeMethodName {
|
|
|
|
fn method();
|
|
|
|
}
|
|
|
|
|
|
|
|
#[cfg(not(cfail1))]
|
|
|
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
|
|
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
|
|
|
trait TraitChangeMethodName {
|
|
|
|
fn methodChanged();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-08-19 16:31:46 -05:00
|
|
|
// Add return type to method
|
2016-10-03 15:59:16 -05:00
|
|
|
#[cfg(cfail1)]
|
|
|
|
trait TraitAddReturnType {
|
|
|
|
fn method();
|
|
|
|
}
|
|
|
|
|
|
|
|
#[cfg(not(cfail1))]
|
2016-12-03 20:21:06 -06:00
|
|
|
#[rustc_clean(label="Hir", cfg="cfail2")]
|
2016-10-03 15:59:16 -05:00
|
|
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
|
|
|
trait TraitAddReturnType {
|
2016-12-03 20:21:06 -06:00
|
|
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
|
|
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
2016-10-03 15:59:16 -05:00
|
|
|
fn method() -> u32;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-08-19 16:31:46 -05:00
|
|
|
// Change return type of method
|
2016-10-03 15:59:16 -05:00
|
|
|
#[cfg(cfail1)]
|
|
|
|
trait TraitChangeReturnType {
|
|
|
|
fn method() -> u32;
|
|
|
|
}
|
|
|
|
|
|
|
|
#[cfg(not(cfail1))]
|
2016-12-03 20:21:06 -06:00
|
|
|
#[rustc_clean(label="Hir", cfg="cfail2")]
|
2016-10-03 15:59:16 -05:00
|
|
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
|
|
|
trait TraitChangeReturnType {
|
2016-12-03 20:21:06 -06:00
|
|
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
|
|
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
2016-10-03 15:59:16 -05:00
|
|
|
fn method() -> u64;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-08-19 16:31:46 -05:00
|
|
|
// Add parameter to method
|
2016-10-03 15:59:16 -05:00
|
|
|
#[cfg(cfail1)]
|
|
|
|
trait TraitAddParameterToMethod {
|
|
|
|
fn method();
|
|
|
|
}
|
|
|
|
|
|
|
|
#[cfg(not(cfail1))]
|
2016-12-03 20:21:06 -06:00
|
|
|
#[rustc_clean(label="Hir", cfg="cfail2")]
|
2016-10-03 15:59:16 -05:00
|
|
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
|
|
|
trait TraitAddParameterToMethod {
|
2016-12-03 20:21:06 -06:00
|
|
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
|
|
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
2016-10-03 15:59:16 -05:00
|
|
|
fn method(a: u32);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-08-19 16:31:46 -05:00
|
|
|
// Change name of method parameter
|
2016-10-03 15:59:16 -05:00
|
|
|
#[cfg(cfail1)]
|
|
|
|
trait TraitChangeMethodParameterName {
|
|
|
|
fn method(a: u32);
|
2016-12-20 14:46:11 -06:00
|
|
|
fn with_default(x: i32) {}
|
2016-10-03 15:59:16 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
#[cfg(not(cfail1))]
|
2016-12-03 20:21:06 -06:00
|
|
|
#[rustc_clean(label="Hir", cfg="cfail2")]
|
2016-10-03 15:59:16 -05:00
|
|
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
|
|
|
trait TraitChangeMethodParameterName {
|
2016-12-20 14:46:11 -06:00
|
|
|
// FIXME(#38501) This should preferably always be clean.
|
2016-12-03 20:21:06 -06:00
|
|
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
|
|
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
2016-10-03 15:59:16 -05:00
|
|
|
fn method(b: u32);
|
2016-12-20 14:46:11 -06:00
|
|
|
|
|
|
|
#[rustc_clean(label="Hir", cfg="cfail2")]
|
|
|
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
2020-02-12 08:34:10 -06:00
|
|
|
#[rustc_dirty(label="hir_owner_items", cfg="cfail2")]
|
|
|
|
#[rustc_clean(label="hir_owner_items", cfg="cfail3")]
|
2016-12-20 14:46:11 -06:00
|
|
|
fn with_default(y: i32) {}
|
2016-10-03 15:59:16 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-08-19 16:31:46 -05:00
|
|
|
// Change type of method parameter (i32 => i64)
|
2016-10-03 15:59:16 -05:00
|
|
|
#[cfg(cfail1)]
|
|
|
|
trait TraitChangeMethodParameterType {
|
|
|
|
fn method(a: i32);
|
|
|
|
}
|
|
|
|
|
|
|
|
#[cfg(not(cfail1))]
|
2016-12-03 20:21:06 -06:00
|
|
|
#[rustc_clean(label="Hir", cfg="cfail2")]
|
2016-10-03 15:59:16 -05:00
|
|
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
|
|
|
trait TraitChangeMethodParameterType {
|
2016-12-03 20:21:06 -06:00
|
|
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
|
|
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
2016-10-03 15:59:16 -05:00
|
|
|
fn method(a: i64);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-08-19 16:31:46 -05:00
|
|
|
// Change type of method parameter (&i32 => &mut i32)
|
2016-10-10 10:57:49 -05:00
|
|
|
#[cfg(cfail1)]
|
|
|
|
trait TraitChangeMethodParameterTypeRef {
|
|
|
|
fn method(a: &i32);
|
|
|
|
}
|
2016-10-03 15:59:16 -05:00
|
|
|
|
2016-10-10 10:57:49 -05:00
|
|
|
#[cfg(not(cfail1))]
|
2016-12-03 20:21:06 -06:00
|
|
|
#[rustc_clean(label="Hir", cfg="cfail2")]
|
2016-10-10 10:57:49 -05:00
|
|
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
|
|
|
trait TraitChangeMethodParameterTypeRef {
|
2016-12-03 20:21:06 -06:00
|
|
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
|
|
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
2016-10-10 10:57:49 -05:00
|
|
|
fn method(a: &mut i32);
|
|
|
|
}
|
2016-10-03 15:59:16 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
2019-08-19 16:31:46 -05:00
|
|
|
// Change order of method parameters
|
2016-10-03 15:59:16 -05:00
|
|
|
#[cfg(cfail1)]
|
|
|
|
trait TraitChangeMethodParametersOrder {
|
2016-10-05 15:05:54 -05:00
|
|
|
fn method(a: i32, b: i64);
|
2016-10-03 15:59:16 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
#[cfg(not(cfail1))]
|
2016-12-03 20:21:06 -06:00
|
|
|
#[rustc_clean(label="Hir", cfg="cfail2")]
|
2016-10-03 15:59:16 -05:00
|
|
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
|
|
|
trait TraitChangeMethodParametersOrder {
|
2016-12-03 20:21:06 -06:00
|
|
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
|
|
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
2016-10-05 15:05:54 -05:00
|
|
|
fn method(b: i64, a: i32);
|
2016-10-03 15:59:16 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-08-19 16:31:46 -05:00
|
|
|
// Add default implementation to method
|
2016-10-03 15:59:16 -05:00
|
|
|
#[cfg(cfail1)]
|
2017-10-09 11:59:20 -05:00
|
|
|
trait TraitAddMethodAutoImplementation {
|
2016-10-03 15:59:16 -05:00
|
|
|
fn method();
|
|
|
|
}
|
|
|
|
|
|
|
|
#[cfg(not(cfail1))]
|
|
|
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
|
|
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
2017-10-09 11:59:20 -05:00
|
|
|
trait TraitAddMethodAutoImplementation {
|
2017-04-05 16:39:02 -05:00
|
|
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
|
|
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
2016-10-03 15:59:16 -05:00
|
|
|
fn method() { }
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-08-19 16:31:46 -05:00
|
|
|
// Change order of methods
|
2016-10-03 15:59:16 -05:00
|
|
|
#[cfg(cfail1)]
|
|
|
|
trait TraitChangeOrderOfMethods {
|
|
|
|
fn method0();
|
|
|
|
fn method1();
|
|
|
|
}
|
|
|
|
|
|
|
|
#[cfg(not(cfail1))]
|
|
|
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
|
|
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
|
|
|
trait TraitChangeOrderOfMethods {
|
|
|
|
fn method1();
|
|
|
|
fn method0();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-08-19 16:31:46 -05:00
|
|
|
// Change mode of self parameter
|
2016-10-10 10:57:49 -05:00
|
|
|
#[cfg(cfail1)]
|
|
|
|
trait TraitChangeModeSelfRefToMut {
|
|
|
|
fn method(&self);
|
|
|
|
}
|
|
|
|
|
|
|
|
#[cfg(not(cfail1))]
|
2016-12-03 20:21:06 -06:00
|
|
|
#[rustc_clean(label="Hir", cfg="cfail2")]
|
2016-10-10 10:57:49 -05:00
|
|
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
|
|
|
trait TraitChangeModeSelfRefToMut {
|
2016-12-03 20:21:06 -06:00
|
|
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
|
|
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
2016-10-10 10:57:49 -05:00
|
|
|
fn method(&mut self);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#[cfg(cfail1)]
|
2016-10-21 19:33:36 -05:00
|
|
|
trait TraitChangeModeSelfOwnToMut: Sized {
|
|
|
|
fn method(self) {}
|
2016-10-10 10:57:49 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
#[cfg(not(cfail1))]
|
2016-12-03 20:21:06 -06:00
|
|
|
#[rustc_clean(label="Hir", cfg="cfail2")]
|
2016-10-10 10:57:49 -05:00
|
|
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
2016-10-21 19:33:36 -05:00
|
|
|
trait TraitChangeModeSelfOwnToMut: Sized {
|
2018-10-01 10:46:04 -05:00
|
|
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
2016-12-03 20:21:06 -06:00
|
|
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
2020-02-12 08:34:10 -06:00
|
|
|
#[rustc_dirty(label="hir_owner_items", cfg="cfail2")]
|
|
|
|
#[rustc_clean(label="hir_owner_items", cfg="cfail3")]
|
2016-10-21 19:33:36 -05:00
|
|
|
fn method(mut self) {}
|
2016-10-10 10:57:49 -05:00
|
|
|
}
|
2016-10-03 15:59:16 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#[cfg(cfail1)]
|
|
|
|
trait TraitChangeModeSelfOwnToRef {
|
|
|
|
fn method(self);
|
|
|
|
}
|
|
|
|
|
|
|
|
#[cfg(not(cfail1))]
|
2016-12-03 20:21:06 -06:00
|
|
|
#[rustc_clean(label="Hir", cfg="cfail2")]
|
2016-10-03 15:59:16 -05:00
|
|
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
|
|
|
trait TraitChangeModeSelfOwnToRef {
|
2016-12-03 20:21:06 -06:00
|
|
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
|
|
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
2016-10-03 15:59:16 -05:00
|
|
|
fn method(&self);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-08-19 16:31:46 -05:00
|
|
|
// Add unsafe modifier to method
|
2016-10-10 10:57:49 -05:00
|
|
|
#[cfg(cfail1)]
|
|
|
|
trait TraitAddUnsafeModifier {
|
|
|
|
fn method();
|
|
|
|
}
|
2016-10-03 15:59:16 -05:00
|
|
|
|
2016-10-10 10:57:49 -05:00
|
|
|
#[cfg(not(cfail1))]
|
2016-12-03 20:21:06 -06:00
|
|
|
#[rustc_clean(label="Hir", cfg="cfail2")]
|
2016-10-10 10:57:49 -05:00
|
|
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
|
|
|
trait TraitAddUnsafeModifier {
|
2016-12-03 20:21:06 -06:00
|
|
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
|
|
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
2016-10-10 10:57:49 -05:00
|
|
|
unsafe fn method();
|
|
|
|
}
|
2016-10-03 15:59:16 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
2019-08-19 16:31:46 -05:00
|
|
|
// Add extern modifier to method
|
2016-10-10 10:57:49 -05:00
|
|
|
#[cfg(cfail1)]
|
|
|
|
trait TraitAddExternModifier {
|
|
|
|
fn method();
|
|
|
|
}
|
2016-10-03 15:59:16 -05:00
|
|
|
|
2016-10-10 10:57:49 -05:00
|
|
|
#[cfg(not(cfail1))]
|
2016-12-03 20:21:06 -06:00
|
|
|
#[rustc_clean(label="Hir", cfg="cfail2")]
|
2016-10-10 10:57:49 -05:00
|
|
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
|
|
|
trait TraitAddExternModifier {
|
2016-12-03 20:21:06 -06:00
|
|
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
|
|
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
2016-10-10 10:57:49 -05:00
|
|
|
extern fn method();
|
|
|
|
}
|
2016-10-03 15:59:16 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
2019-09-12 09:46:49 -05:00
|
|
|
// Change extern "C" to extern "stdcall"
|
2016-10-10 10:57:49 -05:00
|
|
|
#[cfg(cfail1)]
|
|
|
|
trait TraitChangeExternCToRustIntrinsic {
|
|
|
|
extern "C" fn method();
|
|
|
|
}
|
2016-10-03 15:59:16 -05:00
|
|
|
|
2016-10-10 10:57:49 -05:00
|
|
|
#[cfg(not(cfail1))]
|
2016-12-03 20:21:06 -06:00
|
|
|
#[rustc_clean(label="Hir", cfg="cfail2")]
|
2016-10-10 10:57:49 -05:00
|
|
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
|
|
|
trait TraitChangeExternCToRustIntrinsic {
|
2016-12-03 20:21:06 -06:00
|
|
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
|
|
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
2019-09-12 09:46:49 -05:00
|
|
|
extern "stdcall" fn method();
|
2016-10-10 10:57:49 -05:00
|
|
|
}
|
2016-10-03 15:59:16 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
2019-08-19 16:31:46 -05:00
|
|
|
// Add type parameter to method
|
2016-10-03 15:59:16 -05:00
|
|
|
#[cfg(cfail1)]
|
|
|
|
trait TraitAddTypeParameterToMethod {
|
|
|
|
fn method();
|
|
|
|
}
|
|
|
|
|
|
|
|
#[cfg(not(cfail1))]
|
2016-12-03 20:21:06 -06:00
|
|
|
#[rustc_clean(label="Hir", cfg="cfail2")]
|
2016-10-03 15:59:16 -05:00
|
|
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
|
|
|
trait TraitAddTypeParameterToMethod {
|
2016-12-03 20:21:06 -06:00
|
|
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
|
|
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
2016-10-03 15:59:16 -05:00
|
|
|
fn method<T>();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-08-19 16:31:46 -05:00
|
|
|
// Add lifetime parameter to method
|
2016-10-03 15:59:16 -05:00
|
|
|
#[cfg(cfail1)]
|
|
|
|
trait TraitAddLifetimeParameterToMethod {
|
|
|
|
fn method();
|
|
|
|
}
|
|
|
|
|
|
|
|
#[cfg(not(cfail1))]
|
2016-12-03 20:21:06 -06:00
|
|
|
#[rustc_clean(label="Hir", cfg="cfail2")]
|
2016-10-03 15:59:16 -05:00
|
|
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
|
|
|
trait TraitAddLifetimeParameterToMethod {
|
2016-12-03 20:21:06 -06:00
|
|
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
|
|
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
2016-10-03 15:59:16 -05:00
|
|
|
fn method<'a>();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// dummy trait for bound
|
2016-10-05 15:05:54 -05:00
|
|
|
trait ReferencedTrait0 { }
|
|
|
|
trait ReferencedTrait1 { }
|
2016-10-03 15:59:16 -05:00
|
|
|
|
2019-08-19 16:31:46 -05:00
|
|
|
// Add trait bound to method type parameter
|
2016-10-03 15:59:16 -05:00
|
|
|
#[cfg(cfail1)]
|
|
|
|
trait TraitAddTraitBoundToMethodTypeParameter {
|
|
|
|
fn method<T>();
|
|
|
|
}
|
|
|
|
|
|
|
|
#[cfg(not(cfail1))]
|
2016-12-03 20:21:06 -06:00
|
|
|
#[rustc_clean(label="Hir", cfg="cfail2")]
|
2016-10-03 15:59:16 -05:00
|
|
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
|
|
|
trait TraitAddTraitBoundToMethodTypeParameter {
|
2016-12-03 20:21:06 -06:00
|
|
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
|
|
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
2016-10-05 15:05:54 -05:00
|
|
|
fn method<T: ReferencedTrait0>();
|
2016-10-03 15:59:16 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-08-19 16:31:46 -05:00
|
|
|
// Add builtin bound to method type parameter
|
2016-10-03 15:59:16 -05:00
|
|
|
#[cfg(cfail1)]
|
|
|
|
trait TraitAddBuiltinBoundToMethodTypeParameter {
|
|
|
|
fn method<T>();
|
|
|
|
}
|
|
|
|
|
|
|
|
#[cfg(not(cfail1))]
|
2016-12-03 20:21:06 -06:00
|
|
|
#[rustc_clean(label="Hir", cfg="cfail2")]
|
2016-10-03 15:59:16 -05:00
|
|
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
|
|
|
trait TraitAddBuiltinBoundToMethodTypeParameter {
|
2016-12-03 20:21:06 -06:00
|
|
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
|
|
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
2016-10-03 15:59:16 -05:00
|
|
|
fn method<T: Sized>();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-08-19 16:31:46 -05:00
|
|
|
// Add lifetime bound to method lifetime parameter
|
2016-10-03 15:59:16 -05:00
|
|
|
#[cfg(cfail1)]
|
2016-10-06 03:05:48 -05:00
|
|
|
trait TraitAddLifetimeBoundToMethodLifetimeParameter {
|
2016-10-03 15:59:16 -05:00
|
|
|
fn method<'a, 'b>(a: &'a u32, b: &'b u32);
|
|
|
|
}
|
|
|
|
|
|
|
|
#[cfg(not(cfail1))]
|
2016-12-03 20:21:06 -06:00
|
|
|
#[rustc_clean(label="Hir", cfg="cfail2")]
|
2016-10-03 15:59:16 -05:00
|
|
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
2016-10-06 03:05:48 -05:00
|
|
|
trait TraitAddLifetimeBoundToMethodLifetimeParameter {
|
2016-12-03 20:21:06 -06:00
|
|
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
|
|
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
2016-10-03 15:59:16 -05:00
|
|
|
fn method<'a, 'b: 'a>(a: &'a u32, b: &'b u32);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-08-19 16:31:46 -05:00
|
|
|
// Add second trait bound to method type parameter
|
2016-10-03 15:59:16 -05:00
|
|
|
#[cfg(cfail1)]
|
|
|
|
trait TraitAddSecondTraitBoundToMethodTypeParameter {
|
2016-10-05 15:05:54 -05:00
|
|
|
fn method<T: ReferencedTrait0>();
|
2016-10-03 15:59:16 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
#[cfg(not(cfail1))]
|
2016-12-03 20:21:06 -06:00
|
|
|
#[rustc_clean(label="Hir", cfg="cfail2")]
|
2016-10-03 15:59:16 -05:00
|
|
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
|
|
|
trait TraitAddSecondTraitBoundToMethodTypeParameter {
|
2016-12-03 20:21:06 -06:00
|
|
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
|
|
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
2016-10-05 15:05:54 -05:00
|
|
|
fn method<T: ReferencedTrait0 + ReferencedTrait1>();
|
2016-10-03 15:59:16 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-08-19 16:31:46 -05:00
|
|
|
// Add second builtin bound to method type parameter
|
2016-10-03 15:59:16 -05:00
|
|
|
#[cfg(cfail1)]
|
|
|
|
trait TraitAddSecondBuiltinBoundToMethodTypeParameter {
|
|
|
|
fn method<T: Sized>();
|
|
|
|
}
|
|
|
|
|
|
|
|
#[cfg(not(cfail1))]
|
2016-12-03 20:21:06 -06:00
|
|
|
#[rustc_clean(label="Hir", cfg="cfail2")]
|
2016-10-03 15:59:16 -05:00
|
|
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
|
|
|
trait TraitAddSecondBuiltinBoundToMethodTypeParameter {
|
2016-12-03 20:21:06 -06:00
|
|
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
|
|
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
2016-10-03 15:59:16 -05:00
|
|
|
fn method<T: Sized + Sync>();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-08-19 16:31:46 -05:00
|
|
|
// Add second lifetime bound to method lifetime parameter
|
2016-10-03 15:59:16 -05:00
|
|
|
#[cfg(cfail1)]
|
2016-10-06 03:05:48 -05:00
|
|
|
trait TraitAddSecondLifetimeBoundToMethodLifetimeParameter {
|
2016-10-05 16:02:01 -05:00
|
|
|
fn method<'a, 'b, 'c: 'a>(a: &'a u32, b: &'b u32, c: &'c u32);
|
2016-10-03 15:59:16 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
#[cfg(not(cfail1))]
|
2016-12-03 20:21:06 -06:00
|
|
|
#[rustc_clean(label="Hir", cfg="cfail2")]
|
2016-10-03 15:59:16 -05:00
|
|
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
2016-10-06 03:05:48 -05:00
|
|
|
trait TraitAddSecondLifetimeBoundToMethodLifetimeParameter {
|
2016-12-03 20:21:06 -06:00
|
|
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
|
|
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
2016-10-03 15:59:16 -05:00
|
|
|
fn method<'a, 'b, 'c: 'a + 'b>(a: &'a u32, b: &'b u32, c: &'c u32);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-08-19 16:31:46 -05:00
|
|
|
// Add associated type
|
2016-10-03 15:59:16 -05:00
|
|
|
#[cfg(cfail1)]
|
|
|
|
trait TraitAddAssociatedType {
|
2017-04-05 16:39:02 -05:00
|
|
|
|
|
|
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
|
|
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
|
|
|
fn method();
|
2016-10-03 15:59:16 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
#[cfg(not(cfail1))]
|
|
|
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
|
|
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
|
|
|
trait TraitAddAssociatedType {
|
|
|
|
type Associated;
|
|
|
|
|
2017-04-05 16:39:02 -05:00
|
|
|
fn method();
|
2016-10-03 15:59:16 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-08-19 16:31:46 -05:00
|
|
|
// Add trait bound to associated type
|
2016-10-03 15:59:16 -05:00
|
|
|
#[cfg(cfail1)]
|
|
|
|
trait TraitAddTraitBoundToAssociatedType {
|
|
|
|
type Associated;
|
|
|
|
|
2017-04-05 16:39:02 -05:00
|
|
|
fn method();
|
2016-10-03 15:59:16 -05:00
|
|
|
}
|
|
|
|
|
2017-04-05 16:39:02 -05:00
|
|
|
|
|
|
|
// Apparently the type bound contributes to the predicates of the trait, but
|
|
|
|
// does not change the associated item itself.
|
2016-10-03 15:59:16 -05:00
|
|
|
#[cfg(not(cfail1))]
|
2016-12-03 20:21:06 -06:00
|
|
|
#[rustc_clean(label="Hir", cfg="cfail2")]
|
2016-10-03 15:59:16 -05:00
|
|
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
|
|
|
trait TraitAddTraitBoundToAssociatedType {
|
2016-12-03 20:21:06 -06:00
|
|
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
|
|
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
2016-10-05 15:05:54 -05:00
|
|
|
type Associated: ReferencedTrait0;
|
2016-10-03 15:59:16 -05:00
|
|
|
|
2017-04-05 16:39:02 -05:00
|
|
|
fn method();
|
2016-10-03 15:59:16 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-08-19 16:31:46 -05:00
|
|
|
// Add lifetime bound to associated type
|
2016-10-03 15:59:16 -05:00
|
|
|
#[cfg(cfail1)]
|
|
|
|
trait TraitAddLifetimeBoundToAssociatedType<'a> {
|
|
|
|
type Associated;
|
|
|
|
|
2017-04-05 16:39:02 -05:00
|
|
|
fn method();
|
2016-10-03 15:59:16 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
#[cfg(not(cfail1))]
|
2016-12-03 20:21:06 -06:00
|
|
|
#[rustc_clean(label="Hir", cfg="cfail2")]
|
2016-10-03 15:59:16 -05:00
|
|
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
|
|
|
trait TraitAddLifetimeBoundToAssociatedType<'a> {
|
2016-12-03 20:21:06 -06:00
|
|
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
|
|
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
2016-10-03 15:59:16 -05:00
|
|
|
type Associated: 'a;
|
|
|
|
|
2017-04-05 16:39:02 -05:00
|
|
|
fn method();
|
2016-10-03 15:59:16 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-08-19 16:31:46 -05:00
|
|
|
// Add default to associated type
|
2016-10-03 15:59:16 -05:00
|
|
|
#[cfg(cfail1)]
|
|
|
|
trait TraitAddDefaultToAssociatedType {
|
|
|
|
type Associated;
|
|
|
|
|
2017-04-05 16:39:02 -05:00
|
|
|
fn method();
|
2016-10-03 15:59:16 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
#[cfg(not(cfail1))]
|
|
|
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
|
|
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
|
|
|
trait TraitAddDefaultToAssociatedType {
|
2017-04-05 16:39:02 -05:00
|
|
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
|
|
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
2016-10-03 15:59:16 -05:00
|
|
|
type Associated = ReferenceType0;
|
|
|
|
|
2017-04-05 16:39:02 -05:00
|
|
|
fn method();
|
2016-10-03 15:59:16 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-08-19 16:31:46 -05:00
|
|
|
// Add associated constant
|
2016-10-03 15:59:16 -05:00
|
|
|
#[cfg(cfail1)]
|
|
|
|
trait TraitAddAssociatedConstant {
|
2017-04-05 16:39:02 -05:00
|
|
|
fn method();
|
2016-10-03 15:59:16 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
#[cfg(not(cfail1))]
|
|
|
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
|
|
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
|
|
|
trait TraitAddAssociatedConstant {
|
|
|
|
const Value: u32;
|
|
|
|
|
2017-04-05 16:39:02 -05:00
|
|
|
fn method();
|
2016-10-03 15:59:16 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-08-19 16:31:46 -05:00
|
|
|
// Add initializer to associated constant
|
2016-10-03 15:59:16 -05:00
|
|
|
#[cfg(cfail1)]
|
|
|
|
trait TraitAddInitializerToAssociatedConstant {
|
|
|
|
const Value: u32;
|
|
|
|
|
2017-04-05 16:39:02 -05:00
|
|
|
fn method();
|
2016-10-03 15:59:16 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
#[cfg(not(cfail1))]
|
|
|
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
|
|
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
|
|
|
trait TraitAddInitializerToAssociatedConstant {
|
2017-04-05 16:39:02 -05:00
|
|
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
|
|
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
2016-10-03 15:59:16 -05:00
|
|
|
const Value: u32 = 1;
|
|
|
|
|
2017-04-05 16:39:02 -05:00
|
|
|
#[rustc_clean(label="Hir", cfg="cfail2")]
|
|
|
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
|
|
|
fn method();
|
2016-10-03 15:59:16 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-08-19 16:31:46 -05:00
|
|
|
// Change type of associated constant
|
2016-10-03 15:59:16 -05:00
|
|
|
#[cfg(cfail1)]
|
|
|
|
trait TraitChangeTypeOfAssociatedConstant {
|
|
|
|
const Value: u32;
|
|
|
|
|
2017-04-05 16:39:02 -05:00
|
|
|
fn method();
|
2016-10-03 15:59:16 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
#[cfg(not(cfail1))]
|
2016-12-03 20:21:06 -06:00
|
|
|
#[rustc_clean(label="Hir", cfg="cfail2")]
|
2016-10-03 15:59:16 -05:00
|
|
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
|
|
|
trait TraitChangeTypeOfAssociatedConstant {
|
2016-12-03 20:21:06 -06:00
|
|
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
|
|
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
2016-10-03 15:59:16 -05:00
|
|
|
const Value: f64;
|
|
|
|
|
2017-04-05 16:39:02 -05:00
|
|
|
#[rustc_clean(label="Hir", cfg="cfail2")]
|
|
|
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
|
|
|
fn method();
|
2016-10-03 15:59:16 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-08-19 16:31:46 -05:00
|
|
|
// Add super trait
|
2016-10-03 15:59:16 -05:00
|
|
|
#[cfg(cfail1)]
|
|
|
|
trait TraitAddSuperTrait { }
|
|
|
|
|
|
|
|
#[cfg(not(cfail1))]
|
|
|
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
|
|
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
2016-10-05 15:05:54 -05:00
|
|
|
trait TraitAddSuperTrait : ReferencedTrait0 { }
|
2016-10-03 15:59:16 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
2019-08-19 16:31:46 -05:00
|
|
|
// Add builtin bound (Send or Copy)
|
2016-10-03 15:59:16 -05:00
|
|
|
#[cfg(cfail1)]
|
|
|
|
trait TraitAddBuiltiBound { }
|
|
|
|
|
|
|
|
#[cfg(not(cfail1))]
|
|
|
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
|
|
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
|
|
|
trait TraitAddBuiltiBound : Send { }
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-08-19 16:31:46 -05:00
|
|
|
// Add 'static lifetime bound to trait
|
2016-10-03 15:59:16 -05:00
|
|
|
#[cfg(cfail1)]
|
|
|
|
trait TraitAddStaticLifetimeBound { }
|
|
|
|
|
|
|
|
#[cfg(not(cfail1))]
|
|
|
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
|
|
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
|
|
|
trait TraitAddStaticLifetimeBound : 'static { }
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-08-19 16:31:46 -05:00
|
|
|
// Add super trait as second bound
|
2016-10-03 15:59:16 -05:00
|
|
|
#[cfg(cfail1)]
|
2016-10-05 15:05:54 -05:00
|
|
|
trait TraitAddTraitAsSecondBound : ReferencedTrait0 { }
|
2016-10-03 15:59:16 -05:00
|
|
|
|
|
|
|
#[cfg(not(cfail1))]
|
|
|
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
|
|
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
2016-10-05 15:05:54 -05:00
|
|
|
trait TraitAddTraitAsSecondBound : ReferencedTrait0 + ReferencedTrait1 { }
|
2016-10-03 15:59:16 -05:00
|
|
|
|
|
|
|
#[cfg(cfail1)]
|
|
|
|
trait TraitAddTraitAsSecondBoundFromBuiltin : Send { }
|
|
|
|
|
|
|
|
#[cfg(not(cfail1))]
|
|
|
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
|
|
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
2016-10-05 15:05:54 -05:00
|
|
|
trait TraitAddTraitAsSecondBoundFromBuiltin : Send + ReferencedTrait0 { }
|
2016-10-03 15:59:16 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
2019-08-19 16:31:46 -05:00
|
|
|
// Add builtin bound as second bound
|
2016-10-03 15:59:16 -05:00
|
|
|
#[cfg(cfail1)]
|
2016-10-05 15:05:54 -05:00
|
|
|
trait TraitAddBuiltinBoundAsSecondBound : ReferencedTrait0 { }
|
2016-10-03 15:59:16 -05:00
|
|
|
|
|
|
|
#[cfg(not(cfail1))]
|
|
|
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
|
|
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
2016-10-05 15:05:54 -05:00
|
|
|
trait TraitAddBuiltinBoundAsSecondBound : ReferencedTrait0 + Send { }
|
2016-10-03 15:59:16 -05:00
|
|
|
|
|
|
|
#[cfg(cfail1)]
|
|
|
|
trait TraitAddBuiltinBoundAsSecondBoundFromBuiltin : Send { }
|
|
|
|
|
|
|
|
#[cfg(not(cfail1))]
|
|
|
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
|
|
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
|
|
|
trait TraitAddBuiltinBoundAsSecondBoundFromBuiltin: Send + Copy { }
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-08-19 16:31:46 -05:00
|
|
|
// Add 'static bounds as second bound
|
2016-10-03 15:59:16 -05:00
|
|
|
#[cfg(cfail1)]
|
2016-10-05 15:05:54 -05:00
|
|
|
trait TraitAddStaticBoundAsSecondBound : ReferencedTrait0 { }
|
2016-10-03 15:59:16 -05:00
|
|
|
|
|
|
|
#[cfg(not(cfail1))]
|
|
|
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
|
|
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
2016-10-05 15:05:54 -05:00
|
|
|
trait TraitAddStaticBoundAsSecondBound : ReferencedTrait0 + 'static { }
|
2016-10-03 15:59:16 -05:00
|
|
|
|
|
|
|
#[cfg(cfail1)]
|
|
|
|
trait TraitAddStaticBoundAsSecondBoundFromBuiltin : Send { }
|
|
|
|
|
|
|
|
#[cfg(not(cfail1))]
|
|
|
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
|
|
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
|
|
|
trait TraitAddStaticBoundAsSecondBoundFromBuiltin : Send + 'static { }
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-08-19 16:31:46 -05:00
|
|
|
// Add type parameter to trait
|
2016-10-03 15:59:16 -05:00
|
|
|
#[cfg(cfail1)]
|
|
|
|
trait TraitAddTypeParameterToTrait { }
|
|
|
|
|
|
|
|
#[cfg(not(cfail1))]
|
|
|
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
|
|
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
|
|
|
trait TraitAddTypeParameterToTrait<T> { }
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-08-19 16:31:46 -05:00
|
|
|
// Add lifetime parameter to trait
|
2016-10-03 15:59:16 -05:00
|
|
|
#[cfg(cfail1)]
|
|
|
|
trait TraitAddLifetimeParameterToTrait { }
|
|
|
|
|
|
|
|
#[cfg(not(cfail1))]
|
|
|
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
|
|
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
|
|
|
trait TraitAddLifetimeParameterToTrait<'a> { }
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-08-19 16:31:46 -05:00
|
|
|
// Add trait bound to type parameter of trait
|
2016-10-03 15:59:16 -05:00
|
|
|
#[cfg(cfail1)]
|
|
|
|
trait TraitAddTraitBoundToTypeParameterOfTrait<T> { }
|
|
|
|
|
|
|
|
#[cfg(not(cfail1))]
|
|
|
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
|
|
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
2016-10-05 15:05:54 -05:00
|
|
|
trait TraitAddTraitBoundToTypeParameterOfTrait<T: ReferencedTrait0> { }
|
2016-10-03 15:59:16 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
2019-08-19 16:31:46 -05:00
|
|
|
// Add lifetime bound to type parameter of trait
|
2016-10-03 15:59:16 -05:00
|
|
|
#[cfg(cfail1)]
|
|
|
|
trait TraitAddLifetimeBoundToTypeParameterOfTrait<'a, T> { }
|
|
|
|
|
|
|
|
#[cfg(not(cfail1))]
|
|
|
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
|
|
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
|
|
|
trait TraitAddLifetimeBoundToTypeParameterOfTrait<'a, T: 'a> { }
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-08-19 16:31:46 -05:00
|
|
|
// Add lifetime bound to lifetime parameter of trait
|
2016-10-03 15:59:16 -05:00
|
|
|
#[cfg(cfail1)]
|
|
|
|
trait TraitAddLifetimeBoundToLifetimeParameterOfTrait<'a, 'b> { }
|
|
|
|
|
|
|
|
#[cfg(not(cfail1))]
|
|
|
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
|
|
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
|
|
|
trait TraitAddLifetimeBoundToLifetimeParameterOfTrait<'a: 'b, 'b> { }
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-08-19 16:31:46 -05:00
|
|
|
// Add builtin bound to type parameter of trait
|
2016-10-03 15:59:16 -05:00
|
|
|
#[cfg(cfail1)]
|
|
|
|
trait TraitAddBuiltinBoundToTypeParameterOfTrait<T> { }
|
|
|
|
|
|
|
|
#[cfg(not(cfail1))]
|
|
|
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
|
|
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
|
|
|
trait TraitAddBuiltinBoundToTypeParameterOfTrait<T: Send> { }
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-08-19 16:31:46 -05:00
|
|
|
// Add second type parameter to trait
|
2016-10-03 15:59:16 -05:00
|
|
|
#[cfg(cfail1)]
|
|
|
|
trait TraitAddSecondTypeParameterToTrait<T> { }
|
|
|
|
|
|
|
|
#[cfg(not(cfail1))]
|
|
|
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
|
|
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
|
|
|
trait TraitAddSecondTypeParameterToTrait<T, S> { }
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-08-19 16:31:46 -05:00
|
|
|
// Add second lifetime parameter to trait
|
2016-10-03 15:59:16 -05:00
|
|
|
#[cfg(cfail1)]
|
|
|
|
trait TraitAddSecondLifetimeParameterToTrait<'a> { }
|
|
|
|
|
|
|
|
#[cfg(not(cfail1))]
|
|
|
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
|
|
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
|
|
|
trait TraitAddSecondLifetimeParameterToTrait<'a, 'b> { }
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-08-19 16:31:46 -05:00
|
|
|
// Add second trait bound to type parameter of trait
|
2016-10-03 15:59:16 -05:00
|
|
|
#[cfg(cfail1)]
|
2016-10-05 15:05:54 -05:00
|
|
|
trait TraitAddSecondTraitBoundToTypeParameterOfTrait<T: ReferencedTrait0> { }
|
2016-10-03 15:59:16 -05:00
|
|
|
|
|
|
|
#[cfg(not(cfail1))]
|
|
|
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
|
|
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
2016-10-05 15:05:54 -05:00
|
|
|
trait TraitAddSecondTraitBoundToTypeParameterOfTrait<T: ReferencedTrait0 + ReferencedTrait1> { }
|
2016-10-03 15:59:16 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
2019-08-19 16:31:46 -05:00
|
|
|
// Add second lifetime bound to type parameter of trait
|
2016-10-03 15:59:16 -05:00
|
|
|
#[cfg(cfail1)]
|
|
|
|
trait TraitAddSecondLifetimeBoundToTypeParameterOfTrait<'a, 'b, T: 'a> { }
|
|
|
|
|
|
|
|
#[cfg(not(cfail1))]
|
|
|
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
|
|
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
|
|
|
trait TraitAddSecondLifetimeBoundToTypeParameterOfTrait<'a, 'b, T: 'a + 'b> { }
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-08-19 16:31:46 -05:00
|
|
|
// Add second lifetime bound to lifetime parameter of trait
|
2016-10-03 15:59:16 -05:00
|
|
|
#[cfg(cfail1)]
|
|
|
|
trait TraitAddSecondLifetimeBoundToLifetimeParameterOfTrait<'a: 'b, 'b, 'c> { }
|
|
|
|
|
|
|
|
#[cfg(not(cfail1))]
|
|
|
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
|
|
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
|
|
|
trait TraitAddSecondLifetimeBoundToLifetimeParameterOfTrait<'a: 'b + 'c, 'b, 'c> { }
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-08-19 16:31:46 -05:00
|
|
|
// Add second builtin bound to type parameter of trait
|
2016-10-03 15:59:16 -05:00
|
|
|
#[cfg(cfail1)]
|
|
|
|
trait TraitAddSecondBuiltinBoundToTypeParameterOfTrait<T: Send> { }
|
|
|
|
|
|
|
|
#[cfg(not(cfail1))]
|
|
|
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
|
|
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
|
|
|
trait TraitAddSecondBuiltinBoundToTypeParameterOfTrait<T: Send + Sync> { }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct ReferenceType0 {}
|
|
|
|
struct ReferenceType1 {}
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-08-19 16:31:46 -05:00
|
|
|
// Add trait bound to type parameter of trait in where clause
|
2016-10-03 15:59:16 -05:00
|
|
|
#[cfg(cfail1)]
|
|
|
|
trait TraitAddTraitBoundToTypeParameterOfTraitWhere<T> { }
|
|
|
|
|
|
|
|
#[cfg(not(cfail1))]
|
|
|
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
|
|
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
2016-10-05 15:05:54 -05:00
|
|
|
trait TraitAddTraitBoundToTypeParameterOfTraitWhere<T> where T: ReferencedTrait0 { }
|
2016-10-03 15:59:16 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
2019-08-19 16:31:46 -05:00
|
|
|
// Add lifetime bound to type parameter of trait in where clause
|
2016-10-03 15:59:16 -05:00
|
|
|
#[cfg(cfail1)]
|
|
|
|
trait TraitAddLifetimeBoundToTypeParameterOfTraitWhere<'a, T> { }
|
|
|
|
|
|
|
|
#[cfg(not(cfail1))]
|
|
|
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
|
|
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
|
|
|
trait TraitAddLifetimeBoundToTypeParameterOfTraitWhere<'a, T> where T: 'a { }
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-08-19 16:31:46 -05:00
|
|
|
// Add lifetime bound to lifetime parameter of trait in where clause
|
2016-10-03 15:59:16 -05:00
|
|
|
#[cfg(cfail1)]
|
|
|
|
trait TraitAddLifetimeBoundToLifetimeParameterOfTraitWhere<'a, 'b> { }
|
|
|
|
|
|
|
|
#[cfg(not(cfail1))]
|
|
|
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
|
|
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
|
|
|
trait TraitAddLifetimeBoundToLifetimeParameterOfTraitWhere<'a, 'b> where 'a: 'b { }
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-08-19 16:31:46 -05:00
|
|
|
// Add builtin bound to type parameter of trait in where clause
|
2016-10-03 15:59:16 -05:00
|
|
|
#[cfg(cfail1)]
|
|
|
|
trait TraitAddBuiltinBoundToTypeParameterOfTraitWhere<T> { }
|
|
|
|
|
|
|
|
#[cfg(not(cfail1))]
|
|
|
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
|
|
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
|
|
|
trait TraitAddBuiltinBoundToTypeParameterOfTraitWhere<T> where T: Send { }
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-08-19 16:31:46 -05:00
|
|
|
// Add second trait bound to type parameter of trait in where clause
|
2016-10-03 15:59:16 -05:00
|
|
|
#[cfg(cfail1)]
|
2016-10-05 15:05:54 -05:00
|
|
|
trait TraitAddSecondTraitBoundToTypeParameterOfTraitWhere<T> where T: ReferencedTrait0 { }
|
2016-10-03 15:59:16 -05:00
|
|
|
|
|
|
|
#[cfg(not(cfail1))]
|
|
|
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
|
|
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
2016-10-03 16:51:22 -05:00
|
|
|
trait TraitAddSecondTraitBoundToTypeParameterOfTraitWhere<T>
|
2016-10-05 15:05:54 -05:00
|
|
|
where T: ReferencedTrait0 + ReferencedTrait1 { }
|
2016-10-03 15:59:16 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
2019-08-19 16:31:46 -05:00
|
|
|
// Add second lifetime bound to type parameter of trait in where clause
|
2016-10-03 15:59:16 -05:00
|
|
|
#[cfg(cfail1)]
|
|
|
|
trait TraitAddSecondLifetimeBoundToTypeParameterOfTraitWhere<'a, 'b, T> where T: 'a { }
|
|
|
|
|
|
|
|
#[cfg(not(cfail1))]
|
|
|
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
|
|
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
|
|
|
trait TraitAddSecondLifetimeBoundToTypeParameterOfTraitWhere<'a, 'b, T> where T: 'a + 'b { }
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-08-19 16:31:46 -05:00
|
|
|
// Add second lifetime bound to lifetime parameter of trait in where clause
|
2016-10-03 15:59:16 -05:00
|
|
|
#[cfg(cfail1)]
|
|
|
|
trait TraitAddSecondLifetimeBoundToLifetimeParameterOfTraitWhere<'a, 'b, 'c> where 'a: 'b { }
|
|
|
|
|
|
|
|
#[cfg(not(cfail1))]
|
|
|
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
|
|
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
|
|
|
trait TraitAddSecondLifetimeBoundToLifetimeParameterOfTraitWhere<'a, 'b, 'c> where 'a: 'b + 'c { }
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-08-19 16:31:46 -05:00
|
|
|
// Add second builtin bound to type parameter of trait in where clause
|
2016-10-03 15:59:16 -05:00
|
|
|
#[cfg(cfail1)]
|
|
|
|
trait TraitAddSecondBuiltinBoundToTypeParameterOfTraitWhere<T> where T: Send { }
|
|
|
|
|
|
|
|
#[cfg(not(cfail1))]
|
|
|
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
|
|
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
|
|
|
trait TraitAddSecondBuiltinBoundToTypeParameterOfTraitWhere<T> where T: Send + Sync { }
|
|
|
|
|
|
|
|
|
2019-08-19 16:31:46 -05:00
|
|
|
// Change return type of method indirectly by modifying a use statement
|
2016-10-03 15:59:16 -05:00
|
|
|
mod change_return_type_of_method_indirectly_use {
|
|
|
|
#[cfg(cfail1)]
|
|
|
|
use super::ReferenceType0 as ReturnType;
|
|
|
|
#[cfg(not(cfail1))]
|
|
|
|
use super::ReferenceType1 as ReturnType;
|
|
|
|
|
2016-12-03 20:21:06 -06:00
|
|
|
#[rustc_clean(label="Hir", cfg="cfail2")]
|
2016-10-03 15:59:16 -05:00
|
|
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
|
|
|
trait TraitChangeReturnType {
|
2016-12-03 20:21:06 -06:00
|
|
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
|
|
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
2016-10-03 15:59:16 -05:00
|
|
|
fn method() -> ReturnType;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-08-19 16:31:46 -05:00
|
|
|
// Change type of method parameter indirectly by modifying a use statement
|
2016-10-03 15:59:16 -05:00
|
|
|
mod change_method_parameter_type_indirectly_by_use {
|
|
|
|
#[cfg(cfail1)]
|
|
|
|
use super::ReferenceType0 as ArgType;
|
|
|
|
#[cfg(not(cfail1))]
|
|
|
|
use super::ReferenceType1 as ArgType;
|
|
|
|
|
2016-12-03 20:21:06 -06:00
|
|
|
#[rustc_clean(label="Hir", cfg="cfail2")]
|
2016-10-03 15:59:16 -05:00
|
|
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
|
|
|
trait TraitChangeArgType {
|
2016-12-03 20:21:06 -06:00
|
|
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
|
|
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
2016-10-03 15:59:16 -05:00
|
|
|
fn method(a: ArgType);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Change trait bound of method type parameter indirectly by modifying a use statement
|
|
|
|
mod change_method_parameter_type_bound_indirectly_by_use {
|
|
|
|
#[cfg(cfail1)]
|
2016-10-05 15:05:54 -05:00
|
|
|
use super::ReferencedTrait0 as Bound;
|
2016-10-03 15:59:16 -05:00
|
|
|
#[cfg(not(cfail1))]
|
2016-10-05 15:05:54 -05:00
|
|
|
use super::ReferencedTrait1 as Bound;
|
2016-10-03 15:59:16 -05:00
|
|
|
|
2016-12-03 20:21:06 -06:00
|
|
|
#[rustc_clean(label="Hir", cfg="cfail2")]
|
2016-10-03 15:59:16 -05:00
|
|
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
|
|
|
trait TraitChangeBoundOfMethodTypeParameter {
|
2016-12-03 20:21:06 -06:00
|
|
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
|
|
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
2016-10-03 15:59:16 -05:00
|
|
|
fn method<T: Bound>(a: T);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-10-03 16:51:22 -05:00
|
|
|
// Change trait bound of method type parameter in where clause indirectly
|
|
|
|
// by modifying a use statement
|
2016-10-03 15:59:16 -05:00
|
|
|
mod change_method_parameter_type_bound_indirectly_by_use_where {
|
|
|
|
#[cfg(cfail1)]
|
2016-10-05 15:05:54 -05:00
|
|
|
use super::ReferencedTrait0 as Bound;
|
2016-10-03 15:59:16 -05:00
|
|
|
#[cfg(not(cfail1))]
|
2016-10-05 15:05:54 -05:00
|
|
|
use super::ReferencedTrait1 as Bound;
|
2016-10-03 15:59:16 -05:00
|
|
|
|
2016-12-03 20:21:06 -06:00
|
|
|
#[rustc_clean(label="Hir", cfg="cfail2")]
|
2016-10-03 15:59:16 -05:00
|
|
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
|
|
|
trait TraitChangeBoundOfMethodTypeParameterWhere {
|
2016-12-03 20:21:06 -06:00
|
|
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
|
|
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
2016-10-03 15:59:16 -05:00
|
|
|
fn method<T>(a: T) where T: Bound;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Change trait bound of trait type parameter indirectly by modifying a use statement
|
|
|
|
mod change_method_type_parameter_bound_indirectly {
|
|
|
|
#[cfg(cfail1)]
|
2016-10-05 15:05:54 -05:00
|
|
|
use super::ReferencedTrait0 as Bound;
|
2016-10-03 15:59:16 -05:00
|
|
|
#[cfg(not(cfail1))]
|
2016-10-05 15:05:54 -05:00
|
|
|
use super::ReferencedTrait1 as Bound;
|
2016-10-03 15:59:16 -05:00
|
|
|
|
|
|
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
|
|
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
|
|
|
trait TraitChangeTraitBound<T: Bound> {
|
|
|
|
fn method(a: T);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-10-03 16:51:22 -05:00
|
|
|
// Change trait bound of trait type parameter in where clause indirectly
|
|
|
|
// by modifying a use statement
|
2016-10-03 15:59:16 -05:00
|
|
|
mod change_method_type_parameter_bound_indirectly_where {
|
|
|
|
#[cfg(cfail1)]
|
2016-10-05 15:05:54 -05:00
|
|
|
use super::ReferencedTrait0 as Bound;
|
2016-10-03 15:59:16 -05:00
|
|
|
#[cfg(not(cfail1))]
|
2016-10-05 15:05:54 -05:00
|
|
|
use super::ReferencedTrait1 as Bound;
|
2016-10-03 15:59:16 -05:00
|
|
|
|
|
|
|
#[rustc_dirty(label="Hir", cfg="cfail2")]
|
|
|
|
#[rustc_clean(label="Hir", cfg="cfail3")]
|
|
|
|
trait TraitChangeTraitBoundWhere<T> where T: Bound {
|
|
|
|
fn method(a: T);
|
|
|
|
}
|
|
|
|
}
|