Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
ae5c0926
R
Rust
项目概览
int
/
Rust
大约 1 年 前同步成功
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
Rust
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
ae5c0926
编写于
1月 03, 2019
作者:
G
Georg Semmler
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
More test deduplication
上级
2bc436e7
变更
29
隐藏空白更改
内联
并排
Showing
29 changed file
with
38 addition
and
446 deletion
+38
-446
src/test/run-pass/coherence/auxiliary/re_rebalance_coherence_lib.rs
...un-pass/coherence/auxiliary/re_rebalance_coherence_lib.rs
+0
-0
src/test/run-pass/coherence/coherence-bigint-int.rs
src/test/run-pass/coherence/coherence-bigint-int.rs
+3
-0
src/test/run-pass/coherence/coherence-bigint-vecint.rs
src/test/run-pass/coherence/coherence-bigint-vecint.rs
+3
-0
src/test/run-pass/coherence/coherence-blanket.rs
src/test/run-pass/coherence/coherence-blanket.rs
+3
-0
src/test/run-pass/coherence/coherence-covered-type-parameter.rs
...st/run-pass/coherence/coherence-covered-type-parameter.rs
+3
-0
src/test/run-pass/coherence/coherence-impl-in-fn.rs
src/test/run-pass/coherence/coherence-impl-in-fn.rs
+3
-0
src/test/run-pass/coherence/coherence-iterator-vec-any-elem.rs
...est/run-pass/coherence/coherence-iterator-vec-any-elem.rs
+3
-0
src/test/run-pass/coherence/coherence-iterator-vec.rs
src/test/run-pass/coherence/coherence-iterator-vec.rs
+3
-0
src/test/run-pass/coherence/coherence-multidispatch-tuple.rs
src/test/run-pass/coherence/coherence-multidispatch-tuple.rs
+3
-0
src/test/run-pass/coherence/coherence-negative-impls-safe.rs
src/test/run-pass/coherence/coherence-negative-impls-safe.rs
+3
-0
src/test/run-pass/coherence/coherence-rfc447-constrained.rs
src/test/run-pass/coherence/coherence-rfc447-constrained.rs
+3
-0
src/test/run-pass/coherence/coherence-where-clause.rs
src/test/run-pass/coherence/coherence-where-clause.rs
+4
-0
src/test/run-pass/coherence/coherence_copy_like.rs
src/test/run-pass/coherence/coherence_copy_like.rs
+3
-0
src/test/run-pass/coherence/re-rebalance-coherence.rs
src/test/run-pass/coherence/re-rebalance-coherence.rs
+1
-0
src/test/run-pass/re_rebalance_coherence/auxiliary/coherence_copy_like_lib.rs
..._rebalance_coherence/auxiliary/coherence_copy_like_lib.rs
+0
-20
src/test/run-pass/re_rebalance_coherence/auxiliary/coherence_lib.rs
...un-pass/re_rebalance_coherence/auxiliary/coherence_lib.rs
+0
-25
src/test/run-pass/re_rebalance_coherence/coherence-bigint-int.rs
...t/run-pass/re_rebalance_coherence/coherence-bigint-int.rs
+0
-25
src/test/run-pass/re_rebalance_coherence/coherence-bigint-vecint.rs
...un-pass/re_rebalance_coherence/coherence-bigint-vecint.rs
+0
-25
src/test/run-pass/re_rebalance_coherence/coherence-blanket.rs
...test/run-pass/re_rebalance_coherence/coherence-blanket.rs
+0
-27
src/test/run-pass/re_rebalance_coherence/coherence-covered-type-parameter.rs
...e_rebalance_coherence/coherence-covered-type-parameter.rs
+0
-25
src/test/run-pass/re_rebalance_coherence/coherence-impl-in-fn.rs
...t/run-pass/re_rebalance_coherence/coherence-impl-in-fn.rs
+0
-25
src/test/run-pass/re_rebalance_coherence/coherence-iterator-vec-any-elem.rs
...re_rebalance_coherence/coherence-iterator-vec-any-elem.rs
+0
-25
src/test/run-pass/re_rebalance_coherence/coherence-iterator-vec.rs
...run-pass/re_rebalance_coherence/coherence-iterator-vec.rs
+0
-25
src/test/run-pass/re_rebalance_coherence/coherence-multidispatch-tuple.rs
...s/re_rebalance_coherence/coherence-multidispatch-tuple.rs
+0
-35
src/test/run-pass/re_rebalance_coherence/coherence-negative-impls-safe.rs
...s/re_rebalance_coherence/coherence-negative-impls-safe.rs
+0
-24
src/test/run-pass/re_rebalance_coherence/coherence-rfc447-constrained.rs
...ss/re_rebalance_coherence/coherence-rfc447-constrained.rs
+0
-34
src/test/run-pass/re_rebalance_coherence/coherence-subtyping.rs
...st/run-pass/re_rebalance_coherence/coherence-subtyping.rs
+0
-51
src/test/run-pass/re_rebalance_coherence/coherence-where-clause.rs
...run-pass/re_rebalance_coherence/coherence-where-clause.rs
+0
-49
src/test/run-pass/re_rebalance_coherence/coherence_copy_like.rs
...st/run-pass/re_rebalance_coherence/coherence_copy_like.rs
+0
-31
未找到文件。
src/test/run-pass/
re_rebalance_
coherence/auxiliary/re_rebalance_coherence_lib.rs
→
src/test/run-pass/coherence/auxiliary/re_rebalance_coherence_lib.rs
浏览文件 @
ae5c0926
文件已移动
src/test/run-pass/coherence/coherence-bigint-int.rs
浏览文件 @
ae5c0926
// run-pass
// aux-build:coherence_lib.rs
// revisions: old re
#![cfg_attr(re,
feature(re_rebalance_coherence))]
// pretty-expanded FIXME #23616
...
...
src/test/run-pass/coherence/coherence-bigint-vecint.rs
浏览文件 @
ae5c0926
// run-pass
// aux-build:coherence_lib.rs
// revisions: old re
#![cfg_attr(re,
feature(re_rebalance_coherence))]
// pretty-expanded FIXME #23616
...
...
src/test/run-pass/coherence/coherence-blanket.rs
浏览文件 @
ae5c0926
// run-pass
#![allow(unused_imports)]
// aux-build:coherence_lib.rs
// revisions: old re
#![cfg_attr(re,
feature(re_rebalance_coherence))]
// pretty-expanded FIXME #23616
...
...
src/test/run-pass/coherence/coherence-covered-type-parameter.rs
浏览文件 @
ae5c0926
// run-pass
#![allow(dead_code)]
// aux-build:coherence_lib.rs
// revisions: old re
#![cfg_attr(re,
feature(re_rebalance_coherence))]
// pretty-expanded FIXME #23616
...
...
src/test/run-pass/coherence/coherence-impl-in-fn.rs
浏览文件 @
ae5c0926
// run-pass
// revisions: old re
#![cfg_attr(re,
feature(re_rebalance_coherence))]
#![allow(dead_code)]
#![allow(non_camel_case_types)]
...
...
src/test/run-pass/coherence/coherence-iterator-vec-any-elem.rs
浏览文件 @
ae5c0926
// run-pass
// revisions: old re
#![cfg_attr(re,
feature(re_rebalance_coherence))]
#![allow(dead_code)]
// aux-build:coherence_lib.rs
...
...
src/test/run-pass/coherence/coherence-iterator-vec.rs
浏览文件 @
ae5c0926
// run-pass
// revisions: old re
#![cfg_attr(re,
feature(re_rebalance_coherence))]
#![allow(dead_code)]
// aux-build:coherence_lib.rs
...
...
src/test/run-pass/coherence/coherence-multidispatch-tuple.rs
浏览文件 @
ae5c0926
// run-pass
// revisions: old re
#![cfg_attr(re,
feature(re_rebalance_coherence))]
#![allow(unused_imports)]
// pretty-expanded FIXME #23616
...
...
src/test/run-pass/coherence/coherence-negative-impls-safe.rs
浏览文件 @
ae5c0926
// run-pass
// revisions: old re
#![cfg_attr(re,
feature(re_rebalance_coherence))]
#![allow(dead_code)]
// pretty-expanded FIXME #23616
...
...
src/test/run-pass/coherence/coherence-rfc447-constrained.rs
浏览文件 @
ae5c0926
// run-pass
// revisions: old re
#![cfg_attr(re,
feature(re_rebalance_coherence))]
// check that trait matching can handle impls whose types are only
// constrained by a projection.
...
...
src/test/run-pass/coherence/coherence-where-clause.rs
浏览文件 @
ae5c0926
// run-pass
// revisions: old re
#![cfg_attr(re,
feature(re_rebalance_coherence))]
use
std
::
fmt
::
Debug
;
use
std
::
default
::
Default
;
...
...
src/test/run-pass/coherence/coherence_copy_like.rs
浏览文件 @
ae5c0926
// run-pass
// revisions: old re
#![cfg_attr(re,
feature(re_rebalance_coherence))]
#![allow(dead_code)]
// Test that we are able to introduce a negative constraint that
// `MyType: !MyTrait` along with other "fundamental" wrappers.
...
...
src/test/run-pass/
re_rebalance_
coherence/re-rebalance-coherence.rs
→
src/test/run-pass/coherence/re-rebalance-coherence.rs
浏览文件 @
ae5c0926
#![allow(dead_code)]
#![feature(re_rebalance_coherence)]
// run-pass
...
...
src/test/run-pass/re_rebalance_coherence/auxiliary/coherence_copy_like_lib.rs
已删除
100644 → 0
浏览文件 @
2bc436e7
// Copyright 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.
#![crate_type
=
"rlib"
]
#![feature(fundamental)]
pub
trait
MyCopy
{
}
impl
MyCopy
for
i32
{
}
pub
struct
MyStruct
<
T
>
(
T
);
#[fundamental]
pub
struct
MyFundamentalStruct
<
T
>
(
T
);
src/test/run-pass/re_rebalance_coherence/auxiliary/coherence_lib.rs
已删除
100644 → 0
浏览文件 @
2bc436e7
// Copyright 2012 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.
#![crate_type=
"lib"
]
pub
trait
Remote
{
fn
foo
(
&
self
)
{
}
}
pub
trait
Remote1
<
T
>
{
fn
foo
(
&
self
,
t
:
T
)
{
}
}
pub
trait
Remote2
<
T
,
U
>
{
fn
foo
(
&
self
,
t
:
T
,
u
:
U
)
{
}
}
pub
struct
Pair
<
T
,
U
>
(
T
,
U
);
src/test/run-pass/re_rebalance_coherence/coherence-bigint-int.rs
已删除
100644 → 0
浏览文件 @
2bc436e7
// Copyright 2014 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.
#![feature(re_rebalance_coherence)]
// run-pass
// aux-build:coherence_lib.rs
// pretty-expanded FIXME #23616
extern
crate
coherence_lib
as
lib
;
use
lib
::
Remote1
;
pub
struct
BigInt
;
impl
Remote1
<
BigInt
>
for
isize
{
}
fn
main
()
{
}
src/test/run-pass/re_rebalance_coherence/coherence-bigint-vecint.rs
已删除
100644 → 0
浏览文件 @
2bc436e7
// Copyright 2014 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.
#![feature(re_rebalance_coherence)]
// run-pass
// aux-build:coherence_lib.rs
// pretty-expanded FIXME #23616
extern
crate
coherence_lib
as
lib
;
use
lib
::
Remote1
;
pub
struct
BigInt
;
impl
Remote1
<
BigInt
>
for
Vec
<
isize
>
{
}
fn
main
()
{
}
src/test/run-pass/re_rebalance_coherence/coherence-blanket.rs
已删除
100644 → 0
浏览文件 @
2bc436e7
// Copyright 2014 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.
// run-pass
#![allow(unused_imports)]
#![feature(re_rebalance_coherence)]
// aux-build:coherence_lib.rs
// pretty-expanded FIXME #23616
extern
crate
coherence_lib
as
lib
;
use
lib
::
Remote1
;
pub
trait
Local
{
fn
foo
(
&
self
)
{
}
}
impl
<
T
>
Local
for
T
{
}
fn
main
()
{
}
src/test/run-pass/re_rebalance_coherence/coherence-covered-type-parameter.rs
已删除
100644 → 0
浏览文件 @
2bc436e7
// Copyright 2014 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.
// run-pass
#![allow(dead_code)]
#![feature(re_rebalance_coherence)]
// aux-build:coherence_lib.rs
// pretty-expanded FIXME #23616
extern
crate
coherence_lib
as
lib
;
use
lib
::
Remote
;
struct
Foo
<
T
>
(
T
);
impl
<
T
>
Remote
for
Foo
<
T
>
{
}
fn
main
()
{
}
src/test/run-pass/re_rebalance_coherence/coherence-impl-in-fn.rs
已删除
100644 → 0
浏览文件 @
2bc436e7
// Copyright 2012 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.
// run-pass
#![allow(dead_code)]
#![allow(non_camel_case_types)]
#![feature(re_rebalance_coherence)]
pub
fn
main
()
{
#[derive(Copy,
Clone)]
enum
x
{
foo
}
impl
::
std
::
cmp
::
PartialEq
for
x
{
fn
eq
(
&
self
,
other
:
&
x
)
->
bool
{
(
*
self
)
as
isize
==
(
*
other
)
as
isize
}
fn
ne
(
&
self
,
other
:
&
x
)
->
bool
{
!
(
*
self
)
.eq
(
other
)
}
}
}
src/test/run-pass/re_rebalance_coherence/coherence-iterator-vec-any-elem.rs
已删除
100644 → 0
浏览文件 @
2bc436e7
// Copyright 2014 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.
// run-pass
#![allow(dead_code)]
#![feature(re_rebalance_coherence)]
// aux-build:coherence_lib.rs
// pretty-expanded FIXME #23616
extern
crate
coherence_lib
as
lib
;
use
lib
::
Remote1
;
struct
Foo
<
T
>
(
T
);
impl
<
T
,
U
>
Remote1
<
U
>
for
Foo
<
T
>
{
}
fn
main
()
{
}
src/test/run-pass/re_rebalance_coherence/coherence-iterator-vec.rs
已删除
100644 → 0
浏览文件 @
2bc436e7
// Copyright 2014 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.
// run-pass
#![allow(dead_code)]
#![feature(re_rebalance_coherence)]
// aux-build:coherence_lib.rs
// pretty-expanded FIXME #23616
extern
crate
coherence_lib
as
lib
;
use
lib
::
Remote1
;
struct
Foo
<
T
>
(
T
);
impl
<
T
>
Remote1
<
T
>
for
Foo
<
T
>
{
}
fn
main
()
{
}
src/test/run-pass/re_rebalance_coherence/coherence-multidispatch-tuple.rs
已删除
100644 → 0
浏览文件 @
2bc436e7
// Copyright 2014 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.
// run-pass
#![allow(unused_imports)]
#![feature(re_rebalance_coherence)]
// pretty-expanded FIXME #23616
use
std
::
fmt
::
Debug
;
use
std
::
default
::
Default
;
// Test that an impl for homogeneous pairs does not conflict with a
// heterogeneous pair.
trait
MyTrait
{
fn
get
(
&
self
)
->
usize
;
}
impl
<
T
>
MyTrait
for
(
T
,
T
)
{
fn
get
(
&
self
)
->
usize
{
0
}
}
impl
MyTrait
for
(
usize
,
isize
)
{
fn
get
(
&
self
)
->
usize
{
0
}
}
fn
main
()
{
}
src/test/run-pass/re_rebalance_coherence/coherence-negative-impls-safe.rs
已删除
100644 → 0
浏览文件 @
2bc436e7
// Copyright 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.
// run-pass
#![allow(dead_code)]
// pretty-expanded FIXME #23616
#![feature(optin_builtin_traits)]
#![feature(re_rebalance_coherence)]
use
std
::
marker
::
Send
;
struct
TestType
;
impl
!
Send
for
TestType
{}
fn
main
()
{}
src/test/run-pass/re_rebalance_coherence/coherence-rfc447-constrained.rs
已删除
100644 → 0
浏览文件 @
2bc436e7
// Copyright 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.
#![feature(re_rebalance_coherence)]
// run-pass
// check that trait matching can handle impls whose types are only
// constrained by a projection.
trait
IsU32
{}
impl
IsU32
for
u32
{}
trait
Mirror
{
type
Image
:
?
Sized
;
}
impl
<
T
:
?
Sized
>
Mirror
for
T
{
type
Image
=
T
;
}
trait
Bar
{}
impl
<
U
:
Mirror
,
V
:
Mirror
<
Image
=
L
>
,
L
:
Mirror
<
Image
=
U
>>
Bar
for
V
where
U
::
Image
:
IsU32
{}
trait
Foo
{
fn
name
()
->
&
'static
str
;
}
impl
Foo
for
u64
{
fn
name
()
->
&
'static
str
{
"u64"
}
}
impl
<
T
:
Bar
>
Foo
for
T
{
fn
name
()
->
&
'static
str
{
"Bar"
}}
fn
main
()
{
assert_eq!
(
<
u64
as
Foo
>
::
name
(),
"u64"
);
assert_eq!
(
<
u32
as
Foo
>
::
name
(),
"Bar"
);
}
src/test/run-pass/re_rebalance_coherence/coherence-subtyping.rs
已删除
100644 → 0
浏览文件 @
2bc436e7
// Copyright 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.
#![feature(re_rebalance_coherence)]
// run-pass
// Test that two distinct impls which match subtypes of one another
// yield coherence errors (or not) depending on the variance.
trait
Contravariant
{
fn
foo
(
&
self
)
{
}
}
impl
Contravariant
for
for
<
'a
,
'b
>
fn
(
&
'a
u8
,
&
'b
u8
)
->
&
'a
u8
{
}
impl
Contravariant
for
for
<
'a
>
fn
(
&
'a
u8
,
&
'a
u8
)
->
&
'a
u8
{
}
///////////////////////////////////////////////////////////////////////////
trait
Covariant
{
fn
foo
(
&
self
)
{
}
}
impl
Covariant
for
for
<
'a
,
'b
>
fn
(
&
'a
u8
,
&
'b
u8
)
->
&
'a
u8
{
}
impl
Covariant
for
for
<
'a
>
fn
(
&
'a
u8
,
&
'a
u8
)
->
&
'a
u8
{
}
///////////////////////////////////////////////////////////////////////////
trait
Invariant
{
fn
foo
(
&
self
)
{
}
}
impl
Invariant
for
for
<
'a
,
'b
>
fn
(
&
'a
u8
,
&
'b
u8
)
->
&
'a
u8
{
}
impl
Invariant
for
for
<
'a
>
fn
(
&
'a
u8
,
&
'a
u8
)
->
&
'a
u8
{
}
fn
main
()
{
}
src/test/run-pass/re_rebalance_coherence/coherence-where-clause.rs
已删除
100644 → 0
浏览文件 @
2bc436e7
// Copyright 2014 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.
#![feature(re_rebalance_coherence)]
// run-pass
use
std
::
fmt
::
Debug
;
use
std
::
default
::
Default
;
trait
MyTrait
{
fn
get
(
&
self
)
->
Self
;
}
impl
<
T
>
MyTrait
for
T
where
T
:
Default
{
fn
get
(
&
self
)
->
T
{
Default
::
default
()
}
}
#[derive(Clone,
Copy,
Debug,
PartialEq)]
struct
MyType
{
dummy
:
usize
}
impl
MyTrait
for
MyType
{
fn
get
(
&
self
)
->
MyType
{
(
*
self
)
.clone
()
}
}
fn
test_eq
<
M
>
(
m
:
M
,
n
:
M
)
where
M
:
MyTrait
+
Debug
+
PartialEq
{
assert_eq!
(
m
.get
(),
n
);
}
pub
fn
main
()
{
test_eq
(
0_u
size
,
0_u
size
);
let
value
=
MyType
{
dummy
:
256
+
22
};
test_eq
(
value
,
value
);
}
src/test/run-pass/re_rebalance_coherence/coherence_copy_like.rs
已删除
100644 → 0
浏览文件 @
2bc436e7
// Copyright 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.
// run-pass
#![allow(dead_code)]
#![feature(re_rebalance_coherence)]
// Test that we are able to introduce a negative constraint that
// `MyType: !MyTrait` along with other "fundamental" wrappers.
// aux-build:coherence_copy_like_lib.rs
extern
crate
coherence_copy_like_lib
as
lib
;
struct
MyType
{
x
:
i32
}
trait
MyTrait
{
}
impl
<
T
:
lib
::
MyCopy
>
MyTrait
for
T
{
}
impl
MyTrait
for
MyType
{
}
impl
<
'a
>
MyTrait
for
&
'a
MyType
{
}
impl
MyTrait
for
Box
<
MyType
>
{
}
impl
<
'a
>
MyTrait
for
&
'a
Box
<
MyType
>
{
}
fn
main
()
{
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录