Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
42a19dde
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,发现更多精彩内容 >>
提交
42a19dde
编写于
9月 15, 2019
作者:
V
Vadim Petrochenkov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
resolve: Tweak "cannot find" wording for attributes
上级
8bf776d5
变更
38
隐藏空白更改
内联
并排
Showing
38 changed file
with
128 addition
and
121 deletion
+128
-121
src/librustc_resolve/macros.rs
src/librustc_resolve/macros.rs
+3
-3
src/libsyntax_pos/hygiene.rs
src/libsyntax_pos/hygiene.rs
+7
-0
src/test/ui/attributes/obsolete-attr.rs
src/test/ui/attributes/obsolete-attr.rs
+2
-2
src/test/ui/attributes/obsolete-attr.stderr
src/test/ui/attributes/obsolete-attr.stderr
+2
-2
src/test/ui/attributes/unknown-attr.rs
src/test/ui/attributes/unknown-attr.rs
+3
-3
src/test/ui/attributes/unknown-attr.stderr
src/test/ui/attributes/unknown-attr.stderr
+3
-3
src/test/ui/conditional-compilation/cfg-attr-unknown-attribute-macro-expansion.rs
...compilation/cfg-attr-unknown-attribute-macro-expansion.rs
+1
-1
src/test/ui/conditional-compilation/cfg-attr-unknown-attribute-macro-expansion.stderr
...ilation/cfg-attr-unknown-attribute-macro-expansion.stderr
+1
-1
src/test/ui/conditional-compilation/cfg-generic-params.rs
src/test/ui/conditional-compilation/cfg-generic-params.rs
+5
-5
src/test/ui/conditional-compilation/cfg-generic-params.stderr
...test/ui/conditional-compilation/cfg-generic-params.stderr
+5
-5
src/test/ui/custom_attribute.rs
src/test/ui/custom_attribute.rs
+3
-3
src/test/ui/custom_attribute.stderr
src/test/ui/custom_attribute.stderr
+3
-3
src/test/ui/feature-gates/feature-gate-custom_attribute.rs
src/test/ui/feature-gates/feature-gate-custom_attribute.rs
+13
-13
src/test/ui/feature-gates/feature-gate-custom_attribute.stderr
...est/ui/feature-gates/feature-gate-custom_attribute.stderr
+13
-13
src/test/ui/feature-gates/feature-gate-custom_attribute2.rs
src/test/ui/feature-gates/feature-gate-custom_attribute2.rs
+17
-17
src/test/ui/feature-gates/feature-gate-custom_attribute2.stderr
...st/ui/feature-gates/feature-gate-custom_attribute2.stderr
+17
-17
src/test/ui/feature-gates/feature-gate-rustc-attrs.rs
src/test/ui/feature-gates/feature-gate-rustc-attrs.rs
+1
-1
src/test/ui/feature-gates/feature-gate-rustc-attrs.stderr
src/test/ui/feature-gates/feature-gate-rustc-attrs.stderr
+1
-1
src/test/ui/issues/issue-32655.rs
src/test/ui/issues/issue-32655.rs
+2
-2
src/test/ui/issues/issue-32655.stderr
src/test/ui/issues/issue-32655.stderr
+2
-2
src/test/ui/issues/issue-49074.rs
src/test/ui/issues/issue-49074.rs
+1
-1
src/test/ui/issues/issue-49074.stderr
src/test/ui/issues/issue-49074.stderr
+1
-1
src/test/ui/macros/macro-reexport-removed.rs
src/test/ui/macros/macro-reexport-removed.rs
+1
-1
src/test/ui/macros/macro-reexport-removed.stderr
src/test/ui/macros/macro-reexport-removed.stderr
+1
-1
src/test/ui/proc-macro/derive-still-gated.rs
src/test/ui/proc-macro/derive-still-gated.rs
+1
-1
src/test/ui/proc-macro/derive-still-gated.stderr
src/test/ui/proc-macro/derive-still-gated.stderr
+1
-1
src/test/ui/proc-macro/macro-namespace-reserved-2.rs
src/test/ui/proc-macro/macro-namespace-reserved-2.rs
+1
-1
src/test/ui/proc-macro/macro-namespace-reserved-2.stderr
src/test/ui/proc-macro/macro-namespace-reserved-2.stderr
+1
-1
src/test/ui/proc-macro/proc-macro-attributes.rs
src/test/ui/proc-macro/proc-macro-attributes.rs
+1
-1
src/test/ui/proc-macro/proc-macro-attributes.stderr
src/test/ui/proc-macro/proc-macro-attributes.stderr
+1
-1
src/test/ui/proc-macro/resolve-error.rs
src/test/ui/proc-macro/resolve-error.rs
+2
-2
src/test/ui/proc-macro/resolve-error.stderr
src/test/ui/proc-macro/resolve-error.stderr
+2
-2
src/test/ui/reserved/reserved-attr-on-macro.rs
src/test/ui/reserved/reserved-attr-on-macro.rs
+1
-1
src/test/ui/reserved/reserved-attr-on-macro.stderr
src/test/ui/reserved/reserved-attr-on-macro.stderr
+1
-1
src/test/ui/suggestions/attribute-typos.rs
src/test/ui/suggestions/attribute-typos.rs
+3
-3
src/test/ui/suggestions/attribute-typos.stderr
src/test/ui/suggestions/attribute-typos.stderr
+3
-3
src/test/ui/tool-attributes/tool-attributes-misplaced-1.rs
src/test/ui/tool-attributes/tool-attributes-misplaced-1.rs
+1
-1
src/test/ui/tool-attributes/tool-attributes-misplaced-1.stderr
...est/ui/tool-attributes/tool-attributes-misplaced-1.stderr
+1
-1
未找到文件。
src/librustc_resolve/macros.rs
浏览文件 @
42a19dde
...
...
@@ -323,7 +323,7 @@ fn smart_resolve_macro_path(
self
.check_stability_and_deprecation
(
&
ext
,
path
);
Ok
(
if
ext
.macro_kind
()
!=
kind
{
let
expected
=
if
kind
==
MacroKind
::
Attr
{
"attribute"
}
else
{
kind
.descr
()
}
;
let
expected
=
kind
.descr_expected
()
;
let
msg
=
format!
(
"expected {}, found {} `{}`"
,
expected
,
res
.descr
(),
path
);
self
.session
.struct_span_err
(
path
.span
,
&
msg
)
.span_label
(
path
.span
,
format!
(
"not {} {}"
,
kind
.article
(),
expected
))
...
...
@@ -775,8 +775,8 @@ struct Flags: u8 {
Err
(
..
)
=>
{
assert
!
(
initial_binding
.is_none
());
let
bang
=
if
kind
==
MacroKind
::
Bang
{
"!"
}
else
{
""
};
let
msg
=
format!
(
"cannot find {} `{}{}` in this scope"
,
kind
.descr
()
,
ident
,
bang
);
let
expected
=
kind
.descr_expected
();
let
msg
=
format!
(
"cannot find {} `{}{}` in this scope"
,
expected
,
ident
,
bang
);
let
mut
err
=
self
.session
.struct_span_err
(
ident
.span
,
&
msg
);
self
.unresolved_macro_suggestions
(
&
mut
err
,
kind
,
&
parent_scope
,
ident
);
err
.emit
();
...
...
src/libsyntax_pos/hygiene.rs
浏览文件 @
42a19dde
...
...
@@ -677,6 +677,13 @@ pub fn descr(self) -> &'static str {
}
}
pub
fn
descr_expected
(
self
)
->
&
'static
str
{
match
self
{
MacroKind
::
Attr
=>
"attribute"
,
_
=>
self
.descr
(),
}
}
pub
fn
article
(
self
)
->
&
'static
str
{
match
self
{
MacroKind
::
Attr
=>
"an"
,
...
...
src/test/ui/attributes/obsolete-attr.rs
浏览文件 @
42a19dde
// Obsolete attributes fall back to unstable custom attributes.
#[ab_isize=
"stdcall"
]
extern
{}
//~^ ERROR cannot find attribute
macro
`ab_isize` in this scope
//~^ ERROR cannot find attribute `ab_isize` in this scope
#[fixed_stack_segment]
fn
f
()
{}
//~^ ERROR cannot find attribute
macro
`fixed_stack_segment` in this scope
//~^ ERROR cannot find attribute `fixed_stack_segment` in this scope
fn
main
()
{}
src/test/ui/attributes/obsolete-attr.stderr
浏览文件 @
42a19dde
error: cannot find attribute
macro
`fixed_stack_segment` in this scope
error: cannot find attribute `fixed_stack_segment` in this scope
--> $DIR/obsolete-attr.rs:6:3
|
LL | #[fixed_stack_segment] fn f() {}
| ^^^^^^^^^^^^^^^^^^^
error: cannot find attribute
macro
`ab_isize` in this scope
error: cannot find attribute `ab_isize` in this scope
--> $DIR/obsolete-attr.rs:3:3
|
LL | #[ab_isize="stdcall"] extern {}
...
...
src/test/ui/attributes/unknown-attr.rs
浏览文件 @
42a19dde
...
...
@@ -3,10 +3,10 @@
#![feature(custom_inner_attributes)]
#![mutable_doc]
//~^ ERROR cannot find attribute
macro
`mutable_doc` in this scope
//~^ ERROR cannot find attribute `mutable_doc` in this scope
#[dance]
mod
a
{}
//~^ ERROR cannot find attribute
macro
`dance` in this scope
//~^ ERROR cannot find attribute `dance` in this scope
#[dance]
fn
main
()
{}
//~^ ERROR cannot find attribute
macro
`dance` in this scope
//~^ ERROR cannot find attribute `dance` in this scope
src/test/ui/attributes/unknown-attr.stderr
浏览文件 @
42a19dde
error: cannot find attribute
macro
`mutable_doc` in this scope
error: cannot find attribute `mutable_doc` in this scope
--> $DIR/unknown-attr.rs:5:4
|
LL | #![mutable_doc]
| ^^^^^^^^^^^
error: cannot find attribute
macro
`dance` in this scope
error: cannot find attribute `dance` in this scope
--> $DIR/unknown-attr.rs:8:3
|
LL | #[dance] mod a {}
| ^^^^^
error: cannot find attribute
macro
`dance` in this scope
error: cannot find attribute `dance` in this scope
--> $DIR/unknown-attr.rs:11:3
|
LL | #[dance] fn main() {}
...
...
src/test/ui/conditional-compilation/cfg-attr-unknown-attribute-macro-expansion.rs
浏览文件 @
42a19dde
macro_rules!
foo
{
()
=>
{
#[cfg_attr(all(),
unknown)]
//~^ ERROR cannot find attribute
macro
`unknown` in this scope
//~^ ERROR cannot find attribute `unknown` in this scope
fn
foo
()
{}
}
}
...
...
src/test/ui/conditional-compilation/cfg-attr-unknown-attribute-macro-expansion.stderr
浏览文件 @
42a19dde
error: cannot find attribute
macro
`unknown` in this scope
error: cannot find attribute `unknown` in this scope
--> $DIR/cfg-attr-unknown-attribute-macro-expansion.rs:3:27
|
LL | #[cfg_attr(all(), unknown)]
...
...
src/test/ui/conditional-compilation/cfg-generic-params.rs
浏览文件 @
42a19dde
...
...
@@ -17,22 +17,22 @@ fn f_ty<#[cfg(no)] 'a: 'a, #[cfg(yes)] T>() {}
fn
f_lt_no
<
#[cfg_attr(no,
unknown)]
'a
>
()
{}
// OK
fn
f_lt_yes
<
#[cfg_attr(yes,
unknown)]
'a
>
()
{}
//~^ ERROR cannot find attribute
macro
`unknown` in this scope
//~^ ERROR cannot find attribute `unknown` in this scope
fn
f_ty_no
<
#[cfg_attr(no,
unknown)]
T
>
()
{}
// OK
fn
f_ty_yes
<
#[cfg_attr(yes,
unknown)]
T
>
()
{}
//~^ ERROR cannot find attribute
macro
`unknown` in this scope
//~^ ERROR cannot find attribute `unknown` in this scope
type
FnNo
=
for
<
#[cfg_attr(no,
unknown)]
'a
>
fn
();
// OK
type
FnYes
=
for
<
#[cfg_attr(yes,
unknown)]
'a
>
fn
();
//~^ ERROR cannot find attribute
macro
`unknown` in this scope
//~^ ERROR cannot find attribute `unknown` in this scope
type
PolyNo
=
dyn
for
<
#[cfg_attr(no,
unknown)]
'a
>
Copy
;
// OK
type
PolyYes
=
dyn
for
<
#[cfg_attr(yes,
unknown)]
'a
>
Copy
;
//~^ ERROR cannot find attribute
macro
`unknown` in this scope
//~^ ERROR cannot find attribute `unknown` in this scope
struct
WhereNo
where
for
<
#[cfg_attr(no,
unknown)]
'a
>
u8
:
Copy
;
// OK
struct
WhereYes
where
for
<
#[cfg_attr(yes,
unknown)]
'a
>
u8
:
Copy
;
//~^ ERROR cannot find attribute
macro
`unknown` in this scope
//~^ ERROR cannot find attribute `unknown` in this scope
fn
main
()
{
f_lt
::
<
'static
>
();
...
...
src/test/ui/conditional-compilation/cfg-generic-params.stderr
浏览文件 @
42a19dde
...
...
@@ -16,31 +16,31 @@ error: only lifetime parameters can be used in this context
LL | struct WhereBad where for<#[cfg(no)] 'a, #[cfg(yes)] T> u8: Copy;
| ^
error: cannot find attribute
macro
`unknown` in this scope
error: cannot find attribute `unknown` in this scope
--> $DIR/cfg-generic-params.rs:34:43
|
LL | struct WhereYes where for<#[cfg_attr(yes, unknown)] 'a> u8: Copy;
| ^^^^^^^
error: cannot find attribute
macro
`unknown` in this scope
error: cannot find attribute `unknown` in this scope
--> $DIR/cfg-generic-params.rs:30:40
|
LL | type PolyYes = dyn for<#[cfg_attr(yes, unknown)] 'a> Copy;
| ^^^^^^^
error: cannot find attribute
macro
`unknown` in this scope
error: cannot find attribute `unknown` in this scope
--> $DIR/cfg-generic-params.rs:26:34
|
LL | type FnYes = for<#[cfg_attr(yes, unknown)] 'a> fn();
| ^^^^^^^
error: cannot find attribute
macro
`unknown` in this scope
error: cannot find attribute `unknown` in this scope
--> $DIR/cfg-generic-params.rs:22:29
|
LL | fn f_ty_yes<#[cfg_attr(yes, unknown)] T>() {}
| ^^^^^^^
error: cannot find attribute
macro
`unknown` in this scope
error: cannot find attribute `unknown` in this scope
--> $DIR/cfg-generic-params.rs:19:29
|
LL | fn f_lt_yes<#[cfg_attr(yes, unknown)] 'a>() {}
...
...
src/test/ui/custom_attribute.rs
浏览文件 @
42a19dde
#![feature(stmt_expr_attributes)]
#[foo]
//~ ERROR cannot find attribute
macro
`foo` in this scope
#[foo]
//~ ERROR cannot find attribute `foo` in this scope
fn
main
()
{
#[foo]
//~ ERROR cannot find attribute
macro
`foo` in this scope
#[foo]
//~ ERROR cannot find attribute `foo` in this scope
let
x
=
();
#[foo]
//~ ERROR cannot find attribute
macro
`foo` in this scope
#[foo]
//~ ERROR cannot find attribute `foo` in this scope
x
}
src/test/ui/custom_attribute.stderr
浏览文件 @
42a19dde
error: cannot find attribute
macro
`foo` in this scope
error: cannot find attribute `foo` in this scope
--> $DIR/custom_attribute.rs:3:3
|
LL | #[foo]
| ^^^
error: cannot find attribute
macro
`foo` in this scope
error: cannot find attribute `foo` in this scope
--> $DIR/custom_attribute.rs:5:7
|
LL | #[foo]
| ^^^
error: cannot find attribute
macro
`foo` in this scope
error: cannot find attribute `foo` in this scope
--> $DIR/custom_attribute.rs:7:7
|
LL | #[foo]
...
...
src/test/ui/feature-gates/feature-gate-custom_attribute.rs
浏览文件 @
42a19dde
// Check that literals in attributes parse just fine.
#[fake_attr]
//~ ERROR cannot find attribute
macro
`fake_attr` in this scope
#[fake_attr(
100
)]
//~ ERROR cannot find attribute
macro
`fake_attr` in this scope
#[fake_attr(
1
,
2
,
3
)]
//~ ERROR cannot find attribute
macro
`fake_attr` in this scope
#[fake_attr(
"hello"
)]
//~ ERROR cannot find attribute
macro
`fake_attr` in this scope
#[fake_attr(name
=
"hello"
)]
//~ ERROR cannot find attribute
macro
`fake_attr` in this scope
#[fake_attr(
1
,
"hi"
,
key
=
12
,
true
,
false
)]
//~ ERROR cannot find attribute
macro
`fake_attr` in th
#[fake_attr(key
=
"hello"
,
val
=
10
)]
//~ ERROR cannot find attribute
macro
`fake_attr` in this scop
#[fake_attr(key(
"hello"
),
val(
10
))]
//~ ERROR cannot find attribute
macro
`fake_attr` in this scope
#[fake_attr(enabled
=
true
,
disabled
=
false
)]
//~ ERROR cannot find attribute
macro
`fake_attr` in
#[fake_attr(
true
)]
//~ ERROR cannot find attribute
macro
`fake_attr` in this scope
#[fake_attr(pi
=
3.14159
)]
//~ ERROR cannot find attribute
macro
`fake_attr` in this scope
#[fake_attr(b
"hi"
)]
//~ ERROR cannot find attribute
macro
`fake_attr` in this scope
#[fake_doc(
r"doc"
)]
//~ ERROR cannot find attribute
macro
`fake_doc` in this scope
#[fake_attr]
//~ ERROR cannot find attribute `fake_attr` in this scope
#[fake_attr(
100
)]
//~ ERROR cannot find attribute `fake_attr` in this scope
#[fake_attr(
1
,
2
,
3
)]
//~ ERROR cannot find attribute `fake_attr` in this scope
#[fake_attr(
"hello"
)]
//~ ERROR cannot find attribute `fake_attr` in this scope
#[fake_attr(name
=
"hello"
)]
//~ ERROR cannot find attribute `fake_attr` in this scope
#[fake_attr(
1
,
"hi"
,
key
=
12
,
true
,
false
)]
//~ ERROR cannot find attribute `fake_attr` in th
#[fake_attr(key
=
"hello"
,
val
=
10
)]
//~ ERROR cannot find attribute `fake_attr` in this scop
#[fake_attr(key(
"hello"
),
val(
10
))]
//~ ERROR cannot find attribute `fake_attr` in this scope
#[fake_attr(enabled
=
true
,
disabled
=
false
)]
//~ ERROR cannot find attribute `fake_attr` in
#[fake_attr(
true
)]
//~ ERROR cannot find attribute `fake_attr` in this scope
#[fake_attr(pi
=
3.14159
)]
//~ ERROR cannot find attribute `fake_attr` in this scope
#[fake_attr(b
"hi"
)]
//~ ERROR cannot find attribute `fake_attr` in this scope
#[fake_doc(
r"doc"
)]
//~ ERROR cannot find attribute `fake_doc` in this scope
struct
Q
{}
fn
main
()
{}
src/test/ui/feature-gates/feature-gate-custom_attribute.stderr
浏览文件 @
42a19dde
error: cannot find attribute
macro
`fake_attr` in this scope
error: cannot find attribute `fake_attr` in this scope
--> $DIR/feature-gate-custom_attribute.rs:3:3
|
LL | #[fake_attr]
| ^^^^^^^^^
error: cannot find attribute
macro
`fake_attr` in this scope
error: cannot find attribute `fake_attr` in this scope
--> $DIR/feature-gate-custom_attribute.rs:4:3
|
LL | #[fake_attr(100)]
| ^^^^^^^^^
error: cannot find attribute
macro
`fake_attr` in this scope
error: cannot find attribute `fake_attr` in this scope
--> $DIR/feature-gate-custom_attribute.rs:5:3
|
LL | #[fake_attr(1, 2, 3)]
| ^^^^^^^^^
error: cannot find attribute
macro
`fake_attr` in this scope
error: cannot find attribute `fake_attr` in this scope
--> $DIR/feature-gate-custom_attribute.rs:6:3
|
LL | #[fake_attr("hello")]
| ^^^^^^^^^
error: cannot find attribute
macro
`fake_attr` in this scope
error: cannot find attribute `fake_attr` in this scope
--> $DIR/feature-gate-custom_attribute.rs:7:3
|
LL | #[fake_attr(name = "hello")]
| ^^^^^^^^^
error: cannot find attribute
macro
`fake_attr` in this scope
error: cannot find attribute `fake_attr` in this scope
--> $DIR/feature-gate-custom_attribute.rs:8:3
|
LL | #[fake_attr(1, "hi", key = 12, true, false)]
| ^^^^^^^^^
error: cannot find attribute
macro
`fake_attr` in this scope
error: cannot find attribute `fake_attr` in this scope
--> $DIR/feature-gate-custom_attribute.rs:9:3
|
LL | #[fake_attr(key = "hello", val = 10)]
| ^^^^^^^^^
error: cannot find attribute
macro
`fake_attr` in this scope
error: cannot find attribute `fake_attr` in this scope
--> $DIR/feature-gate-custom_attribute.rs:10:3
|
LL | #[fake_attr(key("hello"), val(10))]
| ^^^^^^^^^
error: cannot find attribute
macro
`fake_attr` in this scope
error: cannot find attribute `fake_attr` in this scope
--> $DIR/feature-gate-custom_attribute.rs:11:3
|
LL | #[fake_attr(enabled = true, disabled = false)]
| ^^^^^^^^^
error: cannot find attribute
macro
`fake_attr` in this scope
error: cannot find attribute `fake_attr` in this scope
--> $DIR/feature-gate-custom_attribute.rs:12:3
|
LL | #[fake_attr(true)]
| ^^^^^^^^^
error: cannot find attribute
macro
`fake_attr` in this scope
error: cannot find attribute `fake_attr` in this scope
--> $DIR/feature-gate-custom_attribute.rs:13:3
|
LL | #[fake_attr(pi = 3.14159)]
| ^^^^^^^^^
error: cannot find attribute
macro
`fake_attr` in this scope
error: cannot find attribute `fake_attr` in this scope
--> $DIR/feature-gate-custom_attribute.rs:14:3
|
LL | #[fake_attr(b"hi")]
| ^^^^^^^^^
error: cannot find attribute
macro
`fake_doc` in this scope
error: cannot find attribute `fake_doc` in this scope
--> $DIR/feature-gate-custom_attribute.rs:15:3
|
LL | #[fake_doc(r"doc")]
...
...
src/test/ui/feature-gates/feature-gate-custom_attribute2.rs
浏览文件 @
42a19dde
...
...
@@ -4,54 +4,54 @@
// gate-test-custom_attribute
struct
StLt
<
#[lt_struct]
'a
>
(
&
'a
u32
);
//~^ ERROR cannot find attribute
macro
`lt_struct` in this scope
//~^ ERROR cannot find attribute `lt_struct` in this scope
struct
StTy
<
#[ty_struct]
I
>
(
I
);
//~^ ERROR cannot find attribute
macro
`ty_struct` in this scope
//~^ ERROR cannot find attribute `ty_struct` in this scope
enum
EnLt
<
#[lt_enum]
'b
>
{
A
(
&
'b
u32
),
B
}
//~^ ERROR cannot find attribute
macro
`lt_enum` in this scope
//~^ ERROR cannot find attribute `lt_enum` in this scope
enum
EnTy
<
#[ty_enum]
J
>
{
A
(
J
),
B
}
//~^ ERROR cannot find attribute
macro
`ty_enum` in this scope
//~^ ERROR cannot find attribute `ty_enum` in this scope
trait
TrLt
<
#[lt_trait]
'c
>
{
fn
foo
(
&
self
,
_
:
&
'c
[
u32
])
->
&
'c
u32
;
}
//~^ ERROR cannot find attribute
macro
`lt_trait` in this scope
//~^ ERROR cannot find attribute `lt_trait` in this scope
trait
TrTy
<
#[ty_trait]
K
>
{
fn
foo
(
&
self
,
_
:
K
);
}
//~^ ERROR cannot find attribute
macro
`ty_trait` in this scope
//~^ ERROR cannot find attribute `ty_trait` in this scope
type
TyLt
<
#[lt_type]
'd
>
=
&
'd
u32
;
//~^ ERROR cannot find attribute
macro
`lt_type` in this scope
//~^ ERROR cannot find attribute `lt_type` in this scope
type
TyTy
<
#[ty_type]
L
>
=
(
L
,
);
//~^ ERROR cannot find attribute
macro
`ty_type` in this scope
//~^ ERROR cannot find attribute `ty_type` in this scope
impl
<
#[lt_inherent]
'e
>
StLt
<
'e
>
{
}
//~^ ERROR cannot find attribute
macro
`lt_inherent` in this scope
//~^ ERROR cannot find attribute `lt_inherent` in this scope
impl
<
#[ty_inherent]
M
>
StTy
<
M
>
{
}
//~^ ERROR cannot find attribute
macro
`ty_inherent` in this scope
//~^ ERROR cannot find attribute `ty_inherent` in this scope
impl
<
#[lt_impl_for]
'f
>
TrLt
<
'f
>
for
StLt
<
'f
>
{
//~^ ERROR cannot find attribute
macro
`lt_impl_for` in this scope
//~^ ERROR cannot find attribute `lt_impl_for` in this scope
fn
foo
(
&
self
,
_
:
&
'f
[
u32
])
->
&
'f
u32
{
loop
{
}
}
}
impl
<
#[ty_impl_for]
N
>
TrTy
<
N
>
for
StTy
<
N
>
{
//~^ ERROR cannot find attribute
macro
`ty_impl_for` in this scope
//~^ ERROR cannot find attribute `ty_impl_for` in this scope
fn
foo
(
&
self
,
_
:
N
)
{
}
}
fn
f_lt
<
#[lt_fn]
'g
>
(
_
:
&
'g
[
u32
])
->
&
'g
u32
{
loop
{
}
}
//~^ ERROR cannot find attribute
macro
`lt_fn` in this scope
//~^ ERROR cannot find attribute `lt_fn` in this scope
fn
f_ty
<
#[ty_fn]
O
>
(
_
:
O
)
{
}
//~^ ERROR cannot find attribute
macro
`ty_fn` in this scope
//~^ ERROR cannot find attribute `ty_fn` in this scope
impl
<
I
>
StTy
<
I
>
{
fn
m_lt
<
#[lt_meth]
'h
>
(
_
:
&
'h
[
u32
])
->
&
'h
u32
{
loop
{
}
}
//~^ ERROR cannot find attribute
macro
`lt_meth` in this scope
//~^ ERROR cannot find attribute `lt_meth` in this scope
fn
m_ty
<
#[ty_meth]
P
>
(
_
:
P
)
{
}
//~^ ERROR cannot find attribute
macro
`ty_meth` in this scope
//~^ ERROR cannot find attribute `ty_meth` in this scope
}
fn
hof_lt
<
Q
>
(
_
:
Q
)
where
Q
:
for
<
#[lt_hof]
'i
>
Fn
(
&
'i
[
u32
])
->
&
'i
u32
//~^ ERROR cannot find attribute
macro
`lt_hof` in this scope
//~^ ERROR cannot find attribute `lt_hof` in this scope
{
}
...
...
src/test/ui/feature-gates/feature-gate-custom_attribute2.stderr
浏览文件 @
42a19dde
error: cannot find attribute
macro
`lt_hof` in this scope
error: cannot find attribute `lt_hof` in this scope
--> $DIR/feature-gate-custom_attribute2.rs:53:21
|
LL | where Q: for <#[lt_hof] 'i> Fn(&'i [u32]) -> &'i u32
| ^^^^^^
error: cannot find attribute
macro
`ty_meth` in this scope
error: cannot find attribute `ty_meth` in this scope
--> $DIR/feature-gate-custom_attribute2.rs:48:15
|
LL | fn m_ty<#[ty_meth] P>(_: P) { }
| ^^^^^^^
error: cannot find attribute
macro
`lt_meth` in this scope
error: cannot find attribute `lt_meth` in this scope
--> $DIR/feature-gate-custom_attribute2.rs:46:15
|
LL | fn m_lt<#[lt_meth] 'h>(_: &'h [u32]) -> &'h u32 { loop { } }
| ^^^^^^^
error: cannot find attribute
macro
`ty_fn` in this scope
error: cannot find attribute `ty_fn` in this scope
--> $DIR/feature-gate-custom_attribute2.rs:42:11
|
LL | fn f_ty<#[ty_fn] O>(_: O) { }
| ^^^^^
error: cannot find attribute
macro
`lt_fn` in this scope
error: cannot find attribute `lt_fn` in this scope
--> $DIR/feature-gate-custom_attribute2.rs:40:11
|
LL | fn f_lt<#[lt_fn] 'g>(_: &'g [u32]) -> &'g u32 { loop { } }
| ^^^^^
error: cannot find attribute
macro
`ty_impl_for` in this scope
error: cannot find attribute `ty_impl_for` in this scope
--> $DIR/feature-gate-custom_attribute2.rs:35:8
|
LL | impl<#[ty_impl_for] N> TrTy<N> for StTy<N> {
| ^^^^^^^^^^^
error: cannot find attribute
macro
`lt_impl_for` in this scope
error: cannot find attribute `lt_impl_for` in this scope
--> $DIR/feature-gate-custom_attribute2.rs:31:8
|
LL | impl<#[lt_impl_for] 'f> TrLt<'f> for StLt<'f> {
| ^^^^^^^^^^^
error: cannot find attribute
macro
`ty_inherent` in this scope
error: cannot find attribute `ty_inherent` in this scope
--> $DIR/feature-gate-custom_attribute2.rs:28:8
|
LL | impl<#[ty_inherent] M> StTy<M> { }
| ^^^^^^^^^^^
error: cannot find attribute
macro
`lt_inherent` in this scope
error: cannot find attribute `lt_inherent` in this scope
--> $DIR/feature-gate-custom_attribute2.rs:26:8
|
LL | impl<#[lt_inherent] 'e> StLt<'e> { }
| ^^^^^^^^^^^
error: cannot find attribute
macro
`ty_type` in this scope
error: cannot find attribute `ty_type` in this scope
--> $DIR/feature-gate-custom_attribute2.rs:23:13
|
LL | type TyTy<#[ty_type] L> = (L, );
| ^^^^^^^
error: cannot find attribute
macro
`lt_type` in this scope
error: cannot find attribute `lt_type` in this scope
--> $DIR/feature-gate-custom_attribute2.rs:21:13
|
LL | type TyLt<#[lt_type] 'd> = &'d u32;
| ^^^^^^^
error: cannot find attribute
macro
`ty_trait` in this scope
error: cannot find attribute `ty_trait` in this scope
--> $DIR/feature-gate-custom_attribute2.rs:18:14
|
LL | trait TrTy<#[ty_trait] K> { fn foo(&self, _: K); }
| ^^^^^^^^
error: cannot find attribute
macro
`lt_trait` in this scope
error: cannot find attribute `lt_trait` in this scope
--> $DIR/feature-gate-custom_attribute2.rs:16:14
|
LL | trait TrLt<#[lt_trait] 'c> { fn foo(&self, _: &'c [u32]) -> &'c u32; }
| ^^^^^^^^
error: cannot find attribute
macro
`ty_enum` in this scope
error: cannot find attribute `ty_enum` in this scope
--> $DIR/feature-gate-custom_attribute2.rs:13:13
|
LL | enum EnTy<#[ty_enum] J> { A(J), B }
| ^^^^^^^
error: cannot find attribute
macro
`lt_enum` in this scope
error: cannot find attribute `lt_enum` in this scope
--> $DIR/feature-gate-custom_attribute2.rs:11:13
|
LL | enum EnLt<#[lt_enum] 'b> { A(&'b u32), B }
| ^^^^^^^
error: cannot find attribute
macro
`ty_struct` in this scope
error: cannot find attribute `ty_struct` in this scope
--> $DIR/feature-gate-custom_attribute2.rs:8:15
|
LL | struct StTy<#[ty_struct] I>(I);
| ^^^^^^^^^
error: cannot find attribute
macro
`lt_struct` in this scope
error: cannot find attribute `lt_struct` in this scope
--> $DIR/feature-gate-custom_attribute2.rs:6:15
|
LL | struct StLt<#[lt_struct] 'a>(&'a u32);
...
...
src/test/ui/feature-gates/feature-gate-rustc-attrs.rs
浏览文件 @
42a19dde
...
...
@@ -19,5 +19,5 @@ fn g() {}
//~^ ERROR the `#[rustc_dummy]` attribute is just used for rustc unit tests
#[rustc_unknown]
//~^ ERROR attributes starting with `rustc` are reserved for use by the `rustc` compiler
//~| ERROR cannot find attribute
macro
`rustc_unknown` in this scope
//~| ERROR cannot find attribute `rustc_unknown` in this scope
fn
main
()
{}
src/test/ui/feature-gates/feature-gate-rustc-attrs.stderr
浏览文件 @
42a19dde
...
...
@@ -37,7 +37,7 @@ LL | #[rustc_unknown]
= note: for more information, see https://github.com/rust-lang/rust/issues/29642
= help: add `#![feature(rustc_attrs)]` to the crate attributes to enable
error: cannot find attribute
macro
`rustc_unknown` in this scope
error: cannot find attribute `rustc_unknown` in this scope
--> $DIR/feature-gate-rustc-attrs.rs:20:3
|
LL | #[rustc_unknown]
...
...
src/test/ui/issues/issue-32655.rs
浏览文件 @
42a19dde
macro_rules!
foo
(
()
=>
(
#[derive_Clone]
//~ ERROR cannot find attribute
macro
`derive_Clone` in this scope
#[derive_Clone]
//~ ERROR cannot find attribute `derive_Clone` in this scope
struct
T
;
);
);
...
...
@@ -12,7 +12,7 @@
foo!
();
bar!
(
#[derive_Clone]
//~ ERROR cannot find attribute
macro
`derive_Clone` in this scope
#[derive_Clone]
//~ ERROR cannot find attribute `derive_Clone` in this scope
struct
S
;
);
...
...
src/test/ui/issues/issue-32655.stderr
浏览文件 @
42a19dde
error: cannot find attribute
macro
`derive_Clone` in this scope
error: cannot find attribute `derive_Clone` in this scope
--> $DIR/issue-32655.rs:3:11
|
LL | #[derive_Clone]
...
...
@@ -7,7 +7,7 @@ LL | #[derive_Clone]
LL | foo!();
| ------- in this macro invocation
error: cannot find attribute
macro
`derive_Clone` in this scope
error: cannot find attribute `derive_Clone` in this scope
--> $DIR/issue-32655.rs:15:7
|
LL | #[derive_Clone]
...
...
src/test/ui/issues/issue-49074.rs
浏览文件 @
42a19dde
// Check that unknown attribute error is shown even if there are unresolved macros.
#[marco_use]
// typo
//~^ ERROR cannot find attribute
macro
`marco_use` in this scope
//~^ ERROR cannot find attribute `marco_use` in this scope
mod
foo
{
macro_rules!
bar
{
()
=>
();
...
...
src/test/ui/issues/issue-49074.stderr
浏览文件 @
42a19dde
...
...
@@ -6,7 +6,7 @@ LL | bar!();
|
= help: have you added the `#[macro_use]` on the module/import?
error: cannot find attribute
macro
`marco_use` in this scope
error: cannot find attribute `marco_use` in this scope
--> $DIR/issue-49074.rs:3:3
|
LL | #[marco_use] // typo
...
...
src/test/ui/macros/macro-reexport-removed.rs
浏览文件 @
42a19dde
...
...
@@ -2,7 +2,7 @@
#![feature(macro_reexport)]
//~ ERROR feature has been removed
#[macro_reexport(macro_one)]
//~ ERROR cannot find attribute
macro
`macro_reexport` in this scope
#[macro_reexport(macro_one)]
//~ ERROR cannot find attribute `macro_reexport` in this scope
extern
crate
two_macros
;
fn
main
()
{}
src/test/ui/macros/macro-reexport-removed.stderr
浏览文件 @
42a19dde
...
...
@@ -10,7 +10,7 @@ note: subsumed by `pub use`
LL | #![feature(macro_reexport)]
| ^^^^^^^^^^^^^^
error: cannot find attribute
macro
`macro_reexport` in this scope
error: cannot find attribute `macro_reexport` in this scope
--> $DIR/macro-reexport-removed.rs:5:3
|
LL | #[macro_reexport(macro_one)]
...
...
src/test/ui/proc-macro/derive-still-gated.rs
浏览文件 @
42a19dde
...
...
@@ -3,7 +3,7 @@
#[macro_use]
extern
crate
test_macros
;
#[derive_Empty]
//~ ERROR cannot find attribute
macro
`derive_Empty` in this scope
#[derive_Empty]
//~ ERROR cannot find attribute `derive_Empty` in this scope
struct
A
;
fn
main
()
{}
src/test/ui/proc-macro/derive-still-gated.stderr
浏览文件 @
42a19dde
error: cannot find attribute
macro
`derive_Empty` in this scope
error: cannot find attribute `derive_Empty` in this scope
--> $DIR/derive-still-gated.rs:6:3
|
LL | #[derive_Empty]
...
...
src/test/ui/proc-macro/macro-namespace-reserved-2.rs
浏览文件 @
42a19dde
...
...
@@ -35,7 +35,7 @@ fn check_bang3() {
//~| ERROR expected macro, found derive macro `crate::MyTrait`
}
#[my_macro]
//~ ERROR cannot find attribute
macro
`my_macro` in this scope
#[my_macro]
//~ ERROR cannot find attribute `my_macro` in this scope
#[crate::my_macro]
//~ ERROR can't use a procedural macro from the same crate that defines it
//~| ERROR expected attribute, found macro `crate::my_macro`
fn
check_attr1
()
{}
...
...
src/test/ui/proc-macro/macro-namespace-reserved-2.stderr
浏览文件 @
42a19dde
...
...
@@ -100,7 +100,7 @@ error: cannot find macro `MyTrait!` in this scope
LL | MyTrait!();
| ^^^^^^^
error: cannot find attribute
macro
`my_macro` in this scope
error: cannot find attribute `my_macro` in this scope
--> $DIR/macro-namespace-reserved-2.rs:38:3
|
LL | #[my_macro]
...
...
src/test/ui/proc-macro/proc-macro-attributes.rs
浏览文件 @
42a19dde
...
...
@@ -4,7 +4,7 @@
extern
crate
derive_b
;
#[B]
//~ ERROR `B` is ambiguous
#[C]
//~ ERROR cannot find attribute
macro
`C` in this scope
#[C]
//~ ERROR cannot find attribute `C` in this scope
#[B(D)]
//~ ERROR `B` is ambiguous
#[B(E
=
"foo"
)]
//~ ERROR `B` is ambiguous
#[B(arbitrary
tokens)]
//~ ERROR `B` is ambiguous
...
...
src/test/ui/proc-macro/proc-macro-attributes.stderr
浏览文件 @
42a19dde
error: cannot find attribute
macro
`C` in this scope
error: cannot find attribute `C` in this scope
--> $DIR/proc-macro-attributes.rs:7:3
|
LL | #[C]
...
...
src/test/ui/proc-macro/resolve-error.rs
浏览文件 @
42a19dde
...
...
@@ -24,11 +24,11 @@
struct
Foo
;
// Interpreted as an unstable custom attribute
#[attr_proc_macra]
//~ ERROR cannot find attribute
macro
`attr_proc_macra` in this scope
#[attr_proc_macra]
//~ ERROR cannot find attribute `attr_proc_macra` in this scope
struct
Bar
;
// Interpreted as an unstable custom attribute
#[FooWithLongNan]
//~ ERROR cannot find attribute
macro
`FooWithLongNan` in this scope
#[FooWithLongNan]
//~ ERROR cannot find attribute `FooWithLongNan` in this scope
struct
Asdf
;
#[derive(Dlone)]
...
...
src/test/ui/proc-macro/resolve-error.stderr
浏览文件 @
42a19dde
...
...
@@ -40,13 +40,13 @@ error: cannot find derive macro `Dlone` in this scope
LL | #[derive(Dlone)]
| ^^^^^ help: a derive macro with a similar name exists: `Clone`
error: cannot find attribute
macro
`FooWithLongNan` in this scope
error: cannot find attribute `FooWithLongNan` in this scope
--> $DIR/resolve-error.rs:31:3
|
LL | #[FooWithLongNan]
| ^^^^^^^^^^^^^^
error: cannot find attribute
macro
`attr_proc_macra` in this scope
error: cannot find attribute `attr_proc_macra` in this scope
--> $DIR/resolve-error.rs:27:3
|
LL | #[attr_proc_macra]
...
...
src/test/ui/reserved/reserved-attr-on-macro.rs
浏览文件 @
42a19dde
#[rustc_attribute_should_be_reserved]
//~^ ERROR cannot find attribute
macro
`rustc_attribute_should_be_reserved` in this scope
//~^ ERROR cannot find attribute `rustc_attribute_should_be_reserved` in this scope
//~| ERROR attributes starting with `rustc` are reserved for use by the `rustc` compiler
macro_rules!
foo
{
...
...
src/test/ui/reserved/reserved-attr-on-macro.stderr
浏览文件 @
42a19dde
...
...
@@ -15,7 +15,7 @@ LL | foo!();
|
= note: import resolution is stuck, try simplifying macro imports
error: cannot find attribute
macro
`rustc_attribute_should_be_reserved` in this scope
error: cannot find attribute `rustc_attribute_should_be_reserved` in this scope
--> $DIR/reserved-attr-on-macro.rs:1:3
|
LL | #[rustc_attribute_should_be_reserved]
...
...
src/test/ui/suggestions/attribute-typos.rs
浏览文件 @
42a19dde
#[deprcated]
//~ ERROR cannot find attribute
macro
`deprcated` in this scope
#[deprcated]
//~ ERROR cannot find attribute `deprcated` in this scope
fn
foo
()
{}
#[tests]
//~ ERROR cannot find attribute
macro
`tests` in this scope
#[tests]
//~ ERROR cannot find attribute `tests` in this scope
fn
bar
()
{}
#[rustc_err]
//~^ ERROR cannot find attribute
macro
`rustc_err` in this scope
//~^ ERROR cannot find attribute `rustc_err` in this scope
//~| ERROR attributes starting with `rustc` are reserved for use by the `rustc` compiler
fn
main
()
{}
src/test/ui/suggestions/attribute-typos.stderr
浏览文件 @
42a19dde
...
...
@@ -7,19 +7,19 @@ LL | #[rustc_err]
= note: for more information, see https://github.com/rust-lang/rust/issues/29642
= help: add `#![feature(rustc_attrs)]` to the crate attributes to enable
error: cannot find attribute
macro
`rustc_err` in this scope
error: cannot find attribute `rustc_err` in this scope
--> $DIR/attribute-typos.rs:7:3
|
LL | #[rustc_err]
| ^^^^^^^^^ help: a built-in attribute with a similar name exists: `rustc_error`
error: cannot find attribute
macro
`tests` in this scope
error: cannot find attribute `tests` in this scope
--> $DIR/attribute-typos.rs:4:3
|
LL | #[tests]
| ^^^^^ help: an attribute macro with a similar name exists: `test`
error: cannot find attribute
macro
`deprcated` in this scope
error: cannot find attribute `deprcated` in this scope
--> $DIR/attribute-typos.rs:1:3
|
LL | #[deprcated]
...
...
src/test/ui/tool-attributes/tool-attributes-misplaced-1.rs
浏览文件 @
42a19dde
...
...
@@ -5,7 +5,7 @@
struct
S
;
// Interpreted as an unstable custom attribute
#[rustfmt]
//~ ERROR cannot find attribute
macro
`rustfmt` in this scope
#[rustfmt]
//~ ERROR cannot find attribute `rustfmt` in this scope
fn
check
()
{}
#[rustfmt::skip]
// OK
...
...
src/test/ui/tool-attributes/tool-attributes-misplaced-1.stderr
浏览文件 @
42a19dde
...
...
@@ -4,7 +4,7 @@ error: cannot find derive macro `rustfmt` in this scope
LL | #[derive(rustfmt)]
| ^^^^^^^
error: cannot find attribute
macro
`rustfmt` in this scope
error: cannot find attribute `rustfmt` in this scope
--> $DIR/tool-attributes-misplaced-1.rs:8:3
|
LL | #[rustfmt]
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录