Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
95f1866a
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,发现更多精彩内容 >>
提交
95f1866a
编写于
6月 14, 2018
作者:
V
varkor
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Make GenericBound explicit
上级
c5f16e0e
变更
13
隐藏空白更改
内联
并排
Showing
13 changed file
with
53 addition
and
56 deletion
+53
-56
src/librustc/hir/lowering.rs
src/librustc/hir/lowering.rs
+3
-3
src/librustc_passes/ast_validation.rs
src/librustc_passes/ast_validation.rs
+3
-3
src/librustc_save_analysis/dump_visitor.rs
src/librustc_save_analysis/dump_visitor.rs
+3
-5
src/librustdoc/clean/inline.rs
src/librustdoc/clean/inline.rs
+5
-5
src/librustdoc/clean/mod.rs
src/librustdoc/clean/mod.rs
+12
-11
src/librustdoc/clean/simplify.rs
src/librustdoc/clean/simplify.rs
+2
-2
src/librustdoc/html/format.rs
src/librustdoc/html/format.rs
+2
-2
src/libsyntax/ast.rs
src/libsyntax/ast.rs
+4
-5
src/libsyntax/ext/build.rs
src/libsyntax/ext/build.rs
+2
-1
src/libsyntax/fold.rs
src/libsyntax/fold.rs
+5
-3
src/libsyntax/parse/parser.rs
src/libsyntax/parse/parser.rs
+5
-5
src/libsyntax/print/pprust.rs
src/libsyntax/print/pprust.rs
+5
-5
src/libsyntax/visit.rs
src/libsyntax/visit.rs
+2
-6
未找到文件。
src/librustc/hir/lowering.rs
浏览文件 @
95f1866a
...
...
@@ -1109,11 +1109,11 @@ fn lower_ty(&mut self, t: &Ty, itctx: ImplTraitContext) -> P<hir::Ty> {
let
bounds
=
bounds
.iter
()
.filter_map
(|
bound
|
match
*
bound
{
Trait
(
ref
ty
,
TraitBoundModifier
::
None
)
=>
{
GenericBound
::
Trait
(
ref
ty
,
TraitBoundModifier
::
None
)
=>
{
Some
(
self
.lower_poly_trait_ref
(
ty
,
itctx
))
}
Trait
(
_
,
TraitBoundModifier
::
Maybe
)
=>
None
,
Outlives
(
ref
lifetime
)
=>
{
GenericBound
::
Trait
(
_
,
TraitBoundModifier
::
Maybe
)
=>
None
,
GenericBound
::
Outlives
(
ref
lifetime
)
=>
{
if
lifetime_bound
.is_none
()
{
lifetime_bound
=
Some
(
self
.lower_lifetime
(
lifetime
));
}
...
...
src/librustc_passes/ast_validation.rs
浏览文件 @
95f1866a
...
...
@@ -101,7 +101,7 @@ fn check_trait_fn_not_const(&self, constness: Spanned<Constness>) {
fn
no_questions_in_bounds
(
&
self
,
bounds
:
&
GenericBounds
,
where_
:
&
str
,
is_trait
:
bool
)
{
for
bound
in
bounds
{
if
let
Trait
(
ref
poly
,
TraitBoundModifier
::
Maybe
)
=
*
bound
{
if
let
GenericBound
::
Trait
(
ref
poly
,
TraitBoundModifier
::
Maybe
)
=
*
bound
{
let
mut
err
=
self
.err_handler
()
.struct_span_err
(
poly
.span
,
&
format!
(
"`?Trait` is not permitted in {}"
,
where_
));
if
is_trait
{
...
...
@@ -190,7 +190,7 @@ fn visit_ty(&mut self, ty: &'a Ty) {
TyKind
::
TraitObject
(
ref
bounds
,
..
)
=>
{
let
mut
any_lifetime_bounds
=
false
;
for
bound
in
bounds
{
if
let
Outlives
(
ref
lifetime
)
=
*
bound
{
if
let
GenericBound
::
Outlives
(
ref
lifetime
)
=
*
bound
{
if
any_lifetime_bounds
{
span_err!
(
self
.session
,
lifetime
.ident.span
,
E0226
,
"only a single explicit lifetime bound is permitted"
);
...
...
@@ -203,7 +203,7 @@ fn visit_ty(&mut self, ty: &'a Ty) {
}
TyKind
::
ImplTrait
(
ref
bounds
)
=>
{
if
!
bounds
.iter
()
.any
(|
b
|
if
let
Trait
(
..
)
=
*
b
{
true
}
else
{
false
})
{
.any
(|
b
|
if
let
GenericBound
::
Trait
(
..
)
=
*
b
{
true
}
else
{
false
})
{
self
.err_handler
()
.span_err
(
ty
.span
,
"at least one trait must be specified"
);
}
}
...
...
src/librustc_save_analysis/dump_visitor.rs
浏览文件 @
95f1866a
...
...
@@ -761,10 +761,8 @@ fn process_trait(
// super-traits
for
super_bound
in
trait_refs
.iter
()
{
let
trait_ref
=
match
*
super_bound
{
ast
::
Trait
(
ref
trait_ref
,
_
)
=>
trait_ref
,
ast
::
Outlives
(
..
)
=>
{
continue
;
}
ast
::
GenericBound
::
Trait
(
ref
trait_ref
,
_
)
=>
trait_ref
,
ast
::
GenericBound
::
Outlives
(
..
)
=>
continue
,
};
let
trait_ref
=
&
trait_ref
.trait_ref
;
...
...
@@ -1489,7 +1487,7 @@ fn visit_generics(&mut self, generics: &'l ast::Generics) {
ast
::
GenericParamKind
::
Lifetime
{
..
}
=>
{}
ast
::
GenericParamKind
::
Type
{
ref
default
,
..
}
=>
{
for
bound
in
&
param
.bounds
{
if
let
ast
::
Trait
(
ref
trait_ref
,
_
)
=
*
bound
{
if
let
ast
::
GenericBound
::
Trait
(
ref
trait_ref
,
_
)
=
*
bound
{
self
.process_path
(
trait_ref
.trait_ref.ref_id
,
&
trait_ref
.trait_ref.path
)
}
}
...
...
src/librustdoc/clean/inline.rs
浏览文件 @
95f1866a
...
...
@@ -374,8 +374,8 @@ pub fn build_impl(cx: &DocContext, did: DefId, ret: &mut Vec<clean::Item>) {
let
polarity
=
tcx
.impl_polarity
(
did
);
let
trait_
=
associated_trait
.clean
(
cx
)
.map
(|
bound
|
{
match
bound
{
clean
::
TraitBound
(
polyt
,
_
)
=>
polyt
.trait_
,
clean
::
Outlives
(
..
)
=>
unreachable!
(),
clean
::
GenericBound
::
TraitBound
(
polyt
,
_
)
=>
polyt
.trait_
,
clean
::
GenericBound
::
Outlives
(
..
)
=>
unreachable!
(),
}
});
if
trait_
.def_id
()
==
tcx
.lang_items
()
.deref_trait
()
{
...
...
@@ -387,9 +387,9 @@ pub fn build_impl(cx: &DocContext, did: DefId, ret: &mut Vec<clean::Item>) {
let
provided
=
trait_
.def_id
()
.map
(|
did
|
{
tcx
.provided_trait_methods
(
did
)
.into_iter
()
.map
(|
meth
|
meth
.name
.to_string
())
.collect
()
.into_iter
()
.map
(|
meth
|
meth
.name
.to_string
())
.collect
()
})
.unwrap_or
(
FxHashSet
());
ret
.push
(
clean
::
Item
{
...
...
src/librustdoc/clean/mod.rs
浏览文件 @
95f1866a
...
...
@@ -14,7 +14,6 @@
pub
use
self
::
Type
::
*
;
pub
use
self
::
Mutability
::
*
;
pub
use
self
::
ItemEnum
::
*
;
pub
use
self
::
GenericBound
::
*
;
pub
use
self
::
SelfTy
::
*
;
pub
use
self
::
FunctionRetTy
::
*
;
pub
use
self
::
Visibility
::{
Public
,
Inherited
};
...
...
@@ -1470,7 +1469,7 @@ fn maybe_sized(cx: &DocContext) -> GenericBound {
let
path
=
external_path
(
cx
,
&
cx
.tcx
.item_name
(
did
)
.as_str
(),
Some
(
did
),
false
,
vec!
[],
empty
);
inline
::
record_extern_fqn
(
cx
,
did
,
TypeKind
::
Trait
);
TraitBound
(
PolyTrait
{
GenericBound
::
TraitBound
(
PolyTrait
{
trait_
:
ResolvedPath
{
path
,
typarams
:
None
,
...
...
@@ -1510,8 +1509,10 @@ fn get_trait_type(&self) -> Option<Type> {
impl
Clean
<
GenericBound
>
for
hir
::
GenericBound
{
fn
clean
(
&
self
,
cx
:
&
DocContext
)
->
GenericBound
{
match
*
self
{
hir
::
GenericBound
::
Outlives
(
lt
)
=>
Outlives
(
lt
.clean
(
cx
)),
hir
::
GenericBound
::
Trait
(
ref
t
,
modifier
)
=>
TraitBound
(
t
.clean
(
cx
),
modifier
),
hir
::
GenericBound
::
Outlives
(
lt
)
=>
GenericBound
::
Outlives
(
lt
.clean
(
cx
)),
hir
::
GenericBound
::
Trait
(
ref
t
,
modifier
)
=>
{
GenericBound
::
TraitBound
(
t
.clean
(
cx
),
modifier
)
}
}
}
}
...
...
@@ -1599,7 +1600,7 @@ fn clean(&self, cx: &DocContext) -> GenericBound {
}
}
TraitBound
(
GenericBound
::
TraitBound
(
PolyTrait
{
trait_
:
ResolvedPath
{
path
,
...
...
@@ -1623,9 +1624,8 @@ fn clean(&self, cx: &DocContext) -> GenericBound {
impl
<
'tcx
>
Clean
<
Option
<
Vec
<
GenericBound
>>>
for
Substs
<
'tcx
>
{
fn
clean
(
&
self
,
cx
:
&
DocContext
)
->
Option
<
Vec
<
GenericBound
>>
{
let
mut
v
=
Vec
::
new
();
v
.extend
(
self
.regions
()
.filter_map
(|
r
|
r
.clean
(
cx
))
.map
(
GenericBound
::
Outlives
));
v
.extend
(
self
.types
()
.map
(|
t
|
TraitBound
(
PolyTrait
{
v
.extend
(
self
.regions
()
.filter_map
(|
r
|
r
.clean
(
cx
))
.map
(
GenericBound
::
Outlives
));
v
.extend
(
self
.types
()
.map
(|
t
|
GenericBound
::
TraitBound
(
PolyTrait
{
trait_
:
t
.clean
(
cx
),
generic_params
:
Vec
::
new
(),
},
hir
::
TraitBoundModifier
::
None
)));
...
...
@@ -2978,10 +2978,11 @@ fn clean(&self, cx: &DocContext) -> Type {
match
bounds
[
0
]
.clean
(
cx
)
.trait_
{
ResolvedPath
{
path
,
typarams
:
None
,
did
,
is_generic
}
=>
{
let
mut
bounds
:
Vec
<
self
::
GenericBound
>
=
bounds
[
1
..
]
.iter
()
.map
(|
bound
|
{
TraitBound
(
bound
.clean
(
cx
),
hir
::
TraitBoundModifier
::
None
)
self
::
GenericBound
::
TraitBound
(
bound
.clean
(
cx
),
hir
::
TraitBoundModifier
::
None
)
})
.collect
();
if
!
lifetime
.is_elided
()
{
bounds
.push
(
self
::
Outlives
(
lifetime
.clean
(
cx
)));
bounds
.push
(
self
::
GenericBound
::
Outlives
(
lifetime
.clean
(
cx
)));
}
ResolvedPath
{
path
,
typarams
:
Some
(
bounds
),
did
,
is_generic
,
}
}
...
...
@@ -3086,7 +3087,7 @@ fn clean(&self, cx: &DocContext) -> Type {
let
path
=
external_path
(
cx
,
&
cx
.tcx
.item_name
(
did
)
.as_str
(),
Some
(
did
),
false
,
vec!
[],
empty
);
inline
::
record_extern_fqn
(
cx
,
did
,
TypeKind
::
Trait
);
let
bound
=
TraitBound
(
PolyTrait
{
let
bound
=
GenericBound
::
TraitBound
(
PolyTrait
{
trait_
:
ResolvedPath
{
path
,
typarams
:
None
,
...
...
src/librustdoc/clean/simplify.rs
浏览文件 @
95f1866a
...
...
@@ -83,8 +83,8 @@ pub fn where_clauses(cx: &DocContext, clauses: Vec<WP>) -> Vec<WP> {
};
!
bounds
.iter_mut
()
.any
(|
b
|
{
let
trait_ref
=
match
*
b
{
clean
::
TraitBound
(
ref
mut
tr
,
_
)
=>
tr
,
clean
::
Outlives
(
..
)
=>
return
false
,
clean
::
GenericBound
::
TraitBound
(
ref
mut
tr
,
_
)
=>
tr
,
clean
::
GenericBound
::
Outlives
(
..
)
=>
return
false
,
};
let
(
did
,
path
)
=
match
trait_ref
.trait_
{
clean
::
ResolvedPath
{
did
,
ref
mut
path
,
..
}
=>
(
did
,
path
),
...
...
src/librustdoc/html/format.rs
浏览文件 @
95f1866a
...
...
@@ -270,10 +270,10 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
impl
fmt
::
Display
for
clean
::
GenericBound
{
fn
fmt
(
&
self
,
f
:
&
mut
fmt
::
Formatter
)
->
fmt
::
Result
{
match
*
self
{
clean
::
Outlives
(
ref
lt
)
=>
{
clean
::
GenericBound
::
Outlives
(
ref
lt
)
=>
{
write!
(
f
,
"{}"
,
*
lt
)
}
clean
::
TraitBound
(
ref
ty
,
modifier
)
=>
{
clean
::
GenericBound
::
TraitBound
(
ref
ty
,
modifier
)
=>
{
let
modifier_str
=
match
modifier
{
hir
::
TraitBoundModifier
::
None
=>
""
,
hir
::
TraitBoundModifier
::
Maybe
=>
"?"
,
...
...
src/libsyntax/ast.rs
浏览文件 @
95f1866a
...
...
@@ -10,7 +10,6 @@
// The Rust abstract syntax tree.
pub
use
self
::
GenericBound
::
*
;
pub
use
self
::
UnsafeSource
::
*
;
pub
use
self
::
GenericArgs
::
*
;
pub
use
symbol
::{
Ident
,
Symbol
as
Name
};
...
...
@@ -290,8 +289,8 @@ pub enum GenericBound {
impl
GenericBound
{
pub
fn
span
(
&
self
)
->
Span
{
match
self
{
&
Trait
(
ref
t
,
..
)
=>
t
.span
,
&
Outlives
(
ref
l
)
=>
l
.ident.span
,
&
GenericBound
::
Trait
(
ref
t
,
..
)
=>
t
.span
,
&
GenericBound
::
Outlives
(
ref
l
)
=>
l
.ident.span
,
}
}
}
...
...
@@ -930,8 +929,8 @@ pub fn returns(&self) -> bool {
fn
to_bound
(
&
self
)
->
Option
<
GenericBound
>
{
match
&
self
.node
{
ExprKind
::
Path
(
None
,
path
)
=>
Some
(
Trait
(
PolyTraitRef
::
new
(
Vec
::
new
(),
path
.clone
(),
self
.span
),
TraitBoundModifier
::
None
)),
Some
(
GenericBound
::
Trait
(
PolyTraitRef
::
new
(
Vec
::
new
(),
path
.clone
(),
self
.span
),
TraitBoundModifier
::
None
)),
_
=>
None
,
}
}
...
...
src/libsyntax/ext/build.rs
浏览文件 @
95f1866a
...
...
@@ -465,7 +465,8 @@ fn poly_trait_ref(&self, span: Span, path: ast::Path) -> ast::PolyTraitRef {
}
fn
ty_param_bound
(
&
self
,
path
:
ast
::
Path
)
->
ast
::
GenericBound
{
ast
::
Trait
(
self
.poly_trait_ref
(
path
.span
,
path
),
ast
::
TraitBoundModifier
::
None
)
ast
::
GenericBound
::
Trait
(
self
.poly_trait_ref
(
path
.span
,
path
),
ast
::
TraitBoundModifier
::
None
)
}
fn
lifetime
(
&
self
,
span
:
Span
,
ident
:
ast
::
Ident
)
->
ast
::
Lifetime
{
...
...
src/libsyntax/fold.rs
浏览文件 @
95f1866a
...
...
@@ -678,10 +678,12 @@ pub fn noop_fold_fn_decl<T: Folder>(decl: P<FnDecl>, fld: &mut T) -> P<FnDecl> {
pub
fn
noop_fold_param_bound
<
T
>
(
pb
:
GenericBound
,
fld
:
&
mut
T
)
->
GenericBound
where
T
:
Folder
{
match
pb
{
Trait
(
ty
,
modifier
)
=>
{
Trait
(
fld
.fold_poly_trait_ref
(
ty
),
modifier
)
GenericBound
::
Trait
(
ty
,
modifier
)
=>
{
GenericBound
::
Trait
(
fld
.fold_poly_trait_ref
(
ty
),
modifier
)
}
GenericBound
::
Outlives
(
lifetime
)
=>
{
GenericBound
::
Outlives
(
noop_fold_lifetime
(
lifetime
,
fld
))
}
Outlives
(
lifetime
)
=>
Outlives
(
noop_fold_lifetime
(
lifetime
,
fld
)),
}
}
...
...
src/libsyntax/parse/parser.rs
浏览文件 @
95f1866a
...
...
@@ -10,7 +10,7 @@
use
rustc_target
::
spec
::
abi
::{
self
,
Abi
};
use
ast
::{
AngleBracketedArgs
,
ParenthesizedArgData
,
AttrStyle
,
BareFnTy
};
use
ast
::{
Outlives
,
Trait
,
TraitBoundModifier
};
use
ast
::{
GenericBound
,
TraitBoundModifier
};
use
ast
::
Unsafety
;
use
ast
::{
Mod
,
AnonConst
,
Arg
,
Arm
,
Attribute
,
BindingMode
,
TraitItemKind
};
use
ast
::
Block
;
...
...
@@ -1444,7 +1444,7 @@ fn parse_ty_common(&mut self, allow_plus: bool, allow_qpath_recovery: bool)
TyKind
::
TraitObject
(
ref
bounds
,
TraitObjectSyntax
::
None
)
if
maybe_bounds
&&
bounds
.len
()
==
1
&&
!
trailing_plus
=>
{
let
path
=
match
bounds
[
0
]
{
Trait
(
ref
pt
,
..
)
=>
pt
.trait_ref.path
.clone
(),
GenericBound
::
Trait
(
ref
pt
,
..
)
=>
pt
.trait_ref.path
.clone
(),
_
=>
self
.bug
(
"unexpected lifetime bound"
),
};
self
.parse_remaining_bounds
(
Vec
::
new
(),
path
,
lo
,
true
)
?
...
...
@@ -1566,7 +1566,7 @@ fn parse_ty_common(&mut self, allow_plus: bool, allow_qpath_recovery: bool)
fn
parse_remaining_bounds
(
&
mut
self
,
generic_params
:
Vec
<
GenericParam
>
,
path
:
ast
::
Path
,
lo
:
Span
,
parse_plus
:
bool
)
->
PResult
<
'a
,
TyKind
>
{
let
poly_trait_ref
=
PolyTraitRef
::
new
(
generic_params
,
path
,
lo
.to
(
self
.prev_span
));
let
mut
bounds
=
vec!
[
Trait
(
poly_trait_ref
,
TraitBoundModifier
::
None
)];
let
mut
bounds
=
vec!
[
GenericBound
::
Trait
(
poly_trait_ref
,
TraitBoundModifier
::
None
)];
if
parse_plus
{
self
.eat_plus
();
// `+`, or `+=` gets split and `+` is discarded
bounds
.append
(
&
mut
self
.parse_ty_param_bounds
()
?
);
...
...
@@ -4752,7 +4752,7 @@ fn parse_ty_param_bounds_common(&mut self, allow_plus: bool) -> PResult<'a, Gene
self
.span_err
(
question_span
,
"`?` may only modify trait bounds, not lifetime bounds"
);
}
bounds
.push
(
Outlives
(
self
.expect_lifetime
()));
bounds
.push
(
GenericBound
::
Outlives
(
self
.expect_lifetime
()));
if
has_parens
{
self
.expect
(
&
token
::
CloseDelim
(
token
::
Paren
))
?
;
self
.span_err
(
self
.prev_span
,
...
...
@@ -4770,7 +4770,7 @@ fn parse_ty_param_bounds_common(&mut self, allow_plus: bool) -> PResult<'a, Gene
}
else
{
TraitBoundModifier
::
None
};
bounds
.push
(
Trait
(
poly_trait
,
modifier
));
bounds
.push
(
GenericBound
::
Trait
(
poly_trait
,
modifier
));
}
}
else
{
break
...
...
src/libsyntax/print/pprust.rs
浏览文件 @
95f1866a
...
...
@@ -12,7 +12,7 @@
use
rustc_target
::
spec
::
abi
::{
self
,
Abi
};
use
ast
::{
self
,
BlockCheckMode
,
PatKind
,
RangeEnd
,
RangeSyntax
};
use
ast
::{
SelfKind
,
Outlives
,
Trait
,
TraitBoundModifier
};
use
ast
::{
SelfKind
,
GenericBound
,
TraitBoundModifier
};
use
ast
::{
Attribute
,
MacDelimiter
,
GenericArg
};
use
util
::
parser
::{
self
,
AssocOp
,
Fixity
};
use
attr
;
...
...
@@ -1364,7 +1364,7 @@ pub fn print_item(&mut self, item: &ast::Item) -> io::Result<()> {
self
.print_generic_params
(
&
generics
.params
)
?
;
let
mut
real_bounds
=
Vec
::
with_capacity
(
bounds
.len
());
for
b
in
bounds
.iter
()
{
if
let
Trait
(
ref
ptr
,
ast
::
TraitBoundModifier
::
Maybe
)
=
*
b
{
if
let
GenericBound
::
Trait
(
ref
ptr
,
ast
::
TraitBoundModifier
::
Maybe
)
=
*
b
{
self
.s
.space
()
?
;
self
.word_space
(
"for ?"
)
?
;
self
.print_trait_ref
(
&
ptr
.trait_ref
)
?
;
...
...
@@ -1390,7 +1390,7 @@ pub fn print_item(&mut self, item: &ast::Item) -> io::Result<()> {
let
mut
real_bounds
=
Vec
::
with_capacity
(
bounds
.len
());
// FIXME(durka) this seems to be some quite outdated syntax
for
b
in
bounds
.iter
()
{
if
let
Trait
(
ref
ptr
,
ast
::
TraitBoundModifier
::
Maybe
)
=
*
b
{
if
let
GenericBound
::
Trait
(
ref
ptr
,
ast
::
TraitBoundModifier
::
Maybe
)
=
*
b
{
self
.s
.space
()
?
;
self
.word_space
(
"for ?"
)
?
;
self
.print_trait_ref
(
&
ptr
.trait_ref
)
?
;
...
...
@@ -2826,13 +2826,13 @@ pub fn print_type_bounds(&mut self,
}
match
bound
{
Trait
(
tref
,
modifier
)
=>
{
GenericBound
::
Trait
(
tref
,
modifier
)
=>
{
if
modifier
==
&
TraitBoundModifier
::
Maybe
{
self
.s
.word
(
"?"
)
?
;
}
self
.print_poly_trait_ref
(
tref
)
?
;
}
Outlives
(
lt
)
=>
self
.print_lifetime
(
*
lt
)
?
,
GenericBound
::
Outlives
(
lt
)
=>
self
.print_lifetime
(
*
lt
)
?
,
}
}
}
...
...
src/libsyntax/visit.rs
浏览文件 @
95f1866a
...
...
@@ -481,12 +481,8 @@ pub fn walk_global_asm<'a, V: Visitor<'a>>(_: &mut V, _: &'a GlobalAsm) {
pub
fn
walk_param_bound
<
'a
,
V
:
Visitor
<
'a
>>
(
visitor
:
&
mut
V
,
bound
:
&
'a
GenericBound
)
{
match
*
bound
{
Trait
(
ref
typ
,
ref
modifier
)
=>
{
visitor
.visit_poly_trait_ref
(
typ
,
modifier
);
}
Outlives
(
ref
lifetime
)
=>
{
visitor
.visit_lifetime
(
lifetime
);
}
GenericBound
::
Trait
(
ref
typ
,
ref
modifier
)
=>
visitor
.visit_poly_trait_ref
(
typ
,
modifier
),
GenericBound
::
Outlives
(
ref
lifetime
)
=>
visitor
.visit_lifetime
(
lifetime
),
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录