Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
dc21daee
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,发现更多精彩内容 >>
提交
dc21daee
编写于
4月 30, 2013
作者:
N
Niko Matsakis
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
borrowck: fix critical bug prevent us from ever using write guards :)
上级
418f9911
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
6 addition
and
24 deletion
+6
-24
src/librustc/middle/borrowck/check_loans.rs
src/librustc/middle/borrowck/check_loans.rs
+3
-0
src/librustc/middle/borrowck/gather_loans/lifetime.rs
src/librustc/middle/borrowck/gather_loans/lifetime.rs
+1
-0
src/librustc/middle/borrowck/gather_loans/mod.rs
src/librustc/middle/borrowck/gather_loans/mod.rs
+2
-2
src/test/run-pass/too-much-recursion.rs
src/test/run-pass/too-much-recursion.rs
+0
-22
未找到文件。
src/librustc/middle/borrowck/check_loans.rs
浏览文件 @
dc21daee
...
...
@@ -357,6 +357,8 @@ fn check_for_aliasable_mutable_writes(self: &CheckLoanCtxt,
//! Safety checks related to writes to aliasable, mutable locations
let
guarantor
=
cmt
.guarantor
();
debug!
(
"check_for_aliasable_mutable_writes(cmt=%s, guarantor=%s)"
,
cmt
.repr
(
self
.tcx
()),
guarantor
.repr
(
self
.tcx
()));
match
guarantor
.cat
{
mc
::
cat_deref
(
b
,
_
,
mc
::
region_ptr
(
m_mutbl
,
_
))
=>
{
// Statically prohibit writes to `&mut` when aliasable
...
...
@@ -379,6 +381,7 @@ fn check_for_aliasable_mutable_writes(self: &CheckLoanCtxt,
id
:
base
.id
,
derefs
:
deref_count
};
debug!
(
"Inserting write guard at %?"
,
key
);
self
.bccx.write_guard_map
.insert
(
key
);
}
...
...
src/librustc/middle/borrowck/gather_loans/lifetime.rs
浏览文件 @
dc21daee
...
...
@@ -90,6 +90,7 @@ fn check(&self, cmt: mc::cmt, discr_scope: Option<ast::node_id>) {
// See rule Freeze-Imm-Managed-Ptr-2 in doc.rs
let
omit_root
=
(
ptr_mutbl
==
m_imm
&&
self
.bccx
.is_subregion_of
(
self
.loan_region
,
base_scope
)
&&
base
.mutbl
.is_immutable
()
&&
!
self
.is_moved
(
base
)
...
...
src/librustc/middle/borrowck/gather_loans/mod.rs
浏览文件 @
dc21daee
...
...
@@ -148,7 +148,7 @@ fn gather_loans_in_expr(ex: @ast::expr,
// If this expression is borrowed, have to ensure it remains valid:
{
let
mut
this
=
&
mut
*
self
;
// FIXME(#5074)
let
this
=
&
mut
*
self
;
// FIXME(#5074)
if
!
this
.ignore_adjustments
.contains
(
&
ex
.id
)
{
for
tcx
.adjustments
.find
(
&
ex
.id
)
.each
|
&
adjustments
|
{
this
.guarantee_adjustments
(
ex
,
*
adjustments
);
...
...
@@ -283,7 +283,7 @@ fn guarantee_adjustments(&mut self,
let
mcx
=
&
mc
::
mem_categorization_ctxt
{
tcx
:
self
.tcx
(),
method_map
:
self
.bccx.method_map
};
let
mut
cmt
=
mcx
.cat_expr_autoderefd
(
expr
,
autoderefs
);
let
cmt
=
mcx
.cat_expr_autoderefd
(
expr
,
autoderefs
);
debug!
(
"after autoderef, cmt=%s"
,
cmt
.repr
(
self
.tcx
()));
match
*
autoref
{
...
...
src/test/run-pass/too-much-recursion.rs
已删除
100644 → 0
浏览文件 @
418f9911
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// xfail-win32
// error-pattern:ran out of stack
// Test that the task fails after hitting the recursion limit, but
// that it doesn't bring down the whole proc
pub
fn
main
()
{
do
task
::
spawn_unlinked
{
fn
f
()
{
f
()
};
f
();
};
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录