Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
52610c39
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,发现更多精彩内容 >>
提交
52610c39
编写于
5月 10, 2013
作者:
L
Lenny222
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
more back-ticks, less colons
上级
fdf601ea
变更
17
隐藏空白更改
内联
并排
Showing
17 changed file
with
34 addition
and
34 deletion
+34
-34
src/librustc/middle/resolve.rs
src/librustc/middle/resolve.rs
+14
-14
src/test/compile-fail/alt-join.rs
src/test/compile-fail/alt-join.rs
+1
-1
src/test/compile-fail/bad-expr-path.rs
src/test/compile-fail/bad-expr-path.rs
+1
-1
src/test/compile-fail/bad-expr-path2.rs
src/test/compile-fail/bad-expr-path2.rs
+1
-1
src/test/compile-fail/does-nothing.rs
src/test/compile-fail/does-nothing.rs
+1
-1
src/test/compile-fail/issue-1476.rs
src/test/compile-fail/issue-1476.rs
+1
-1
src/test/compile-fail/issue-2281-part1.rs
src/test/compile-fail/issue-2281-part1.rs
+1
-1
src/test/compile-fail/issue-3021-b.rs
src/test/compile-fail/issue-3021-b.rs
+1
-1
src/test/compile-fail/issue-3021-d.rs
src/test/compile-fail/issue-3021-d.rs
+2
-2
src/test/compile-fail/issue-3021.rs
src/test/compile-fail/issue-3021.rs
+1
-1
src/test/compile-fail/issue-3038.rs
src/test/compile-fail/issue-3038.rs
+3
-3
src/test/compile-fail/issue-3099-a.rs
src/test/compile-fail/issue-3099-a.rs
+1
-1
src/test/compile-fail/issue-3099-b.rs
src/test/compile-fail/issue-3099-b.rs
+1
-1
src/test/compile-fail/issue-3099.rs
src/test/compile-fail/issue-3099.rs
+1
-1
src/test/compile-fail/issue-4265.rs
src/test/compile-fail/issue-4265.rs
+1
-1
src/test/compile-fail/issue-4366.rs
src/test/compile-fail/issue-4366.rs
+2
-2
src/test/compile-fail/test-cfg.rs
src/test/compile-fail/test-cfg.rs
+1
-1
未找到文件。
src/librustc/middle/resolve.rs
浏览文件 @
52610c39
...
...
@@ -1007,7 +1007,7 @@ fn add_child(@mut self,
let
ns
=
namespace_for_duplicate_checking_mode
(
duplicate_checking_mode
);
self
.session
.span_err
(
sp
,
fmt!
(
"duplicate definition of %s
%s
"
,
fmt!
(
"duplicate definition of %s
`%s`
"
,
namespace_to_str
(
ns
),
*
self
.session
.str_of
(
name
)));
for
child
.span_for_namespace
(
ns
)
.each
|
sp
|
{
...
...
@@ -1959,7 +1959,7 @@ fn resolve_imports_for_module(@mut self, module: @mut Module) {
match
self
.resolve_import_for_module
(
module
,
import_directive
)
{
Failed
=>
{
// We presumably emitted an error. Continue.
let
msg
=
fmt!
(
"failed to resolve import
: %s
"
,
let
msg
=
fmt!
(
"failed to resolve import
`%s`
"
,
*
self
.import_path_to_str
(
import_directive
.module_path
,
*
import_directive
.subclass
));
...
...
@@ -2488,7 +2488,7 @@ fn resolve_module_path_from_root(@mut self,
self
.session
.span_err
(
span
{
lo
:
span
.lo
,
hi
:
span
.lo
+
BytePos
(
str
::
len
(
*
segment_name
)),
expn_info
:
span
.expn_info
},
fmt!
(
"unresolved import. maybe
\
a missing
'extern mod %s'
?"
,
a missing
`extern mod %s`
?"
,
*
segment_name
));
return
Failed
;
}
...
...
@@ -2511,7 +2511,7 @@ fn resolve_module_path_from_root(@mut self,
// Not a module.
self
.session
.span_err
(
span
,
fmt!
(
"not a
\
module
: %s
"
,
module
`%s`
"
,
*
self
.session
.
str_of
(
name
)));
...
...
@@ -2525,7 +2525,7 @@ fn resolve_module_path_from_root(@mut self,
None
=>
{
// There are no type bindings at all.
self
.session
.span_err
(
span
,
fmt!
(
"not a module
: %s
"
,
fmt!
(
"not a module
`%s`
"
,
*
self
.session
.str_of
(
name
)));
return
Failed
;
...
...
@@ -2976,7 +2976,7 @@ fn resolve_name_in_module(@mut self,
}
// We're out of luck.
debug!
(
"(resolving name in module) failed to resolve
%s
"
,
debug!
(
"(resolving name in module) failed to resolve
`%s`
"
,
*
self
.session
.str_of
(
name
));
return
Failed
;
}
...
...
@@ -4158,7 +4158,7 @@ struct in scope",
// in the same disjunct, which is an
// error
self
.session
.span_err
(
pattern
.span
,
fmt!
(
"Identifier
%s
is bound more
\
fmt!
(
"Identifier
`%s`
is bound more
\
than once in the same pattern"
,
path_to_str
(
path
,
self
.session
.intr
())));
...
...
@@ -4199,7 +4199,7 @@ struct in scope",
Some
(
_
)
=>
{
self
.session
.span_err
(
path
.span
,
fmt!
(
"
not an enum variant or constant: %s
"
,
fmt!
(
"
`%s` is not an enum variant or constant
"
,
*
self
.session
.str_of
(
*
path
.idents
.last
())));
}
...
...
@@ -4227,7 +4227,7 @@ struct in scope",
Some
(
_
)
=>
{
self
.session
.span_err
(
path
.span
,
fmt!
(
"
not an enum variant, struct or const: %s
"
,
fmt!
(
"
`%s` is not an enum variant, struct or const
"
,
*
self
.session
.str_of
(
*
path
.idents
.last
())));
}
...
...
@@ -4723,8 +4723,8 @@ fn resolve_expr(@mut self, expr: @expr, visitor: ResolveVisitor) {
path
.idents
);
if
self
.name_exists_in_scope_struct
(
wrong_name
)
{
self
.session
.span_err
(
expr
.span
,
fmt!
(
"unresolved name
:
`%s`.
\
Did you mean
:
`self.%s`?"
,
fmt!
(
"unresolved name `%s`.
\
Did you mean `self.%s`?"
,
wrong_name
,
wrong_name
));
}
...
...
@@ -4734,13 +4734,13 @@ fn resolve_expr(@mut self, expr: @expr, visitor: ResolveVisitor) {
match
self
.find_best_match_for_name
(
wrong_name
,
5
)
{
Some
(
m
)
=>
{
self
.session
.span_err
(
expr
.span
,
fmt!
(
"unresolved name
:
`%s`.
\
Did you mean
:
`%s`?"
,
fmt!
(
"unresolved name `%s`.
\
Did you mean `%s`?"
,
wrong_name
,
m
));
}
None
=>
{
self
.session
.span_err
(
expr
.span
,
fmt!
(
"unresolved name
:
`%s`."
,
fmt!
(
"unresolved name `%s`."
,
wrong_name
));
}
}
...
...
src/test/compile-fail/alt-join.rs
浏览文件 @
52610c39
...
...
@@ -16,6 +16,6 @@
fn
main
()
{
match
true
{
false
=>
{
my_fail
();
}
true
=>
{
}
}
debug!
(
x
);
//~ ERROR unresolved name
:
`x`.
debug!
(
x
);
//~ ERROR unresolved name `x`.
let
x
:
int
;
}
src/test/compile-fail/bad-expr-path.rs
浏览文件 @
52610c39
...
...
@@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// error-pattern: unresolved name
: `m1::a`. Did you mean:
`args`?
// error-pattern: unresolved name
`m1::a`. Did you mean
`args`?
mod
m1
{}
...
...
src/test/compile-fail/bad-expr-path2.rs
浏览文件 @
52610c39
...
...
@@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// error-pattern: unresolved name
: `m1::a`. Did you mean:
`args`?
// error-pattern: unresolved name
`m1::a`. Did you mean
`args`?
mod
m1
{
pub
mod
a
{}
...
...
src/test/compile-fail/does-nothing.rs
浏览文件 @
52610c39
// error-pattern: unresolved name
:
`this_does_nothing_what_the`.
// error-pattern: unresolved name `this_does_nothing_what_the`.
fn
main
()
{
debug!
(
"doing"
);
this_does_nothing_what_the
;
debug!
(
"boing"
);
}
src/test/compile-fail/issue-1476.rs
浏览文件 @
52610c39
...
...
@@ -9,5 +9,5 @@
// except according to those terms.
fn
main
()
{
error!
(
x
);
//~ ERROR unresolved name
:
`x`.
error!
(
x
);
//~ ERROR unresolved name `x`.
}
src/test/compile-fail/issue-2281-part1.rs
浏览文件 @
52610c39
...
...
@@ -8,6 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// error-pattern: unresolved name
:
`foobar`.
// error-pattern: unresolved name `foobar`.
fn
main
(
args
:
~
[
str
])
{
debug!
(
foobar
);
}
src/test/compile-fail/issue-3021-b.rs
浏览文件 @
52610c39
...
...
@@ -19,7 +19,7 @@ struct siphash {
pub
impl
siphash
{
fn
reset
(
&
mut
self
)
{
self
.v0
=
k0
^
0x736f6d6570736575
;
//~ ERROR attempted dynamic environment-capture
//~^ ERROR unresolved name
:
`k0`.
//~^ ERROR unresolved name `k0`.
}
}
}
...
...
src/test/compile-fail/issue-3021-d.rs
浏览文件 @
52610c39
...
...
@@ -31,9 +31,9 @@ fn mk_result(st : SipState) -> u64 {
impl
siphash
for
SipState
{
fn
reset
(
&
self
)
{
self
.v0
=
k0
^
0x736f6d6570736575
;
//~ ERROR attempted dynamic environment-capture
//~^ ERROR unresolved name
:
`k0`.
//~^ ERROR unresolved name `k0`.
self
.v1
=
k1
^
0x646f72616e646f6d
;
//~ ERROR attempted dynamic environment-capture
//~^ ERROR unresolved name
:
`k1`.
//~^ ERROR unresolved name `k1`.
}
fn
result
(
&
self
)
->
u64
{
return
mk_result
(
self
);
}
}
...
...
src/test/compile-fail/issue-3021.rs
浏览文件 @
52610c39
...
...
@@ -22,7 +22,7 @@ struct SipState {
impl
SipHash
for
SipState
{
fn
reset
(
&
self
)
{
self
.v0
=
k0
^
0x736f6d6570736575
;
//~ ERROR attempted dynamic environment-capture
//~^ ERROR unresolved name
:
`k0`.
//~^ ERROR unresolved name `k0`.
}
}
fail
!
();
...
...
src/test/compile-fail/issue-3038.rs
浏览文件 @
52610c39
...
...
@@ -20,16 +20,16 @@ fn main()
let
_
z
=
match
g
(
1
,
2
)
{
g
(
x
,
x
)
=>
{
debug!
(
x
+
x
);
}
//~^ ERROR Identifier
x
is bound more than once in the same pattern
//~^ ERROR Identifier
`x`
is bound more than once in the same pattern
};
let
_
z
=
match
i
(
l
(
1
,
2
),
m
(
3
,
4
))
{
i
(
l
(
x
,
_
),
m
(
_
,
x
))
//~ ERROR Identifier
x
is bound more than once in the same pattern
i
(
l
(
x
,
_
),
m
(
_
,
x
))
//~ ERROR Identifier
`x`
is bound more than once in the same pattern
=>
{
error!
(
x
+
x
);
}
};
let
_
z
=
match
(
1
,
2
)
{
(
x
,
x
)
=>
{
x
}
//~ ERROR Identifier
x
is bound more than once in the same pattern
(
x
,
x
)
=>
{
x
}
//~ ERROR Identifier
`x`
is bound more than once in the same pattern
};
}
src/test/compile-fail/issue-3099-a.rs
浏览文件 @
52610c39
...
...
@@ -10,6 +10,6 @@
enum
a
{
b
,
c
}
enum
a
{
d
,
e
}
//~ ERROR duplicate definition of type
a
enum
a
{
d
,
e
}
//~ ERROR duplicate definition of type
`a`
fn
main
()
{}
src/test/compile-fail/issue-3099-b.rs
浏览文件 @
52610c39
...
...
@@ -10,6 +10,6 @@
pub
mod
a
{}
pub
mod
a
{}
//~ ERROR duplicate definition of type
a
pub
mod
a
{}
//~ ERROR duplicate definition of type
`a`
fn
main
()
{}
src/test/compile-fail/issue-3099.rs
浏览文件 @
52610c39
...
...
@@ -12,7 +12,7 @@ fn a(x: ~str) -> ~str {
fmt!
(
"First function with %s"
,
x
)
}
fn
a
(
x
:
~
str
,
y
:
~
str
)
->
~
str
{
//~ ERROR duplicate definition of value
a
fn
a
(
x
:
~
str
,
y
:
~
str
)
->
~
str
{
//~ ERROR duplicate definition of value
`a`
fmt!
(
"Second function with %s and %s"
,
x
,
y
)
}
...
...
src/test/compile-fail/issue-4265.rs
浏览文件 @
52610c39
...
...
@@ -17,7 +17,7 @@ fn bar() {
Foo
{
baz
:
0
}
.bar
();
}
fn
bar
()
{
//~ ERROR duplicate definition of value
bar
fn
bar
()
{
//~ ERROR duplicate definition of value
`bar`
}
}
...
...
src/test/compile-fail/issue-4366.rs
浏览文件 @
52610c39
...
...
@@ -25,7 +25,7 @@ pub mod b {
}
pub
mod
sub
{
use
a
::
b
::
*
;
fn
sub
()
->
bar
{
foo
();
1
}
//~ ERROR: unresolved name
:
`foo`
fn
sub
()
->
bar
{
foo
();
1
}
//~ ERROR: unresolved name `foo`
//~^ ERROR: use of undeclared type name `bar`
}
}
...
...
@@ -35,5 +35,5 @@ fn foo() {}
}
fn
main
()
{
foo
();
//~ ERROR: unresolved name
:
`foo`
foo
();
//~ ERROR: unresolved name `foo`
}
src/test/compile-fail/test-cfg.rs
浏览文件 @
52610c39
...
...
@@ -14,5 +14,5 @@
fn
foo
()
{}
fn
main
()
{
foo
();
//~ ERROR unresolved name
:
`foo`.
foo
();
//~ ERROR unresolved name `foo`.
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录