Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
5bbaa3c9
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,发现更多精彩内容 >>
提交
5bbaa3c9
编写于
8月 14, 2015
作者:
A
Alexis Beingessner
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fallout of reworking rc and arc APIs
上级
dfa4bca8
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
9 addition
and
8 deletion
+9
-8
src/librustc_resolve/build_reduced_graph.rs
src/librustc_resolve/build_reduced_graph.rs
+3
-3
src/librustc_resolve/lib.rs
src/librustc_resolve/lib.rs
+1
-1
src/librustc_trans/lib.rs
src/librustc_trans/lib.rs
+1
-1
src/librustc_trans/trans/debuginfo/namespace.rs
src/librustc_trans/trans/debuginfo/namespace.rs
+1
-1
src/test/run-pass/dst-coerce-rc.rs
src/test/run-pass/dst-coerce-rc.rs
+3
-2
未找到文件。
src/librustc_resolve/build_reduced_graph.rs
浏览文件 @
5bbaa3c9
...
...
@@ -258,7 +258,7 @@ fn block_needs_anonymous_module(&mut self, block: &Block) -> bool {
}
fn
get_parent_link
(
&
mut
self
,
parent
:
&
Rc
<
Module
>
,
name
:
Name
)
->
ParentLink
{
ModuleParentLink
(
parent
.downgrade
(
),
name
)
ModuleParentLink
(
Rc
::
downgrade
(
parent
),
name
)
}
/// Constructs the reduced graph for one item.
...
...
@@ -390,7 +390,7 @@ fn build_reduced_graph_for_item(&mut self, item: &Item, parent: &Rc<Module>) ->
if
let
Some
(
crate_id
)
=
self
.session.cstore
.find_extern_mod_stmt_cnum
(
item
.id
)
{
let
def_id
=
DefId
{
krate
:
crate_id
,
node
:
0
};
self
.external_exports
.insert
(
def_id
);
let
parent_link
=
ModuleParentLink
(
parent
.downgrade
(
),
name
);
let
parent_link
=
ModuleParentLink
(
Rc
::
downgrade
(
parent
),
name
);
let
external_module
=
Rc
::
new
(
Module
::
new
(
parent_link
,
Some
(
def_id
),
NormalModuleKind
,
...
...
@@ -638,7 +638,7 @@ fn build_reduced_graph_for_block(&mut self, block: &Block, parent: &Rc<Module>)
block_id
);
let
new_module
=
Rc
::
new
(
Module
::
new
(
BlockParentLink
(
parent
.downgrade
(
),
block_id
),
BlockParentLink
(
Rc
::
downgrade
(
parent
),
block_id
),
None
,
AnonymousModuleKind
,
false
,
...
...
src/librustc_resolve/lib.rs
浏览文件 @
5bbaa3c9
...
...
@@ -21,11 +21,11 @@
#![feature(associated_consts)]
#![feature(borrow_state)]
#![feature(rc_weak)]
#![feature(rustc_diagnostic_macros)]
#![feature(rustc_private)]
#![feature(slice_splits)]
#![feature(staged_api)]
#![feature(rc_weak)]
#[macro_use]
extern
crate
log
;
#[macro_use]
extern
crate
syntax
;
...
...
src/librustc_trans/lib.rs
浏览文件 @
5bbaa3c9
...
...
@@ -36,13 +36,13 @@
#![feature(path_relative_from)]
#![feature(path_relative_from)]
#![feature(quote)]
#![feature(rc_weak)]
#![feature(rustc_diagnostic_macros)]
#![feature(rustc_private)]
#![feature(staged_api)]
#![feature(unicode)]
#![feature(unicode)]
#![feature(vec_push_all)]
#![feature(rc_weak)]
#![allow(trivial_casts)]
...
...
src/librustc_trans/trans/debuginfo/namespace.rs
浏览文件 @
5bbaa3c9
...
...
@@ -109,7 +109,7 @@ pub fn namespace_for_item(cx: &CrateContext, def_id: ast::DefId) -> Rc<Namespace
let
node
=
Rc
::
new
(
NamespaceTreeNode
{
name
:
name
,
scope
:
scope
,
parent
:
parent_node
.map
(|
parent
|
parent
.downgrade
(
)),
parent
:
parent_node
.map
(|
parent
|
Rc
::
downgrade
(
&
parent
)),
});
debug_context
(
cx
)
.namespace_map
.borrow_mut
()
...
...
src/test/run-pass/dst-coerce-rc.rs
浏览文件 @
5bbaa3c9
...
...
@@ -36,7 +36,7 @@ fn main() {
let
b
:
Rc
<
Baz
>
=
a
.clone
();
assert_eq!
(
b
.get
(),
42
);
let
c
:
Weak
<
i32
>
=
a
.downgrade
(
);
let
c
:
Weak
<
i32
>
=
Rc
::
downgrade
(
&
a
);
let
d
:
Weak
<
Baz
>
=
c
.clone
();
let
_
c
=
b
.clone
();
...
...
@@ -44,5 +44,6 @@ fn main() {
let
a
:
Rc
<
RefCell
<
i32
>>
=
Rc
::
new
(
RefCell
::
new
(
42
));
let
b
:
Rc
<
RefCell
<
Baz
>>
=
a
.clone
();
assert_eq!
(
b
.borrow
()
.get
(),
42
);
let
c
:
Weak
<
RefCell
<
Baz
>>
=
a
.downgrade
();
// FIXME
let
c
:
Weak
<
RefCell
<
Baz
>>
=
Rc
::
downgrade
(
&
a
)
as
Weak
<
_
>
;
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录