Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
0895590c
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,发现更多精彩内容 >>
提交
0895590c
编写于
5月 29, 2018
作者:
E
Eduard-Mihai Burtescu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
rustc: rename mir::LocalDecl's source_info to visibility_source_info.
上级
b10c157b
变更
20
隐藏空白更改
内联
并排
Showing
20 changed file
with
60 addition
and
59 deletion
+60
-59
src/librustc/ich/impls_mir.rs
src/librustc/ich/impls_mir.rs
+1
-1
src/librustc/mir/mod.rs
src/librustc/mir/mod.rs
+14
-14
src/librustc/mir/visit.rs
src/librustc/mir/visit.rs
+4
-4
src/librustc_codegen_llvm/debuginfo/create_scope_map.rs
src/librustc_codegen_llvm/debuginfo/create_scope_map.rs
+1
-1
src/librustc_codegen_llvm/mir/mod.rs
src/librustc_codegen_llvm/mir/mod.rs
+2
-2
src/librustc_mir/borrow_check/error_reporting.rs
src/librustc_mir/borrow_check/error_reporting.rs
+1
-1
src/librustc_mir/borrow_check/mod.rs
src/librustc_mir/borrow_check/mod.rs
+1
-1
src/librustc_mir/borrow_check/nll/explain_borrow/mod.rs
src/librustc_mir/borrow_check/nll/explain_borrow/mod.rs
+1
-1
src/librustc_mir/borrow_check/nll/type_check/mod.rs
src/librustc_mir/borrow_check/nll/type_check/mod.rs
+1
-1
src/librustc_mir/build/expr/into.rs
src/librustc_mir/build/expr/into.rs
+1
-1
src/librustc_mir/build/matches/mod.rs
src/librustc_mir/build/matches/mod.rs
+17
-17
src/librustc_mir/build/mod.rs
src/librustc_mir/build/mod.rs
+1
-1
src/librustc_mir/dataflow/move_paths/builder.rs
src/librustc_mir/dataflow/move_paths/builder.rs
+1
-1
src/librustc_mir/shim.rs
src/librustc_mir/shim.rs
+1
-1
src/librustc_mir/transform/check_unsafety.rs
src/librustc_mir/transform/check_unsafety.rs
+1
-1
src/librustc_mir/transform/generator.rs
src/librustc_mir/transform/generator.rs
+3
-3
src/librustc_mir/transform/inline.rs
src/librustc_mir/transform/inline.rs
+3
-2
src/librustc_mir/transform/promote_consts.rs
src/librustc_mir/transform/promote_consts.rs
+2
-2
src/librustc_mir/transform/qualify_consts.rs
src/librustc_mir/transform/qualify_consts.rs
+2
-2
src/librustc_mir/util/pretty.rs
src/librustc_mir/util/pretty.rs
+2
-2
未找到文件。
src/librustc/ich/impls_mir.rs
浏览文件 @
0895590c
...
...
@@ -25,8 +25,8 @@
mutability
,
ty
,
name
,
source_info
,
syntactic_source_info
,
visibility_source_info
,
internal
,
is_user_variable
});
...
...
src/librustc/mir/mod.rs
浏览文件 @
0895590c
...
...
@@ -505,10 +505,6 @@ pub struct LocalDecl<'tcx> {
/// to generate better debuginfo.
pub
name
:
Option
<
Name
>
,
/// Source info of the local. The `SourceScope` is the *visibility* one,
/// not the the *syntactic* one (see `syntactic_source_info` for more details).
pub
source_info
:
SourceInfo
,
/// The *syntactic* (i.e. not visibility) source scope the local is defined
/// in. If the local was defined in a let-statement, this
/// is *within* the let-statement, rather than outside
...
...
@@ -562,7 +558,7 @@ pub struct LocalDecl<'tcx> {
/// To allow both uses to work, we need to have more than a single scope
/// for a local. We have the `syntactic_source_info.scope` represent the
/// "syntactic" lint scope (with a variable being under its let
/// block) while the `source_info.scope` represents the "local variable"
/// block) while the `
visibility_
source_info.scope` represents the "local variable"
/// scope (where the "rest" of a block is under all prior let-statements).
///
/// The end result looks like this:
...
...
@@ -581,14 +577,18 @@ pub struct LocalDecl<'tcx> {
/// │ │
/// │ │ │{ let y: u32 }
/// │ │ │
/// │ │ │← y.source_info.scope
/// │ │ │← y.
visibility_
source_info.scope
/// │ │ │← `y + 2`
/// │
/// │ │{ let x: u32 }
/// │ │← x.source_info.scope
/// │ │← x.
visibility_
source_info.scope
/// │ │← `drop(x)` // this accesses `x: u32`
/// ```
pub
syntactic_source_info
:
SourceInfo
,
/// Source info of the local. The `SourceScope` is the *visibility* one,
/// not the the *syntactic* one (see `syntactic_source_info` for more details).
pub
visibility_source_info
:
SourceInfo
,
}
impl
<
'tcx
>
LocalDecl
<
'tcx
>
{
...
...
@@ -599,11 +599,11 @@ pub fn new_temp(ty: Ty<'tcx>, span: Span) -> Self {
mutability
:
Mutability
::
Mut
,
ty
,
name
:
None
,
source_info
:
SourceInfo
{
s
yntactic_s
ource_info
:
SourceInfo
{
span
,
scope
:
OUTERMOST_SOURCE_SCOPE
},
syntactic
_source_info
:
SourceInfo
{
visibility
_source_info
:
SourceInfo
{
span
,
scope
:
OUTERMOST_SOURCE_SCOPE
},
...
...
@@ -619,11 +619,11 @@ pub fn new_internal(ty: Ty<'tcx>, span: Span) -> Self {
mutability
:
Mutability
::
Mut
,
ty
,
name
:
None
,
source_info
:
SourceInfo
{
s
yntactic_s
ource_info
:
SourceInfo
{
span
,
scope
:
OUTERMOST_SOURCE_SCOPE
},
syntactic
_source_info
:
SourceInfo
{
visibility
_source_info
:
SourceInfo
{
span
,
scope
:
OUTERMOST_SOURCE_SCOPE
},
...
...
@@ -640,11 +640,11 @@ pub fn new_return_place(return_ty: Ty, span: Span) -> LocalDecl {
LocalDecl
{
mutability
:
Mutability
::
Mut
,
ty
:
return_ty
,
source_info
:
SourceInfo
{
s
yntactic_s
ource_info
:
SourceInfo
{
span
,
scope
:
OUTERMOST_SOURCE_SCOPE
},
syntactic
_source_info
:
SourceInfo
{
visibility
_source_info
:
SourceInfo
{
span
,
scope
:
OUTERMOST_SOURCE_SCOPE
},
...
...
@@ -2200,8 +2200,8 @@ impl<'tcx> TypeFoldable<'tcx> for LocalDecl<'tcx> {
internal
,
ty
,
name
,
source_info
,
syntactic_source_info
,
visibility_source_info
,
}
}
...
...
src/librustc/mir/visit.rs
浏览文件 @
0895590c
...
...
@@ -714,18 +714,18 @@ fn super_local_decl(&mut self,
mutability
:
_
,
ref
$
(
$mutability
)
*
ty
,
name
:
_
,
ref
$
(
$mutability
)
*
source_info
,
internal
:
_
,
ref
$
(
$mutability
)
*
syntactic_source_info
,
ref
$
(
$mutability
)
*
visibility_source_info
,
internal
:
_
,
is_user_variable
:
_
,
}
=
*
local_decl
;
self
.visit_ty
(
ty
,
TyContext
::
LocalDecl
{
local
,
source_info
:
*
source_info
,
source_info
:
*
visibility_
source_info
,
});
self
.visit_source_info
(
syntactic_source_info
);
self
.visit_source_info
(
source_info
);
self
.visit_source_info
(
visibility_
source_info
);
}
fn
super_source_scope
(
&
mut
self
,
...
...
src/librustc_codegen_llvm/debuginfo/create_scope_map.rs
浏览文件 @
0895590c
...
...
@@ -65,7 +65,7 @@ pub fn create_mir_scopes(cx: &CodegenCx, mir: &Mir, debug_context: &FunctionDebu
let
mut
has_variables
=
BitVector
::
new
(
mir
.source_scopes
.len
());
for
var
in
mir
.vars_iter
()
{
let
decl
=
&
mir
.local_decls
[
var
];
has_variables
.insert
(
decl
.source_info.scope
.index
());
has_variables
.insert
(
decl
.
visibility_
source_info.scope
.index
());
}
// Instantiate all scopes.
...
...
src/librustc_codegen_llvm/mir/mod.rs
浏览文件 @
0895590c
...
...
@@ -265,7 +265,7 @@ pub fn codegen_mir<'a, 'tcx: 'a>(
if
let
Some
(
name
)
=
decl
.name
{
// User variable
let
debug_scope
=
fx
.scopes
[
decl
.source_info.scope
];
let
debug_scope
=
fx
.scopes
[
decl
.
visibility_
source_info.scope
];
let
dbg
=
debug_scope
.is_valid
()
&&
bx
.sess
()
.opts.debuginfo
==
FullDebugInfo
;
if
!
memory_locals
.contains
(
local
.index
())
&&
!
dbg
{
...
...
@@ -276,7 +276,7 @@ pub fn codegen_mir<'a, 'tcx: 'a>(
debug!
(
"alloc: {:?} ({}) -> place"
,
local
,
name
);
let
place
=
PlaceRef
::
alloca
(
&
bx
,
layout
,
&
name
.as_str
());
if
dbg
{
let
(
scope
,
span
)
=
fx
.debug_loc
(
decl
.source_info
);
let
(
scope
,
span
)
=
fx
.debug_loc
(
decl
.
visibility_
source_info
);
declare_local
(
&
bx
,
&
fx
.debug_context
,
name
,
layout
.ty
,
scope
,
VariableAccess
::
DirectVariable
{
alloca
:
place
.llval
},
VariableKind
::
LocalVariable
,
span
);
...
...
src/librustc_mir/borrow_check/error_reporting.rs
浏览文件 @
0895590c
...
...
@@ -398,7 +398,7 @@ pub(super) fn report_borrowed_value_does_not_live_long_enough(
let
borrow_span
=
self
.mir
.source_info
(
borrow
.reserve_location
)
.span
;
let
proper_span
=
match
*
root_place
{
Place
::
Local
(
local
)
=>
self
.mir.local_decls
[
local
]
.source_info.span
,
Place
::
Local
(
local
)
=>
self
.mir.local_decls
[
local
]
.
visibility_
source_info.span
,
_
=>
drop_span
,
};
...
...
src/librustc_mir/borrow_check/mod.rs
浏览文件 @
0895590c
...
...
@@ -306,7 +306,7 @@ fn do_mir_borrowck<'a, 'gcx, 'tcx>(
None
=>
continue
,
}
let
source_info
=
local_decl
.source_info
;
let
source_info
=
local_decl
.
visibility_
source_info
;
let
mut_span
=
tcx
.sess
.codemap
()
.span_until_non_whitespace
(
source_info
.span
);
tcx
.struct_span_lint_node
(
...
...
src/librustc_mir/borrow_check/nll/explain_borrow/mod.rs
浏览文件 @
0895590c
...
...
@@ -67,7 +67,7 @@ pub(in borrow_check) fn explain_why_borrow_contains_point(
}
None
=>
{
err
.span_label
(
mir
.local_decls
[
local
]
.source_info.span
,
mir
.local_decls
[
local
]
.
visibility_
source_info.span
,
"borrow may end up in a temporary, created here"
,
);
...
...
src/librustc_mir/borrow_check/nll/type_check/mod.rs
浏览文件 @
0895590c
...
...
@@ -1201,7 +1201,7 @@ fn check_local(&mut self, mir: &Mir<'tcx>, local: Local, local_decl: &LocalDecl<
LocalKind
::
Var
|
LocalKind
::
Temp
=>
{}
}
let
span
=
local_decl
.source_info.span
;
let
span
=
local_decl
.
visibility_
source_info.span
;
let
ty
=
local_decl
.ty
;
// Erase the regions from `ty` to get a global type. The
...
...
src/librustc_mir/build/expr/into.rs
浏览文件 @
0895590c
...
...
@@ -246,8 +246,8 @@ pub fn into_expr(&mut self,
mutability
:
Mutability
::
Mut
,
ty
:
ptr_ty
,
name
:
None
,
source_info
,
syntactic_source_info
:
source_info
,
visibility_source_info
:
source_info
,
internal
:
true
,
is_user_variable
:
false
});
...
...
src/librustc_mir/build/matches/mod.rs
浏览文件 @
0895590c
...
...
@@ -294,22 +294,22 @@ pub fn place_into_pattern(&mut self,
block
.unit
()
}
/// Declares the bindings of the given pattern and returns the
source
scope
/// Declares the bindings of the given pattern and returns the
visibility
scope
/// for the bindings in this patterns, if such a scope had to be created.
/// NOTE: Declaring the bindings should always be done in their drop scope.
pub
fn
declare_bindings
(
&
mut
self
,
mut
v
ar
_scope
:
Option
<
SourceScope
>
,
mut
v
isibility
_scope
:
Option
<
SourceScope
>
,
scope_span
:
Span
,
lint_level
:
LintLevel
,
pattern
:
&
Pattern
<
'tcx
>
,
has_guard
:
ArmHasGuard
)
->
Option
<
SourceScope
>
{
assert
!
(
!
(
v
ar
_scope
.is_some
()
&&
lint_level
.is_explicit
()),
"can't have both a v
ar
and a lint scope at the same time"
);
assert
!
(
!
(
v
isibility
_scope
.is_some
()
&&
lint_level
.is_explicit
()),
"can't have both a v
isibility
and a lint scope at the same time"
);
let
mut
syntactic_scope
=
self
.source_scope
;
self
.visit_bindings
(
pattern
,
&
mut
|
this
,
mutability
,
name
,
var
,
span
,
ty
|
{
if
v
ar
_scope
.is_none
()
{
v
ar
_scope
=
Some
(
this
.new_source_scope
(
scope_span
,
if
v
isibility
_scope
.is_none
()
{
v
isibility
_scope
=
Some
(
this
.new_source_scope
(
scope_span
,
LintLevel
::
Inherited
,
None
));
// If we have lints, create a new source scope
...
...
@@ -320,18 +320,18 @@ pub fn declare_bindings(&mut self,
this
.new_source_scope
(
scope_span
,
lint_level
,
None
);
}
}
let
source_info
=
SourceInfo
{
span
,
scope
:
var_scope
.unwrap
()
};
let
syntactic_source_info
=
SourceInfo
{
span
,
scope
:
syntactic_scope
,
};
this
.declare_binding
(
source_info
,
syntactic_source_info
,
mutability
,
name
,
var
,
let
visibility_source_info
=
SourceInfo
{
span
,
scope
:
visibility_scope
.unwrap
()
};
this
.declare_binding
(
syntactic_source_info
,
visibility_source_info
,
mutability
,
name
,
var
,
ty
,
has_guard
);
});
v
ar
_scope
v
isibility
_scope
}
pub
fn
storage_live_binding
(
&
mut
self
,
...
...
@@ -1117,25 +1117,25 @@ fn bind_matched_candidate_for_arm_body(&mut self,
/// `&T`. The second local is a binding for occurrences of `var`
/// in the arm body, which will have type `T`.
fn
declare_binding
(
&
mut
self
,
source_info
:
SourceInfo
,
syntactic_source_info
:
SourceInfo
,
visibility_source_info
:
SourceInfo
,
mutability
:
Mutability
,
name
:
Name
,
var_id
:
NodeId
,
var_ty
:
Ty
<
'tcx
>
,
has_guard
:
ArmHasGuard
)
{
debug!
(
"declare_binding(var_id={:?}, name={:?}, var_ty={:?}, source_info={:?},
\
debug!
(
"declare_binding(var_id={:?}, name={:?}, var_ty={:?},
visibility_
source_info={:?},
\
syntactic_source_info={:?})"
,
var_id
,
name
,
var_ty
,
source_info
,
syntactic_source_info
);
var_id
,
name
,
var_ty
,
visibility_
source_info
,
syntactic_source_info
);
let
tcx
=
self
.hir
.tcx
();
let
local
=
LocalDecl
::
<
'tcx
>
{
mutability
,
ty
:
var_ty
.clone
(),
name
:
Some
(
name
),
source_info
,
syntactic_source_info
,
visibility_source_info
,
internal
:
false
,
is_user_variable
:
true
,
};
...
...
@@ -1146,8 +1146,8 @@ fn declare_binding(&mut self,
mutability
,
ty
:
tcx
.mk_imm_ref
(
tcx
.types.re_empty
,
var_ty
),
name
:
Some
(
name
),
source_info
,
syntactic_source_info
,
visibility_source_info
,
internal
:
false
,
is_user_variable
:
true
,
});
...
...
src/librustc_mir/build/mod.rs
浏览文件 @
0895590c
...
...
@@ -664,8 +664,8 @@ fn args_and_body(&mut self,
self
.local_decls
.push
(
LocalDecl
{
mutability
:
Mutability
::
Mut
,
ty
,
source_info
,
syntactic_source_info
:
source_info
,
visibility_source_info
:
source_info
,
name
,
internal
:
false
,
is_user_variable
:
false
,
...
...
src/librustc_mir/dataflow/move_paths/builder.rs
浏览文件 @
0895590c
...
...
@@ -233,7 +233,7 @@ impl<'a, 'gcx, 'tcx> MoveDataBuilder<'a, 'gcx, 'tcx> {
fn
gather_args
(
&
mut
self
)
{
for
arg
in
self
.mir
.args_iter
()
{
let
path
=
self
.data.rev_lookup.locals
[
arg
];
let
span
=
self
.mir.local_decls
[
arg
]
.source_info.span
;
let
span
=
self
.mir.local_decls
[
arg
]
.
visibility_
source_info.span
;
let
init
=
self
.data.inits
.push
(
Init
{
path
,
span
,
kind
:
InitKind
::
Deep
...
...
src/librustc_mir/shim.rs
浏览文件 @
0895590c
...
...
@@ -141,8 +141,8 @@ fn temp_decl(mutability: Mutability, ty: Ty, span: Span) -> LocalDecl {
let
source_info
=
SourceInfo
{
scope
:
OUTERMOST_SOURCE_SCOPE
,
span
};
LocalDecl
{
mutability
,
ty
,
name
:
None
,
source_info
,
syntactic_source_info
:
source_info
,
visibility_source_info
:
source_info
,
internal
:
false
,
is_user_variable
:
false
}
...
...
src/librustc_mir/transform/check_unsafety.rs
浏览文件 @
0895590c
...
...
@@ -166,7 +166,7 @@ fn visit_place(&mut self,
// Internal locals are used in the `move_val_init` desugaring.
// We want to check unsafety against the source info of the
// desugaring, rather than the source info of the RHS.
self
.source_info
=
self
.mir.local_decls
[
local
]
.source_info
;
self
.source_info
=
self
.mir.local_decls
[
local
]
.
visibility_
source_info
;
}
}
let
base_ty
=
base
.ty
(
self
.mir
,
self
.tcx
)
.to_ty
(
self
.tcx
);
...
...
src/librustc_mir/transform/generator.rs
浏览文件 @
0895590c
...
...
@@ -300,8 +300,8 @@ fn replace_result_variable<'tcx>(ret_ty: Ty<'tcx>,
mutability
:
Mutability
::
Mut
,
ty
:
ret_ty
,
name
:
None
,
source_info
,
syntactic_source_info
:
source_info
,
visibility_source_info
:
source_info
,
internal
:
false
,
is_user_variable
:
false
,
};
...
...
@@ -641,8 +641,8 @@ fn create_generator_drop_shim<'a, 'tcx>(
mutability
:
Mutability
::
Mut
,
ty
:
tcx
.mk_nil
(),
name
:
None
,
source_info
,
syntactic_source_info
:
source_info
,
visibility_source_info
:
source_info
,
internal
:
false
,
is_user_variable
:
false
,
};
...
...
@@ -657,8 +657,8 @@ fn create_generator_drop_shim<'a, 'tcx>(
mutbl
:
hir
::
Mutability
::
MutMutable
,
}),
name
:
None
,
source_info
,
syntactic_source_info
:
source_info
,
visibility_source_info
:
source_info
,
internal
:
false
,
is_user_variable
:
false
,
};
...
...
src/librustc_mir/transform/inline.rs
浏览文件 @
0895590c
...
...
@@ -398,11 +398,12 @@ fn inline_call(&self,
for
loc
in
callee_mir
.vars_and_temps_iter
()
{
let
mut
local
=
callee_mir
.local_decls
[
loc
]
.clone
();
local
.source_info.scope
=
scope_map
[
local
.source_info.scope
];
local
.source_info.span
=
callsite
.location.span
;
local
.syntactic_source_info.scope
=
scope_map
[
local
.syntactic_source_info.scope
];
local
.syntactic_source_info.span
=
callsite
.location.span
;
local
.visibility_source_info.scope
=
scope_map
[
local
.visibility_source_info.scope
];
local
.visibility_source_info.span
=
callsite
.location.span
;
let
idx
=
caller_mir
.local_decls
.push
(
local
);
local_map
.push
(
idx
);
...
...
src/librustc_mir/transform/promote_consts.rs
浏览文件 @
0895590c
...
...
@@ -210,7 +210,7 @@ fn promote_temp(&mut self, temp: Local) -> Local {
let
no_stmts
=
self
.source
[
loc
.block
]
.statements
.len
();
let
new_temp
=
self
.promoted.local_decls
.push
(
LocalDecl
::
new_temp
(
self
.source.local_decls
[
temp
]
.ty
,
self
.source.local_decls
[
temp
]
.source_info.span
));
self
.source.local_decls
[
temp
]
.
visibility_
source_info.span
));
debug!
(
"promote({:?} @ {:?}/{:?}, {:?})"
,
temp
,
loc
,
no_stmts
,
self
.keep_original
);
...
...
@@ -334,8 +334,8 @@ fn interior_base<'a, 'tcx>(place: &'a mut Place<'tcx>)
// This is because `*r` requires `r` to be a local,
// otherwise we would use the `promoted` directly.
let
mut
promoted_ref
=
LocalDecl
::
new_temp
(
ref_ty
,
span
);
promoted_ref
.source_info
=
statement
.source_info
;
promoted_ref
.syntactic_source_info
=
statement
.source_info
;
promoted_ref
.visibility_source_info
=
statement
.source_info
;
let
promoted_ref
=
local_decls
.push
(
promoted_ref
);
assert_eq!
(
self
.temps
.push
(
TempState
::
Unpromotable
),
promoted_ref
);
self
.extra_statements
.push
((
loc
,
Statement
{
...
...
src/librustc_mir/transform/qualify_consts.rs
浏览文件 @
0895590c
...
...
@@ -1046,7 +1046,7 @@ fn visit_terminator_kind(&mut self,
// conservatively, that drop elaboration will do.
let
needs_drop
=
if
let
Place
::
Local
(
local
)
=
*
place
{
if
self
.local_qualif
[
local
]
.map_or
(
true
,
|
q
|
q
.intersects
(
Qualif
::
NEEDS_DROP
))
{
Some
(
self
.mir.local_decls
[
local
]
.source_info.span
)
Some
(
self
.mir.local_decls
[
local
]
.
visibility_
source_info.span
)
}
else
{
None
}
...
...
@@ -1102,7 +1102,7 @@ fn visit_assign(&mut self,
let
mut
err
=
feature_err
(
&
self
.tcx.sess.parse_sess
,
"const_let"
,
decl
.source_info.span
,
decl
.
visibility_
source_info.span
,
GateIssue
::
Language
,
"arguments of constant functions can only be immutable by-value bindings"
);
...
...
src/librustc_mir/util/pretty.rs
浏览文件 @
0895590c
...
...
@@ -467,8 +467,8 @@ fn write_scope_tree(
// User variable types (including the user's name in a comment).
for
local
in
mir
.vars_iter
()
{
let
var
=
&
mir
.local_decls
[
local
];
let
(
name
,
source_info
)
=
if
var
.source_info.scope
==
child
{
(
var
.name
.unwrap
(),
var
.source_info
)
let
(
name
,
source_info
)
=
if
var
.
visibility_
source_info.scope
==
child
{
(
var
.name
.unwrap
(),
var
.
visibility_
source_info
)
}
else
{
// Not a variable or not declared in this scope.
continue
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录