Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
bf531bd4
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,发现更多精彩内容 >>
提交
bf531bd4
编写于
2月 08, 2019
作者:
T
Taiki Endo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
librustc_passes => 2018
上级
b139669f
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
23 addition
and
22 deletion
+23
-22
src/librustc_passes/Cargo.toml
src/librustc_passes/Cargo.toml
+2
-1
src/librustc_passes/ast_validation.rs
src/librustc_passes/ast_validation.rs
+2
-1
src/librustc_passes/diagnostics.rs
src/librustc_passes/diagnostics.rs
+2
-0
src/librustc_passes/hir_stats.rs
src/librustc_passes/hir_stats.rs
+1
-1
src/librustc_passes/lib.rs
src/librustc_passes/lib.rs
+3
-11
src/librustc_passes/loops.rs
src/librustc_passes/loops.rs
+3
-2
src/librustc_passes/rvalue_promotion.rs
src/librustc_passes/rvalue_promotion.rs
+10
-6
未找到文件。
src/librustc_passes/Cargo.toml
浏览文件 @
bf531bd4
...
...
@@ -2,6 +2,7 @@
authors
=
[
"The Rust Project Developers"
]
name
=
"rustc_passes"
version
=
"0.0.0"
edition
=
"2018"
[lib]
name
=
"rustc_passes"
...
...
@@ -16,4 +17,4 @@ rustc_data_structures = { path = "../librustc_data_structures" }
syntax
=
{
path
=
"../libsyntax"
}
syntax_ext
=
{
path
=
"../libsyntax_ext"
}
syntax_pos
=
{
path
=
"../libsyntax_pos"
}
rustc_errors
=
{
path
=
"../lib
rustc_errors"
}
errors
=
{
path
=
"../librustc_errors"
,
package
=
"
rustc_errors"
}
src/librustc_passes/ast_validation.rs
浏览文件 @
bf531bd4
...
...
@@ -15,10 +15,11 @@
use
syntax
::
symbol
::
keywords
;
use
syntax
::
ptr
::
P
;
use
syntax
::
visit
::{
self
,
Visitor
};
use
syntax
::{
span_err
,
struct_span_err
,
walk_list
};
use
syntax_ext
::
proc_macro_decls
::
is_proc_macro_attr
;
use
syntax_pos
::
Span
;
use
errors
;
use
errors
::
Applicability
;
use
log
::
debug
;
struct
AstValidator
<
'a
>
{
session
:
&
'a
Session
,
...
...
src/librustc_passes/diagnostics.rs
浏览文件 @
bf531bd4
#![allow(non_snake_case)]
use
syntax
::{
register_diagnostic
,
register_diagnostics
,
register_long_diagnostics
};
register_long_diagnostics!
{
/*
E0014: r##"
...
...
src/librustc_passes/hir_stats.rs
浏览文件 @
bf531bd4
...
...
@@ -61,7 +61,7 @@ fn record<T>(&mut self, label: &'static str, id: Id, node: &T) {
});
entry
.count
+=
1
;
entry
.size
=
::
std
::
mem
::
size_of_val
(
node
);
entry
.size
=
std
::
mem
::
size_of_val
(
node
);
}
fn
print
(
&
self
,
title
:
&
str
)
{
...
...
src/librustc_passes/lib.rs
浏览文件 @
bf531bd4
...
...
@@ -13,18 +13,10 @@
#![recursion_limit=
"256"
]
#[macro_use]
extern
crate
rustc
;
extern
crate
rustc_mir
;
extern
crate
rustc_data_structures
;
#![deny(rust_2018_idioms)]
#[macro_use]
extern
crate
log
;
#[macro_use]
extern
crate
syntax
;
extern
crate
syntax_ext
;
extern
crate
syntax_pos
;
extern
crate
rustc_errors
as
errors
;
extern
crate
rustc
;
use
rustc
::
ty
::
query
::
Providers
;
...
...
@@ -38,7 +30,7 @@
__
build_diagnostic_array!
{
librustc_passes
,
DIAGNOSTICS
}
pub
fn
provide
(
providers
:
&
mut
Providers
)
{
pub
fn
provide
(
providers
:
&
mut
Providers
<
'_
>
)
{
rvalue_promotion
::
provide
(
providers
);
loops
::
provide
(
providers
);
}
src/librustc_passes/loops.rs
浏览文件 @
bf531bd4
use
self
::
Context
::
*
;
use
Context
::
*
;
use
rustc
::
session
::
Session
;
...
...
@@ -9,6 +9,7 @@
use
rustc
::
hir
::
intravisit
::{
self
,
Visitor
,
NestedVisitorMap
};
use
rustc
::
hir
::{
self
,
Node
,
Destination
};
use
syntax
::
ast
;
use
syntax
::
struct_span_err
;
use
syntax_pos
::
Span
;
use
errors
::
Applicability
;
...
...
@@ -59,7 +60,7 @@ fn check_mod_loops<'tcx>(tcx: TyCtxt<'_, 'tcx, 'tcx>, module_def_id: DefId) {
}
.as_deep_visitor
());
}
pub
(
crate
)
fn
provide
(
providers
:
&
mut
Providers
)
{
pub
(
crate
)
fn
provide
(
providers
:
&
mut
Providers
<
'_
>
)
{
*
providers
=
Providers
{
check_mod_loops
,
..*
providers
...
...
src/librustc_passes/rvalue_promotion.rs
浏览文件 @
bf531bd4
...
...
@@ -28,10 +28,11 @@
use
rustc_data_structures
::
sync
::
Lrc
;
use
syntax
::
ast
;
use
syntax_pos
::{
Span
,
DUMMY_SP
};
use
self
::
Promotability
::
*
;
use
log
::
debug
;
use
Promotability
::
*
;
use
std
::
ops
::{
BitAnd
,
BitAndAssign
,
BitOr
};
pub
fn
provide
(
providers
:
&
mut
Providers
)
{
pub
fn
provide
(
providers
:
&
mut
Providers
<
'_
>
)
{
*
providers
=
Providers
{
rvalue_promotable_map
,
const_is_rvalue_promotable_to_static
,
...
...
@@ -622,7 +623,7 @@ impl<'a, 'gcx, 'tcx> euv::Delegate<'tcx> for CheckCrateVisitor<'a, 'gcx> {
fn
consume
(
&
mut
self
,
_
consume_id
:
ast
::
NodeId
,
_
consume_span
:
Span
,
_
cmt
:
&
mc
::
cmt_
,
_
cmt
:
&
mc
::
cmt_
<
'_
>
,
_
mode
:
euv
::
ConsumeMode
)
{}
fn
borrow
(
&
mut
self
,
...
...
@@ -681,11 +682,14 @@ fn decl_without_init(&mut self, _id: ast::NodeId, _span: Span) {}
fn
mutate
(
&
mut
self
,
_
assignment_id
:
ast
::
NodeId
,
_
assignment_span
:
Span
,
_
assignee_cmt
:
&
mc
::
cmt_
,
_
assignee_cmt
:
&
mc
::
cmt_
<
'_
>
,
_
mode
:
euv
::
MutateMode
)
{
}
fn
matched_pat
(
&
mut
self
,
_
:
&
hir
::
Pat
,
_
:
&
mc
::
cmt_
,
_
:
euv
::
MatchMode
)
{}
fn
matched_pat
(
&
mut
self
,
_
:
&
hir
::
Pat
,
_
:
&
mc
::
cmt_
<
'_
>
,
_
:
euv
::
MatchMode
)
{}
fn
consume_pat
(
&
mut
self
,
_
consume_pat
:
&
hir
::
Pat
,
_
cmt
:
&
mc
::
cmt_
,
_
mode
:
euv
::
ConsumeMode
)
{}
fn
consume_pat
(
&
mut
self
,
_
consume_pat
:
&
hir
::
Pat
,
_
cmt
:
&
mc
::
cmt_
<
'_
>
,
_
mode
:
euv
::
ConsumeMode
)
{}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录