Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
0e26bb72
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,发现更多精彩内容 >>
提交
0e26bb72
编写于
2月 18, 2018
作者:
T
Tatsuyuki Ishi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Revert "Implement Ord as necessary"
This reverts commit
c6772b4d
.
上级
27a046e9
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
5 addition
and
33 deletion
+5
-33
src/librustc/traits/project.rs
src/librustc/traits/project.rs
+1
-1
src/librustc/ty/mod.rs
src/librustc/ty/mod.rs
+1
-29
src/librustc/ty/sty.rs
src/librustc/ty/sty.rs
+2
-2
src/librustc/ty/subst.rs
src/librustc/ty/subst.rs
+1
-1
未找到文件。
src/librustc/traits/project.rs
浏览文件 @
0e26bb72
...
...
@@ -101,7 +101,7 @@ pub struct MismatchedProjectionTypes<'tcx> {
pub
err
:
ty
::
error
::
TypeError
<
'tcx
>
}
#[derive(PartialEq,
Eq,
PartialOrd,
Ord,
Debug)]
#[derive(PartialEq,
Eq,
Debug)]
enum
ProjectionTyCandidate
<
'tcx
>
{
// from a where-clause in the env or object type
ParamEnv
(
ty
::
PolyProjectionPredicate
<
'tcx
>
),
...
...
src/librustc/ty/mod.rs
浏览文件 @
0e26bb72
...
...
@@ -39,7 +39,6 @@
use
serialize
::{
self
,
Encodable
,
Encoder
};
use
std
::
cell
::
RefCell
;
use
std
::
cmp
;
use
std
::
cmp
::
Ordering
;
use
std
::
fmt
;
use
std
::
hash
::{
Hash
,
Hasher
};
use
std
::
iter
::
FromIterator
;
...
...
@@ -498,20 +497,6 @@ fn hash<H: Hasher>(&self, s: &mut H) {
}
}
impl
<
'tcx
>
Ord
for
TyS
<
'tcx
>
{
#[inline]
fn
cmp
(
&
self
,
other
:
&
TyS
<
'tcx
>
)
->
Ordering
{
// (self as *const _).cmp(other as *const _)
(
self
as
*
const
TyS
<
'tcx
>
)
.cmp
(
&
(
other
as
*
const
TyS
<
'tcx
>
))
}
}
impl
<
'tcx
>
PartialOrd
for
TyS
<
'tcx
>
{
#[inline]
fn
partial_cmp
(
&
self
,
other
:
&
TyS
<
'tcx
>
)
->
Option
<
Ordering
>
{
Some
(
self
.cmp
(
other
))
}
}
impl
<
'tcx
>
TyS
<
'tcx
>
{
pub
fn
is_primitive_ty
(
&
self
)
->
bool
{
match
self
.sty
{
...
...
@@ -581,19 +566,6 @@ fn eq(&self, other: &Slice<T>) -> bool {
}
impl
<
T
>
Eq
for
Slice
<
T
>
{}
impl
<
T
>
Ord
for
Slice
<
T
>
{
#[inline]
fn
cmp
(
&
self
,
other
:
&
Slice
<
T
>
)
->
Ordering
{
(
&
self
.0
as
*
const
[
T
])
.cmp
(
&
(
&
other
.0
as
*
const
[
T
]))
}
}
impl
<
T
>
PartialOrd
for
Slice
<
T
>
{
#[inline]
fn
partial_cmp
(
&
self
,
other
:
&
Slice
<
T
>
)
->
Option
<
Ordering
>
{
Some
(
self
.cmp
(
other
))
}
}
impl
<
T
>
Hash
for
Slice
<
T
>
{
fn
hash
<
H
:
Hasher
>
(
&
self
,
s
:
&
mut
H
)
{
(
self
.as_ptr
(),
self
.len
())
.hash
(
s
)
...
...
@@ -1128,7 +1100,7 @@ pub struct SubtypePredicate<'tcx> {
/// equality between arbitrary types. Processing an instance of
/// Form #2 eventually yields one of these `ProjectionPredicate`
/// instances to normalize the LHS.
#[derive(Copy,
Clone,
PartialEq,
Eq,
PartialOrd,
Ord,
Hash,
RustcEncodable,
RustcDecodable)]
#[derive(Copy,
Clone,
PartialEq,
Eq,
Hash,
RustcEncodable,
RustcDecodable)]
pub
struct
ProjectionPredicate
<
'tcx
>
{
pub
projection_ty
:
ProjectionTy
<
'tcx
>
,
pub
ty
:
Ty
<
'tcx
>
,
...
...
src/librustc/ty/sty.rs
浏览文件 @
0e26bb72
...
...
@@ -645,7 +645,7 @@ pub fn input_types<'a>(&'a self) -> impl DoubleEndedIterator<Item=Ty<'tcx>> + 'a
/// erase, or otherwise "discharge" these bound regions, we change the
/// type from `Binder<T>` to just `T` (see
/// e.g. `liberate_late_bound_regions`).
#[derive(Copy,
Clone,
PartialEq,
Eq,
PartialOrd,
Ord,
Hash,
Debug,
RustcEncodable,
RustcDecodable)]
#[derive(Copy,
Clone,
PartialEq,
Eq,
Hash,
Debug,
RustcEncodable,
RustcDecodable)]
pub
struct
Binder
<
T
>
(
pub
T
);
impl
<
T
>
Binder
<
T
>
{
...
...
@@ -745,7 +745,7 @@ pub fn split<U,V,F>(self, f: F) -> (Binder<U>, Binder<V>)
/// Represents the projection of an associated type. In explicit UFCS
/// form this would be written `<T as Trait<..>>::N`.
#[derive(Copy,
Clone,
PartialEq,
Eq,
PartialOrd,
Ord,
Hash,
Debug,
RustcEncodable,
RustcDecodable)]
#[derive(Copy,
Clone,
PartialEq,
Eq,
Hash,
Debug,
RustcEncodable,
RustcDecodable)]
pub
struct
ProjectionTy
<
'tcx
>
{
/// The parameters of the associated item.
pub
substs
:
&
'tcx
Substs
<
'tcx
>
,
...
...
src/librustc/ty/subst.rs
浏览文件 @
0e26bb72
...
...
@@ -29,7 +29,7 @@
/// To reduce memory usage, a `Kind` is a interned pointer,
/// with the lowest 2 bits being reserved for a tag to
/// indicate the type (`Ty` or `Region`) it points to.
#[derive(Copy,
Clone,
PartialEq,
Eq,
PartialOrd,
Ord,
Hash)]
#[derive(Copy,
Clone,
PartialEq,
Eq,
Hash)]
pub
struct
Kind
<
'tcx
>
{
ptr
:
NonZero
<
usize
>
,
marker
:
PhantomData
<
(
Ty
<
'tcx
>
,
ty
::
Region
<
'tcx
>
)
>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录