Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
bccc59a8
R
Rust
项目概览
int
/
Rust
12 个月 前同步成功
通知
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,发现更多精彩内容 >>
提交
bccc59a8
编写于
11月 21, 2019
作者:
M
Matthew Jasper
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Address review comments
上级
025630d1
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
9 addition
and
10 deletion
+9
-10
src/librustc/mir/mod.rs
src/librustc/mir/mod.rs
+4
-7
src/librustc_mir/build/expr/as_temp.rs
src/librustc_mir/build/expr/as_temp.rs
+1
-2
src/librustc_mir/hair/mod.rs
src/librustc_mir/hair/mod.rs
+4
-1
未找到文件。
src/librustc/mir/mod.rs
浏览文件 @
bccc59a8
...
...
@@ -689,13 +689,6 @@ pub struct LocalDecl<'tcx> {
/// Temporaries and the return place are always mutable.
pub
mutability
:
Mutability
,
/// `Some(binding_mode)` if this corresponds to a user-declared local variable.
///
/// This is solely used for local diagnostics when generating
/// warnings/errors when compiling the current crate, and
/// therefore it need not be visible across crates. pnkfelix
/// currently hypothesized we *need* to wrap this in a
/// `ClearCrossCrate` as long as it carries as `HirId`.
// FIXME(matthewjasper) Don't store in this in `Body`
pub
local_info
:
LocalInfo
<
'tcx
>
,
...
...
@@ -831,6 +824,10 @@ pub struct LocalDecl<'tcx> {
#[derive(Clone,
Debug,
RustcEncodable,
RustcDecodable,
HashStable,
TypeFoldable)]
pub
enum
LocalInfo
<
'tcx
>
{
/// A user-defined local variable or function parameter
///
/// The `BindingForm` is solely used for local diagnostics when generating
/// warnings/errors when compiling the current crate, and therefore it need
/// not be visible across crates.
User
(
ClearCrossCrate
<
BindingForm
<
'tcx
>>
),
/// A temporary created that references the static with the given `DefId`.
StaticRef
{
def_id
:
DefId
,
is_thread_local
:
bool
},
...
...
src/librustc_mir/build/expr/as_temp.rs
浏览文件 @
bccc59a8
...
...
@@ -65,8 +65,7 @@ fn expr_as_temp(
local_decl
=
local_decl
.block_tail
(
tail_info
);
}
if
let
ExprKind
::
StaticRef
{
def_id
,
..
}
=
expr
.kind
{
let
attrs
=
this
.hir
.tcx
()
.get_attrs
(
def_id
);
let
is_thread_local
=
attrs
.iter
()
.any
(|
attr
|
attr
.check_name
(
sym
::
thread_local
));
let
is_thread_local
=
this
.hir
.tcx
()
.has_attr
(
def_id
,
sym
::
thread_local
);
local_decl
.local_info
=
LocalInfo
::
StaticRef
{
def_id
,
is_thread_local
};
}
this
.local_decls
.push
(
local_decl
)
...
...
src/librustc_mir/hair/mod.rs
浏览文件 @
bccc59a8
...
...
@@ -264,7 +264,10 @@ pub enum ExprKind<'tcx> {
literal
:
&
'tcx
Const
<
'tcx
>
,
user_ty
:
Option
<
Canonical
<
'tcx
,
UserType
<
'tcx
>>>
,
},
/// A literal containing the address of a `static`
/// A literal containing the address of a `static`.
///
/// This is only distinguished from `Literal` so that we can register some
/// info for diagnostics.
StaticRef
{
literal
:
&
'tcx
Const
<
'tcx
>
,
def_id
:
DefId
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录