Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
0bcc96dd
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,发现更多精彩内容 >>
未验证
提交
0bcc96dd
编写于
9月 16, 2020
作者:
R
Ralf Jung
提交者:
GitHub
9月 16, 2020
浏览文件
操作
浏览文件
下载
差异文件
Rollup merge of #76641 - nox:pointee-random-stuff, r=eddyb
Some cleanup changes and commenting r? @nikomatsakis Cc
@EddyB
上级
1ff91d6d
caf6c92d
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
13 addition
and
22 deletion
+13
-22
compiler/rustc_middle/src/ty/sty.rs
compiler/rustc_middle/src/ty/sty.rs
+6
-0
compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs
...r/rustc_trait_selection/src/traits/error_reporting/mod.rs
+1
-6
compiler/rustc_traits/src/chalk/db.rs
compiler/rustc_traits/src/chalk/db.rs
+5
-15
src/librustdoc/clean/mod.rs
src/librustdoc/clean/mod.rs
+1
-1
未找到文件。
compiler/rustc_middle/src/ty/sty.rs
浏览文件 @
0bcc96dd
...
...
@@ -2280,6 +2280,12 @@ pub fn to_opt_closure_kind(&self) -> Option<ty::ClosureKind> {
///
/// Returning true means the type is known to be sized. Returning
/// `false` means nothing -- could be sized, might not be.
///
/// Note that we could never rely on the fact that a type such as `[_]` is
/// trivially `!Sized` because we could be in a type environment with a
/// bound such as `[_]: Copy`. A function with such a bound obviously never
/// can be called, but that doesn't mean it shouldn't typecheck. This is why
/// this method doesn't return `Option<bool>`.
pub
fn
is_trivially_sized
(
&
self
,
tcx
:
TyCtxt
<
'tcx
>
)
->
bool
{
match
self
.kind
()
{
ty
::
Infer
(
ty
::
IntVar
(
_
)
|
ty
::
FloatVar
(
_
))
...
...
compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs
浏览文件 @
0bcc96dd
...
...
@@ -1512,12 +1512,7 @@ fn maybe_report_ambiguity(
// avoid inundating the user with unnecessary errors, but we now
// check upstream for type errors and don't add the obligations to
// begin with in those cases.
if
self
.tcx
.lang_items
()
.sized_trait
()
.map_or
(
false
,
|
sized_id
|
sized_id
==
trait_ref
.def_id
())
{
if
self
.tcx
.lang_items
()
.sized_trait
()
==
Some
(
trait_ref
.def_id
())
{
self
.need_type_info_err
(
body_id
,
span
,
self_ty
,
ErrorCode
::
E0282
)
.emit
();
return
;
}
...
...
compiler/rustc_traits/src/chalk/db.rs
浏览文件 @
0bcc96dd
...
...
@@ -110,25 +110,15 @@ fn trait_datum(
.map
(|
i
|
chalk_ir
::
AssocTypeId
(
i
.def_id
))
.collect
();
let
well_known
=
if
self
.interner
.tcx
.lang_items
()
.sized_trait
()
.map
(|
t
|
def_id
==
t
)
.unwrap_or
(
false
)
{
let
well_known
=
if
self
.interner.tcx
.lang_items
()
.sized_trait
()
==
Some
(
def_id
)
{
Some
(
chalk_solve
::
rust_ir
::
WellKnownTrait
::
Sized
)
}
else
if
self
.interner.tcx
.lang_items
()
.copy_trait
()
.map
(|
t
|
def_id
==
t
)
.unwrap_or
(
false
)
{
}
else
if
self
.interner.tcx
.lang_items
()
.copy_trait
()
==
Some
(
def_id
)
{
Some
(
chalk_solve
::
rust_ir
::
WellKnownTrait
::
Copy
)
}
else
if
self
.interner.tcx
.lang_items
()
.clone_trait
()
.map
(|
t
|
def_id
==
t
)
.unwrap_or
(
false
)
{
}
else
if
self
.interner.tcx
.lang_items
()
.clone_trait
()
==
Some
(
def_id
)
{
Some
(
chalk_solve
::
rust_ir
::
WellKnownTrait
::
Clone
)
}
else
if
self
.interner.tcx
.lang_items
()
.drop_trait
()
.map
(|
t
|
def_id
==
t
)
.unwrap_or
(
false
)
{
}
else
if
self
.interner.tcx
.lang_items
()
.drop_trait
()
==
Some
(
def_id
)
{
Some
(
chalk_solve
::
rust_ir
::
WellKnownTrait
::
Drop
)
}
else
if
self
.interner.tcx
.lang_items
()
.fn_trait
()
.map
(|
t
|
def_id
==
t
)
.unwrap_or
(
false
)
{
}
else
if
self
.interner.tcx
.lang_items
()
.fn_trait
()
==
Some
(
def_id
)
{
Some
(
chalk_solve
::
rust_ir
::
WellKnownTrait
::
Fn
)
}
else
if
self
.interner
...
...
src/librustdoc/clean/mod.rs
浏览文件 @
0bcc96dd
...
...
@@ -840,7 +840,7 @@ fn clean(&self, cx: &DocContext<'_>) -> Generics {
let
mut
where_predicates
=
where_predicates
.into_iter
()
.flat_map
(|
p
|
p
.clean
(
cx
))
.collect
::
<
Vec
<
_
>>
();
// Type parameters
and
have a Sized bound by default unless removed with
// Type parameters have a Sized bound by default unless removed with
// ?Sized. Scan through the predicates and mark any type parameter with
// a Sized bound, removing the bounds as we find them.
//
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录