Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
69c53ac9
R
Rust
项目概览
int
/
Rust
11 个月 前同步成功
通知
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,发现更多精彩内容 >>
提交
69c53ac9
编写于
2月 23, 2018
作者:
M
Manish Goregaokar
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Run Rustfix on librustc
上级
e8af0f4c
变更
22
隐藏空白更改
内联
并排
Showing
22 changed file
with
55 addition
and
55 deletion
+55
-55
src/librustc/dep_graph/debug.rs
src/librustc/dep_graph/debug.rs
+1
-1
src/librustc/hir/lowering.rs
src/librustc/hir/lowering.rs
+4
-4
src/librustc/hir/map/collector.rs
src/librustc/hir/map/collector.rs
+1
-1
src/librustc/hir/map/def_collector.rs
src/librustc/hir/map/def_collector.rs
+1
-1
src/librustc/hir/map/mod.rs
src/librustc/hir/map/mod.rs
+1
-1
src/librustc/hir/print.rs
src/librustc/hir/print.rs
+11
-11
src/librustc/ich/hcx.rs
src/librustc/ich/hcx.rs
+2
-2
src/librustc/infer/region_constraints/mod.rs
src/librustc/infer/region_constraints/mod.rs
+1
-1
src/librustc/lint/mod.rs
src/librustc/lint/mod.rs
+2
-2
src/librustc/middle/cstore.rs
src/librustc/middle/cstore.rs
+4
-4
src/librustc/middle/dependency_format.rs
src/librustc/middle/dependency_format.rs
+1
-1
src/librustc/middle/expr_use_visitor.rs
src/librustc/middle/expr_use_visitor.rs
+3
-3
src/librustc/middle/liveness.rs
src/librustc/middle/liveness.rs
+2
-2
src/librustc/mir/interpret/error.rs
src/librustc/mir/interpret/error.rs
+2
-2
src/librustc/session/config.rs
src/librustc/session/config.rs
+3
-3
src/librustc/session/mod.rs
src/librustc/session/mod.rs
+4
-4
src/librustc/traits/error_reporting.rs
src/librustc/traits/error_reporting.rs
+1
-1
src/librustc/traits/specialize/specialization_graph.rs
src/librustc/traits/specialize/specialization_graph.rs
+2
-2
src/librustc/ty/context.rs
src/librustc/ty/context.rs
+5
-5
src/librustc/ty/fold.rs
src/librustc/ty/fold.rs
+2
-2
src/librustc/ty/util.rs
src/librustc/ty/util.rs
+1
-1
src/librustc/util/common.rs
src/librustc/util/common.rs
+1
-1
未找到文件。
src/librustc/dep_graph/debug.rs
浏览文件 @
69c53ac9
...
...
@@ -54,7 +54,7 @@ pub struct EdgeFilter {
}
impl
EdgeFilter
{
pub
fn
new
(
test
:
&
str
)
->
Result
<
EdgeFilter
,
Box
<
Error
>>
{
pub
fn
new
(
test
:
&
str
)
->
Result
<
EdgeFilter
,
Box
<
dyn
Error
>>
{
let
parts
:
Vec
<
_
>
=
test
.split
(
"->"
)
.collect
();
if
parts
.len
()
!=
2
{
Err
(
format!
(
"expected a filter like `a&b -> c&d`, not `{}`"
,
test
)
.into
())
...
...
src/librustc/hir/lowering.rs
浏览文件 @
69c53ac9
...
...
@@ -80,13 +80,13 @@ pub struct LoweringContext<'a> {
// Use to assign ids to hir nodes that do not directly correspond to an ast node
sess
:
&
'a
Session
,
cstore
:
&
'a
CrateStore
,
cstore
:
&
'a
dyn
CrateStore
,
// As we walk the AST we must keep track of the current 'parent' def id (in
// the form of a DefIndex) so that if we create a new node which introduces
// a definition, then we can properly create the def id.
parent_def
:
Option
<
DefIndex
>
,
resolver
:
&
'a
mut
Resolver
,
resolver
:
&
'a
mut
dyn
Resolver
,
name_map
:
FxHashMap
<
Ident
,
Name
>
,
/// The items being lowered are collected here.
...
...
@@ -177,10 +177,10 @@ enum ImplTraitContext {
}
pub
fn
lower_crate
(
sess
:
&
Session
,
cstore
:
&
CrateStore
,
cstore
:
&
dyn
CrateStore
,
dep_graph
:
&
DepGraph
,
krate
:
&
Crate
,
resolver
:
&
mut
Resolver
)
resolver
:
&
mut
dyn
Resolver
)
->
hir
::
Crate
{
// We're constructing the HIR here; we don't care what we will
// read, since we haven't even constructed the *input* to
...
...
src/librustc/hir/map/collector.rs
浏览文件 @
69c53ac9
...
...
@@ -123,7 +123,7 @@ pub(super) fn root(krate: &'hir Crate,
pub
(
super
)
fn
finalize_and_compute_crate_hash
(
self
,
crate_disambiguator
:
CrateDisambiguator
,
cstore
:
&
CrateStore
,
cstore
:
&
dyn
CrateStore
,
codemap
:
&
CodeMap
,
commandline_args_hash
:
u64
)
->
(
Vec
<
MapEntry
<
'hir
>>
,
Svh
)
{
...
...
src/librustc/hir/map/def_collector.rs
浏览文件 @
69c53ac9
...
...
@@ -26,7 +26,7 @@ pub struct DefCollector<'a> {
definitions
:
&
'a
mut
Definitions
,
parent_def
:
Option
<
DefIndex
>
,
expansion
:
Mark
,
pub
visit_macro_invoc
:
Option
<&
'a
mut
FnMut
(
MacroInvocationData
)
>
,
pub
visit_macro_invoc
:
Option
<&
'a
mut
dyn
FnMut
(
MacroInvocationData
)
>
,
}
pub
struct
MacroInvocationData
{
...
...
src/librustc/hir/map/mod.rs
浏览文件 @
69c53ac9
...
...
@@ -1137,7 +1137,7 @@ impl Named for TraitItem { fn name(&self) -> Name { self.name } }
impl
Named
for
ImplItem
{
fn
name
(
&
self
)
->
Name
{
self
.name
}
}
pub
fn
map_crate
<
'hir
>
(
sess
:
&
::
session
::
Session
,
cstore
:
&
::
middle
::
cstore
::
CrateStore
,
cstore
:
&
dyn
::
middle
::
cstore
::
CrateStore
,
forest
:
&
'hir
mut
Forest
,
definitions
:
&
'hir
Definitions
)
->
Map
<
'hir
>
{
...
...
src/librustc/hir/print.rs
浏览文件 @
69c53ac9
...
...
@@ -62,7 +62,7 @@ fn post(&self, _state: &mut State, _node: AnnNode) -> io::Result<()> {
pub
struct
NoAnn
;
impl
PpAnn
for
NoAnn
{}
pub
const
NO_ANN
:
&
'static
PpAnn
=
&
NoAnn
;
pub
const
NO_ANN
:
&
'static
dyn
PpAnn
=
&
NoAnn
;
impl
PpAnn
for
hir
::
Crate
{
fn
nested
(
&
self
,
state
:
&
mut
State
,
nested
:
Nested
)
->
io
::
Result
<
()
>
{
...
...
@@ -83,7 +83,7 @@ pub struct State<'a> {
literals
:
Peekable
<
vec
::
IntoIter
<
comments
::
Literal
>>
,
cur_cmnt
:
usize
,
boxes
:
Vec
<
pp
::
Breaks
>
,
ann
:
&
'a
(
PpAnn
+
'a
),
ann
:
&
'a
(
dyn
PpAnn
+
'a
),
}
impl
<
'a
>
PrintState
<
'a
>
for
State
<
'a
>
{
...
...
@@ -126,9 +126,9 @@ pub fn print_crate<'a>(cm: &'a CodeMap,
sess
:
&
ParseSess
,
krate
:
&
hir
::
Crate
,
filename
:
FileName
,
input
:
&
mut
Read
,
out
:
Box
<
Write
+
'a
>
,
ann
:
&
'a
PpAnn
,
input
:
&
mut
dyn
Read
,
out
:
Box
<
dyn
Write
+
'a
>
,
ann
:
&
'a
dyn
PpAnn
,
is_expanded
:
bool
)
->
io
::
Result
<
()
>
{
let
mut
s
=
State
::
new_from_input
(
cm
,
sess
,
filename
,
input
,
out
,
ann
,
is_expanded
);
...
...
@@ -145,9 +145,9 @@ impl<'a> State<'a> {
pub
fn
new_from_input
(
cm
:
&
'a
CodeMap
,
sess
:
&
ParseSess
,
filename
:
FileName
,
input
:
&
mut
Read
,
out
:
Box
<
Write
+
'a
>
,
ann
:
&
'a
PpAnn
,
input
:
&
mut
dyn
Read
,
out
:
Box
<
dyn
Write
+
'a
>
,
ann
:
&
'a
dyn
PpAnn
,
is_expanded
:
bool
)
->
State
<
'a
>
{
let
(
cmnts
,
lits
)
=
comments
::
gather_comments_and_literals
(
sess
,
filename
,
input
);
...
...
@@ -167,8 +167,8 @@ pub fn new_from_input(cm: &'a CodeMap,
}
pub
fn
new
(
cm
:
&
'a
CodeMap
,
out
:
Box
<
Write
+
'a
>
,
ann
:
&
'a
PpAnn
,
out
:
Box
<
dyn
Write
+
'a
>
,
ann
:
&
'a
dyn
PpAnn
,
comments
:
Option
<
Vec
<
comments
::
Comment
>>
,
literals
:
Option
<
Vec
<
comments
::
Literal
>>
)
->
State
<
'a
>
{
...
...
@@ -184,7 +184,7 @@ pub fn new(cm: &'a CodeMap,
}
}
pub
fn
to_string
<
F
>
(
ann
:
&
PpAnn
,
f
:
F
)
->
String
pub
fn
to_string
<
F
>
(
ann
:
&
dyn
PpAnn
,
f
:
F
)
->
String
where
F
:
FnOnce
(
&
mut
State
)
->
io
::
Result
<
()
>
{
let
mut
wr
=
Vec
::
new
();
...
...
src/librustc/ich/hcx.rs
浏览文件 @
69c53ac9
...
...
@@ -49,7 +49,7 @@ pub fn compute_ignored_attr_names() -> FxHashSet<Symbol> {
pub
struct
StableHashingContext
<
'gcx
>
{
sess
:
&
'gcx
Session
,
definitions
:
&
'gcx
Definitions
,
cstore
:
&
'gcx
CrateStore
,
cstore
:
&
'gcx
dyn
CrateStore
,
body_resolver
:
BodyResolver
<
'gcx
>
,
hash_spans
:
bool
,
hash_bodies
:
bool
,
...
...
@@ -88,7 +88,7 @@ impl<'gcx> StableHashingContext<'gcx> {
pub
fn
new
(
sess
:
&
'gcx
Session
,
krate
:
&
'gcx
hir
::
Crate
,
definitions
:
&
'gcx
Definitions
,
cstore
:
&
'gcx
CrateStore
)
cstore
:
&
'gcx
dyn
CrateStore
)
->
Self
{
let
hash_spans_initial
=
!
sess
.opts.debugging_opts.incremental_ignore_spans
;
...
...
src/librustc/infer/region_constraints/mod.rs
浏览文件 @
69c53ac9
...
...
@@ -896,7 +896,7 @@ pub fn to_ty(&self, tcx: TyCtxt<'a, 'gcx, 'tcx>) -> Ty<'tcx> {
}
impl
<
'a
,
'gcx
,
'tcx
>
VerifyBound
<
'tcx
>
{
fn
for_each_region
(
&
self
,
f
:
&
mut
FnMut
(
ty
::
Region
<
'tcx
>
))
{
fn
for_each_region
(
&
self
,
f
:
&
mut
dyn
FnMut
(
ty
::
Region
<
'tcx
>
))
{
match
self
{
&
VerifyBound
::
AnyRegion
(
ref
rs
)
|
&
VerifyBound
::
AllRegions
(
ref
rs
)
=>
for
&
r
in
rs
{
f
(
r
);
...
...
src/librustc/lint/mod.rs
浏览文件 @
69c53ac9
...
...
@@ -280,8 +280,8 @@ fn exit_lint_attrs(&mut self, _: &EarlyContext, _: &[ast::Attribute]) { }
}
/// A lint pass boxed up as a trait object.
pub
type
EarlyLintPassObject
=
Box
<
EarlyLintPass
+
'static
>
;
pub
type
LateLintPassObject
=
Box
<
for
<
'a
,
'tcx
>
LateLintPass
<
'a
,
'tcx
>
+
'static
>
;
pub
type
EarlyLintPassObject
=
Box
<
dyn
EarlyLintPass
+
'static
>
;
pub
type
LateLintPassObject
=
Box
<
dyn
for
<
'a
,
'tcx
>
LateLintPass
<
'a
,
'tcx
>
+
'static
>
;
/// Identifies a lint known to the compiler.
#[derive(Clone,
Copy,
Debug)]
...
...
src/librustc/middle/cstore.rs
浏览文件 @
69c53ac9
...
...
@@ -225,10 +225,10 @@ pub struct ExternBodyNestedBodies {
/// (it'd break incremental compilation) and should only be called pre-HIR (e.g.
/// during resolve)
pub
trait
CrateStore
{
fn
crate_data_as_rc_any
(
&
self
,
krate
:
CrateNum
)
->
Lrc
<
Any
>
;
fn
crate_data_as_rc_any
(
&
self
,
krate
:
CrateNum
)
->
Lrc
<
dyn
Any
>
;
// access to the metadata loader
fn
metadata_loader
(
&
self
)
->
&
MetadataLoader
;
fn
metadata_loader
(
&
self
)
->
&
dyn
MetadataLoader
;
// resolve
fn
def_key
(
&
self
,
def
:
DefId
)
->
DefKey
;
...
...
@@ -297,7 +297,7 @@ pub fn validate_crate_name(sess: Option<&Session>, s: &str, sp: Option<Span>) {
#[allow(unused_variables)]
impl
CrateStore
for
DummyCrateStore
{
fn
crate_data_as_rc_any
(
&
self
,
krate
:
CrateNum
)
->
Lrc
<
Any
>
fn
crate_data_as_rc_any
(
&
self
,
krate
:
CrateNum
)
->
Lrc
<
dyn
Any
>
{
bug!
(
"crate_data_as_rc_any"
)
}
// item info
fn
visibility_untracked
(
&
self
,
def
:
DefId
)
->
ty
::
Visibility
{
bug!
(
"visibility"
)
}
...
...
@@ -351,7 +351,7 @@ fn metadata_encoding_version(&self) -> &[u8] { bug!("metadata_encoding_version")
fn
postorder_cnums_untracked
(
&
self
)
->
Vec
<
CrateNum
>
{
bug!
(
"postorder_cnums_untracked"
)
}
// access to the metadata loader
fn
metadata_loader
(
&
self
)
->
&
MetadataLoader
{
bug!
(
"metadata_loader"
)
}
fn
metadata_loader
(
&
self
)
->
&
dyn
MetadataLoader
{
bug!
(
"metadata_loader"
)
}
}
pub
trait
CrateLoader
{
...
...
src/librustc/middle/dependency_format.rs
浏览文件 @
69c53ac9
...
...
@@ -319,7 +319,7 @@ fn attempt_static<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>) -> Option<DependencyLis
// also skip this step entirely.
fn
activate_injected_dep
(
injected
:
Option
<
CrateNum
>
,
list
:
&
mut
DependencyList
,
replaces_injected
:
&
Fn
(
CrateNum
)
->
bool
)
{
replaces_injected
:
&
dyn
Fn
(
CrateNum
)
->
bool
)
{
for
(
i
,
slot
)
in
list
.iter
()
.enumerate
()
{
let
cnum
=
CrateNum
::
new
(
i
+
1
);
if
!
replaces_injected
(
cnum
)
{
...
...
src/librustc/middle/expr_use_visitor.rs
浏览文件 @
69c53ac9
...
...
@@ -239,7 +239,7 @@ fn from_method_id(tcx: TyCtxt, method_id: DefId) -> OverloadedCallType {
// This is the code that actually walks the tree.
pub
struct
ExprUseVisitor
<
'a
,
'gcx
:
'a
+
'tcx
,
'tcx
:
'a
>
{
mc
:
mc
::
MemCategorizationContext
<
'a
,
'gcx
,
'tcx
>
,
delegate
:
&
'a
mut
Delegate
<
'tcx
>
,
delegate
:
&
'a
mut
dyn
Delegate
<
'tcx
>
,
param_env
:
ty
::
ParamEnv
<
'tcx
>
,
}
...
...
@@ -274,7 +274,7 @@ impl<'a, 'tcx> ExprUseVisitor<'a, 'tcx, 'tcx> {
/// `None` means that rvalues will be given more conservative lifetimes.
///
/// See also `with_infer`, which is used *during* typeck.
pub
fn
new
(
delegate
:
&
'a
mut
(
Delegate
<
'tcx
>+
'a
),
pub
fn
new
(
delegate
:
&
'a
mut
(
dyn
Delegate
<
'tcx
>+
'a
),
tcx
:
TyCtxt
<
'a
,
'tcx
,
'tcx
>
,
param_env
:
ty
::
ParamEnv
<
'tcx
>
,
region_scope_tree
:
&
'a
region
::
ScopeTree
,
...
...
@@ -294,7 +294,7 @@ pub fn new(delegate: &'a mut (Delegate<'tcx>+'a),
}
impl
<
'a
,
'gcx
,
'tcx
>
ExprUseVisitor
<
'a
,
'gcx
,
'tcx
>
{
pub
fn
with_infer
(
delegate
:
&
'a
mut
(
Delegate
<
'tcx
>+
'a
),
pub
fn
with_infer
(
delegate
:
&
'a
mut
(
dyn
Delegate
<
'tcx
>+
'a
),
infcx
:
&
'a
InferCtxt
<
'a
,
'gcx
,
'tcx
>
,
param_env
:
ty
::
ParamEnv
<
'tcx
>
,
region_scope_tree
:
&
'a
region
::
ScopeTree
,
...
...
src/librustc/middle/liveness.rs
浏览文件 @
69c53ac9
...
...
@@ -673,7 +673,7 @@ fn indices2<F>(&mut self, ln: LiveNode, succ_ln: LiveNode, mut op: F) where
}
fn
write_vars
<
F
>
(
&
self
,
wr
:
&
mut
Write
,
wr
:
&
mut
dyn
Write
,
ln
:
LiveNode
,
mut
test
:
F
)
->
io
::
Result
<
()
>
where
...
...
@@ -694,7 +694,7 @@ fn write_vars<F>(&self,
fn
ln_str
(
&
self
,
ln
:
LiveNode
)
->
String
{
let
mut
wr
=
Vec
::
new
();
{
let
wr
=
&
mut
wr
as
&
mut
Write
;
let
wr
=
&
mut
wr
as
&
mut
dyn
Write
;
write!
(
wr
,
"[ln({:?}) of kind {:?} reads"
,
ln
.get
(),
self
.ir
.lnk
(
ln
));
self
.write_vars
(
wr
,
ln
,
|
idx
|
self
.users
[
idx
]
.reader
);
write!
(
wr
,
" writes"
);
...
...
src/librustc/mir/interpret/error.rs
浏览文件 @
69c53ac9
...
...
@@ -35,7 +35,7 @@ fn from(kind: EvalErrorKind<'tcx>) -> Self {
pub
enum
EvalErrorKind
<
'tcx
>
{
/// This variant is used by machines to signal their own errors that do not
/// match an existing variant
MachineError
(
Box
<
Error
>
),
MachineError
(
Box
<
dyn
Error
>
),
FunctionPointerTyMismatch
(
FnSig
<
'tcx
>
,
FnSig
<
'tcx
>
),
NoMirFor
(
String
),
UnterminatedCString
(
MemoryPointer
),
...
...
@@ -248,7 +248,7 @@ fn description(&self) -> &str {
}
}
fn
cause
(
&
self
)
->
Option
<&
Error
>
{
fn
cause
(
&
self
)
->
Option
<&
dyn
Error
>
{
use
self
::
EvalErrorKind
::
*
;
match
self
.kind
{
MachineError
(
ref
inner
)
=>
Some
(
&**
inner
),
...
...
src/librustc/session/config.rs
浏览文件 @
69c53ac9
...
...
@@ -341,7 +341,7 @@ pub fn iter<'a>(&'a self) -> BTreeMapIter<'a, String, BTreeSet<String>> {
(
$opt_name:ident
,
$opt_expr:expr
,
$sub_hashes:expr
,
[
UNTRACKED
])
=>
({});
(
$opt_name:ident
,
$opt_expr:expr
,
$sub_hashes:expr
,
[
TRACKED
])
=>
({
if
$sub_hashes
.insert
(
stringify!
(
$opt_name
),
$opt_expr
as
&
d
ep_tracking
::
DepTracking
Hash
)
.is_some
()
{
$opt_expr
as
&
d
yn
dep_tracking
::
DepTrackingHashHashHashHashHashHashHashHashHashHashHashHashHashHashHashHashHashHashHashHashHashHashHashHashHashHashHashHashHashHashHashHashHashHashHashHashHashHashHashHashHashHashHashHashHashHashHashHashHashHashHashHashHashHashHashHashHashHashHashHashHashHashHashHashHashHashHashHashHashHashHashHashHash
Hash
)
.is_some
()
{
bug!
(
"Duplicate key in CLI DepTrackingHash: {}"
,
stringify!
(
$opt_name
))
}
});
...
...
@@ -1456,7 +1456,7 @@ pub enum OptionStability {
}
pub
struct
RustcOptGroup
{
pub
apply
:
Box
<
Fn
(
&
mut
getopts
::
Options
)
->
&
mut
getopts
::
Options
>
,
pub
apply
:
Box
<
dyn
Fn
(
&
mut
getopts
::
Options
)
->
&
mut
getopts
::
Options
>
,
pub
name
:
&
'static
str
,
pub
stability
:
OptionStability
,
}
...
...
@@ -2256,7 +2256,7 @@ fn hash(&self, hasher: &mut DefaultHasher, error_format: ErrorOutputType) {
}
// This is a stable hash because BTreeMap is a sorted container
pub
fn
stable_hash
(
sub_hashes
:
BTreeMap
<&
'static
str
,
&
DepTrackingHash
>
,
pub
fn
stable_hash
(
sub_hashes
:
BTreeMap
<&
'static
str
,
&
dyn
DepTrackingHash
>
,
hasher
:
&
mut
DefaultHasher
,
error_format
:
ErrorOutputType
)
{
for
(
key
,
sub_hash
)
in
sub_hashes
{
...
...
src/librustc/session/mod.rs
浏览文件 @
69c53ac9
...
...
@@ -905,7 +905,7 @@ pub fn build_session_with_codemap(sopts: config::Options,
local_crate_source_file
:
Option
<
PathBuf
>
,
registry
:
errors
::
registry
::
Registry
,
codemap
:
Lrc
<
codemap
::
CodeMap
>
,
emitter_dest
:
Option
<
Box
<
Write
+
Send
>>
)
emitter_dest
:
Option
<
Box
<
dyn
Write
+
Send
>>
)
->
Session
{
// FIXME: This is not general enough to make the warning lint completely override
// normal diagnostic warnings, since the warning lint can also be denied and changed
...
...
@@ -924,7 +924,7 @@ pub fn build_session_with_codemap(sopts: config::Options,
let
external_macro_backtrace
=
sopts
.debugging_opts.external_macro_backtrace
;
let
emitter
:
Box
<
Emitter
>
=
match
(
sopts
.error_format
,
emitter_dest
)
{
let
emitter
:
Box
<
dyn
Emitter
>
=
match
(
sopts
.error_format
,
emitter_dest
)
{
(
config
::
ErrorOutputType
::
HumanReadable
(
color_config
),
None
)
=>
{
Box
::
new
(
EmitterWriter
::
stderr
(
color_config
,
Some
(
codemap
.clone
()),
false
,
sopts
.debugging_opts.teach
)
...
...
@@ -1123,7 +1123,7 @@ pub enum IncrCompSession {
}
pub
fn
early_error
(
output
:
config
::
ErrorOutputType
,
msg
:
&
str
)
->
!
{
let
emitter
:
Box
<
Emitter
>
=
match
output
{
let
emitter
:
Box
<
dyn
Emitter
>
=
match
output
{
config
::
ErrorOutputType
::
HumanReadable
(
color_config
)
=>
{
Box
::
new
(
EmitterWriter
::
stderr
(
color_config
,
None
,
false
,
false
))
}
...
...
@@ -1138,7 +1138,7 @@ pub fn early_error(output: config::ErrorOutputType, msg: &str) -> ! {
}
pub
fn
early_warn
(
output
:
config
::
ErrorOutputType
,
msg
:
&
str
)
{
let
emitter
:
Box
<
Emitter
>
=
match
output
{
let
emitter
:
Box
<
dyn
Emitter
>
=
match
output
{
config
::
ErrorOutputType
::
HumanReadable
(
color_config
)
=>
{
Box
::
new
(
EmitterWriter
::
stderr
(
color_config
,
None
,
false
,
false
))
}
...
...
src/librustc/traits/error_reporting.rs
浏览文件 @
69c53ac9
...
...
@@ -499,7 +499,7 @@ pub fn report_extra_impl_obligation(&self,
item_name
:
ast
::
Name
,
_
impl_item_def_id
:
DefId
,
trait_item_def_id
:
DefId
,
requirement
:
&
fmt
::
Display
)
requirement
:
&
dyn
fmt
::
Display
)
->
DiagnosticBuilder
<
'tcx
>
{
let
msg
=
"impl has stricter requirements than trait"
;
...
...
src/librustc/traits/specialize/specialization_graph.rs
浏览文件 @
69c53ac9
...
...
@@ -190,13 +190,13 @@ fn insert(&mut self,
Ok
(
Inserted
::
BecameNewSibling
(
last_lint
))
}
fn
iter_mut
(
&
'a
mut
self
)
->
Box
<
Iterator
<
Item
=
&
'a
mut
DefId
>
+
'a
>
{
fn
iter_mut
(
&
'a
mut
self
)
->
Box
<
dyn
Iterator
<
Item
=
&
'a
mut
DefId
>
+
'a
>
{
let
nonblanket
=
self
.nonblanket_impls
.iter_mut
()
.flat_map
(|(
_
,
v
)|
v
.iter_mut
());
Box
::
new
(
self
.blanket_impls
.iter_mut
()
.chain
(
nonblanket
))
}
fn
filtered_mut
(
&
'a
mut
self
,
sty
:
SimplifiedType
)
->
Box
<
Iterator
<
Item
=
&
'a
mut
DefId
>
+
'a
>
{
->
Box
<
dyn
Iterator
<
Item
=
&
'a
mut
DefId
>
+
'a
>
{
let
nonblanket
=
self
.nonblanket_impls
.entry
(
sty
)
.or_insert
(
vec!
[])
.iter_mut
();
Box
::
new
(
self
.blanket_impls
.iter_mut
()
.chain
(
nonblanket
))
}
...
...
src/librustc/ty/context.rs
浏览文件 @
69c53ac9
...
...
@@ -799,7 +799,7 @@ pub struct GlobalCtxt<'tcx> {
global_arenas
:
&
'tcx
GlobalArenas
<
'tcx
>
,
global_interners
:
CtxtInterners
<
'tcx
>
,
cstore
:
&
'tcx
CrateStore
,
cstore
:
&
'tcx
dyn
CrateStore
,
pub
sess
:
&
'tcx
Session
,
...
...
@@ -883,7 +883,7 @@ pub struct GlobalCtxt<'tcx> {
/// This is intended to only get used during the trans phase of the compiler
/// when satisfying the query for a particular codegen unit. Internally in
/// the query it'll send data along this channel to get processed later.
pub
tx_to_llvm_workers
:
mpsc
::
Sender
<
Box
<
Any
+
Send
>>
,
pub
tx_to_llvm_workers
:
mpsc
::
Sender
<
Box
<
dyn
Any
+
Send
>>
,
output_filenames
:
Arc
<
OutputFilenames
>
,
}
...
...
@@ -1131,7 +1131,7 @@ fn is_global(self) -> bool {
/// value (types, substs, etc.) can only be used while `ty::tls` has a valid
/// reference to the context, to allow formatting values that need it.
pub
fn
create_and_enter
<
F
,
R
>
(
s
:
&
'tcx
Session
,
cstore
:
&
'tcx
CrateStore
,
cstore
:
&
'tcx
dyn
CrateStore
,
local_providers
:
ty
::
maps
::
Providers
<
'tcx
>
,
extern_providers
:
ty
::
maps
::
Providers
<
'tcx
>
,
arenas
:
&
'tcx
AllArenas
<
'tcx
>
,
...
...
@@ -1139,7 +1139,7 @@ pub fn create_and_enter<F, R>(s: &'tcx Session,
hir
:
hir_map
::
Map
<
'tcx
>
,
on_disk_query_result_cache
:
maps
::
OnDiskCache
<
'tcx
>
,
crate_name
:
&
str
,
tx
:
mpsc
::
Sender
<
Box
<
Any
+
Send
>>
,
tx
:
mpsc
::
Sender
<
Box
<
dyn
Any
+
Send
>>
,
output_filenames
:
&
OutputFilenames
,
f
:
F
)
->
R
where
F
:
for
<
'b
>
FnOnce
(
TyCtxt
<
'b
,
'tcx
,
'tcx
>
)
->
R
...
...
@@ -1312,7 +1312,7 @@ pub fn metadata_encoding_version(self) -> Vec<u8> {
// Note that this is *untracked* and should only be used within the query
// system if the result is otherwise tracked through queries
pub
fn
crate_data_as_rc_any
(
self
,
cnum
:
CrateNum
)
->
Lrc
<
Any
>
{
pub
fn
crate_data_as_rc_any
(
self
,
cnum
:
CrateNum
)
->
Lrc
<
dyn
Any
>
{
self
.cstore
.crate_data_as_rc_any
(
cnum
)
}
...
...
src/librustc/ty/fold.rs
浏览文件 @
69c53ac9
...
...
@@ -277,7 +277,7 @@ pub struct RegionFolder<'a, 'gcx: 'a+'tcx, 'tcx: 'a> {
tcx
:
TyCtxt
<
'a
,
'gcx
,
'tcx
>
,
skipped_regions
:
&
'a
mut
bool
,
current_depth
:
u32
,
fld_r
:
&
'a
mut
(
FnMut
(
ty
::
Region
<
'tcx
>
,
u32
)
->
ty
::
Region
<
'tcx
>
+
'a
),
fld_r
:
&
'a
mut
(
dyn
FnMut
(
ty
::
Region
<
'tcx
>
,
u32
)
->
ty
::
Region
<
'tcx
>
+
'a
),
}
impl
<
'a
,
'gcx
,
'tcx
>
RegionFolder
<
'a
,
'gcx
,
'tcx
>
{
...
...
@@ -330,7 +330,7 @@ fn fold_region(&mut self, r: ty::Region<'tcx>) -> ty::Region<'tcx> {
struct
RegionReplacer
<
'a
,
'gcx
:
'a
+
'tcx
,
'tcx
:
'a
>
{
tcx
:
TyCtxt
<
'a
,
'gcx
,
'tcx
>
,
current_depth
:
u32
,
fld_r
:
&
'a
mut
(
FnMut
(
ty
::
BoundRegion
)
->
ty
::
Region
<
'tcx
>
+
'a
),
fld_r
:
&
'a
mut
(
dyn
FnMut
(
ty
::
BoundRegion
)
->
ty
::
Region
<
'tcx
>
+
'a
),
map
:
BTreeMap
<
ty
::
BoundRegion
,
ty
::
Region
<
'tcx
>>
}
...
...
src/librustc/ty/util.rs
浏览文件 @
69c53ac9
...
...
@@ -419,7 +419,7 @@ pub fn required_region_bounds(self,
pub
fn
calculate_dtor
(
self
,
adt_did
:
DefId
,
validate
:
&
mut
FnMut
(
Self
,
DefId
)
->
Result
<
(),
ErrorReported
>
validate
:
&
mut
dyn
FnMut
(
Self
,
DefId
)
->
Result
<
(),
ErrorReported
>
)
->
Option
<
ty
::
Destructor
>
{
let
drop_trait
=
if
let
Some
(
def_id
)
=
self
.lang_items
()
.drop_trait
()
{
def_id
...
...
src/librustc/util/common.rs
浏览文件 @
69c53ac9
...
...
@@ -38,7 +38,7 @@
thread_local!
(
static
TIME_DEPTH
:
Cell
<
usize
>
=
Cell
::
new
(
0
));
lazy_static!
{
static
ref
DEFAULT_HOOK
:
Box
<
Fn
(
&
panic
::
PanicInfo
)
+
Sync
+
Send
+
'static
>
=
{
static
ref
DEFAULT_HOOK
:
Box
<
dyn
Fn
(
&
panic
::
PanicInfo
)
+
Sync
+
Send
+
'static
>
=
{
let
hook
=
panic
::
take_hook
();
panic
::
set_hook
(
Box
::
new
(
panic_hook
));
hook
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录