Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
ec711767
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,发现更多精彩内容 >>
未验证
提交
ec711767
编写于
6月 21, 2019
作者:
J
Jeremy Stucki
提交者:
Jeremy Stucki
7月 03, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove needless lifetimes
上级
d50a3a7b
变更
29
隐藏空白更改
内联
并排
Showing
29 changed file
with
99 addition
and
99 deletion
+99
-99
src/librustc_borrowck/dataflow.rs
src/librustc_borrowck/dataflow.rs
+3
-3
src/librustc_codegen_llvm/base.rs
src/librustc_codegen_llvm/base.rs
+2
-2
src/librustc_codegen_llvm/builder.rs
src/librustc_codegen_llvm/builder.rs
+1
-1
src/librustc_codegen_llvm/lib.rs
src/librustc_codegen_llvm/lib.rs
+1
-1
src/librustc_codegen_ssa/base.rs
src/librustc_codegen_ssa/base.rs
+1
-1
src/librustc_codegen_utils/symbol_names_test.rs
src/librustc_codegen_utils/symbol_names_test.rs
+1
-1
src/librustc_data_structures/bit_set.rs
src/librustc_data_structures/bit_set.rs
+2
-2
src/librustc_data_structures/fingerprint.rs
src/librustc_data_structures/fingerprint.rs
+1
-1
src/librustc_driver/pretty.rs
src/librustc_driver/pretty.rs
+10
-10
src/librustc_errors/emitter.rs
src/librustc_errors/emitter.rs
+1
-1
src/librustc_errors/lib.rs
src/librustc_errors/lib.rs
+42
-42
src/librustc_incremental/assert_dep_graph.rs
src/librustc_incremental/assert_dep_graph.rs
+1
-1
src/librustc_incremental/assert_module_sources.rs
src/librustc_incremental/assert_module_sources.rs
+1
-1
src/librustc_interface/passes.rs
src/librustc_interface/passes.rs
+3
-3
src/librustc_interface/proc_macro_decls.rs
src/librustc_interface/proc_macro_decls.rs
+2
-2
src/librustc_lint/lib.rs
src/librustc_lint/lib.rs
+1
-1
src/librustc_metadata/cstore_impl.rs
src/librustc_metadata/cstore_impl.rs
+2
-2
src/librustc_metadata/encoder.rs
src/librustc_metadata/encoder.rs
+2
-2
src/librustc_metadata/foreign_modules.rs
src/librustc_metadata/foreign_modules.rs
+1
-1
src/librustc_metadata/link_args.rs
src/librustc_metadata/link_args.rs
+1
-1
src/librustc_metadata/native_libs.rs
src/librustc_metadata/native_libs.rs
+1
-1
src/librustc_mir/shim.rs
src/librustc_mir/shim.rs
+1
-1
src/librustc_passes/hir_stats.rs
src/librustc_passes/hir_stats.rs
+1
-1
src/librustc_passes/layout_test.rs
src/librustc_passes/layout_test.rs
+1
-1
src/librustc_passes/loops.rs
src/librustc_passes/loops.rs
+1
-1
src/librustc_passes/rvalue_promotion.rs
src/librustc_passes/rvalue_promotion.rs
+2
-2
src/librustc_plugin/build.rs
src/librustc_plugin/build.rs
+2
-2
src/librustc_plugin/registry.rs
src/librustc_plugin/registry.rs
+1
-1
src/librustc_privacy/lib.rs
src/librustc_privacy/lib.rs
+10
-10
未找到文件。
src/librustc_borrowck/dataflow.rs
浏览文件 @
ec711767
...
...
@@ -84,9 +84,9 @@ struct PropagationContext<'a, 'tcx, O> {
changed
:
bool
,
}
fn
get_cfg_indices
<
'a
>
(
id
:
hir
::
ItemLocalId
,
index
:
&
'a
FxHashMap
<
hir
::
ItemLocalId
,
Vec
<
CFGIndex
>>
)
->
&
'a
[
CFGIndex
]
{
fn
get_cfg_indices
(
id
:
hir
::
ItemLocalId
,
index
:
&
FxHashMap
<
hir
::
ItemLocalId
,
Vec
<
CFGIndex
>>
)
->
&
[
CFGIndex
]
{
index
.get
(
&
id
)
.map_or
(
&
[],
|
v
|
&
v
[
..
])
}
...
...
src/librustc_codegen_llvm/base.rs
浏览文件 @
ec711767
...
...
@@ -123,8 +123,8 @@ pub fn compile_codegen_unit(tcx: TyCtxt<'tcx>, cgu_name: InternedString) {
submit_codegened_module_to_llvm
(
&
LlvmCodegenBackend
(()),
tcx
,
module
,
cost
);
fn
module_codegen
<
'tcx
>
(
tcx
:
TyCtxt
<
'
tcx
>
,
fn
module_codegen
(
tcx
:
TyCtxt
<
'
_
>
,
cgu_name
:
InternedString
,
)
->
ModuleCodegen
<
ModuleLlvm
>
{
let
cgu
=
tcx
.codegen_unit
(
cgu_name
);
...
...
src/librustc_codegen_llvm/builder.rs
浏览文件 @
ec711767
...
...
@@ -144,7 +144,7 @@ fn with_cx(cx: &'a CodegenCx<'ll, 'tcx>) -> Self {
}
}
fn
build_sibling_block
<
'b
>
(
&
self
,
name
:
&
'b
str
)
->
Self
{
fn
build_sibling_block
(
&
self
,
name
:
&
str
)
->
Self
{
Builder
::
new_block
(
self
.cx
,
self
.llfn
(),
name
)
}
...
...
src/librustc_codegen_llvm/lib.rs
浏览文件 @
ec711767
...
...
@@ -124,7 +124,7 @@ fn codegen_allocator<'tcx>(
)
{
unsafe
{
allocator
::
codegen
(
tcx
,
mods
,
kind
)
}
}
fn
compile_codegen_unit
<
'tcx
>
(
&
self
,
tcx
:
TyCtxt
<
'tcx
>
,
cgu_name
:
InternedString
)
{
fn
compile_codegen_unit
(
&
self
,
tcx
:
TyCtxt
<
'_
>
,
cgu_name
:
InternedString
)
{
base
::
compile_codegen_unit
(
tcx
,
cgu_name
);
}
fn
target_machine_factory
(
...
...
src/librustc_codegen_ssa/base.rs
浏览文件 @
ec711767
...
...
@@ -700,7 +700,7 @@ fn drop(&mut self) {
}
}
fn
assert_and_save_dep_graph
<
'tcx
>
(
tcx
:
TyCtxt
<
'tcx
>
)
{
fn
assert_and_save_dep_graph
(
tcx
:
TyCtxt
<
'_
>
)
{
time
(
tcx
.sess
,
"assert dep graph"
,
||
::
rustc_incremental
::
assert_dep_graph
(
tcx
));
...
...
src/librustc_codegen_utils/symbol_names_test.rs
浏览文件 @
ec711767
...
...
@@ -11,7 +11,7 @@
const
SYMBOL_NAME
:
Symbol
=
sym
::
rustc_symbol_name
;
const
DEF_PATH
:
Symbol
=
sym
::
rustc_def_path
;
pub
fn
report_symbol_names
<
'tcx
>
(
tcx
:
TyCtxt
<
'tcx
>
)
{
pub
fn
report_symbol_names
(
tcx
:
TyCtxt
<
'_
>
)
{
// if the `rustc_attrs` feature is not enabled, then the
// attributes we are interested in cannot be present anyway, so
// skip the walk.
...
...
src/librustc_data_structures/bit_set.rs
浏览文件 @
ec711767
...
...
@@ -168,7 +168,7 @@ pub fn words(&self) -> &[Word] {
/// Iterates over the indices of set bits in a sorted order.
#[inline]
pub
fn
iter
<
'a
>
(
&
'a
self
)
->
BitIter
<
'a
,
T
>
{
pub
fn
iter
(
&
self
)
->
BitIter
<
'_
,
T
>
{
BitIter
{
cur
:
None
,
iter
:
self
.words
.iter
()
.enumerate
(),
...
...
@@ -849,7 +849,7 @@ pub fn words(&self) -> &[Word] {
/// Iterates through all the columns set to true in a given row of
/// the matrix.
pub
fn
iter
<
'a
>
(
&
'a
self
,
row
:
R
)
->
BitIter
<
'a
,
C
>
{
pub
fn
iter
(
&
self
,
row
:
R
)
->
BitIter
<
'_
,
C
>
{
assert
!
(
row
.index
()
<
self
.num_rows
);
let
(
start
,
end
)
=
self
.range
(
row
);
BitIter
{
...
...
src/librustc_data_structures/fingerprint.rs
浏览文件 @
ec711767
...
...
@@ -58,7 +58,7 @@ pub fn encode_opaque(&self, encoder: &mut Encoder) -> EncodeResult {
Ok
(())
}
pub
fn
decode_opaque
<
'a
>
(
decoder
:
&
mut
Decoder
<
'a
>
)
->
Result
<
Fingerprint
,
String
>
{
pub
fn
decode_opaque
(
decoder
:
&
mut
Decoder
<
'_
>
)
->
Result
<
Fingerprint
,
String
>
{
let
mut
bytes
=
[
0
;
16
];
decoder
.read_raw_bytes
(
&
mut
bytes
)
?
;
...
...
src/librustc_driver/pretty.rs
浏览文件 @
ec711767
...
...
@@ -188,7 +188,7 @@ fn call_with_pp_support<'tcx, A, F>(
_
=>
panic!
(
"Should use call_with_pp_support_hir"
),
}
}
fn
call_with_pp_support_hir
<
'tcx
,
A
,
F
>
(
&
self
,
tcx
:
TyCtxt
<
'tcx
>
,
f
:
F
)
->
A
fn
call_with_pp_support_hir
<
A
,
F
>
(
&
self
,
tcx
:
TyCtxt
<
'_
>
,
f
:
F
)
->
A
where
F
:
FnOnce
(
&
dyn
HirPrinterSupport
<
'_
>
,
&
hir
::
Crate
)
->
A
,
{
...
...
@@ -228,7 +228,7 @@ fn call_with_pp_support_hir<'tcx, A, F>(&self, tcx: TyCtxt<'tcx>, f: F) -> A
trait
PrinterSupport
:
pprust
::
PpAnn
{
/// Provides a uniform interface for re-extracting a reference to a
/// `Session` from a value that now owns it.
fn
sess
<
'a
>
(
&
'a
self
)
->
&
'a
Session
;
fn
sess
(
&
self
)
->
&
Session
;
/// Produces the pretty-print annotation object.
///
...
...
@@ -240,7 +240,7 @@ trait PrinterSupport: pprust::PpAnn {
trait
HirPrinterSupport
<
'hir
>
:
pprust_hir
::
PpAnn
{
/// Provides a uniform interface for re-extracting a reference to a
/// `Session` from a value that now owns it.
fn
sess
<
'a
>
(
&
'a
self
)
->
&
'a
Session
;
fn
sess
(
&
self
)
->
&
Session
;
/// Provides a uniform interface for re-extracting a reference to an
/// `hir_map::Map` from a value that now owns it.
...
...
@@ -272,7 +272,7 @@ struct NoAnn<'hir> {
}
impl
<
'hir
>
PrinterSupport
for
NoAnn
<
'hir
>
{
fn
sess
<
'a
>
(
&
'a
self
)
->
&
'a
Session
{
fn
sess
(
&
self
)
->
&
Session
{
self
.sess
}
...
...
@@ -282,7 +282,7 @@ fn pp_ann<'a>(&'a self) -> &'a dyn pprust::PpAnn {
}
impl
<
'hir
>
HirPrinterSupport
<
'hir
>
for
NoAnn
<
'hir
>
{
fn
sess
<
'a
>
(
&
'a
self
)
->
&
'a
Session
{
fn
sess
(
&
self
)
->
&
Session
{
self
.sess
}
...
...
@@ -313,7 +313,7 @@ struct IdentifiedAnnotation<'hir> {
}
impl
<
'hir
>
PrinterSupport
for
IdentifiedAnnotation
<
'hir
>
{
fn
sess
<
'a
>
(
&
'a
self
)
->
&
'a
Session
{
fn
sess
(
&
self
)
->
&
Session
{
self
.sess
}
...
...
@@ -360,7 +360,7 @@ fn post(&self, s: &mut pprust::State<'_>, node: pprust::AnnNode<'_>) -> io::Resu
}
impl
<
'hir
>
HirPrinterSupport
<
'hir
>
for
IdentifiedAnnotation
<
'hir
>
{
fn
sess
<
'a
>
(
&
'a
self
)
->
&
'a
Session
{
fn
sess
(
&
self
)
->
&
Session
{
self
.sess
}
...
...
@@ -458,7 +458,7 @@ struct TypedAnnotation<'a, 'tcx> {
}
impl
<
'b
,
'tcx
>
HirPrinterSupport
<
'tcx
>
for
TypedAnnotation
<
'b
,
'tcx
>
{
fn
sess
<
'a
>
(
&
'a
self
)
->
&
'a
Session
{
fn
sess
(
&
self
)
->
&
Session
{
&
self
.tcx.sess
}
...
...
@@ -866,8 +866,8 @@ pub fn print_after_hir_lowering<'tcx>(
// analysis is performed. However, we want to call `phase_3_run_analysis_passes`
// with a different callback than the standard driver, so that isn't easy.
// Instead, we call that function ourselves.
fn
print_with_analysis
<
'tcx
>
(
tcx
:
TyCtxt
<
'
tcx
>
,
fn
print_with_analysis
(
tcx
:
TyCtxt
<
'
_
>
,
ppm
:
PpMode
,
uii
:
Option
<
UserIdentifiedItem
>
,
ofile
:
Option
<&
Path
>
,
...
...
src/librustc_errors/emitter.rs
浏览文件 @
ec711767
...
...
@@ -1635,7 +1635,7 @@ fn from_stderr(color: ColorConfig) -> Destination {
}
}
fn
writable
<
'a
>
(
&
'a
mut
self
)
->
WritableDst
<
'a
>
{
fn
writable
(
&
mut
self
)
->
WritableDst
<
'_
>
{
match
*
self
{
Destination
::
Terminal
(
ref
mut
t
)
=>
WritableDst
::
Terminal
(
t
),
Destination
::
Buffered
(
ref
mut
t
)
=>
{
...
...
src/librustc_errors/lib.rs
浏览文件 @
ec711767
...
...
@@ -438,14 +438,14 @@ pub fn reset_err_count(&self) {
self
.err_count
.store
(
0
,
SeqCst
);
}
pub
fn
struct_dummy
<
'a
>
(
&
'a
self
)
->
DiagnosticBuilder
<
'a
>
{
pub
fn
struct_dummy
(
&
self
)
->
DiagnosticBuilder
<
'_
>
{
DiagnosticBuilder
::
new
(
self
,
Level
::
Cancelled
,
""
)
}
pub
fn
struct_span_warn
<
'a
,
S
:
Into
<
MultiSpan
>>
(
&
'a
self
,
sp
:
S
,
msg
:
&
str
)
->
DiagnosticBuilder
<
'a
>
{
pub
fn
struct_span_warn
<
S
:
Into
<
MultiSpan
>>
(
&
self
,
sp
:
S
,
msg
:
&
str
)
->
DiagnosticBuilder
<
'_
>
{
let
mut
result
=
DiagnosticBuilder
::
new
(
self
,
Level
::
Warning
,
msg
);
result
.set_span
(
sp
);
if
!
self
.flags.can_emit_warnings
{
...
...
@@ -453,11 +453,11 @@ pub fn struct_span_warn<'a, S: Into<MultiSpan>>(&'a self,
}
result
}
pub
fn
struct_span_warn_with_code
<
'a
,
S
:
Into
<
MultiSpan
>>
(
&
'a
self
,
sp
:
S
,
msg
:
&
str
,
code
:
DiagnosticId
)
->
DiagnosticBuilder
<
'a
>
{
pub
fn
struct_span_warn_with_code
<
S
:
Into
<
MultiSpan
>>
(
&
self
,
sp
:
S
,
msg
:
&
str
,
code
:
DiagnosticId
)
->
DiagnosticBuilder
<
'_
>
{
let
mut
result
=
DiagnosticBuilder
::
new
(
self
,
Level
::
Warning
,
msg
);
result
.set_span
(
sp
);
result
.code
(
code
);
...
...
@@ -466,63 +466,63 @@ pub fn struct_span_warn_with_code<'a, S: Into<MultiSpan>>(&'a self,
}
result
}
pub
fn
struct_warn
<
'a
>
(
&
'a
self
,
msg
:
&
str
)
->
DiagnosticBuilder
<
'a
>
{
pub
fn
struct_warn
(
&
self
,
msg
:
&
str
)
->
DiagnosticBuilder
<
'_
>
{
let
mut
result
=
DiagnosticBuilder
::
new
(
self
,
Level
::
Warning
,
msg
);
if
!
self
.flags.can_emit_warnings
{
result
.cancel
();
}
result
}
pub
fn
struct_span_err
<
'a
,
S
:
Into
<
MultiSpan
>>
(
&
'a
self
,
sp
:
S
,
msg
:
&
str
)
->
DiagnosticBuilder
<
'a
>
{
pub
fn
struct_span_err
<
S
:
Into
<
MultiSpan
>>
(
&
self
,
sp
:
S
,
msg
:
&
str
)
->
DiagnosticBuilder
<
'_
>
{
let
mut
result
=
DiagnosticBuilder
::
new
(
self
,
Level
::
Error
,
msg
);
result
.set_span
(
sp
);
result
}
pub
fn
struct_span_err_with_code
<
'a
,
S
:
Into
<
MultiSpan
>>
(
&
'a
self
,
sp
:
S
,
msg
:
&
str
,
code
:
DiagnosticId
)
->
DiagnosticBuilder
<
'a
>
{
pub
fn
struct_span_err_with_code
<
S
:
Into
<
MultiSpan
>>
(
&
self
,
sp
:
S
,
msg
:
&
str
,
code
:
DiagnosticId
)
->
DiagnosticBuilder
<
'_
>
{
let
mut
result
=
DiagnosticBuilder
::
new
(
self
,
Level
::
Error
,
msg
);
result
.set_span
(
sp
);
result
.code
(
code
);
result
}
// FIXME: This method should be removed (every error should have an associated error code).
pub
fn
struct_err
<
'a
>
(
&
'a
self
,
msg
:
&
str
)
->
DiagnosticBuilder
<
'a
>
{
pub
fn
struct_err
(
&
self
,
msg
:
&
str
)
->
DiagnosticBuilder
<
'_
>
{
DiagnosticBuilder
::
new
(
self
,
Level
::
Error
,
msg
)
}
pub
fn
struct_err_with_code
<
'a
>
(
&
'a
self
,
pub
fn
struct_err_with_code
(
&
self
,
msg
:
&
str
,
code
:
DiagnosticId
,
)
->
DiagnosticBuilder
<
'
a
>
{
)
->
DiagnosticBuilder
<
'
_
>
{
let
mut
result
=
DiagnosticBuilder
::
new
(
self
,
Level
::
Error
,
msg
);
result
.code
(
code
);
result
}
pub
fn
struct_span_fatal
<
'a
,
S
:
Into
<
MultiSpan
>>
(
&
'a
self
,
sp
:
S
,
msg
:
&
str
)
->
DiagnosticBuilder
<
'a
>
{
pub
fn
struct_span_fatal
<
S
:
Into
<
MultiSpan
>>
(
&
self
,
sp
:
S
,
msg
:
&
str
)
->
DiagnosticBuilder
<
'_
>
{
let
mut
result
=
DiagnosticBuilder
::
new
(
self
,
Level
::
Fatal
,
msg
);
result
.set_span
(
sp
);
result
}
pub
fn
struct_span_fatal_with_code
<
'a
,
S
:
Into
<
MultiSpan
>>
(
&
'a
self
,
sp
:
S
,
msg
:
&
str
,
code
:
DiagnosticId
)
->
DiagnosticBuilder
<
'a
>
{
pub
fn
struct_span_fatal_with_code
<
S
:
Into
<
MultiSpan
>>
(
&
self
,
sp
:
S
,
msg
:
&
str
,
code
:
DiagnosticId
)
->
DiagnosticBuilder
<
'_
>
{
let
mut
result
=
DiagnosticBuilder
::
new
(
self
,
Level
::
Fatal
,
msg
);
result
.set_span
(
sp
);
result
.code
(
code
);
result
}
pub
fn
struct_fatal
<
'a
>
(
&
'a
self
,
msg
:
&
str
)
->
DiagnosticBuilder
<
'a
>
{
pub
fn
struct_fatal
(
&
self
,
msg
:
&
str
)
->
DiagnosticBuilder
<
'_
>
{
DiagnosticBuilder
::
new
(
self
,
Level
::
Fatal
,
msg
)
}
...
...
@@ -563,10 +563,10 @@ pub fn span_fatal_with_code<S: Into<MultiSpan>>(&self,
pub
fn
span_err
<
S
:
Into
<
MultiSpan
>>
(
&
self
,
sp
:
S
,
msg
:
&
str
)
{
self
.emit
(
&
sp
.into
(),
msg
,
Error
);
}
pub
fn
mut_span_err
<
'a
,
S
:
Into
<
MultiSpan
>>
(
&
'a
self
,
sp
:
S
,
msg
:
&
str
)
->
DiagnosticBuilder
<
'a
>
{
pub
fn
mut_span_err
<
S
:
Into
<
MultiSpan
>>
(
&
self
,
sp
:
S
,
msg
:
&
str
)
->
DiagnosticBuilder
<
'_
>
{
let
mut
result
=
DiagnosticBuilder
::
new
(
self
,
Level
::
Error
,
msg
);
result
.set_span
(
sp
);
result
...
...
@@ -605,10 +605,10 @@ pub fn span_bug_no_panic<S: Into<MultiSpan>>(&self, sp: S, msg: &str) {
pub
fn
span_note_without_error
<
S
:
Into
<
MultiSpan
>>
(
&
self
,
sp
:
S
,
msg
:
&
str
)
{
self
.emit
(
&
sp
.into
(),
msg
,
Note
);
}
pub
fn
span_note_diag
<
'a
>
(
&
'a
self
,
sp
:
Span
,
msg
:
&
str
)
->
DiagnosticBuilder
<
'a
>
{
pub
fn
span_note_diag
(
&
self
,
sp
:
Span
,
msg
:
&
str
)
->
DiagnosticBuilder
<
'_
>
{
let
mut
db
=
DiagnosticBuilder
::
new
(
self
,
Note
,
msg
);
db
.set_span
(
sp
);
db
...
...
src/librustc_incremental/assert_dep_graph.rs
浏览文件 @
ec711767
...
...
@@ -51,7 +51,7 @@
use
syntax
::
ast
;
use
syntax_pos
::
Span
;
pub
fn
assert_dep_graph
<
'tcx
>
(
tcx
:
TyCtxt
<
'tcx
>
)
{
pub
fn
assert_dep_graph
(
tcx
:
TyCtxt
<
'_
>
)
{
tcx
.dep_graph
.with_ignore
(||
{
if
tcx
.sess.opts.debugging_opts.dump_dep_graph
{
dump_graph
(
tcx
);
...
...
src/librustc_incremental/assert_module_sources.rs
浏览文件 @
ec711767
...
...
@@ -35,7 +35,7 @@
const
CFG
:
Symbol
=
sym
::
cfg
;
const
KIND
:
Symbol
=
sym
::
kind
;
pub
fn
assert_module_sources
<
'tcx
>
(
tcx
:
TyCtxt
<
'tcx
>
)
{
pub
fn
assert_module_sources
(
tcx
:
TyCtxt
<
'_
>
)
{
tcx
.dep_graph
.with_ignore
(||
{
if
tcx
.sess.opts.incremental
.is_none
()
{
return
;
...
...
src/librustc_interface/passes.rs
浏览文件 @
ec711767
...
...
@@ -878,7 +878,7 @@ pub fn create_global_ctxt(
/// Runs the resolution, type-checking, region checking and other
/// miscellaneous analysis passes on the crate.
fn
analysis
<
'tcx
>
(
tcx
:
TyCtxt
<
'tcx
>
,
cnum
:
CrateNum
)
->
Result
<
()
>
{
fn
analysis
(
tcx
:
TyCtxt
<
'_
>
,
cnum
:
CrateNum
)
->
Result
<
()
>
{
assert_eq!
(
cnum
,
LOCAL_CRATE
);
let
sess
=
tcx
.sess
;
...
...
@@ -995,8 +995,8 @@ fn analysis<'tcx>(tcx: TyCtxt<'tcx>, cnum: CrateNum) -> Result<()> {
Ok
(())
}
fn
encode_and_write_metadata
<
'tcx
>
(
tcx
:
TyCtxt
<
'
tcx
>
,
fn
encode_and_write_metadata
(
tcx
:
TyCtxt
<
'
_
>
,
outputs
:
&
OutputFilenames
,
)
->
(
middle
::
cstore
::
EncodedMetadata
,
bool
)
{
#[derive(PartialEq,
Eq,
PartialOrd,
Ord)]
...
...
src/librustc_interface/proc_macro_decls.rs
浏览文件 @
ec711767
...
...
@@ -6,11 +6,11 @@
use
syntax
::
attr
;
use
syntax
::
symbol
::
sym
;
pub
fn
find
<
'tcx
>
(
tcx
:
TyCtxt
<
'tcx
>
)
->
Option
<
DefId
>
{
pub
fn
find
(
tcx
:
TyCtxt
<
'_
>
)
->
Option
<
DefId
>
{
tcx
.proc_macro_decls_static
(
LOCAL_CRATE
)
}
fn
proc_macro_decls_static
<
'tcx
>
(
tcx
:
TyCtxt
<
'tcx
>
,
cnum
:
CrateNum
)
->
Option
<
DefId
>
{
fn
proc_macro_decls_static
(
tcx
:
TyCtxt
<
'_
>
,
cnum
:
CrateNum
)
->
Option
<
DefId
>
{
assert_eq!
(
cnum
,
LOCAL_CRATE
);
let
mut
finder
=
Finder
{
decls
:
None
};
...
...
src/librustc_lint/lib.rs
浏览文件 @
ec711767
...
...
@@ -74,7 +74,7 @@ pub fn provide(providers: &mut Providers<'_>) {
};
}
fn
lint_mod
<
'tcx
>
(
tcx
:
TyCtxt
<
'tcx
>
,
module_def_id
:
DefId
)
{
fn
lint_mod
(
tcx
:
TyCtxt
<
'_
>
,
module_def_id
:
DefId
)
{
lint
::
late_lint_mod
(
tcx
,
module_def_id
,
BuiltinCombinedModuleLateLintPass
::
new
());
}
...
...
src/librustc_metadata/cstore_impl.rs
浏览文件 @
ec711767
...
...
@@ -250,7 +250,7 @@ fn into_args(self) -> (DefId, DefId) { (self.0.as_def_id(), self.1) }
exported_symbols
=>
{
Arc
::
new
(
cdata
.exported_symbols
(
tcx
))
}
}
pub
fn
provide
<
'tcx
>
(
providers
:
&
mut
Providers
<
'tcx
>
)
{
pub
fn
provide
(
providers
:
&
mut
Providers
<
'_
>
)
{
// FIXME(#44234) - almost all of these queries have no sub-queries and
// therefore no actual inputs, they're just reading tables calculated in
// resolve! Does this work? Unsure! That's what the issue is about
...
...
@@ -550,7 +550,7 @@ fn postorder_cnums_untracked(&self) -> Vec<CrateNum> {
self
.do_postorder_cnums_untracked
()
}
fn
encode_metadata
<
'tcx
>
(
&
self
,
tcx
:
TyCtxt
<
'tcx
>
)
->
EncodedMetadata
{
fn
encode_metadata
(
&
self
,
tcx
:
TyCtxt
<
'_
>
)
->
EncodedMetadata
{
encoder
::
encode_metadata
(
tcx
)
}
...
...
src/librustc_metadata/encoder.rs
浏览文件 @
ec711767
...
...
@@ -1863,7 +1863,7 @@ fn visit_impl_item(&mut self, _impl_item: &'v hir::ImplItem) {
// will allow us to slice the metadata to the precise length that we just
// generated regardless of trailing bytes that end up in it.
pub
fn
encode_metadata
<
'tcx
>
(
tcx
:
TyCtxt
<
'tcx
>
)
->
EncodedMetadata
{
pub
fn
encode_metadata
(
tcx
:
TyCtxt
<
'_
>
)
->
EncodedMetadata
{
let
mut
encoder
=
opaque
::
Encoder
::
new
(
vec!
[]);
encoder
.emit_raw_bytes
(
METADATA_HEADER
);
...
...
@@ -1905,7 +1905,7 @@ pub fn encode_metadata<'tcx>(tcx: TyCtxt<'tcx>) -> EncodedMetadata {
EncodedMetadata
{
raw_data
:
result
}
}
pub
fn
get_repr_options
<
'tcx
>
(
tcx
:
TyCtxt
<
'tcx
>
,
did
:
DefId
)
->
ReprOptions
{
pub
fn
get_repr_options
(
tcx
:
TyCtxt
<
'_
>
,
did
:
DefId
)
->
ReprOptions
{
let
ty
=
tcx
.type_of
(
did
);
match
ty
.sty
{
ty
::
Adt
(
ref
def
,
_
)
=>
return
def
.repr
,
...
...
src/librustc_metadata/foreign_modules.rs
浏览文件 @
ec711767
...
...
@@ -3,7 +3,7 @@
use
rustc
::
middle
::
cstore
::
ForeignModule
;
use
rustc
::
ty
::
TyCtxt
;
pub
fn
collect
<
'tcx
>
(
tcx
:
TyCtxt
<
'tcx
>
)
->
Vec
<
ForeignModule
>
{
pub
fn
collect
(
tcx
:
TyCtxt
<
'_
>
)
->
Vec
<
ForeignModule
>
{
let
mut
collector
=
Collector
{
tcx
,
modules
:
Vec
::
new
(),
...
...
src/librustc_metadata/link_args.rs
浏览文件 @
ec711767
...
...
@@ -4,7 +4,7 @@
use
rustc_target
::
spec
::
abi
::
Abi
;
use
syntax
::
symbol
::
sym
;
pub
fn
collect
<
'tcx
>
(
tcx
:
TyCtxt
<
'tcx
>
)
->
Vec
<
String
>
{
pub
fn
collect
(
tcx
:
TyCtxt
<
'_
>
)
->
Vec
<
String
>
{
let
mut
collector
=
Collector
{
args
:
Vec
::
new
(),
};
...
...
src/librustc_metadata/native_libs.rs
浏览文件 @
ec711767
...
...
@@ -11,7 +11,7 @@
use
syntax
::
symbol
::{
Symbol
,
sym
};
use
syntax
::{
span_err
,
struct_span_err
};
pub
fn
collect
<
'tcx
>
(
tcx
:
TyCtxt
<
'tcx
>
)
->
Vec
<
NativeLibrary
>
{
pub
fn
collect
(
tcx
:
TyCtxt
<
'_
>
)
->
Vec
<
NativeLibrary
>
{
let
mut
collector
=
Collector
{
tcx
,
libs
:
Vec
::
new
(),
...
...
src/librustc_mir/shim.rs
浏览文件 @
ec711767
...
...
@@ -829,7 +829,7 @@ fn build_call_shim<'tcx>(
body
}
pub
fn
build_adt_ctor
<
'tcx
>
(
tcx
:
TyCtxt
<
'tcx
>
,
ctor_id
:
DefId
)
->
&
'tcx
Body
<
'tcx
>
{
pub
fn
build_adt_ctor
(
tcx
:
TyCtxt
<
'_
>
,
ctor_id
:
DefId
)
->
&
Body
<
'_
>
{
debug_assert!
(
tcx
.is_constructor
(
ctor_id
));
let
span
=
tcx
.hir
()
.span_if_local
(
ctor_id
)
...
...
src/librustc_passes/hir_stats.rs
浏览文件 @
ec711767
...
...
@@ -38,7 +38,7 @@ pub fn print_hir_stats(krate: &hir::Crate) {
collector
.print
(
"HIR STATS"
);
}
pub
fn
print_ast_stats
<
'v
>
(
krate
:
&
'v
ast
::
Crate
,
title
:
&
str
)
{
pub
fn
print_ast_stats
(
krate
:
&
ast
::
Crate
,
title
:
&
str
)
{
let
mut
collector
=
StatCollector
{
krate
:
None
,
data
:
FxHashMap
::
default
(),
...
...
src/librustc_passes/layout_test.rs
浏览文件 @
ec711767
...
...
@@ -14,7 +14,7 @@
use
syntax
::
ast
::
Attribute
;
use
syntax
::
symbol
::
sym
;
pub
fn
test_layout
<
'tcx
>
(
tcx
:
TyCtxt
<
'tcx
>
)
{
pub
fn
test_layout
(
tcx
:
TyCtxt
<
'_
>
)
{
if
tcx
.features
()
.rustc_attrs
{
// if the `rustc_attrs` feature is not enabled, don't bother testing layout
tcx
.hir
()
...
...
src/librustc_passes/loops.rs
浏览文件 @
ec711767
...
...
@@ -45,7 +45,7 @@ struct CheckLoopVisitor<'a, 'hir> {
cx
:
Context
,
}
fn
check_mod_loops
<
'tcx
>
(
tcx
:
TyCtxt
<
'tcx
>
,
module_def_id
:
DefId
)
{
fn
check_mod_loops
(
tcx
:
TyCtxt
<
'_
>
,
module_def_id
:
DefId
)
{
tcx
.hir
()
.visit_item_likes_in_module
(
module_def_id
,
&
mut
CheckLoopVisitor
{
sess
:
&
tcx
.sess
,
hir_map
:
&
tcx
.hir
(),
...
...
src/librustc_passes/rvalue_promotion.rs
浏览文件 @
ec711767
...
...
@@ -39,7 +39,7 @@ pub fn provide(providers: &mut Providers<'_>) {
};
}
fn
const_is_rvalue_promotable_to_static
<
'tcx
>
(
tcx
:
TyCtxt
<
'tcx
>
,
def_id
:
DefId
)
->
bool
{
fn
const_is_rvalue_promotable_to_static
(
tcx
:
TyCtxt
<
'_
>
,
def_id
:
DefId
)
->
bool
{
assert
!
(
def_id
.is_local
());
let
hir_id
=
tcx
.hir
()
.as_local_hir_id
(
def_id
)
...
...
@@ -48,7 +48,7 @@ fn const_is_rvalue_promotable_to_static<'tcx>(tcx: TyCtxt<'tcx>, def_id: DefId)
tcx
.rvalue_promotable_map
(
def_id
)
.contains
(
&
body_id
.hir_id.local_id
)
}
fn
rvalue_promotable_map
<
'tcx
>
(
tcx
:
TyCtxt
<
'tcx
>
,
def_id
:
DefId
)
->
&
'tcx
ItemLocalSet
{
fn
rvalue_promotable_map
(
tcx
:
TyCtxt
<
'_
>
,
def_id
:
DefId
)
->
&
ItemLocalSet
{
let
outer_def_id
=
tcx
.closure_base_def_id
(
def_id
);
if
outer_def_id
!=
def_id
{
return
tcx
.rvalue_promotable_map
(
outer_def_id
);
...
...
src/librustc_plugin/build.rs
浏览文件 @
ec711767
...
...
@@ -30,11 +30,11 @@ fn visit_impl_item(&mut self, _impl_item: &hir::ImplItem) {
}
/// Finds the function marked with `#[plugin_registrar]`, if any.
pub
fn
find_plugin_registrar
<
'tcx
>
(
tcx
:
TyCtxt
<
'tcx
>
)
->
Option
<
DefId
>
{
pub
fn
find_plugin_registrar
(
tcx
:
TyCtxt
<
'_
>
)
->
Option
<
DefId
>
{
tcx
.plugin_registrar_fn
(
LOCAL_CRATE
)
}
fn
plugin_registrar_fn
<
'tcx
>
(
tcx
:
TyCtxt
<
'tcx
>
,
cnum
:
CrateNum
)
->
Option
<
DefId
>
{
fn
plugin_registrar_fn
(
tcx
:
TyCtxt
<
'_
>
,
cnum
:
CrateNum
)
->
Option
<
DefId
>
{
assert_eq!
(
cnum
,
LOCAL_CRATE
);
let
mut
finder
=
RegistrarFinder
{
registrars
:
Vec
::
new
()
};
...
...
src/librustc_plugin/registry.rs
浏览文件 @
ec711767
...
...
@@ -77,7 +77,7 @@ pub fn new(sess: &'a Session, krate_span: Span) -> Registry<'a> {
///
/// Returns empty slice in case the plugin was loaded
/// with `--extra-plugins`
pub
fn
args
<
'b
>
(
&
'b
self
)
->
&
'b
[
ast
::
NestedMetaItem
]
{
pub
fn
args
(
&
self
)
->
&
[
ast
::
NestedMetaItem
]
{
self
.args_hidden
.as_ref
()
.map
(|
v
|
&
v
[
..
])
.unwrap_or
(
&
[])
}
...
...
src/librustc_privacy/lib.rs
浏览文件 @
ec711767
...
...
@@ -337,7 +337,7 @@ fn item_tables<'a, 'tcx>(
if
tcx
.has_typeck_tables
(
def_id
)
{
tcx
.typeck_tables_of
(
def_id
)
}
else
{
empty_tables
}
}
fn
min
<
'tcx
>
(
vis1
:
ty
::
Visibility
,
vis2
:
ty
::
Visibility
,
tcx
:
TyCtxt
<
'tcx
>
)
->
ty
::
Visibility
{
fn
min
(
vis1
:
ty
::
Visibility
,
vis2
:
ty
::
Visibility
,
tcx
:
TyCtxt
<
'_
>
)
->
ty
::
Visibility
{
if
vis1
.is_at_least
(
vis2
,
tcx
)
{
vis2
}
else
{
vis1
}
}
...
...
@@ -384,14 +384,14 @@ fn visit_def_id(&mut self, def_id: DefId, _kind: &str, _descr: &dyn fmt::Display
trait
VisibilityLike
:
Sized
{
const
MAX
:
Self
;
const
SHALLOW
:
bool
=
false
;
fn
new_min
<
'a
,
'tcx
>
(
find
:
&
FindMin
<
'a
,
'tcx
,
Self
>
,
def_id
:
DefId
)
->
Self
;
fn
new_min
(
find
:
&
FindMin
<
'_
,
'_
,
Self
>
,
def_id
:
DefId
)
->
Self
;
// Returns an over-approximation (`skip_assoc_tys` = true) of visibility due to
// associated types for which we can't determine visibility precisely.
fn
of_impl
<
'a
,
'tcx
>
(
fn
of_impl
(
hir_id
:
hir
::
HirId
,
tcx
:
TyCtxt
<
'
tcx
>
,
access_levels
:
&
'a
AccessLevels
,
tcx
:
TyCtxt
<
'
_
>
,
access_levels
:
&
AccessLevels
,
)
->
Self
{
let
mut
find
=
FindMin
{
tcx
,
access_levels
,
min
:
Self
::
MAX
};
let
def_id
=
tcx
.hir
()
.local_def_id_from_hir_id
(
hir_id
);
...
...
@@ -404,7 +404,7 @@ fn of_impl<'a, 'tcx>(
}
impl
VisibilityLike
for
ty
::
Visibility
{
const
MAX
:
Self
=
ty
::
Visibility
::
Public
;
fn
new_min
<
'a
,
'tcx
>
(
find
:
&
FindMin
<
'a
,
'tcx
,
Self
>
,
def_id
:
DefId
)
->
Self
{
fn
new_min
(
find
:
&
FindMin
<
'_
,
'_
,
Self
>
,
def_id
:
DefId
)
->
Self
{
min
(
def_id_visibility
(
find
.tcx
,
def_id
)
.0
,
find
.min
,
find
.tcx
)
}
}
...
...
@@ -420,7 +420,7 @@ impl VisibilityLike for Option<AccessLevel> {
// both "shallow" version of its self type and "shallow" version of its trait if it exists
// (which require reaching the `DefId`s in them).
const
SHALLOW
:
bool
=
true
;
fn
new_min
<
'a
,
'tcx
>
(
find
:
&
FindMin
<
'a
,
'tcx
,
Self
>
,
def_id
:
DefId
)
->
Self
{
fn
new_min
(
find
:
&
FindMin
<
'_
,
'_
,
Self
>
,
def_id
:
DefId
)
->
Self
{
cmp
::
min
(
if
let
Some
(
hir_id
)
=
find
.tcx
.hir
()
.as_local_hir_id
(
def_id
)
{
find
.access_levels.map
.get
(
&
hir_id
)
.cloned
()
}
else
{
...
...
@@ -1828,7 +1828,7 @@ pub fn provide(providers: &mut Providers<'_>) {
};
}
fn
check_mod_privacy
<
'tcx
>
(
tcx
:
TyCtxt
<
'tcx
>
,
module_def_id
:
DefId
)
{
fn
check_mod_privacy
(
tcx
:
TyCtxt
<
'_
>
,
module_def_id
:
DefId
)
{
let
empty_tables
=
ty
::
TypeckTables
::
empty
(
None
);
// Check privacy of names not checked in previous compilation stages.
...
...
@@ -1855,7 +1855,7 @@ fn check_mod_privacy<'tcx>(tcx: TyCtxt<'tcx>, module_def_id: DefId) {
intravisit
::
walk_mod
(
&
mut
visitor
,
module
,
hir_id
);
}
fn
privacy_access_levels
<
'tcx
>
(
tcx
:
TyCtxt
<
'tcx
>
,
krate
:
CrateNum
)
->
&
'tcx
AccessLevels
{
fn
privacy_access_levels
(
tcx
:
TyCtxt
<
'_
>
,
krate
:
CrateNum
)
->
&
AccessLevels
{
assert_eq!
(
krate
,
LOCAL_CRATE
);
// Build up a set of all exported items in the AST. This is a set of all
...
...
@@ -1879,7 +1879,7 @@ fn privacy_access_levels<'tcx>(tcx: TyCtxt<'tcx>, krate: CrateNum) -> &'tcx Acce
tcx
.arena
.alloc
(
visitor
.access_levels
)
}
fn
check_private_in_public
<
'tcx
>
(
tcx
:
TyCtxt
<
'tcx
>
,
krate
:
CrateNum
)
{
fn
check_private_in_public
(
tcx
:
TyCtxt
<
'_
>
,
krate
:
CrateNum
)
{
assert_eq!
(
krate
,
LOCAL_CRATE
);
let
access_levels
=
tcx
.privacy_access_levels
(
LOCAL_CRATE
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录