rust/tests/target/impls.rs

233 lines
3.3 KiB
Rust
Raw Normal View History

// rustfmt-normalize_comments: true
2015-11-22 18:07:53 -06:00
impl Foo for Bar {
fn foo() {
"hi"
}
}
pub impl Foo for Bar {
2016-03-14 21:05:20 -05:00
// Associated Constants
const Baz: i32 = 16;
// Associated Types
type FooBar = usize;
2015-11-22 18:07:53 -06:00
// Comment 1
fn foo() {
"hi"
}
// Comment 2
fn foo() {
"hi"
}
2015-11-23 22:54:44 -06:00
// Comment 3
2015-11-22 18:07:53 -06:00
}
pub unsafe impl<'a, 'b, X, Y: Foo<Bar>> !Foo<'a, X> for Bar<'b, Y>
2017-06-11 23:01:41 -05:00
where
X: Foo<'a, Z>,
2015-11-22 18:07:53 -06:00
{
fn foo() {
"hi"
}
}
impl<'a, 'b, X, Y: Foo<Bar>> Foo<'a, X> for Bar<'b, Y>
2017-06-11 23:01:41 -05:00
where
X: Fooooooooooooooooooooooooooooo<'a, Z>,
2015-11-22 18:07:53 -06:00
{
fn foo() {
"hi"
}
}
impl<'a, 'b, X, Y: Foo<Bar>> Foo<'a, X> for Bar<'b, Y>
2017-06-11 23:01:41 -05:00
where
X: Foooooooooooooooooooooooooooo<'a, Z>,
2015-11-22 18:07:53 -06:00
{
fn foo() {
"hi"
}
}
2015-11-22 20:49:21 -06:00
2018-05-31 05:34:06 -05:00
impl<T> Foo for Bar<T> where T: Baz {}
impl<T> Foo for Bar<T>
2017-06-11 23:01:41 -05:00
where
T: Baz,
{
// Comment
}
2015-11-22 20:49:21 -06:00
impl Foo {
fn foo() {}
}
2015-11-23 22:54:44 -06:00
impl Boo {
// BOO
fn boo() {}
// FOO
}
2015-11-22 20:49:21 -06:00
mod a {
impl Foo {
// Hello!
fn foo() {}
}
}
mod b {
mod a {
impl Foo {
fn foo() {}
}
}
}
impl Foo {
add_fun!();
}
impl Blah {
fn boop() {}
add_fun!();
}
impl X {
fn do_parse(mut self: X) {}
}
impl Y5000 {
fn bar(self: X<'a, 'b>, y: Y) {}
2016-03-27 06:07:28 -05:00
fn bad(&self, (x, y): CoorT) {}
fn turbo_bad(self: X<'a, 'b>, (x, y): CoorT) {}
}
pub impl<T> Foo for Bar<T>
2017-06-11 23:01:41 -05:00
where
T: Foo,
{
fn foo() {
"hi"
}
}
pub impl<T, Z> Foo for Bar<T, Z>
2017-06-11 23:01:41 -05:00
where
T: Foo,
Z: Baz,
{
}
mod m {
impl<T> PartialEq for S<T>
2017-06-11 23:01:41 -05:00
where
T: PartialEq,
{
fn eq(&self, other: &Self) {
true
}
}
2018-05-31 05:34:06 -05:00
impl<T> PartialEq for S<T> where T: PartialEq {}
}
2017-06-11 09:27:02 -05:00
impl<BorrowType, K, V, NodeType, HandleType>
Handle<NodeRef<BorrowType, K, V, NodeType>, HandleType>
2018-06-05 20:56:07 -05:00
{}
impl<BorrowType, K, V, NodeType, HandleType> PartialEq
for Handle<NodeRef<BorrowType, K, V, NodeType>, HandleType>
2018-06-05 20:56:07 -05:00
{}
mod x {
impl<A, B, C, D> Foo
2017-06-11 23:01:41 -05:00
where
A: 'static,
B: 'static,
C: 'static,
D: 'static,
2018-06-05 20:56:07 -05:00
{}
}
impl<ConcreteThreadSafeLayoutNode: ThreadSafeLayoutNodeFoo>
Issue1249<ConcreteThreadSafeLayoutNode>
{
// Creates a new flow constructor.
fn foo() {}
}
2017-05-27 09:59:29 -05:00
// #1600
impl<#[may_dangle] K, #[may_dangle] V> Drop for RawTable<K, V> {
fn drop() {}
}
2017-06-11 09:27:02 -05:00
// #1168
pub trait Number:
Copy
2017-06-11 09:27:02 -05:00
+ Eq
+ Not<Output = Self>
+ Shl<u8, Output = Self>
+ Shr<u8, Output = Self>
+ BitAnd<Self, Output = Self>
+ BitOr<Self, Output = Self>
+ BitAndAssign
+ BitOrAssign
{
2017-06-11 09:27:02 -05:00
// test
fn zero() -> Self;
}
// #1642
pub trait SomeTrait:
Clone
2017-06-11 09:27:02 -05:00
+ Eq
+ PartialEq
+ Ord
+ PartialOrd
+ Default
+ Hash
+ Debug
+ Display
+ Write
+ Read
+ FromStr
{
2017-06-11 09:27:02 -05:00
// comment
}
2017-09-25 21:20:47 -05:00
// #1995
impl Foo {
fn f(
S {
aaaaaaaaaa: aaaaaaaaaa,
bbbbbbbbbb: bbbbbbbbbb,
cccccccccc: cccccccccc,
}: S,
) -> u32 {
1
}
}
2018-03-08 04:08:32 -06:00
// #2491
impl<'a, 'b, 'c> SomeThing<Something>
for (
&'a mut SomethingLong,
&'b mut SomethingLong,
&'c mut SomethingLong,
)
{
fn foo() {}
}
2018-06-05 20:55:56 -05:00
// #2746
impl<'seq1, 'seq2, 'body, 'scope, Channel>
Adc12<
Dual,
MasterRunningDma<'seq1, 'body, 'scope, Channel>,
SlaveRunningDma<'seq2, 'body, 'scope>,
>
where
Channel: DmaChannel,
{}