Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
00920c00
R
Rust
项目概览
int
/
Rust
11 个月 前同步成功
通知
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,发现更多精彩内容 >>
提交
00920c00
编写于
8月 15, 2018
作者:
J
Jakub Kozlowski
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Stabilize macro_vis_matcher
上级
b3559069
变更
24
隐藏空白更改
内联
并排
Showing
24 changed file
with
22 addition
and
82 deletion
+22
-82
src/doc/unstable-book/src/language-features/macro-vis-matcher.md
.../unstable-book/src/language-features/macro-vis-matcher.md
+0
-14
src/doc/unstable-book/src/language-features/plugin.md
src/doc/unstable-book/src/language-features/plugin.md
+0
-1
src/librustc/lib.rs
src/librustc/lib.rs
+1
-1
src/librustc_data_structures/lib.rs
src/librustc_data_structures/lib.rs
+1
-1
src/librustc_lint/lib.rs
src/librustc_lint/lib.rs
+1
-1
src/librustc_mir/lib.rs
src/librustc_mir/lib.rs
+1
-1
src/libstd/lib.rs
src/libstd/lib.rs
+1
-1
src/libsyntax/ext/tt/macro_rules.rs
src/libsyntax/ext/tt/macro_rules.rs
+1
-13
src/libsyntax/feature_gate.rs
src/libsyntax/feature_gate.rs
+2
-6
src/test/compile-fail-fulldeps/auxiliary/lint_for_crate.rs
src/test/compile-fail-fulldeps/auxiliary/lint_for_crate.rs
+1
-1
src/test/compile-fail-fulldeps/auxiliary/lint_group_plugin_test.rs
...compile-fail-fulldeps/auxiliary/lint_group_plugin_test.rs
+1
-1
src/test/compile-fail-fulldeps/auxiliary/lint_plugin_test.rs
src/test/compile-fail-fulldeps/auxiliary/lint_plugin_test.rs
+1
-1
src/test/run-pass-fulldeps/auxiliary/lint_for_crate.rs
src/test/run-pass-fulldeps/auxiliary/lint_for_crate.rs
+1
-1
src/test/run-pass-fulldeps/proc-macro/auxiliary/issue-40001-plugin.rs
...-pass-fulldeps/proc-macro/auxiliary/issue-40001-plugin.rs
+1
-1
src/test/run-pass/macro-first-set.rs
src/test/run-pass/macro-first-set.rs
+1
-1
src/test/run-pass/macro-pub-matcher.rs
src/test/run-pass/macro-pub-matcher.rs
+2
-1
src/test/ui-fulldeps/auxiliary/lint_group_plugin_test.rs
src/test/ui-fulldeps/auxiliary/lint_group_plugin_test.rs
+1
-1
src/test/ui-fulldeps/auxiliary/lint_plugin_test.rs
src/test/ui-fulldeps/auxiliary/lint_plugin_test.rs
+1
-1
src/test/ui-fulldeps/auxiliary/lint_tool_test.rs
src/test/ui-fulldeps/auxiliary/lint_tool_test.rs
+1
-1
src/test/ui/feature-gates/feature-gate-macro-vis-matcher.rs
src/test/ui/feature-gates/feature-gate-macro-vis-matcher.rs
+0
-19
src/test/ui/feature-gates/feature-gate-macro-vis-matcher.stderr
...st/ui/feature-gates/feature-gate-macro-vis-matcher.stderr
+0
-11
src/test/ui/issues/issue-42755.rs
src/test/ui/issues/issue-42755.rs
+1
-1
src/test/ui/lint/unreachable_pub-pub_crate.rs
src/test/ui/lint/unreachable_pub-pub_crate.rs
+1
-1
src/test/ui/lint/unreachable_pub.rs
src/test/ui/lint/unreachable_pub.rs
+1
-1
未找到文件。
src/doc/unstable-book/src/language-features/macro-vis-matcher.md
已删除
100644 → 0
浏览文件 @
b3559069
# `macro_vis_matcher`
The tracking issue for this feature is: [#41022]
With this feature gate enabled, the
[
list of fragment specifiers
][
frags
]
gains one more entry:
*
`vis`
: a visibility qualifier. Examples: nothing (default visibility);
`pub`
;
`pub(crate)`
.
A
`vis`
variable may be followed by a comma, ident, type, or path.
[
#41022
]:
https://github.com/rust-lang/rust/issues/41022
[
frags
]:
../book/first-edition/macros.html#syntactic-requirements
------------------------
src/doc/unstable-book/src/language-features/plugin.md
浏览文件 @
00920c00
...
...
@@ -183,7 +183,6 @@ that warns about any item named `lintme`.
```
rust,ignore
#![feature(plugin_registrar)]
#![feature(box_syntax,
rustc_private)]
#![feature(macro_vis_matcher)]
#![feature(macro_at_most_once_rep)]
extern
crate
syntax
;
...
...
src/librustc/lib.rs
浏览文件 @
00920c00
...
...
@@ -47,7 +47,7 @@
#![feature(drain_filter)]
#![feature(iterator_find_map)]
#![cfg_attr(windows,
feature(libc))]
#![
feature(macro_vis_matcher
)]
#![
cfg_attr(stage0,
feature(macro_vis_matcher)
)]
#![feature(never_type)]
#![feature(exhaustive_patterns)]
#![feature(extern_types)]
...
...
src/librustc_data_structures/lib.rs
浏览文件 @
00920c00
...
...
@@ -25,7 +25,7 @@
#![feature(unsize)]
#![feature(specialization)]
#![feature(optin_builtin_traits)]
#![
feature(macro_vis_matcher
)]
#![
cfg_attr(stage0,
feature(macro_vis_matcher)
)]
#![cfg_attr(not(stage0),
feature(nll))]
#![feature(allow_internal_unstable)]
#![feature(vec_resize_with)]
...
...
src/librustc_lint/lib.rs
浏览文件 @
00920c00
...
...
@@ -26,7 +26,7 @@
#![cfg_attr(test,
feature(test))]
#![feature(box_patterns)]
#![feature(box_syntax)]
#![
feature(macro_vis_matcher
)]
#![
cfg_attr(stage0,
feature(macro_vis_matcher)
)]
#![cfg_attr(not(stage0),
feature(nll))]
#![feature(quote)]
#![feature(rustc_diagnostic_macros)]
...
...
src/librustc_mir/lib.rs
浏览文件 @
00920c00
...
...
@@ -26,7 +26,7 @@
#![feature(const_fn)]
#![feature(core_intrinsics)]
#![feature(decl_macro)]
#![
feature(macro_vis_matcher
)]
#![
cfg_attr(stage0,
feature(macro_vis_matcher)
)]
#![feature(exhaustive_patterns)]
#![feature(range_contains)]
#![feature(rustc_diagnostic_macros)]
...
...
src/libstd/lib.rs
浏览文件 @
00920c00
...
...
@@ -270,7 +270,7 @@
#![feature(libc)]
#![feature(link_args)]
#![feature(linkage)]
#![
feature(macro_vis_matcher
)]
#![
cfg_attr(stage0,
feature(macro_vis_matcher)
)]
#![feature(needs_panic_runtime)]
#![feature(never_type)]
#![cfg_attr(not(stage0),
feature(nll))]
...
...
src/libsyntax/ext/tt/macro_rules.rs
浏览文件 @
00920c00
...
...
@@ -964,7 +964,7 @@ fn is_legal_fragment_specifier(sess: &ParseSess,
frag_span
:
Span
)
->
bool
{
match
frag_name
{
"item"
|
"block"
|
"stmt"
|
"expr"
|
"pat"
|
"lifetime"
|
"path"
|
"ty"
|
"ident"
|
"meta"
|
"tt"
|
""
=>
true
,
"path"
|
"ty"
|
"ident"
|
"meta"
|
"tt"
|
"
vis"
|
"
"
=>
true
,
"literal"
=>
{
if
!
features
.macro_literal_matcher
&&
!
attr
::
contains_name
(
attrs
,
"allow_internal_unstable"
)
{
...
...
@@ -977,18 +977,6 @@ fn is_legal_fragment_specifier(sess: &ParseSess,
}
true
},
"vis"
=>
{
if
!
features
.macro_vis_matcher
&&
!
attr
::
contains_name
(
attrs
,
"allow_internal_unstable"
)
{
let
explain
=
feature_gate
::
EXPLAIN_VIS_MATCHER
;
emit_feature_err
(
sess
,
"macro_vis_matcher"
,
frag_span
,
GateIssue
::
Language
,
explain
);
}
true
},
_
=>
false
,
}
}
...
...
src/libsyntax/feature_gate.rs
浏览文件 @
00920c00
...
...
@@ -342,9 +342,6 @@ pub fn walk_feature_fields<F>(&self, mut f: F)
// Allows overlapping impls of marker traits
(
active
,
overlapping_marker_traits
,
"1.18.0"
,
Some
(
29864
),
None
),
// Allows use of the :vis macro fragment specifier
(
active
,
macro_vis_matcher
,
"1.18.0"
,
Some
(
41022
),
None
),
// rustc internal
(
active
,
abi_thiscall
,
"1.19.0"
,
None
,
None
),
...
...
@@ -648,6 +645,8 @@ pub fn walk_feature_fields<F>(&self, mut f: F)
(
accepted
,
repr_transparent
,
"1.28.0"
,
Some
(
43036
),
None
),
// Defining procedural macros in `proc-macro` crates
(
accepted
,
proc_macro
,
"1.29.0"
,
Some
(
38356
),
None
),
// Allows use of the :vis macro fragment specifier
(
accepted
,
macro_vis_matcher
,
"1.29.0"
,
Some
(
41022
),
None
),
// Allows importing and reexporting macros with `use`,
// enables macro modularization in general.
(
accepted
,
use_extern_macros
,
"1.30.0"
,
Some
(
35896
),
None
),
...
...
@@ -1363,9 +1362,6 @@ fn leveled_feature_err<'a>(sess: &'a ParseSess, feature: &str, span: Span, issue
pub
const
EXPLAIN_DERIVE_UNDERSCORE
:
&
'static
str
=
"attributes of the form `#[derive_*]` are reserved for the compiler"
;
pub
const
EXPLAIN_VIS_MATCHER
:
&
'static
str
=
":vis fragment specifier is experimental and subject to change"
;
pub
const
EXPLAIN_LITERAL_MATCHER
:
&
'static
str
=
":literal fragment specifier is experimental and subject to change"
;
...
...
src/test/compile-fail-fulldeps/auxiliary/lint_for_crate.rs
浏览文件 @
00920c00
...
...
@@ -12,7 +12,7 @@
#![feature(plugin_registrar,
rustc_private)]
#![feature(box_syntax)]
#![
feature(macro_vis_matcher
)]
#![
cfg_attr(stage0,
feature(macro_vis_matcher)
)]
#![feature(macro_at_most_once_rep)]
#[macro_use]
extern
crate
rustc
;
...
...
src/test/compile-fail-fulldeps/auxiliary/lint_group_plugin_test.rs
浏览文件 @
00920c00
...
...
@@ -12,7 +12,7 @@
#![feature(plugin_registrar)]
#![feature(box_syntax,
rustc_private)]
#![
feature(macro_vis_matcher
)]
#![
cfg_attr(stage0,
feature(macro_vis_matcher)
)]
#![feature(macro_at_most_once_rep)]
// Load rustc as a plugin to get macros
...
...
src/test/compile-fail-fulldeps/auxiliary/lint_plugin_test.rs
浏览文件 @
00920c00
...
...
@@ -12,7 +12,7 @@
#![feature(plugin_registrar)]
#![feature(box_syntax,
rustc_private)]
#![
feature(macro_vis_matcher
)]
#![
cfg_attr(stage0,
feature(macro_vis_matcher)
)]
#![feature(macro_at_most_once_rep)]
extern
crate
syntax
;
...
...
src/test/run-pass-fulldeps/auxiliary/lint_for_crate.rs
浏览文件 @
00920c00
...
...
@@ -12,7 +12,7 @@
#![feature(plugin_registrar,
rustc_private)]
#![feature(box_syntax)]
#![
feature(macro_vis_matcher
)]
#![
cfg_attr(stage0,
feature(macro_vis_matcher)
)]
#![feature(macro_at_most_once_rep)]
#[macro_use]
extern
crate
rustc
;
...
...
src/test/run-pass-fulldeps/proc-macro/auxiliary/issue-40001-plugin.rs
浏览文件 @
00920c00
...
...
@@ -9,7 +9,7 @@
// except according to those terms.
#![feature(box_syntax,
plugin,
plugin_registrar,
rustc_private)]
#![
feature(macro_vis_matcher
)]
#![
cfg_attr(stage0,
feature(macro_vis_matcher)
)]
#![feature(macro_at_most_once_rep)]
#![crate_type
=
"dylib"
]
...
...
src/test/run-pass/macro-first-set.rs
浏览文件 @
00920c00
...
...
@@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![
feature(macro_vis_matcher
)]
#![
cfg_attr(stage0,
feature(macro_vis_matcher)
)]
//{{{ issue 40569 ==============================================================
...
...
src/test/run-pass/macro-pub-matcher.rs
浏览文件 @
00920c00
...
...
@@ -9,7 +9,8 @@
// except according to those terms.
#![allow(dead_code,
unused_imports)]
#![feature(macro_vis_matcher,
crate_visibility_modifier)]
#![cfg_attr(stage0,
feature(macro_vis_matcher))]
#![feature(crate_visibility_modifier)]
/**
Ensure that `:vis` matches can be captured in existing positions, and passed
...
...
src/test/ui-fulldeps/auxiliary/lint_group_plugin_test.rs
浏览文件 @
00920c00
...
...
@@ -12,7 +12,7 @@
#![feature(plugin_registrar)]
#![feature(box_syntax,
rustc_private)]
#![
feature(macro_vis_matcher
)]
#![
cfg_attr(stage0,
feature(macro_vis_matcher)
)]
#![feature(macro_at_most_once_rep)]
// Load rustc as a plugin to get macros
...
...
src/test/ui-fulldeps/auxiliary/lint_plugin_test.rs
浏览文件 @
00920c00
...
...
@@ -12,7 +12,7 @@
#![feature(plugin_registrar)]
#![feature(box_syntax,
rustc_private)]
#![
feature(macro_vis_matcher
)]
#![
cfg_attr(stage0,
feature(macro_vis_matcher)
)]
#![feature(macro_at_most_once_rep)]
extern
crate
syntax
;
...
...
src/test/ui-fulldeps/auxiliary/lint_tool_test.rs
浏览文件 @
00920c00
...
...
@@ -10,7 +10,7 @@
#![feature(plugin_registrar)]
#![feature(box_syntax,
rustc_private)]
#![
feature(macro_vis_matcher
)]
#![
cfg_attr(stage0,
feature(macro_vis_matcher)
)]
#![feature(macro_at_most_once_rep)]
extern
crate
syntax
;
...
...
src/test/ui/feature-gates/feature-gate-macro-vis-matcher.rs
已删除
100644 → 0
浏览文件 @
b3559069
// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// Test that the MSP430 interrupt ABI cannot be used when msp430_interrupt
// feature gate is not used.
macro_rules!
m
{
(
$v:vis
)
=>
{}
}
//~^ ERROR :vis fragment specifier is experimental and subject to change
fn
main
()
{
m!
(
pub
);
}
src/test/ui/feature-gates/feature-gate-macro-vis-matcher.stderr
已删除
100644 → 0
浏览文件 @
b3559069
error[E0658]: :vis fragment specifier is experimental and subject to change (see issue #41022)
--> $DIR/feature-gate-macro-vis-matcher.rs:14:19
|
LL | macro_rules! m { ($v:vis) => {} }
| ^^^^^^
|
= help: add #![feature(macro_vis_matcher)] to the crate attributes to enable
error: aborting due to previous error
For more information about this error, try `rustc --explain E0658`.
src/test/ui/issues/issue-42755.rs
浏览文件 @
00920c00
...
...
@@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![
feature(macro_vis_matcher
)]
#![
cfg_attr(stage0,
feature(macro_vis_matcher)
)]
macro_rules!
foo
{
(
$
(
$p:vis
)
*
)
=>
{}
//~ ERROR repetition matches empty token tree
...
...
src/test/ui/lint/unreachable_pub-pub_crate.rs
浏览文件 @
00920c00
...
...
@@ -16,7 +16,7 @@
// compile-pass
#![
feature(macro_vis_matcher
)]
#![
cfg_attr(stage0,
feature(macro_vis_matcher)
)]
#![allow(unused)]
#![warn(unreachable_pub)]
...
...
src/test/ui/lint/unreachable_pub.rs
浏览文件 @
00920c00
...
...
@@ -11,7 +11,7 @@
// compile-pass
#![feature(crate_visibility_modifier)]
#![
feature(macro_vis_matcher
)]
#![
cfg_attr(stage0,
feature(macro_vis_matcher)
)]
#![allow(unused)]
#![warn(unreachable_pub)]
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录