Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
20926821
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,发现更多精彩内容 >>
提交
20926821
编写于
1月 12, 2017
作者:
V
Vadim Petrochenkov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
resolve: Do not use "resolve"/"resolution" in error messages
上级
513d942a
变更
93
隐藏空白更改
内联
并排
Showing
93 changed file
with
304 addition
and
294 deletion
+304
-294
src/librustc_resolve/lib.rs
src/librustc_resolve/lib.rs
+22
-11
src/librustc_resolve/macros.rs
src/librustc_resolve/macros.rs
+2
-2
src/test/compile-fail-fulldeps/macro-crate-doesnt-resolve.rs
src/test/compile-fail-fulldeps/macro-crate-doesnt-resolve.rs
+1
-1
src/test/compile-fail-fulldeps/qquote.rs
src/test/compile-fail-fulldeps/qquote.rs
+1
-1
src/test/compile-fail/associated-path-shl.rs
src/test/compile-fail/associated-path-shl.rs
+5
-5
src/test/compile-fail/associated-types-eq-1.rs
src/test/compile-fail/associated-types-eq-1.rs
+1
-1
src/test/compile-fail/bad-expr-path.rs
src/test/compile-fail/bad-expr-path.rs
+3
-3
src/test/compile-fail/bad-expr-path2.rs
src/test/compile-fail/bad-expr-path2.rs
+2
-2
src/test/compile-fail/class-missing-self.rs
src/test/compile-fail/class-missing-self.rs
+2
-2
src/test/compile-fail/coherence-error-suppression.rs
src/test/compile-fail/coherence-error-suppression.rs
+1
-1
src/test/compile-fail/derived-errors/issue-31997.rs
src/test/compile-fail/derived-errors/issue-31997.rs
+1
-1
src/test/compile-fail/does-nothing.rs
src/test/compile-fail/does-nothing.rs
+1
-1
src/test/compile-fail/enums-pats-not-idents.rs
src/test/compile-fail/enums-pats-not-idents.rs
+1
-1
src/test/compile-fail/export.rs
src/test/compile-fail/export.rs
+4
-4
src/test/compile-fail/extern-with-type-bounds.rs
src/test/compile-fail/extern-with-type-bounds.rs
+1
-1
src/test/compile-fail/for-expn.rs
src/test/compile-fail/for-expn.rs
+1
-1
src/test/compile-fail/for-loop-hygiene.rs
src/test/compile-fail/for-loop-hygiene.rs
+1
-1
src/test/compile-fail/glob-resolve1.rs
src/test/compile-fail/glob-resolve1.rs
+7
-7
src/test/compile-fail/import-glob-0.rs
src/test/compile-fail/import-glob-0.rs
+1
-1
src/test/compile-fail/import-glob-circular.rs
src/test/compile-fail/import-glob-circular.rs
+1
-3
src/test/compile-fail/imports/duplicate.rs
src/test/compile-fail/imports/duplicate.rs
+4
-4
src/test/compile-fail/imports/macro-paths.rs
src/test/compile-fail/imports/macro-paths.rs
+4
-4
src/test/compile-fail/imports/macros.rs
src/test/compile-fail/imports/macros.rs
+6
-6
src/test/compile-fail/imports/rfc-1560-warning-cycle.rs
src/test/compile-fail/imports/rfc-1560-warning-cycle.rs
+2
-2
src/test/compile-fail/issue-1476.rs
src/test/compile-fail/issue-1476.rs
+1
-1
src/test/compile-fail/issue-15167.rs
src/test/compile-fail/issue-15167.rs
+4
-4
src/test/compile-fail/issue-18058.rs
src/test/compile-fail/issue-18058.rs
+1
-1
src/test/compile-fail/issue-19883.rs
src/test/compile-fail/issue-19883.rs
+1
-1
src/test/compile-fail/issue-22037.rs
src/test/compile-fail/issue-22037.rs
+1
-1
src/test/compile-fail/issue-22384.rs
src/test/compile-fail/issue-22384.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-28388-1.rs
src/test/compile-fail/issue-28388-1.rs
+1
-1
src/test/compile-fail/issue-30589.rs
src/test/compile-fail/issue-30589.rs
+1
-1
src/test/compile-fail/issue-31212.rs
src/test/compile-fail/issue-31212.rs
+1
-1
src/test/compile-fail/issue-31845.rs
src/test/compile-fail/issue-31845.rs
+1
-1
src/test/compile-fail/issue-34334.rs
src/test/compile-fail/issue-34334.rs
+1
-1
src/test/compile-fail/issue-35075.rs
src/test/compile-fail/issue-35075.rs
+2
-2
src/test/compile-fail/issue-37534.rs
src/test/compile-fail/issue-37534.rs
+1
-1
src/test/compile-fail/issue-4366-2.rs
src/test/compile-fail/issue-4366-2.rs
+1
-1
src/test/compile-fail/issue-4366.rs
src/test/compile-fail/issue-4366.rs
+1
-1
src/test/compile-fail/issue-5099.rs
src/test/compile-fail/issue-5099.rs
+1
-1
src/test/compile-fail/issue-5927.rs
src/test/compile-fail/issue-5927.rs
+2
-2
src/test/compile-fail/issue-7607-1.rs
src/test/compile-fail/issue-7607-1.rs
+1
-1
src/test/compile-fail/issue-8767.rs
src/test/compile-fail/issue-8767.rs
+1
-1
src/test/compile-fail/keyword-self-as-identifier.rs
src/test/compile-fail/keyword-self-as-identifier.rs
+1
-1
src/test/compile-fail/macro-outer-attributes.rs
src/test/compile-fail/macro-outer-attributes.rs
+1
-1
src/test/compile-fail/macro-parameter-span.rs
src/test/compile-fail/macro-parameter-span.rs
+1
-1
src/test/compile-fail/match-join.rs
src/test/compile-fail/match-join.rs
+1
-1
src/test/compile-fail/match-vec-mismatch.rs
src/test/compile-fail/match-vec-mismatch.rs
+1
-1
src/test/compile-fail/mod_file_correct_spans.rs
src/test/compile-fail/mod_file_correct_spans.rs
+2
-1
src/test/compile-fail/name-clash-nullary.rs
src/test/compile-fail/name-clash-nullary.rs
+2
-2
src/test/compile-fail/namespaced-enum-glob-import-no-impls-xcrate.rs
...mpile-fail/namespaced-enum-glob-import-no-impls-xcrate.rs
+4
-4
src/test/compile-fail/namespaced-enum-glob-import-no-impls.rs
...test/compile-fail/namespaced-enum-glob-import-no-impls.rs
+4
-4
src/test/compile-fail/nested-cfg-attrs.rs
src/test/compile-fail/nested-cfg-attrs.rs
+1
-1
src/test/compile-fail/no-implicit-prelude-nested.rs
src/test/compile-fail/no-implicit-prelude-nested.rs
+18
-18
src/test/compile-fail/no-implicit-prelude.rs
src/test/compile-fail/no-implicit-prelude.rs
+6
-6
src/test/compile-fail/no-link.rs
src/test/compile-fail/no-link.rs
+1
-1
src/test/compile-fail/parser-recovery-1.rs
src/test/compile-fail/parser-recovery-1.rs
+2
-2
src/test/compile-fail/parser-recovery-2.rs
src/test/compile-fail/parser-recovery-2.rs
+2
-2
src/test/compile-fail/pattern-macro-hygiene.rs
src/test/compile-fail/pattern-macro-hygiene.rs
+1
-1
src/test/compile-fail/privacy-ns1.rs
src/test/compile-fail/privacy-ns1.rs
+2
-2
src/test/compile-fail/privacy/restricted/ty-params.rs
src/test/compile-fail/privacy/restricted/ty-params.rs
+1
-1
src/test/compile-fail/recursive-reexports.rs
src/test/compile-fail/recursive-reexports.rs
+1
-1
src/test/compile-fail/resolve-bad-import-prefix.rs
src/test/compile-fail/resolve-bad-import-prefix.rs
+1
-1
src/test/compile-fail/resolve-bad-visibility.rs
src/test/compile-fail/resolve-bad-visibility.rs
+2
-2
src/test/compile-fail/resolve-primitive-fallback.rs
src/test/compile-fail/resolve-primitive-fallback.rs
+1
-1
src/test/compile-fail/resolve-unknown-trait.rs
src/test/compile-fail/resolve-unknown-trait.rs
+3
-3
src/test/compile-fail/rmeta.rs
src/test/compile-fail/rmeta.rs
+1
-1
src/test/compile-fail/self_type_keyword-2.rs
src/test/compile-fail/self_type_keyword-2.rs
+3
-3
src/test/compile-fail/struct-fields-shorthand-unresolved.rs
src/test/compile-fail/struct-fields-shorthand-unresolved.rs
+1
-1
src/test/compile-fail/syntax-extension-minor.rs
src/test/compile-fail/syntax-extension-minor.rs
+1
-1
src/test/compile-fail/test-cfg.rs
src/test/compile-fail/test-cfg.rs
+1
-1
src/test/compile-fail/ufcs-partially-resolved.rs
src/test/compile-fail/ufcs-partially-resolved.rs
+20
-20
src/test/ui/codemap_tests/tab.stderr
src/test/ui/codemap_tests/tab.stderr
+2
-2
src/test/ui/macros/macro-backtrace-nested.stderr
src/test/ui/macros/macro-backtrace-nested.stderr
+4
-4
src/test/ui/resolve/enums-are-namespaced-xc.stderr
src/test/ui/resolve/enums-are-namespaced-xc.stderr
+6
-6
src/test/ui/resolve/issue-14254.stderr
src/test/ui/resolve/issue-14254.stderr
+29
-29
src/test/ui/resolve/issue-17518.stderr
src/test/ui/resolve/issue-17518.stderr
+2
-2
src/test/ui/resolve/issue-21221-1.stderr
src/test/ui/resolve/issue-21221-1.stderr
+8
-8
src/test/ui/resolve/issue-21221-2.stderr
src/test/ui/resolve/issue-21221-2.stderr
+2
-2
src/test/ui/resolve/issue-21221-3.stderr
src/test/ui/resolve/issue-21221-3.stderr
+2
-2
src/test/ui/resolve/issue-21221-4.stderr
src/test/ui/resolve/issue-21221-4.stderr
+2
-2
src/test/ui/resolve/issue-23305.stderr
src/test/ui/resolve/issue-23305.stderr
+1
-1
src/test/ui/resolve/issue-2356.stderr
src/test/ui/resolve/issue-2356.stderr
+24
-24
src/test/ui/resolve/issue-24968.stderr
src/test/ui/resolve/issue-24968.stderr
+1
-1
src/test/ui/resolve/resolve-assoc-suggestions.stderr
src/test/ui/resolve/resolve-assoc-suggestions.stderr
+15
-15
src/test/ui/resolve/resolve-speculative-adjustment.stderr
src/test/ui/resolve/resolve-speculative-adjustment.stderr
+6
-6
src/test/ui/resolve/token-error-correct-2.stderr
src/test/ui/resolve/token-error-correct-2.stderr
+2
-2
src/test/ui/resolve/token-error-correct-3.stderr
src/test/ui/resolve/token-error-correct-3.stderr
+2
-2
src/test/ui/resolve/token-error-correct.stderr
src/test/ui/resolve/token-error-correct.stderr
+4
-4
src/test/ui/resolve/unboxed-closure-sugar-nonexistent-trait.stderr
...ui/resolve/unboxed-closure-sugar-nonexistent-trait.stderr
+2
-2
src/test/ui/resolve/unresolved_static_type_field.stderr
src/test/ui/resolve/unresolved_static_type_field.stderr
+1
-1
src/test/ui/span/typo-suggestion.stderr
src/test/ui/span/typo-suggestion.stderr
+3
-3
未找到文件。
src/librustc_resolve/lib.rs
浏览文件 @
20926821
...
...
@@ -2084,10 +2084,25 @@ fn smart_resolve_path_fragment(&mut self,
let
expected
=
source
.descr_expected
();
let
path_str
=
names_to_string
(
path
);
let
code
=
source
.error_code
(
def
.is_some
());
let
base_msg
=
if
let
Some
(
def
)
=
def
{
format!
(
"expected {}, found {} `{}`"
,
expected
,
def
.kind_name
(),
path_str
)
let
(
base_msg
,
fallback_label
)
=
if
let
Some
(
def
)
=
def
{
(
format!
(
"expected {}, found {} `{}`"
,
expected
,
def
.kind_name
(),
path_str
),
format!
(
"not a {}"
,
expected
))
}
else
{
format!
(
"unresolved {} `{}`"
,
expected
,
path_str
)
let
item_str
=
path
[
path
.len
()
-
1
];
let
(
mod_prefix
,
mod_str
)
=
if
path
.len
()
==
1
{
(
format!
(
""
),
format!
(
"this scope"
))
}
else
if
path
.len
()
==
2
&&
path
[
0
]
.name
==
keywords
::
CrateRoot
.name
()
{
(
format!
(
""
),
format!
(
"the crate root"
))
}
else
{
let
mod_path
=
&
path
[
..
path
.len
()
-
1
];
let
mod_prefix
=
match
this
.resolve_path
(
mod_path
,
Some
(
TypeNS
),
None
)
{
PathResult
::
Module
(
module
)
=>
module
.def
(),
_
=>
None
,
}
.map_or
(
format!
(
""
),
|
def
|
format!
(
"{} "
,
def
.kind_name
()));
(
mod_prefix
,
format!
(
"`{}`"
,
names_to_string
(
mod_path
)))
};
(
format!
(
"cannot find {} `{}` in {}{}"
,
expected
,
item_str
,
mod_prefix
,
mod_str
),
format!
(
"not found in {}"
,
mod_str
))
};
let
mut
err
=
this
.session
.struct_span_err_with_code
(
span
,
&
base_msg
,
code
);
...
...
@@ -2177,12 +2192,8 @@ fn smart_resolve_path_fragment(&mut self,
}
}
// Fallback labels.
if
def
.is_some
()
{
err
.span_label
(
span
,
&
format!
(
"not a {}"
,
expected
));
}
else
{
err
.span_label
(
span
,
&
format!
(
"no resolution found"
));
}
// Fallback label.
err
.span_label
(
span
,
&
fallback_label
);
err
};
let
report_errors
=
|
this
:
&
mut
Self
,
def
:
Option
<
Def
>
|
{
...
...
@@ -2983,8 +2994,8 @@ fn report_errors(&mut self) {
let
participle
=
|
binding
:
&
NameBinding
|
{
if
binding
.is_import
()
{
"imported"
}
else
{
"defined"
}
};
let
msg1
=
format!
(
"`{}` could re
solve
to the name {} here"
,
name
,
participle
(
b1
));
let
msg2
=
format!
(
"`{}` could also re
solve
to the name {} here"
,
name
,
participle
(
b2
));
let
msg1
=
format!
(
"`{}` could re
fer
to the name {} here"
,
name
,
participle
(
b1
));
let
msg2
=
format!
(
"`{}` could also re
fer
to the name {} here"
,
name
,
participle
(
b2
));
let
note
=
if
!
lexical
&&
b1
.is_glob_import
()
{
format!
(
"consider adding an explicit import of `{}` to disambiguate"
,
name
)
}
else
if
let
Def
::
Macro
(
..
)
=
b1
.def
()
{
...
...
src/librustc_resolve/macros.rs
浏览文件 @
20926821
...
...
@@ -380,8 +380,8 @@ pub fn finalize_current_module_macro_resolutions(&mut self) {
MacroBinding
::
Modern
(
binding
)
=>
(
binding
.span
,
"imported"
),
MacroBinding
::
Legacy
(
binding
)
=>
(
binding
.span
,
"defined"
),
};
let
msg1
=
format!
(
"`{}` could re
solve
to the macro {} here"
,
ident
,
participle
);
let
msg2
=
format!
(
"`{}` could also re
solve
to the macro imported here"
,
ident
);
let
msg1
=
format!
(
"`{}` could re
fer
to the macro {} here"
,
ident
,
participle
);
let
msg2
=
format!
(
"`{}` could also re
fer
to the macro imported here"
,
ident
);
self
.session
.struct_span_err
(
span
,
&
format!
(
"`{}` is ambiguous"
,
ident
))
.span_note
(
legacy_span
,
&
msg1
)
.span_note
(
resolution
.span
,
&
msg2
)
...
...
src/test/compile-fail-fulldeps/macro-crate-doesnt-resolve.rs
浏览文件 @
20926821
...
...
@@ -14,5 +14,5 @@
extern
crate
macro_crate_test
;
fn
main
()
{
macro_crate_test
::
foo
();
//~ ERROR
unresolved function `macro_crate_test::foo
`
macro_crate_test
::
foo
();
//~ ERROR
cannot find function `foo` in module `macro_crate_test
`
}
src/test/compile-fail-fulldeps/qquote.rs
浏览文件 @
20926821
...
...
@@ -39,6 +39,6 @@ fn main() {
assert_eq!
(
pprust
::
expr_to_string
(
&*
quote_expr!
(
&
cx
,
23
)),
"23"
);
let
expr
=
quote_expr!
(
&
cx
,
2
-
$
abcd
+
7
);
//~ ERROR
unresolved value `abcd`
let
expr
=
quote_expr!
(
&
cx
,
2
-
$
abcd
+
7
);
//~ ERROR
cannot find value `abcd` in this scope
assert_eq!
(
pprust
::
expr_to_string
(
&*
expr
),
"2 - $abcd + 7"
);
}
src/test/compile-fail/associated-path-shl.rs
浏览文件 @
20926821
...
...
@@ -11,10 +11,10 @@
// Check that associated paths starting with `<<` are successfully parsed.
fn
main
()
{
let
_
:
<<
A
>
::
B
>
::
C
;
//~ ERROR
unresolved type `A`
let
_
=
<<
A
>
::
B
>
::
C
;
//~ ERROR
unresolved type `A`
let
<<
A
>
::
B
>
::
C
;
//~ ERROR
unresolved type `A`
let
0
...
<<
A
>
::
B
>
::
C
;
//~ ERROR
unresolved type `A`
let
_
:
<<
A
>
::
B
>
::
C
;
//~ ERROR
cannot find type `A` in this scope
let
_
=
<<
A
>
::
B
>
::
C
;
//~ ERROR
cannot find type `A` in this scope
let
<<
A
>
::
B
>
::
C
;
//~ ERROR
cannot find type `A` in this scope
let
0
...
<<
A
>
::
B
>
::
C
;
//~ ERROR
cannot find type `A` in this scope
//~^ ERROR only char and numeric types are allowed in range patterns
<<
A
>
::
B
>
::
C
;
//~ ERROR
unresolved type `A`
<<
A
>
::
B
>
::
C
;
//~ ERROR
cannot find type `A` in this scope
}
src/test/compile-fail/associated-types-eq-1.rs
浏览文件 @
20926821
...
...
@@ -17,7 +17,7 @@ pub trait Foo {
}
fn
foo2
<
I
:
Foo
>
(
x
:
I
)
{
let
_
:
A
=
x
.boo
();
//~ ERROR
unresolved type `A`
let
_
:
A
=
x
.boo
();
//~ ERROR
cannot find type `A` in this scope
}
pub
fn
main
()
{}
src/test/compile-fail/bad-expr-path.rs
浏览文件 @
20926821
...
...
@@ -12,7 +12,7 @@ mod m1 {}
fn
main
(
arguments
:
Vec
<
String
>
)
{
//~ ERROR main function has wrong type
log
(
debug
,
m1
::
arguments
);
//~^ ERROR
unresolved function `log`
//~| ERROR
unresolved value `debug`
//~| ERROR
unresolved value `m1::arguments
`
//~^ ERROR
cannot find function `log` in this scope
//~| ERROR
cannot find value `debug` in this scope
//~| ERROR
cannot find value `arguments` in module `m1
`
}
src/test/compile-fail/bad-expr-path2.rs
浏览文件 @
20926821
...
...
@@ -14,7 +14,7 @@ pub mod arguments {}
fn
main
(
arguments
:
Vec
<
String
>
)
{
//~ ERROR main function has wrong type
log
(
debug
,
m1
::
arguments
);
//~^ ERROR
unresolved function `log`
//~| ERROR
unresolved value `debug`
//~^ ERROR
cannot find function `log` in this scope
//~| ERROR
cannot find value `debug` in this scope
//~| ERROR expected value, found module `m1::arguments`
}
src/test/compile-fail/class-missing-self.rs
浏览文件 @
20926821
...
...
@@ -16,8 +16,8 @@ impl cat {
fn
sleep
(
&
self
)
{
loop
{}
}
fn
meow
(
&
self
)
{
println!
(
"Meow"
);
meows
+=
1
;
//~ ERROR
unresolved value `meows`
sleep
();
//~ ERROR
unresolved function `sleep`
meows
+=
1
;
//~ ERROR
cannot find value `meows` in this scope
sleep
();
//~ ERROR
cannot find function `sleep` in this scope
}
}
...
...
src/test/compile-fail/coherence-error-suppression.rs
浏览文件 @
20926821
...
...
@@ -16,7 +16,7 @@ impl Foo for i8 {}
impl
Foo
for
i16
{}
impl
Foo
for
i32
{}
impl
Foo
for
i64
{}
impl
Foo
for
DoesNotExist
{}
//~ ERROR
unresolved type `DoesNotExist`
impl
Foo
for
DoesNotExist
{}
//~ ERROR
cannot find type `DoesNotExist` in this scope
impl
Foo
for
u8
{}
impl
Foo
for
u16
{}
impl
Foo
for
u32
{}
...
...
src/test/compile-fail/derived-errors/issue-31997.rs
浏览文件 @
20926821
...
...
@@ -20,7 +20,7 @@ fn closure<F, T>(x: F) -> Result<T, ()>
}
fn
foo
()
->
Result
<
(),
()
>
{
try!
(
closure
(||
bar
(
0
as
*
mut
_
)));
//~ ERROR
unresolved function `bar`
try!
(
closure
(||
bar
(
0
as
*
mut
_
)));
//~ ERROR
cannot find function `bar` in this scope
Ok
(())
}
...
...
src/test/compile-fail/does-nothing.rs
浏览文件 @
20926821
...
...
@@ -9,4 +9,4 @@
// except according to those terms.
fn
main
()
{
println!
(
"doing"
);
this_does_nothing_what_the
;
println!
(
"boing"
);
}
//~^ ERROR
unresolved value `this_does_nothing_what_the`
//~^ ERROR
cannot find value `this_does_nothing_what_the` in this scope
src/test/compile-fail/enums-pats-not-idents.rs
浏览文件 @
20926821
...
...
@@ -9,5 +9,5 @@
// except according to those terms.
fn
main
()
{
let
a
(
1
)
=
13
;
//~ ERROR
unresolved tuple struct/variant `a`
let
a
(
1
)
=
13
;
//~ ERROR
cannot find tuple struct/variant `a` in this scope
}
src/test/compile-fail/export.rs
浏览文件 @
20926821
...
...
@@ -10,11 +10,11 @@
mod
foo
{
pub
fn
x
(
y
:
isize
)
{
log
(
debug
,
y
);
}
//~^ ERROR
unresolved function `log`
//~| ERROR
unresolved value `debug`
//~^ ERROR
cannot find function `log` in this scope
//~| ERROR
cannot find value `debug` in this scope
fn
z
(
y
:
isize
)
{
log
(
debug
,
y
);
}
//~^ ERROR
unresolved function `log`
//~| ERROR
unresolved value `debug`
//~^ ERROR
cannot find function `log` in this scope
//~| ERROR
cannot find value `debug` in this scope
}
fn
main
()
{
foo
::
z
(
10
);
}
//~ ERROR function `z` is private
src/test/compile-fail/extern-with-type-bounds.rs
浏览文件 @
20926821
...
...
@@ -24,7 +24,7 @@
// Unresolved bounds should still error.
fn
align_of
<
T
:
NoSuchTrait
>
()
->
usize
;
//~^ ERROR
unresolved trait `NoSuchTrait`
//~^ ERROR
cannot find trait `NoSuchTrait` in this scope
}
fn
main
()
{}
src/test/compile-fail/for-expn.rs
浏览文件 @
20926821
...
...
@@ -13,7 +13,7 @@
fn
main
()
{
// Odd formatting to make sure we get the right span.
for
t
in
&
foo
//~ ERROR
unresolved value `foo`
foo
//~ ERROR
cannot find value `foo` in this scope
{
}
}
src/test/compile-fail/for-loop-hygiene.rs
浏览文件 @
20926821
...
...
@@ -13,6 +13,6 @@
fn
main
()
{
for
_
in
0
..
10
{
iter
.next
();
//~ ERROR
unresolved value `iter`
iter
.next
();
//~ ERROR
cannot find value `iter` in this scope
}
}
src/test/compile-fail/glob-resolve1.rs
浏览文件 @
20926821
...
...
@@ -29,13 +29,13 @@ pub enum B { B1 }
fn
foo
<
T
>
()
{}
fn
main
()
{
fpriv
();
//~ ERROR
unresolved function `fpriv`
epriv
();
//~ ERROR
unresolved function `epriv`
fpriv
();
//~ ERROR
cannot find function `fpriv` in this scope
epriv
();
//~ ERROR
cannot find function `epriv` in this scope
B
;
//~ ERROR expected value, found enum `B`
C
;
//~ ERROR
unresolved value `C`
import
();
//~ ERROR:
unresolved function `import`
C
;
//~ ERROR
cannot find value `C` in this scope
import
();
//~ ERROR:
cannot find function `import` in this scope
foo
::
<
A
>
();
//~ ERROR:
unresolved type `A`
foo
::
<
C
>
();
//~ ERROR:
unresolved type `C`
foo
::
<
D
>
();
//~ ERROR:
unresolved type `D`
foo
::
<
A
>
();
//~ ERROR:
cannot find type `A` in this scope
foo
::
<
C
>
();
//~ ERROR:
cannot find type `C` in this scope
foo
::
<
D
>
();
//~ ERROR:
cannot find type `D` in this scope
}
src/test/compile-fail/import-glob-0.rs
浏览文件 @
20926821
...
...
@@ -21,6 +21,6 @@ mod module_of_many_things {
fn
main
()
{
f1
();
f2
();
f999
();
//~ ERROR
unresolved function `f999`
f999
();
//~ ERROR
cannot find function `f999` in this scope
f4
();
}
src/test/compile-fail/import-glob-circular.rs
浏览文件 @
20926821
...
...
@@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// error-pattern: unresolved
mod
circ1
{
pub
use
circ2
::
f2
;
pub
fn
f1
()
{
println!
(
"f1"
);
}
...
...
@@ -25,5 +23,5 @@ mod circ2 {
mod
test
{
use
circ1
::
*
;
fn
test
()
{
f1066
();
}
fn
test
()
{
f1066
();
}
//~ ERROR cannot find function `f1066` in this scope
}
src/test/compile-fail/imports/duplicate.rs
浏览文件 @
20926821
...
...
@@ -32,13 +32,13 @@ mod e {
}
mod
f
{
pub
use
a
::
*
;
//~ NOTE `foo` could re
solve
to the name imported here
pub
use
b
::
*
;
//~ NOTE `foo` could also re
solve
to the name imported here
pub
use
a
::
*
;
//~ NOTE `foo` could re
fer
to the name imported here
pub
use
b
::
*
;
//~ NOTE `foo` could also re
fer
to the name imported here
}
mod
g
{
pub
use
a
::
*
;
//~ NOTE `foo` could re
solve
to the name imported here
pub
use
f
::
*
;
//~ NOTE `foo` could also re
solve
to the name imported here
pub
use
a
::
*
;
//~ NOTE `foo` could re
fer
to the name imported here
pub
use
f
::
*
;
//~ NOTE `foo` could also re
fer
to the name imported here
}
fn
main
()
{
...
...
src/test/compile-fail/imports/macro-paths.rs
浏览文件 @
20926821
...
...
@@ -21,22 +21,22 @@ pub mod bar {
}
fn
f
()
{
use
foo
::
*
;
//~ NOTE could also re
solve
to the name imported here
use
foo
::
*
;
//~ NOTE could also re
fer
to the name imported here
bar
::
m!
{
//~ ERROR ambiguous
//~| NOTE macro-expanded items do not shadow when used in a macro invocation path
mod
bar
{
pub
use
two_macros
::
m
;
}
//~ NOTE could re
solve
to the name defined here
mod
bar
{
pub
use
two_macros
::
m
;
}
//~ NOTE could re
fer
to the name defined here
//~^^^ NOTE in this expansion
}
}
pub
mod
baz
{
//~ NOTE could also re
solve
to the name defined here
pub
mod
baz
{
//~ NOTE could also re
fer
to the name defined here
pub
use
two_macros
::
m
;
}
fn
g
()
{
baz
::
m!
{
//~ ERROR ambiguous
//~| NOTE macro-expanded items do not shadow when used in a macro invocation path
mod
baz
{
pub
use
two_macros
::
m
;
}
//~ NOTE could re
solve
to the name defined here
mod
baz
{
pub
use
two_macros
::
m
;
}
//~ NOTE could re
fer
to the name defined here
//~^^^ NOTE in this expansion
}
}
src/test/compile-fail/imports/macros.rs
浏览文件 @
20926821
...
...
@@ -24,16 +24,16 @@ mod m1 {
}
mod
m2
{
use
two_macros
::
*
;
//~ NOTE could also re
solve
use
two_macros
::
*
;
//~ NOTE could also re
fer
m!
{
//~ ERROR ambiguous
//~| NOTE macro-expanded macro imports do not shadow
use
foo
::
m
;
//~ NOTE could re
solve
to the name imported here
use
foo
::
m
;
//~ NOTE could re
fer
to the name imported here
//~^^^ NOTE in this expansion
}
}
mod
m3
{
use
two_macros
::
m
;
//~ NOTE could also re
solve
use
two_macros
::
m
;
//~ NOTE could also re
fer
fn
f
()
{
use
two_macros
::
n
as
m
;
// This shadows the above import
m!
();
...
...
@@ -42,14 +42,14 @@ fn f() {
fn
g
()
{
m!
{
//~ ERROR ambiguous
//~| NOTE macro-expanded macro imports do not shadow
use
two_macros
::
n
as
m
;
//~ NOTE could re
solve
to the name imported here
use
two_macros
::
n
as
m
;
//~ NOTE could re
fer
to the name imported here
//~^^^ NOTE in this expansion
}
}
}
mod
m4
{
macro_rules!
m
{
()
=>
{}
}
//~ NOTE could re
solve
to the macro defined here
use
two_macros
::
m
;
//~ NOTE could also re
solve
to the macro imported here
macro_rules!
m
{
()
=>
{}
}
//~ NOTE could re
fer
to the macro defined here
use
two_macros
::
m
;
//~ NOTE could also re
fer
to the macro imported here
m!
();
//~ ERROR ambiguous
}
src/test/compile-fail/imports/rfc-1560-warning-cycle.rs
浏览文件 @
20926821
...
...
@@ -17,8 +17,8 @@ mod bar {
struct
Foo
;
mod
baz
{
use
*
;
//~ NOTE `Foo` could re
solve
to the name imported here
use
bar
::
*
;
//~ NOTE `Foo` could also re
solve
to the name imported here
use
*
;
//~ NOTE `Foo` could re
fer
to the name imported here
use
bar
::
*
;
//~ NOTE `Foo` could also re
fer
to the name imported here
fn
f
(
_
:
Foo
)
{}
//~^ WARN `Foo` is ambiguous
//~| WARN hard error in a future release
...
...
src/test/compile-fail/issue-1476.rs
浏览文件 @
20926821
...
...
@@ -9,5 +9,5 @@
// except according to those terms.
fn
main
()
{
println!
(
"{}"
,
x
);
//~ ERROR
unresolved value `x`
println!
(
"{}"
,
x
);
//~ ERROR
cannot find value `x` in this scope
}
src/test/compile-fail/issue-15167.rs
浏览文件 @
20926821
...
...
@@ -11,10 +11,10 @@
// macro f should not be able to inject a reference to 'n'.
macro_rules!
f
{
()
=>
(
n
)
}
//~^ ERROR
unresolved value `n`
//~| ERROR
unresolved value `n`
//~| ERROR
unresolved value `n`
//~| ERROR
unresolved value `n`
//~^ ERROR
cannot find value `n` in this scope
//~| ERROR
cannot find value `n` in this scope
//~| ERROR
cannot find value `n` in this scope
//~| ERROR
cannot find value `n` in this scope
fn
main
()
->
(){
for
n
in
0
..
1
{
...
...
src/test/compile-fail/issue-18058.rs
浏览文件 @
20926821
...
...
@@ -9,6 +9,6 @@
// except according to those terms.
impl
Undefined
{}
//~^ ERROR
unresolved type `Undefined`
//~^ ERROR
cannot find type `Undefined` in this scope
fn
main
()
{}
src/test/compile-fail/issue-19883.rs
浏览文件 @
20926821
...
...
@@ -17,7 +17,7 @@ trait From<Src> {
trait
To
:
Sized
{
fn
to
<
Dst
:
From
<
Self
>>
(
self
)
->
<
Dst
as
From
<
Self
>>
::
Dst
//~^ ERROR
unresolved associated type `From::Dst
`
//~^ ERROR
cannot find associated type `Dst` in trait `From
`
{
From
::
from
(
self
)
}
...
...
src/test/compile-fail/issue-22037.rs
浏览文件 @
20926821
...
...
@@ -11,7 +11,7 @@
trait
A
{
type
Output
;
fn
a
(
&
self
)
->
<
Self
as
A
>
::
X
;
//~^ ERROR
unresolved associated type `A::X
`
//~^ ERROR
cannot find associated type `X` in trait `A
`
}
impl
A
for
u32
{
...
...
src/test/compile-fail/issue-22384.rs
浏览文件 @
20926821
...
...
@@ -14,5 +14,5 @@ trait Trait {
fn
main
()
{
<<
i32
as
Copy
>
::
foobar
as
Trait
>
::
foo
();
//~^ ERROR
unresolved associated type `Copy::foobar
`
//~^ ERROR
cannot find associated type `foobar` in trait `Copy
`
}
src/test/compile-fail/issue-2281-part1.rs
浏览文件 @
20926821
...
...
@@ -8,4 +8,4 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
fn
main
()
{
println!
(
"{}"
,
foobar
);
}
//~ ERROR
unresolved value `foobar`
fn
main
()
{
println!
(
"{}"
,
foobar
);
}
//~ ERROR
cannot find value `foobar` in this scope
src/test/compile-fail/issue-28388-1.rs
浏览文件 @
20926821
...
...
@@ -10,6 +10,6 @@
// Prefix in imports with empty braces should be resolved and checked privacy, stability, etc.
use
foo
::{};
//~ ERROR
unresolved module or enum `foo`
use
foo
::{};
//~ ERROR
cannot find module or enum `foo` in the crate root
fn
main
()
{}
src/test/compile-fail/issue-30589.rs
浏览文件 @
20926821
...
...
@@ -10,7 +10,7 @@
use
std
::
fmt
;
impl
fmt
::
Display
for
DecoderError
{
//~ ERROR
unresolved type `DecoderError`
impl
fmt
::
Display
for
DecoderError
{
//~ ERROR
cannot find type `DecoderError` in this scope
fn
fmt
(
&
self
,
f
:
&
mut
fmt
::
Formatter
)
->
fmt
::
Result
{
write!
(
f
,
"Missing data: {}"
,
self
.0
)
}
...
...
src/test/compile-fail/issue-31212.rs
浏览文件 @
20926821
...
...
@@ -16,5 +16,5 @@ mod foo {
}
fn
main
()
{
foo
::
f
();
//~ ERROR
unresolved
foo
::
f
();
//~ ERROR
cannot find function `f` in module `foo`
}
src/test/compile-fail/issue-31845.rs
浏览文件 @
20926821
...
...
@@ -14,7 +14,7 @@ fn f() {
fn
g
()
{}
mod
foo
{
fn
h
()
{
g
();
//~ ERROR
unresolved function `g`
g
();
//~ ERROR
cannot find function `g` in this scope
}
}
}
...
...
src/test/compile-fail/issue-34334.rs
浏览文件 @
20926821
...
...
@@ -11,5 +11,5 @@
fn
main
()
{
let
sr
:
Vec
<
(
u32
,
_
,
_
)
=
vec!
[];
//~ ERROR expected one of `+`, `,`, or `>`, found `=`
let
sr2
:
Vec
<
(
u32
,
_
,
_
)
>
=
sr
.iter
()
.map
(|(
faction
,
th_sender
,
th_receiver
)|
{})
.collect
();
//~^ ERROR
unresolved value `sr`
//~^ ERROR
cannot find value `sr` in this scope
}
src/test/compile-fail/issue-35075.rs
浏览文件 @
20926821
...
...
@@ -9,11 +9,11 @@
// except according to those terms.
struct
Bar
<
T
>
{
inner
:
Foo
<
T
>
//~ ERROR
unresolved type `Foo`
inner
:
Foo
<
T
>
//~ ERROR
cannot find type `Foo` in this scope
}
enum
Baz
<
T
>
{
Foo
(
Foo
<
T
>
)
//~ ERROR
unresolved type `Foo`
Foo
(
Foo
<
T
>
)
//~ ERROR
cannot find type `Foo` in this scope
}
fn
main
()
{}
src/test/compile-fail/issue-37534.rs
浏览文件 @
20926821
...
...
@@ -9,7 +9,7 @@
// except according to those terms.
struct
Foo
<
T
:
?
Hash
>
{
}
//~^ ERROR
unresolved trait `Hash`
//~^ ERROR
cannot find trait `Hash` in this scope
//~^^ ERROR parameter `T` is never used
//~^^^ WARN default bound relaxed for a type parameter, but this does nothing
...
...
src/test/compile-fail/issue-4366-2.rs
浏览文件 @
20926821
...
...
@@ -23,7 +23,7 @@ pub mod b {
pub
mod
sub
{
use
a
::
b
::
*
;
fn
sub
()
->
bar
{
1
}
//~^ ERROR
unresolved type `bar`
//~^ ERROR
cannot find type `bar` in this scope
}
}
...
...
src/test/compile-fail/issue-4366.rs
浏览文件 @
20926821
...
...
@@ -25,7 +25,7 @@ pub mod b {
}
pub
mod
sub
{
use
a
::
b
::
*
;
fn
sub
()
->
isize
{
foo
();
1
}
//~ ERROR
unresolved function `foo`
fn
sub
()
->
isize
{
foo
();
1
}
//~ ERROR
cannot find function `foo` in this scope
}
}
...
...
src/test/compile-fail/issue-5099.rs
浏览文件 @
20926821
...
...
@@ -9,6 +9,6 @@
// except according to those terms.
trait
B
<
A
>
{
fn
a
()
->
A
{
this
.a
}
}
//~ ERROR
unresolved value `this`
trait
B
<
A
>
{
fn
a
()
->
A
{
this
.a
}
}
//~ ERROR
cannot find value `this` in this scope
fn
main
()
{}
src/test/compile-fail/issue-5927.rs
浏览文件 @
20926821
...
...
@@ -11,8 +11,8 @@
fn
main
()
{
let
z
=
match
3
{
x
(
1
)
=>
x
(
1
)
//~ ERROR
unresolved tuple struct/variant `x`
//~^ ERROR
unresolved function `x`
x
(
1
)
=>
x
(
1
)
//~ ERROR
cannot find tuple struct/variant `x` in this scope
//~^ ERROR
cannot find function `x` in this scope
};
assert
!
(
z
==
3
);
}
src/test/compile-fail/issue-7607-1.rs
浏览文件 @
20926821
...
...
@@ -12,7 +12,7 @@ struct Foo {
x
:
isize
}
impl
Fo
{
//~ ERROR
unresolved type `Fo`
impl
Fo
{
//~ ERROR
cannot find type `Fo` in this scope
fn
foo
()
{}
}
...
...
src/test/compile-fail/issue-8767.rs
浏览文件 @
20926821
...
...
@@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
impl
B
{
//~ ERROR
unresolved type `B`
impl
B
{
//~ ERROR
cannot find type `B` in this scope
}
fn
main
()
{
...
...
src/test/compile-fail/keyword-self-as-identifier.rs
浏览文件 @
20926821
...
...
@@ -9,5 +9,5 @@
// except according to those terms.
fn
main
()
{
let
Self
=
"foo"
;
//~ ERROR
unresolved unit struct/variant or constant `Self`
let
Self
=
"foo"
;
//~ ERROR
cannot find unit struct/variant or constant `Self` in this scope
}
src/test/compile-fail/macro-outer-attributes.rs
浏览文件 @
20926821
...
...
@@ -25,6 +25,6 @@
// test1!(#[bar])
#[qux]
fn
main
()
{
a
::
bar
();
//~ ERROR
unresolved function `a::bar
`
a
::
bar
();
//~ ERROR
cannot find function `bar` in module `a
`
b
::
bar
();
}
src/test/compile-fail/macro-parameter-span.rs
浏览文件 @
20926821
...
...
@@ -18,6 +18,6 @@
// not to the macro variable '$id'
fn
main
()
{
foo!
(
x
//~ ERROR
unresolved value `x`
x
//~ ERROR
cannot find value `x` in this scope
);
}
src/test/compile-fail/match-join.rs
浏览文件 @
20926821
...
...
@@ -16,6 +16,6 @@
fn
main
()
{
match
true
{
false
=>
{
my_panic
();
}
true
=>
{
}
}
println!
(
"{}"
,
x
);
//~ ERROR
unresolved value `x`
println!
(
"{}"
,
x
);
//~ ERROR
cannot find value `x` in this scope
let
x
:
isize
;
}
src/test/compile-fail/match-vec-mismatch.rs
浏览文件 @
20926821
...
...
@@ -34,7 +34,7 @@ fn main() {
[
0
,
1
,
2
,
3
,
x
..
]
=>
{}
//~ ERROR pattern requires
};
match
does_not_exist
{
//~ ERROR
unresolved value `does_not_exist`
match
does_not_exist
{
//~ ERROR
cannot find value `does_not_exist` in this scope
[]
=>
{}
};
}
...
...
src/test/compile-fail/mod_file_correct_spans.rs
浏览文件 @
20926821
...
...
@@ -13,5 +13,6 @@
mod
mod_file_aux
;
fn
main
()
{
assert
!
(
mod_file_aux
::
bar
()
==
10
);
//~ ERROR unresolved function `mod_file_aux::bar`
assert
!
(
mod_file_aux
::
bar
()
==
10
);
//~^ ERROR cannot find function `bar` in module `mod_file_aux`
}
src/test/compile-fail/name-clash-nullary.rs
浏览文件 @
20926821
...
...
@@ -13,6 +13,6 @@
fn
main
()
{
let
None
:
isize
=
42
;
//~ ERROR let bindings cannot shadow unit variants
log
(
debug
,
None
);
//~^ ERROR
unresolved function `log`
//~| ERROR
unresolved value `debug`
//~^ ERROR
cannot find function `log` in this scope
//~| ERROR
cannot find value `debug` in this scope
}
src/test/compile-fail/namespaced-enum-glob-import-no-impls-xcrate.rs
浏览文件 @
20926821
...
...
@@ -18,8 +18,8 @@ mod m {
pub
fn
main
()
{
use
namespaced_enums
::
Foo
::
*
;
foo
();
//~ ERROR
unresolved function `foo`
m
::
foo
();
//~ ERROR
unresolved function `m::foo
`
bar
();
//~ ERROR
unresolved function `bar`
m
::
bar
();
//~ ERROR
unresolved function `m::bar
`
foo
();
//~ ERROR
cannot find function `foo` in this scope
m
::
foo
();
//~ ERROR
cannot find function `foo` in module `m
`
bar
();
//~ ERROR
cannot find function `bar` in this scope
m
::
bar
();
//~ ERROR
cannot find function `bar` in module `m
`
}
src/test/compile-fail/namespaced-enum-glob-import-no-impls.rs
浏览文件 @
20926821
...
...
@@ -28,8 +28,8 @@ mod m {
pub
fn
main
()
{
use
m2
::
Foo
::
*
;
foo
();
//~ ERROR
unresolved function `foo`
m
::
foo
();
//~ ERROR
unresolved function `m::foo
`
bar
();
//~ ERROR
unresolved function `bar`
m
::
bar
();
//~ ERROR
unresolved function `m::bar
`
foo
();
//~ ERROR
cannot find function `foo` in this scope
m
::
foo
();
//~ ERROR
cannot find function `foo` in module `m
`
bar
();
//~ ERROR
cannot find function `bar` in this scope
m
::
bar
();
//~ ERROR
cannot find function `bar` in module `m
`
}
src/test/compile-fail/nested-cfg-attrs.rs
浏览文件 @
20926821
...
...
@@ -11,4 +11,4 @@
#[cfg_attr(all(),
cfg_attr(all(),
cfg(foo)))]
fn
f
()
{}
fn
main
()
{
f
()
}
//~ ERROR
unresolved function `f`
fn
main
()
{
f
()
}
//~ ERROR
cannot find function `f` in this scope
src/test/compile-fail/no-implicit-prelude-nested.rs
浏览文件 @
20926821
...
...
@@ -18,26 +18,26 @@
mod
foo
{
mod
baz
{
struct
Test
;
impl
Add
for
Test
{}
//~ ERROR
unresolved trait `Add`
impl
Clone
for
Test
{}
//~ ERROR
unresolved trait `Clone`
impl
Iterator
for
Test
{}
//~ ERROR
unresolved trait `Iterator`
impl
ToString
for
Test
{}
//~ ERROR
unresolved trait `ToString`
impl
Writer
for
Test
{}
//~ ERROR
unresolved trait `Writer`
impl
Add
for
Test
{}
//~ ERROR
cannot find trait `Add` in this scope
impl
Clone
for
Test
{}
//~ ERROR
cannot find trait `Clone` in this scope
impl
Iterator
for
Test
{}
//~ ERROR
cannot find trait `Iterator` in this scope
impl
ToString
for
Test
{}
//~ ERROR
cannot find trait `ToString` in this scope
impl
Writer
for
Test
{}
//~ ERROR
cannot find trait `Writer` in this scope
fn
foo
()
{
drop
(
2
)
//~ ERROR
unresolved function `drop`
drop
(
2
)
//~ ERROR
cannot find function `drop` in this scope
}
}
struct
Test
;
impl
Add
for
Test
{}
//~ ERROR
unresolved trait `Add`
impl
Clone
for
Test
{}
//~ ERROR
unresolved trait `Clone`
impl
Iterator
for
Test
{}
//~ ERROR
unresolved trait `Iterator`
impl
ToString
for
Test
{}
//~ ERROR
unresolved trait `ToString`
impl
Writer
for
Test
{}
//~ ERROR
unresolved trait `Writer`
impl
Add
for
Test
{}
//~ ERROR
cannot find trait `Add` in this scope
impl
Clone
for
Test
{}
//~ ERROR
cannot find trait `Clone` in this scope
impl
Iterator
for
Test
{}
//~ ERROR
cannot find trait `Iterator` in this scope
impl
ToString
for
Test
{}
//~ ERROR
cannot find trait `ToString` in this scope
impl
Writer
for
Test
{}
//~ ERROR
cannot find trait `Writer` in this scope
fn
foo
()
{
drop
(
2
)
//~ ERROR
unresolved function `drop`
drop
(
2
)
//~ ERROR
cannot find function `drop` in this scope
}
}
...
...
@@ -45,14 +45,14 @@ fn qux() {
#[no_implicit_prelude]
mod
qux_inner
{
struct
Test
;
impl
Add
for
Test
{}
//~ ERROR
unresolved trait `Add`
impl
Clone
for
Test
{}
//~ ERROR
unresolved trait `Clone`
impl
Iterator
for
Test
{}
//~ ERROR
unresolved trait `Iterator`
impl
ToString
for
Test
{}
//~ ERROR
unresolved trait `ToString`
impl
Writer
for
Test
{}
//~ ERROR
unresolved trait `Writer`
impl
Add
for
Test
{}
//~ ERROR
cannot find trait `Add` in this scope
impl
Clone
for
Test
{}
//~ ERROR
cannot find trait `Clone` in this scope
impl
Iterator
for
Test
{}
//~ ERROR
cannot find trait `Iterator` in this scope
impl
ToString
for
Test
{}
//~ ERROR
cannot find trait `ToString` in this scope
impl
Writer
for
Test
{}
//~ ERROR
cannot find trait `Writer` in this scope
fn
foo
()
{
drop
(
2
)
//~ ERROR
unresolved function `drop`
drop
(
2
)
//~ ERROR
cannot find function `drop` in this scope
}
}
}
...
...
src/test/compile-fail/no-implicit-prelude.rs
浏览文件 @
20926821
...
...
@@ -17,12 +17,12 @@
// fail with the same error message).
struct
Test
;
impl
Add
for
Test
{}
//~ ERROR
unresolved trait `Add`
impl
Clone
for
Test
{}
//~ ERROR
unresolved trait `Clone`
impl
Iterator
for
Test
{}
//~ ERROR
unresolved trait `Iterator`
impl
ToString
for
Test
{}
//~ ERROR
unresolved trait `ToString`
impl
Writer
for
Test
{}
//~ ERROR
unresolved trait `Writer`
impl
Add
for
Test
{}
//~ ERROR
cannot find trait `Add` in this scope
impl
Clone
for
Test
{}
//~ ERROR
cannot find trait `Clone` in this scope
impl
Iterator
for
Test
{}
//~ ERROR
cannot find trait `Iterator` in this scope
impl
ToString
for
Test
{}
//~ ERROR
cannot find trait `ToString` in this scope
impl
Writer
for
Test
{}
//~ ERROR
cannot find trait `Writer` in this scope
fn
main
()
{
drop
(
2
)
//~ ERROR
unresolved function `drop`
drop
(
2
)
//~ ERROR
cannot find function `drop` in this scope
}
src/test/compile-fail/no-link.rs
浏览文件 @
20926821
...
...
@@ -15,5 +15,5 @@
//~^ WARN custom derive crates and `#[no_link]` crates have no effect without `#[macro_use]`
fn
main
()
{
empty_struct
::
XEmpty1
;
//~ ERROR
unresolved value `empty_struct::XEmpty1
`
empty_struct
::
XEmpty1
;
//~ ERROR
cannot find value `XEmpty1` in module `empty_struct
`
}
src/test/compile-fail/parser-recovery-1.rs
浏览文件 @
20926821
...
...
@@ -14,11 +14,11 @@
trait
Foo
{
fn
bar
()
{
let
x
=
foo
();
//~ ERROR
unresolved function `foo`
let
x
=
foo
();
//~ ERROR
cannot find function `foo` in this scope
}
fn
main
()
{
let
x
=
y
.
;
//~ ERROR unexpected token
//~^ ERROR
unresolved value `y`
//~^ ERROR
cannot find value `y` in this scope
}
//~ ERROR this file contains an un-closed delimiter
src/test/compile-fail/parser-recovery-2.rs
浏览文件 @
20926821
...
...
@@ -14,11 +14,11 @@
trait
Foo
{
fn
bar
()
{
let
x
=
foo
();
//~ ERROR
unresolved function `foo`
let
x
=
foo
();
//~ ERROR
cannot find function `foo` in this scope
)
//~ ERROR incorrect close delimiter: `)`
}
fn
main
()
{
let
x
=
y
.
;
//~ ERROR unexpected token
//~^ ERROR
unresolved value `y`
//~^ ERROR
cannot find value `y` in this scope
}
src/test/compile-fail/pattern-macro-hygiene.rs
浏览文件 @
20926821
...
...
@@ -12,5 +12,5 @@
fn
main
()
{
let
foo!
()
=
2
;
x
+
1
;
//~ ERROR
unresolved value `x`
x
+
1
;
//~ ERROR
cannot find value `x` in this scope
}
src/test/compile-fail/privacy-ns1.rs
浏览文件 @
20926821
...
...
@@ -57,8 +57,8 @@ fn Bar() { }
fn
test_glob3
()
{
use
foo3
::
*
;
Bar
();
//~ ERROR
unresolved function `Bar`
let
_
x
:
Box
<
Bar
>
;
//~ ERROR
unresolved type `Bar`
Bar
();
//~ ERROR
cannot find function `Bar` in this scope
let
_
x
:
Box
<
Bar
>
;
//~ ERROR
cannot find type `Bar` in this scope
}
fn
main
()
{
...
...
src/test/compile-fail/privacy/restricted/ty-params.rs
浏览文件 @
20926821
...
...
@@ -20,7 +20,7 @@
mod
foo
{
struct
S
(
pub
(
foo
<
T
>
)
());
//~ ERROR type or lifetime parameters in visibility path
//~^ ERROR
unresolved type `T`
//~^ ERROR
cannot find type `T` in this scope
}
fn
main
()
{}
src/test/compile-fail/recursive-reexports.rs
浏览文件 @
20926821
...
...
@@ -12,6 +12,6 @@
extern
crate
recursive_reexports
;
fn
f
()
->
recursive_reexports
::
S
{}
//~ ERROR
unresolved type `recursive_reexports::S
`
fn
f
()
->
recursive_reexports
::
S
{}
//~ ERROR
cannot find type `S` in module `recursive_reexports
`
fn
main
()
{}
src/test/compile-fail/resolve-bad-import-prefix.rs
浏览文件 @
20926821
...
...
@@ -19,6 +19,6 @@ trait Tr {}
use
E
::{};
// OK
use
S
::{};
//~ ERROR expected module or enum, found struct `S`
use
Tr
::{};
//~ ERROR expected module or enum, found trait `Tr`
use
Nonexistent
::{};
//~ ERROR
unresolved module or enum `Nonexistent`
use
Nonexistent
::{};
//~ ERROR
cannot find module or enum `Nonexistent` in the crate root
fn
main
()
{}
src/test/compile-fail/resolve-bad-visibility.rs
浏览文件 @
20926821
...
...
@@ -16,8 +16,8 @@ trait Tr {}
pub
(
E
)
struct
S
;
//~ ERROR expected module, found enum `E`
pub
(
Tr
)
struct
Z
;
//~ ERROR expected module, found trait `Tr`
pub
(
std
::
vec
)
struct
F
;
//~ ERROR visibilities can only be restricted to ancestor modules
pub
(
nonexistent
)
struct
G
;
//~ ERROR
unresolved module `nonexistent`
pub
(
too_soon
)
struct
H
;
//~ ERROR
unresolved module `too_soon`
pub
(
nonexistent
)
struct
G
;
//~ ERROR
cannot find module `nonexistent` in the crate root
pub
(
too_soon
)
struct
H
;
//~ ERROR
cannot find module `too_soon` in the crate root
// Visibilities are resolved eagerly without waiting for modules becoming fully populated.
// Visibilities can only use ancestor modules legally which are always available in time,
...
...
src/test/compile-fail/resolve-primitive-fallback.rs
浏览文件 @
20926821
...
...
@@ -16,5 +16,5 @@ fn main() {
// Make sure primitive type fallback doesn't work with global paths
let
_
:
::
u8
;
//~^ ERROR
unresolved type `u8`
//~^ ERROR
cannot find type `u8` in the crate root
}
src/test/compile-fail/resolve-unknown-trait.rs
浏览文件 @
20926821
...
...
@@ -10,10 +10,10 @@
trait
NewTrait
:
SomeNonExistentTrait
{}
//~^ ERROR
unresolved trait `SomeNonExistentTrait`
//~^ ERROR
cannot find trait `SomeNonExistentTrait` in this scope
impl
SomeNonExistentTrait
for
isize
{}
//~^ ERROR
unresolved trait `SomeNonExistentTrait`
//~^ ERROR
cannot find trait `SomeNonExistentTrait` in this scope
fn
f
<
T
:
SomeNonExistentTrait
>
()
{}
//~^ ERROR
unresolved trait `SomeNonExistentTrait`
//~^ ERROR
cannot find trait `SomeNonExistentTrait` in this scope
src/test/compile-fail/rmeta.rs
浏览文件 @
20926821
...
...
@@ -14,5 +14,5 @@
// Check that building a metadata crate finds an error.
fn
main
()
{
let
_
=
Foo
;
//~ ERROR
unresolved value `Foo`
let
_
=
Foo
;
//~ ERROR
cannot find value `Foo` in this scope
}
src/test/compile-fail/self_type_keyword-2.rs
浏览文件 @
20926821
...
...
@@ -12,12 +12,12 @@
pub
fn
main
()
{
let
Self
=
5
;
//~^ ERROR
unresolved unit struct/variant or constant `Self`
//~^ ERROR
cannot find unit struct/variant or constant `Self` in this scope
match
15
{
Self
=>
(),
//~^ ERROR
unresolved unit struct/variant or constant `Self`
//~^ ERROR
cannot find unit struct/variant or constant `Self` in this scope
Foo
{
x
:
Self
}
=>
(),
//~^ ERROR
unresolved unit struct/variant or constant `Self`
//~^ ERROR
cannot find unit struct/variant or constant `Self` in this scope
}
}
src/test/compile-fail/struct-fields-shorthand-unresolved.rs
浏览文件 @
20926821
...
...
@@ -19,6 +19,6 @@ fn main() {
let
x
=
0
;
let
foo
=
Foo
{
x
,
y
//~ ERROR
unresolved value `y`
y
//~ ERROR
cannot find value `y` in this scope
};
}
src/test/compile-fail/syntax-extension-minor.rs
浏览文件 @
20926821
...
...
@@ -18,7 +18,7 @@ pub fn main() {
// this now fails (correctly, I claim) because hygiene prevents
// the assembled identifier from being a reference to the binding.
assert
!
(
concat_idents!
(
asd
,
f_f
,
dsa
)
==
"<.<"
.to_string
());
//~^ ERROR
unresolved value `asdf_fdsa`
//~^ ERROR
cannot find value `asdf_fdsa` in this scope
assert_eq!
(
stringify!
(
use_mention_distinction
),
"use_mention_distinction"
);
}
src/test/compile-fail/test-cfg.rs
浏览文件 @
20926821
...
...
@@ -14,5 +14,5 @@
fn
foo
()
{}
fn
main
()
{
foo
();
//~ ERROR
unresolved function `foo`
foo
();
//~ ERROR
cannot find function `foo` in this scope
}
src/test/compile-fail/ufcs-partially-resolved.rs
浏览文件 @
20926821
...
...
@@ -26,37 +26,37 @@ enum E { Y }
type
A
=
u32
;
fn
main
()
{
let
_
:
<
u8
as
Tr
>
::
N
;
//~ ERROR
unresolved associated type `Tr::N
`
let
_
:
<
u8
as
E
>
::
N
;
//~ ERROR
unresolved associated type `E::N
`
let
_
:
<
u8
as
A
>
::
N
;
//~ ERROR
unresolved associated type `A::N
`
<
u8
as
Tr
>
::
N
;
//~ ERROR
unresolved method or associated constant `Tr::N
`
<
u8
as
E
>
::
N
;
//~ ERROR
unresolved method or associated constant `E::N
`
<
u8
as
A
>
::
N
;
//~ ERROR
unresolved method or associated constant `A::N
`
let
_
:
<
u8
as
Tr
>
::
N
;
//~ ERROR
cannot find associated type `N` in trait `Tr
`
let
_
:
<
u8
as
E
>
::
N
;
//~ ERROR
cannot find associated type `N` in enum `E
`
let
_
:
<
u8
as
A
>
::
N
;
//~ ERROR
cannot find associated type `N` in `A
`
<
u8
as
Tr
>
::
N
;
//~ ERROR
cannot find method or associated constant `N` in trait `Tr
`
<
u8
as
E
>
::
N
;
//~ ERROR
cannot find method or associated constant `N` in enum `E
`
<
u8
as
A
>
::
N
;
//~ ERROR
cannot find method or associated constant `N` in `A
`
let
_
:
<
u8
as
Tr
>
::
Y
;
// OK
let
_
:
<
u8
as
E
>
::
Y
;
//~ ERROR expected associated type, found variant `E::Y`
<
u8
as
Tr
>
::
Y
;
// OK
<
u8
as
E
>
::
Y
;
//~ ERROR expected method or associated constant, found unit variant `E::Y`
let
_
:
<
u8
as
Tr
>
::
N
::
NN
;
//~ ERROR
unresolved associated type `Tr::N
`
let
_
:
<
u8
as
E
>
::
N
::
NN
;
//~ ERROR
unresolved associated type `E::N
`
let
_
:
<
u8
as
A
>
::
N
::
NN
;
//~ ERROR
unresolved associated type `A::N
`
<
u8
as
Tr
>
::
N
::
NN
;
//~ ERROR
unresolved associated type `Tr::N
`
<
u8
as
E
>
::
N
::
NN
;
//~ ERROR
unresolved associated type `E::N
`
<
u8
as
A
>
::
N
::
NN
;
//~ ERROR
unresolved associated type `A::N
`
let
_
:
<
u8
as
Tr
>
::
N
::
NN
;
//~ ERROR
cannot find associated type `N` in trait `Tr
`
let
_
:
<
u8
as
E
>
::
N
::
NN
;
//~ ERROR
cannot find associated type `N` in enum `E
`
let
_
:
<
u8
as
A
>
::
N
::
NN
;
//~ ERROR
cannot find associated type `N` in `A
`
<
u8
as
Tr
>
::
N
::
NN
;
//~ ERROR
cannot find associated type `N` in trait `Tr
`
<
u8
as
E
>
::
N
::
NN
;
//~ ERROR
cannot find associated type `N` in enum `E
`
<
u8
as
A
>
::
N
::
NN
;
//~ ERROR
cannot find associated type `N` in `A
`
let
_
:
<
u8
as
Tr
>
::
Y
::
NN
;
//~ ERROR ambiguous associated type
let
_
:
<
u8
as
E
>
::
Y
::
NN
;
//~ ERROR expected associated type, found variant `E::Y`
<
u8
as
Tr
>
::
Y
::
NN
;
//~ ERROR no associated item named `NN` found for type `<u8 as Tr>::Y`
<
u8
as
E
>
::
Y
::
NN
;
//~ ERROR expected associated type, found variant `E::Y`
let
_
:
<
u8
as
Tr
::
N
>
::
NN
;
//~ ERROR
unresolved associated type `Tr::N::N
N`
let
_
:
<
u8
as
E
::
N
>
::
NN
;
//~ ERROR
unresolved associated type `E::N::N
N`
let
_
:
<
u8
as
A
::
N
>
::
NN
;
//~ ERROR
unresolved associated type `A::N::N
N`
<
u8
as
Tr
::
N
>
::
NN
;
//~ ERROR
unresolved method or associated constant `Tr::N::N
N`
<
u8
as
E
::
N
>
::
NN
;
//~ ERROR
unresolved method or associated constant `E::N::N
N`
<
u8
as
A
::
N
>
::
NN
;
//~ ERROR
unresolved method or associated constant `A::N::N
N`
let
_
:
<
u8
as
Tr
::
Y
>
::
NN
;
//~ ERROR
unresolved associated type `Tr::Y::NN
`
let
_
:
<
u8
as
Tr
::
N
>
::
NN
;
//~ ERROR
cannot find associated type `NN` in `Tr::
N`
let
_
:
<
u8
as
E
::
N
>
::
NN
;
//~ ERROR
cannot find associated type `NN` in `E::
N`
let
_
:
<
u8
as
A
::
N
>
::
NN
;
//~ ERROR
cannot find associated type `NN` in `A::
N`
<
u8
as
Tr
::
N
>
::
NN
;
//~ ERROR
cannot find method or associated constant `NN` in `Tr::
N`
<
u8
as
E
::
N
>
::
NN
;
//~ ERROR
cannot find method or associated constant `NN` in `E::
N`
<
u8
as
A
::
N
>
::
NN
;
//~ ERROR
cannot find method or associated constant `NN` in `A::
N`
let
_
:
<
u8
as
Tr
::
Y
>
::
NN
;
//~ ERROR
cannot find associated type `NN` in `Tr::Y
`
let
_
:
<
u8
as
E
::
Y
>
::
NN
;
//~ ERROR failed to resolve. Not a module `Y`
<
u8
as
Tr
::
Y
>
::
NN
;
//~ ERROR
unresolved method or associated constant `Tr::Y::NN
`
<
u8
as
Tr
::
Y
>
::
NN
;
//~ ERROR
cannot find method or associated constant `NN` in `Tr::Y
`
<
u8
as
E
::
Y
>
::
NN
;
//~ ERROR failed to resolve. Not a module `Y`
let
_
:
<
u8
as
Dr
>
::
Z
;
//~ ERROR expected associated type, found method `Dr::Z`
...
...
src/test/ui/codemap_tests/tab.stderr
浏览文件 @
20926821
error[E0425]:
unresolved value `bar`
error[E0425]:
cannot find value `bar` in this scope
--> $DIR/tab.rs:14:2
|
14 | \tbar;
| \t^^^ no
resolution found
| \t^^^ no
t found in this scope
error: aborting due to previous error
src/test/ui/macros/macro-backtrace-nested.stderr
浏览文件 @
20926821
error[E0425]:
unresolved value `fake`
error[E0425]:
cannot find value `fake` in this scope
--> $DIR/macro-backtrace-nested.rs:15:12
|
15 | () => (fake)
| ^^^^ no
resolution found
| ^^^^ no
t found in this scope
...
27 | 1 + call_nested_expr!();
| ------------------- in this macro invocation
error[E0425]:
unresolved value `fake`
error[E0425]:
cannot find value `fake` in this scope
--> $DIR/macro-backtrace-nested.rs:15:12
|
15 | () => (fake)
| ^^^^ no
resolution found
| ^^^^ no
t found in this scope
...
28 | call_nested_expr_sum!();
| ------------------------ in this macro invocation
...
...
src/test/ui/resolve/enums-are-namespaced-xc.stderr
浏览文件 @
20926821
error[E0425]:
unresolved value `namespaced_enums::A
`
error[E0425]:
cannot find value `A` in module `namespaced_enums
`
--> $DIR/enums-are-namespaced-xc.rs:15:13
|
15 | let _ = namespaced_enums::A;
| ^^^^^^^^^^^^^^^^^^^ no
resolution found
| ^^^^^^^^^^^^^^^^^^^ no
t found in `namespaced_enums`
|
= help: possible candidate is found in another module, you can import it into scope:
= help: `use namespaced_enums::Foo::A;`
error[E0425]:
unresolved function `namespaced_enums::B
`
error[E0425]:
cannot find function `B` in module `namespaced_enums
`
--> $DIR/enums-are-namespaced-xc.rs:18:13
|
18 | let _ = namespaced_enums::B(10);
| ^^^^^^^^^^^^^^^^^^^ no
resolution found
| ^^^^^^^^^^^^^^^^^^^ no
t found in `namespaced_enums`
|
= help: possible candidate is found in another module, you can import it into scope:
= help: `use namespaced_enums::Foo::B;`
error[E0422]:
unresolved struct, variant or union type `namespaced_enums::C
`
error[E0422]:
cannot find struct, variant or union type `C` in module `namespaced_enums
`
--> $DIR/enums-are-namespaced-xc.rs:21:13
|
21 | let _ = namespaced_enums::C { a: 10 };
| ^^^^^^^^^^^^^^^^^^^ no
resolution found
| ^^^^^^^^^^^^^^^^^^^ no
t found in `namespaced_enums`
|
= help: possible candidate is found in another module, you can import it into scope:
= help: `use namespaced_enums::Foo::C;`
...
...
src/test/ui/resolve/issue-14254.stderr
浏览文件 @
20926821
error[E0425]:
unresolved function `baz`
error[E0425]:
cannot find function `baz` in this scope
--> $DIR/issue-14254.rs:29:9
|
29 | baz();
| ^^^ did you mean `self.baz(...)`?
error[E0425]:
unresolved value `a`
error[E0425]:
cannot find value `a` in this scope
--> $DIR/issue-14254.rs:32:9
|
32 | a;
| ^ no
resolution found
| ^ no
t found in this scope
error[E0425]:
unresolved function `baz`
error[E0425]:
cannot find function `baz` in this scope
--> $DIR/issue-14254.rs:40:9
|
40 | baz();
| ^^^ did you mean `self.baz(...)`?
error[E0425]:
unresolved value `x`
error[E0425]:
cannot find value `x` in this scope
--> $DIR/issue-14254.rs:43:9
|
43 | x;
| ^ did you mean `self.x`?
error[E0425]:
unresolved value `y`
error[E0425]:
cannot find value `y` in this scope
--> $DIR/issue-14254.rs:46:9
|
46 | y;
| ^ did you mean `self.y`?
error[E0425]:
unresolved value `a`
error[E0425]:
cannot find value `a` in this scope
--> $DIR/issue-14254.rs:49:9
|
49 | a;
| ^ no
resolution found
| ^ no
t found in this scope
error[E0425]:
unresolved value `bah`
error[E0425]:
cannot find value `bah` in this scope
--> $DIR/issue-14254.rs:52:9
|
52 | bah;
| ^^^ did you mean `Self::bah`?
error[E0425]:
unresolved value `b`
error[E0425]:
cannot find value `b` in this scope
--> $DIR/issue-14254.rs:55:9
|
55 | b;
| ^ no
resolution found
| ^ no
t found in this scope
error[E0425]:
unresolved function `baz`
error[E0425]:
cannot find function `baz` in this scope
--> $DIR/issue-14254.rs:63:9
|
63 | baz();
| ^^^ did you mean `self.baz(...)`?
error[E0425]:
unresolved value `x`
error[E0425]:
cannot find value `x` in this scope
--> $DIR/issue-14254.rs:66:9
|
66 | x;
| ^ did you mean `self.x`?
error[E0425]:
unresolved value `y`
error[E0425]:
cannot find value `y` in this scope
--> $DIR/issue-14254.rs:69:9
|
69 | y;
| ^ did you mean `self.y`?
error[E0425]:
unresolved value `a`
error[E0425]:
cannot find value `a` in this scope
--> $DIR/issue-14254.rs:72:9
|
72 | a;
| ^ no
resolution found
| ^ no
t found in this scope
error[E0425]:
unresolved value `bah`
error[E0425]:
cannot find value `bah` in this scope
--> $DIR/issue-14254.rs:75:9
|
75 | bah;
| ^^^ did you mean `Self::bah`?
error[E0425]:
unresolved value `b`
error[E0425]:
cannot find value `b` in this scope
--> $DIR/issue-14254.rs:78:9
|
78 | b;
| ^ no
resolution found
| ^ no
t found in this scope
error[E0425]:
unresolved function `baz`
error[E0425]:
cannot find function `baz` in this scope
--> $DIR/issue-14254.rs:86:9
|
86 | baz();
| ^^^ did you mean `self.baz(...)`?
error[E0425]:
unresolved value `bah`
error[E0425]:
cannot find value `bah` in this scope
--> $DIR/issue-14254.rs:89:9
|
89 | bah;
| ^^^ did you mean `Self::bah`?
error[E0425]:
unresolved function `baz`
error[E0425]:
cannot find function `baz` in this scope
--> $DIR/issue-14254.rs:97:9
|
97 | baz();
| ^^^ did you mean `self.baz(...)`?
error[E0425]:
unresolved value `bah`
error[E0425]:
cannot find value `bah` in this scope
--> $DIR/issue-14254.rs:100:9
|
100 | bah;
| ^^^ did you mean `Self::bah`?
error[E0425]:
unresolved function `baz`
error[E0425]:
cannot find function `baz` in this scope
--> $DIR/issue-14254.rs:108:9
|
108 | baz();
| ^^^ did you mean `self.baz(...)`?
error[E0425]:
unresolved value `bah`
error[E0425]:
cannot find value `bah` in this scope
--> $DIR/issue-14254.rs:111:9
|
111 | bah;
| ^^^ did you mean `Self::bah`?
error[E0425]:
unresolved function `baz`
error[E0425]:
cannot find function `baz` in this scope
--> $DIR/issue-14254.rs:119:9
|
119 | baz();
| ^^^ did you mean `self.baz(...)`?
error[E0425]:
unresolved value `bah`
error[E0425]:
cannot find value `bah` in this scope
--> $DIR/issue-14254.rs:122:9
|
122 | bah;
| ^^^ did you mean `Self::bah`?
error[E0425]:
unresolved function `baz`
error[E0425]:
cannot find function `baz` in this scope
--> $DIR/issue-14254.rs:130:9
|
130 | baz();
| ^^^ did you mean `self.baz(...)`?
error[E0425]:
unresolved value `bah`
error[E0425]:
cannot find value `bah` in this scope
--> $DIR/issue-14254.rs:133:9
|
133 | bah;
...
...
src/test/ui/resolve/issue-17518.stderr
浏览文件 @
20926821
error[E0422]:
unresolved struct, variant or union type `E`
error[E0422]:
cannot find struct, variant or union type `E` in this scope
--> $DIR/issue-17518.rs:16:5
|
16 | E { name: "foobar" }; //~ ERROR unresolved struct, variant or union type `E`
| ^ no
resolution found
| ^ no
t found in this scope
|
= help: possible candidate is found in another module, you can import it into scope:
= help: `use SomeEnum::E;`
...
...
src/test/ui/resolve/issue-21221-1.stderr
浏览文件 @
20926821
error[E0405]:
unresolved trait `Mul`
error[E0405]:
cannot find trait `Mul` in this scope
--> $DIR/issue-21221-1.rs:53:6
|
53 | impl Mul for Foo {
| ^^^ no
resolution found
| ^^^ no
t found in this scope
|
= help: possible candidates are found in other modules, you can import them into scope:
= help: `use mul1::Mul;`
= help: `use mul2::Mul;`
= help: `use std::ops::Mul;`
error[E0412]:
unresolved type `Mul`
error[E0412]:
cannot find type `Mul` in this scope
--> $DIR/issue-21221-1.rs:72:16
|
72 | fn getMul() -> Mul {
| ^^^ no
resolution found
| ^^^ no
t found in this scope
|
= help: possible candidates are found in other modules, you can import them into scope:
= help: `use mul1::Mul;`
...
...
@@ -22,17 +22,17 @@ error[E0412]: unresolved type `Mul`
= help: `use mul4::Mul;`
= help: and 2 other candidates
error[E0405]:
unresolved trait `ThisTraitReallyDoesntExistInAnyModuleReally`
error[E0405]:
cannot find trait `ThisTraitReallyDoesntExistInAnyModuleReally` in this scope
--> $DIR/issue-21221-1.rs:83:6
|
83 | impl ThisTraitReallyDoesntExistInAnyModuleReally for Foo {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no
resolution found
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no
t found in this scope
error[E0405]:
unresolved trait `Div`
error[E0405]:
cannot find trait `Div` in this scope
--> $DIR/issue-21221-1.rs:88:6
|
88 | impl Div for Foo {
| ^^^ no
resolution found
| ^^^ no
t found in this scope
|
= help: possible candidate is found in another module, you can import it into scope:
= help: `use std::ops::Div;`
...
...
src/test/ui/resolve/issue-21221-2.stderr
浏览文件 @
20926821
error[E0405]:
unresolved trait `T`
error[E0405]:
cannot find trait `T` in this scope
--> $DIR/issue-21221-2.rs:28:6
|
28 | impl T for Foo { }
| ^ no
resolution found
| ^ no
t found in this scope
|
= help: possible candidate is found in another module, you can import it into scope:
= help: `use foo::bar::T;`
...
...
src/test/ui/resolve/issue-21221-3.stderr
浏览文件 @
20926821
error[E0405]:
unresolved trait `OuterTrait`
error[E0405]:
cannot find trait `OuterTrait` in this scope
--> $DIR/issue-21221-3.rs:25:6
|
25 | impl OuterTrait for Foo {}
| ^^^^^^^^^^ no
resolution found
| ^^^^^^^^^^ no
t found in this scope
|
= help: possible candidate is found in another module, you can import it into scope:
= help: `use issue_21221_3::outer::OuterTrait;`
...
...
src/test/ui/resolve/issue-21221-4.stderr
浏览文件 @
20926821
error[E0405]:
unresolved trait `T`
error[E0405]:
cannot find trait `T` in this scope
--> $DIR/issue-21221-4.rs:20:6
|
20 | impl T for Foo {}
| ^ no
resolution found
| ^ no
t found in this scope
|
= help: possible candidate is found in another module, you can import it into scope:
= help: `use issue_21221_4::T;`
...
...
src/test/ui/resolve/issue-23305.stderr
浏览文件 @
20926821
error[E0411]:
unresolved type `Self`
error[E0411]:
cannot find type `Self` in this scope
--> $DIR/issue-23305.rs:15:12
|
15 | impl ToNbt<Self> {}
...
...
src/test/ui/resolve/issue-2356.stderr
浏览文件 @
20926821
error[E0425]:
unresolved function `shave`
error[E0425]:
cannot find function `shave` in this scope
--> $DIR/issue-2356.rs:27:5
|
27 | shave();
| ^^^^^ no
resolution found
| ^^^^^ no
t found in this scope
error[E0425]:
unresolved function `clone`
error[E0425]:
cannot find function `clone` in this scope
--> $DIR/issue-2356.rs:35:5
|
35 | clone();
| ^^^^^ did you mean `self.clone(...)`?
error[E0425]:
unresolved function `default`
error[E0425]:
cannot find function `default` in this scope
--> $DIR/issue-2356.rs:43:5
|
43 | default();
| ^^^^^^^ did you mean `Self::default`?
error[E0425]:
unresolved value `whiskers`
error[E0425]:
cannot find value `whiskers` in this scope
--> $DIR/issue-2356.rs:52:5
|
52 | whiskers -= other;
...
...
@@ -25,41 +25,41 @@ error[E0425]: unresolved value `whiskers`
| did you mean `self.whiskers`?
| `self` value is only available in methods with `self` parameter
error[E0425]:
unresolved function `shave`
error[E0425]:
cannot find function `shave` in this scope
--> $DIR/issue-2356.rs:57:5
|
57 | shave(4);
| ^^^^^ did you mean `Self::shave`?
error[E0425]:
unresolved function `purr`
error[E0425]:
cannot find function `purr` in this scope
--> $DIR/issue-2356.rs:60:5
|
60 | purr();
| ^^^^ no
resolution found
| ^^^^ no
t found in this scope
error[E0425]:
unresolved function `static_method`
error[E0425]:
cannot find function `static_method` in this scope
--> $DIR/issue-2356.rs:70:9
|
70 | static_method();
| ^^^^^^^^^^^^^ no
resolution found
| ^^^^^^^^^^^^^ no
t found in this scope
error[E0425]:
unresolved function `purr`
error[E0425]:
cannot find function `purr` in this scope
--> $DIR/issue-2356.rs:73:9
|
73 | purr();
| ^^^^ no
resolution found
| ^^^^ no
t found in this scope
error[E0425]:
unresolved function `purr`
error[E0425]:
cannot find function `purr` in this scope
--> $DIR/issue-2356.rs:76:9
|
76 | purr();
| ^^^^ no
resolution found
| ^^^^ no
t found in this scope
error[E0425]:
unresolved function `purr`
error[E0425]:
cannot find function `purr` in this scope
--> $DIR/issue-2356.rs:79:9
|
79 | purr();
| ^^^^ no
resolution found
| ^^^^ no
t found in this scope
error[E0424]: expected value, found module `self`
--> $DIR/issue-2356.rs:87:8
...
...
@@ -67,25 +67,25 @@ error[E0424]: expected value, found module `self`
87 | if self.whiskers > 3 {
| ^^^^ `self` value is only available in methods with `self` parameter
error[E0425]:
unresolved function `grow_older`
error[E0425]:
cannot find function `grow_older` in this scope
--> $DIR/issue-2356.rs:95:5
|
95 | grow_older();
| ^^^^^^^^^^ no
resolution found
| ^^^^^^^^^^ no
t found in this scope
error[E0425]:
unresolved function `shave`
error[E0425]:
cannot find function `shave` in this scope
--> $DIR/issue-2356.rs:98:5
|
98 | shave();
| ^^^^^ no
resolution found
| ^^^^^ no
t found in this scope
error[E0425]:
unresolved value `whiskers`
error[E0425]:
cannot find value `whiskers` in this scope
--> $DIR/issue-2356.rs:104:5
|
104 | whiskers = 0;
| ^^^^^^^^ did you mean `self.whiskers`?
error[E0425]:
unresolved value `whiskers`
error[E0425]:
cannot find value `whiskers` in this scope
--> $DIR/issue-2356.rs:110:5
|
110 | whiskers = 4;
...
...
@@ -94,11 +94,11 @@ error[E0425]: unresolved value `whiskers`
| did you mean `self.whiskers`?
| `self` value is only available in methods with `self` parameter
error[E0425]:
unresolved function `purr_louder`
error[E0425]:
cannot find function `purr_louder` in this scope
--> $DIR/issue-2356.rs:115:5
|
115 | purr_louder();
| ^^^^^^^^^^^ no
resolution found
| ^^^^^^^^^^^ no
t found in this scope
error[E0424]: expected value, found module `self`
--> $DIR/issue-2356.rs:122:5
...
...
src/test/ui/resolve/issue-24968.stderr
浏览文件 @
20926821
error[E0411]:
unresolved type `Self`
error[E0411]:
cannot find type `Self` in this scope
--> $DIR/issue-24968.rs:11:11
|
11 | fn foo(_: Self) {
...
...
src/test/ui/resolve/resolve-assoc-suggestions.stderr
浏览文件 @
20926821
error[E0412]:
unresolved type `field`
error[E0412]:
cannot find type `field` in this scope
--> $DIR/resolve-assoc-suggestions.rs:26:16
|
26 | let _: field;
| ^^^^^ no
resolution found
| ^^^^^ no
t found in this scope
error[E0531]:
unresolved tuple struct/variant `field`
error[E0531]:
cannot find tuple struct/variant `field` in this scope
--> $DIR/resolve-assoc-suggestions.rs:29:13
|
29 | let field(..);
| ^^^^^ no
resolution found
| ^^^^^ no
t found in this scope
error[E0425]:
unresolved value `field`
error[E0425]:
cannot find value `field` in this scope
--> $DIR/resolve-assoc-suggestions.rs:32:9
|
32 | field;
| ^^^^^ did you mean `self.field`?
error[E0412]:
unresolved type `Type`
error[E0412]:
cannot find type `Type` in this scope
--> $DIR/resolve-assoc-suggestions.rs:36:16
|
36 | let _: Type;
| ^^^^ did you mean `Self::Type`?
error[E0531]:
unresolved tuple struct/variant `Type`
error[E0531]:
cannot find tuple struct/variant `Type` in this scope
--> $DIR/resolve-assoc-suggestions.rs:39:13
|
39 | let Type(..);
| ^^^^ no
resolution found
| ^^^^ no
t found in this scope
error[E0425]:
unresolved value `Type`
error[E0425]:
cannot find value `Type` in this scope
--> $DIR/resolve-assoc-suggestions.rs:42:9
|
42 | Type;
| ^^^^ no
resolution found
| ^^^^ no
t found in this scope
error[E0412]:
unresolved type `method`
error[E0412]:
cannot find type `method` in this scope
--> $DIR/resolve-assoc-suggestions.rs:46:16
|
46 | let _: method;
| ^^^^^^ no
resolution found
| ^^^^^^ no
t found in this scope
error[E0531]:
unresolved tuple struct/variant `method`
error[E0531]:
cannot find tuple struct/variant `method` in this scope
--> $DIR/resolve-assoc-suggestions.rs:49:13
|
49 | let method(..);
| ^^^^^^ no
resolution found
| ^^^^^^ no
t found in this scope
error[E0425]:
unresolved value `method`
error[E0425]:
cannot find value `method` in this scope
--> $DIR/resolve-assoc-suggestions.rs:52:9
|
52 | method;
...
...
src/test/ui/resolve/resolve-speculative-adjustment.stderr
浏览文件 @
20926821
error[E0425]:
unresolved value `field`
error[E0425]:
cannot find value `field` in this scope
--> $DIR/resolve-speculative-adjustment.rs:27:13
|
27 | field;
| ^^^^^ no
resolution found
| ^^^^^ no
t found in this scope
error[E0425]:
unresolved function `method`
error[E0425]:
cannot find function `method` in this scope
--> $DIR/resolve-speculative-adjustment.rs:30:13
|
30 | method();
| ^^^^^^ no
resolution found
| ^^^^^^ no
t found in this scope
error[E0425]:
unresolved value `field`
error[E0425]:
cannot find value `field` in this scope
--> $DIR/resolve-speculative-adjustment.rs:35:9
|
35 | field;
| ^^^^^ did you mean `self.field`?
error[E0425]:
unresolved function `method`
error[E0425]:
cannot find function `method` in this scope
--> $DIR/resolve-speculative-adjustment.rs:38:9
|
38 | method();
...
...
src/test/ui/resolve/token-error-correct-2.stderr
浏览文件 @
20926821
...
...
@@ -10,11 +10,11 @@ note: unclosed delimiter
14 | if foo {
| ^
error[E0425]:
unresolved value `foo`
error[E0425]:
cannot find value `foo` in this scope
--> $DIR/token-error-correct-2.rs:14:8
|
14 | if foo {
| ^^^ no
resolution found
| ^^^ no
t found in this scope
error: aborting due to 2 previous errors
src/test/ui/resolve/token-error-correct-3.stderr
浏览文件 @
20926821
...
...
@@ -22,11 +22,11 @@ error: expected one of `.`, `;`, `?`, `}`, or an operator, found `)`
29 | } else { //~ ERROR: incorrect close delimiter: `}`
| ^
error[E0425]:
unresolved function `is_directory`
error[E0425]:
cannot find function `is_directory` in this scope
--> $DIR/token-error-correct-3.rs:21:13
|
21 | if !is_directory(path.as_ref()) { //~ ERROR: unresolved function `is_directory`
| ^^^^^^^^^^^^ no
resolution found
| ^^^^^^^^^^^^ no
t found in this scope
error[E0308]: mismatched types
--> $DIR/token-error-correct-3.rs:25:13
...
...
src/test/ui/resolve/token-error-correct.stderr
浏览文件 @
20926821
...
...
@@ -40,17 +40,17 @@ error: expected expression, found `)`
23 | }
| ^
error[E0425]:
unresolved function `foo`
error[E0425]:
cannot find function `foo` in this scope
--> $DIR/token-error-correct.rs:14:5
|
14 | foo(bar(;
| ^^^ no
resolution found
| ^^^ no
t found in this scope
error[E0425]:
unresolved function `bar`
error[E0425]:
cannot find function `bar` in this scope
--> $DIR/token-error-correct.rs:14:9
|
14 | foo(bar(;
| ^^^ no
resolution found
| ^^^ no
t found in this scope
error: aborting due to 7 previous errors
src/test/ui/resolve/unboxed-closure-sugar-nonexistent-trait.stderr
浏览文件 @
20926821
error[E0405]:
unresolved trait `Nonexist`
error[E0405]:
cannot find trait `Nonexist` in this scope
--> $DIR/unboxed-closure-sugar-nonexistent-trait.rs:11:8
|
11 | fn f<F:Nonexist(isize) -> isize>(x: F) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^ no
resolution found
| ^^^^^^^^^^^^^^^^^^^^^^^^ no
t found in this scope
error[E0404]: expected trait, found type alias `Typedef`
--> $DIR/unboxed-closure-sugar-nonexistent-trait.rs:17:8
...
...
src/test/ui/resolve/unresolved_static_type_field.stderr
浏览文件 @
20926821
error[E0425]:
unresolved value `cx`
error[E0425]:
cannot find value `cx` in this scope
--> $DIR/unresolved_static_type_field.rs:19:11
|
19 | f(cx);
...
...
src/test/ui/span/typo-suggestion.stderr
浏览文件 @
20926821
error[E0425]:
unresolved value `bar`
error[E0425]:
cannot find value `bar` in this scope
--> $DIR/typo-suggestion.rs:15:26
|
15 | println!("Hello {}", bar);
| ^^^ no
resolution found
| ^^^ no
t found in this scope
error[E0425]:
unresolved value `fob`
error[E0425]:
cannot find value `fob` in this scope
--> $DIR/typo-suggestion.rs:18:26
|
18 | println!("Hello {}", fob);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录