Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
394945ee
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,发现更多精彩内容 >>
提交
394945ee
编写于
5月 02, 2018
作者:
A
Alex Burka
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
stabilize :lifetime
上级
9fae1537
变更
12
隐藏空白更改
内联
并排
Showing
12 changed file
with
4 addition
and
64 deletion
+4
-64
src/doc/unstable-book/src/language-features/macro-lifetime-matcher.md
...able-book/src/language-features/macro-lifetime-matcher.md
+0
-14
src/librustc/lib.rs
src/librustc/lib.rs
+0
-1
src/librustc_metadata/lib.rs
src/librustc_metadata/lib.rs
+0
-2
src/librustc_save_analysis/lib.rs
src/librustc_save_analysis/lib.rs
+0
-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/run-pass/macro-lifetime-used-with-bound.rs
src/test/run-pass/macro-lifetime-used-with-bound.rs
+0
-2
src/test/run-pass/macro-lifetime-used-with-labels.rs
src/test/run-pass/macro-lifetime-used-with-labels.rs
+0
-1
src/test/run-pass/macro-lifetime-used-with-static.rs
src/test/run-pass/macro-lifetime-used-with-static.rs
+0
-2
src/test/run-pass/macro-lifetime.rs
src/test/run-pass/macro-lifetime.rs
+0
-2
src/test/ui/feature-gate-macro-lifetime-matcher.rs
src/test/ui/feature-gate-macro-lifetime-matcher.rs
+0
-19
src/test/ui/macros/nonterminal-matching.rs
src/test/ui/macros/nonterminal-matching.rs
+1
-1
未找到文件。
src/doc/unstable-book/src/language-features/macro-lifetime-matcher.md
已删除
100644 → 0
浏览文件 @
9fae1537
# `macro_lifetime_matcher`
The tracking issue for this feature is: [#46895]
With this feature gate enabled, the
[
list of fragment specifiers
][
frags
]
gains one more entry:
*
`lifetime`
: a lifetime. Examples: 'static, 'a.
A
`lifetime`
variable may be followed by anything.
[
#46895
]:
https://github.com/rust-lang/rust/issues/46895
[
frags
]:
../book/first-edition/macros.html#syntactic-requirements
------------------------
src/librustc/lib.rs
浏览文件 @
394945ee
...
...
@@ -50,7 +50,6 @@
#![feature(from_ref)]
#![feature(fs_read_write)]
#![cfg_attr(windows,
feature(libc))]
#![feature(macro_lifetime_matcher)]
#![feature(macro_vis_matcher)]
#![feature(never_type)]
#![feature(exhaustive_patterns)]
...
...
src/librustc_metadata/lib.rs
浏览文件 @
394945ee
...
...
@@ -15,9 +15,7 @@
#![feature(box_patterns)]
#![feature(fs_read_write)]
#![feature(libc)]
#![feature(macro_lifetime_matcher)]
#![feature(proc_macro_internals)]
#![feature(macro_lifetime_matcher)]
#![feature(quote)]
#![feature(rustc_diagnostic_macros)]
#![feature(slice_sort_by_cached_key)]
...
...
src/librustc_save_analysis/lib.rs
浏览文件 @
394945ee
...
...
@@ -12,7 +12,6 @@
html_favicon_url
=
"https://doc.rust-lang.org/favicon.ico"
,
html_root_url
=
"https://doc.rust-lang.org/nightly/"
)]
#![feature(custom_attribute)]
#![feature(macro_lifetime_matcher)]
#![allow(unused_attributes)]
#[macro_use]
...
...
src/libsyntax/ext/tt/macro_rules.rs
浏览文件 @
394945ee
...
...
@@ -904,20 +904,8 @@ fn is_legal_fragment_specifier(sess: &ParseSess,
frag_name
:
&
str
,
frag_span
:
Span
)
->
bool
{
match
frag_name
{
"item"
|
"block"
|
"stmt"
|
"expr"
|
"pat"
|
"item"
|
"block"
|
"stmt"
|
"expr"
|
"pat"
|
"lifetime"
|
"path"
|
"ty"
|
"ident"
|
"meta"
|
"tt"
|
""
=>
true
,
"lifetime"
=>
{
if
!
features
.macro_lifetime_matcher
&&
!
attr
::
contains_name
(
attrs
,
"allow_internal_unstable"
)
{
let
explain
=
feature_gate
::
EXPLAIN_LIFETIME_MATCHER
;
emit_feature_err
(
sess
,
"macro_lifetime_matcher"
,
frag_span
,
GateIssue
::
Language
,
explain
);
}
true
},
"literal"
=>
{
if
!
features
.macro_literal_matcher
&&
!
attr
::
contains_name
(
attrs
,
"allow_internal_unstable"
)
{
...
...
src/libsyntax/feature_gate.rs
浏览文件 @
394945ee
...
...
@@ -396,9 +396,6 @@ pub fn walk_feature_fields<F>(&self, mut f: F)
// Termination trait in tests (RFC 1937)
(
active
,
termination_trait_test
,
"1.24.0"
,
Some
(
48854
),
Some
(
Edition
::
Edition2018
)),
// Allows use of the :lifetime macro fragment specifier
(
active
,
macro_lifetime_matcher
,
"1.24.0"
,
Some
(
46895
),
None
),
// `extern` in paths
(
active
,
extern_in_paths
,
"1.23.0"
,
Some
(
44660
),
None
),
...
...
@@ -598,6 +595,8 @@ pub fn walk_feature_fields<F>(&self, mut f: F)
(
accepted
,
dyn_trait
,
"1.27.0"
,
Some
(
44662
),
None
),
// allow `#[must_use]` on functions; and, must-use operators (RFC 1940)
(
accepted
,
fn_must_use
,
"1.27.0"
,
Some
(
43302
),
None
),
// Allows use of the :lifetime macro fragment specifier
(
accepted
,
macro_lifetime_matcher
,
"1.27.0"
,
Some
(
34303
),
None
),
);
// If you change this, please modify src/doc/unstable-book as well. You must
...
...
@@ -1331,9 +1330,6 @@ fn leveled_feature_err<'a>(sess: &'a ParseSess, feature: &str, span: Span, issue
pub
const
EXPLAIN_VIS_MATCHER
:
&
'static
str
=
":vis fragment specifier is experimental and subject to change"
;
pub
const
EXPLAIN_LIFETIME_MATCHER
:
&
'static
str
=
":lifetime 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/run-pass/macro-lifetime-used-with-bound.rs
浏览文件 @
394945ee
...
...
@@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(macro_lifetime_matcher)]
macro_rules!
foo
{
(
$l:lifetime
,
$l2:lifetime
)
=>
{
fn
f
<
$l
:
$l2
,
$l2
>
(
arg
:
&
$l
str
,
arg2
:
&
$l2
str
)
->
&
$l
str
{
...
...
src/test/run-pass/macro-lifetime-used-with-labels.rs
浏览文件 @
394945ee
...
...
@@ -9,7 +9,6 @@
// except according to those terms.
#![allow(unreachable_code)]
#![feature(macro_lifetime_matcher)]
macro_rules!
x
{
(
$a:lifetime
)
=>
{
...
...
src/test/run-pass/macro-lifetime-used-with-static.rs
浏览文件 @
394945ee
...
...
@@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(macro_lifetime_matcher)]
macro_rules!
foo
{
(
$l:lifetime
)
=>
{
fn
f
(
arg
:
&
$l
str
)
->
&
$l
str
{
...
...
src/test/run-pass/macro-lifetime.rs
浏览文件 @
394945ee
...
...
@@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(macro_lifetime_matcher)]
macro_rules!
foo
{
(
$l:lifetime
)
=>
{
fn
f
<
$l
>
(
arg
:
&
$l
str
)
->
&
$l
str
{
...
...
src/test/ui/feature-gate-macro-lifetime-matcher.rs
已删除
100644 → 0
浏览文件 @
9fae1537
// 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 :lifetime macro fragment cannot be used when macro_lifetime_matcher
// feature gate is not used.
macro_rules!
m
{
(
$lt:lifetime
)
=>
{}
}
//~^ ERROR :lifetime fragment specifier is experimental and subject to change
fn
main
()
{
m!
(
'a
);
}
src/test/ui/macros/nonterminal-matching.rs
浏览文件 @
394945ee
...
...
@@ -11,7 +11,7 @@
// Check that we are refusing to match on complex nonterminals for which tokens are
// unavailable and we'd have to go through AST comparisons.
#![feature(decl_macro
,
macro_lifetime_matcher
)]
#![feature(decl_macro)]
macro
simple_nonterminal
(
$
nt_ident
:
ident
,
$
nt_lifetime
:
lifetime
,
$
nt_tt
:
tt
)
{
macro
n
(
a
$
nt_ident
b
$
nt_lifetime
c
$
nt_tt
d
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录