Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
22ef04e2
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,发现更多精彩内容 >>
提交
22ef04e2
编写于
8月 15, 2021
作者:
J
jackh726
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
A bit of cleanup to astconv
上级
216906fb
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
181 addition
and
234 deletion
+181
-234
compiler/rustc_typeck/src/astconv/mod.rs
compiler/rustc_typeck/src/astconv/mod.rs
+118
-87
compiler/rustc_typeck/src/collect.rs
compiler/rustc_typeck/src/collect.rs
+17
-94
src/librustdoc/clean/mod.rs
src/librustdoc/clean/mod.rs
+1
-8
src/test/ui/error-codes/e0119/complex-impl.stderr
src/test/ui/error-codes/e0119/complex-impl.stderr
+1
-1
src/test/ui/generics/wrong-number-of-args.stderr
src/test/ui/generics/wrong-number-of-args.stderr
+44
-44
未找到文件。
compiler/rustc_typeck/src/astconv/mod.rs
浏览文件 @
22ef04e2
...
...
@@ -693,6 +693,61 @@ pub fn instantiate_mono_trait_ref(
)
}
fn
instantiate_poly_trait_ref_inner
(
&
self
,
hir_id
:
hir
::
HirId
,
span
:
Span
,
binding_span
:
Option
<
Span
>
,
constness
:
ty
::
BoundConstness
,
bounds
:
&
mut
Bounds
<
'tcx
>
,
speculative
:
bool
,
trait_ref_span
:
Span
,
trait_def_id
:
DefId
,
trait_segment
:
&
hir
::
PathSegment
<
'_
>
,
args
:
&
GenericArgs
<
'_
>
,
infer_args
:
bool
,
self_ty
:
Ty
<
'tcx
>
,
)
->
GenericArgCountResult
{
let
(
substs
,
arg_count
)
=
self
.create_substs_for_ast_path
(
trait_ref_span
,
trait_def_id
,
&
[],
trait_segment
,
args
,
infer_args
,
Some
(
self_ty
),
);
let
tcx
=
self
.tcx
();
let
bound_vars
=
tcx
.late_bound_vars
(
hir_id
);
debug!
(
?
bound_vars
);
let
assoc_bindings
=
self
.create_assoc_bindings_for_generic_args
(
args
);
let
poly_trait_ref
=
ty
::
Binder
::
bind_with_vars
(
ty
::
TraitRef
::
new
(
trait_def_id
,
substs
),
bound_vars
);
debug!
(
?
poly_trait_ref
,
?
assoc_bindings
);
bounds
.trait_bounds
.push
((
poly_trait_ref
,
span
,
constness
));
let
mut
dup_bindings
=
FxHashMap
::
default
();
for
binding
in
&
assoc_bindings
{
// Specify type to assert that error was already reported in `Err` case.
let
_
:
Result
<
_
,
ErrorReported
>
=
self
.add_predicates_for_ast_type_binding
(
hir_id
,
poly_trait_ref
,
binding
,
bounds
,
speculative
,
&
mut
dup_bindings
,
binding_span
.unwrap_or
(
binding
.span
),
);
// Okay to ignore `Err` because of `ErrorReported` (see above).
}
arg_count
}
/// Given a trait bound like `Debug`, applies that trait bound the given self-type to construct
/// a full trait reference. The resulting trait reference is returned. This may also generate
/// auxiliary bounds, which are added to `bounds`.
...
...
@@ -713,7 +768,7 @@ pub fn instantiate_mono_trait_ref(
/// `Bar<'a>`. The returned poly-trait-ref will have this binder instantiated explicitly,
/// however.
#[tracing::instrument(level
=
"debug"
,
skip(self,
span,
constness,
bounds,
speculative))]
pub
fn
instantiate_poly_trait_ref
(
pub
(
crate
)
fn
instantiate_poly_trait_ref
(
&
self
,
trait_ref
:
&
hir
::
TraitRef
<
'_
>
,
span
:
Span
,
...
...
@@ -722,48 +777,34 @@ pub fn instantiate_poly_trait_ref(
bounds
:
&
mut
Bounds
<
'tcx
>
,
speculative
:
bool
,
)
->
GenericArgCountResult
{
let
hir_id
=
trait_ref
.hir_ref_id
;
let
binding_span
=
None
;
let
trait_ref_span
=
trait_ref
.path.span
;
let
trait_def_id
=
trait_ref
.trait_def_id
()
.unwrap_or_else
(||
FatalError
.raise
());
let
trait_segment
=
trait_ref
.path.segments
.last
()
.unwrap
();
let
args
=
trait_segment
.args
();
let
infer_args
=
trait_segment
.infer_args
;
self
.prohibit_generics
(
trait_ref
.path.segments
.split_last
()
.unwrap
()
.1
);
self
.complain_about_internal_fn_trait
(
span
,
trait_def_id
,
trait_segment
);
let
tcx
=
self
.tcx
();
let
bound_vars
=
tcx
.late_bound_vars
(
trait_ref
.hir_ref_id
);
debug!
(
?
bound_vars
);
let
(
substs
,
arg_count
)
=
self
.create_substs_for_ast_trait_ref
(
trait_ref
.path.span
,
self
.instantiate_poly_trait_ref_inner
(
hir_id
,
span
,
binding_span
,
constness
,
bounds
,
speculative
,
trait_ref_span
,
trait_def_id
,
trait_segment
,
args
,
infer_args
,
self_ty
,
trait_ref
.path.segments
.last
()
.unwrap
(),
);
let
assoc_bindings
=
self
.create_assoc_bindings_for_generic_args
(
trait_ref
.path.segments
.last
()
.unwrap
()
.args
());
let
poly_trait_ref
=
ty
::
Binder
::
bind_with_vars
(
ty
::
TraitRef
::
new
(
trait_def_id
,
substs
),
bound_vars
);
debug!
(
?
poly_trait_ref
,
?
assoc_bindings
);
bounds
.trait_bounds
.push
((
poly_trait_ref
,
span
,
constness
));
let
mut
dup_bindings
=
FxHashMap
::
default
();
for
binding
in
&
assoc_bindings
{
// Specify type to assert that error was already reported in `Err` case.
let
_
:
Result
<
_
,
ErrorReported
>
=
self
.add_predicates_for_ast_type_binding
(
trait_ref
.hir_ref_id
,
poly_trait_ref
,
binding
,
bounds
,
speculative
,
&
mut
dup_bindings
,
binding
.span
,
);
// Okay to ignore `Err` because of `ErrorReported` (see above).
}
arg_count
)
}
pub
fn
instantiate_lang_item_trait_ref
(
pub
(
crate
)
fn
instantiate_lang_item_trait_ref
(
&
self
,
lang_item
:
hir
::
LangItem
,
span
:
Span
,
...
...
@@ -772,36 +813,28 @@ pub fn instantiate_lang_item_trait_ref(
self_ty
:
Ty
<
'tcx
>
,
bounds
:
&
mut
Bounds
<
'tcx
>
,
)
{
let
binding_span
=
Some
(
span
);
let
constness
=
ty
::
BoundConstness
::
NotConst
;
let
speculative
=
false
;
let
trait_ref_span
=
span
;
let
trait_def_id
=
self
.tcx
()
.require_lang_item
(
lang_item
,
Some
(
span
));
let
trait_segment
=
&
hir
::
PathSegment
::
invalid
();
let
infer_args
=
false
;
let
(
substs
,
_
)
=
self
.create_substs_for_ast_path
(
self
.instantiate_poly_trait_ref_inner
(
hir_id
,
span
,
binding_span
,
constness
,
bounds
,
speculative
,
trait_ref_span
,
trait_def_id
,
&
[],
&
hir
::
PathSegment
::
invalid
(),
trait_segment
,
args
,
false
,
Some
(
self_ty
)
,
infer_args
,
self_ty
,
);
let
assoc_bindings
=
self
.create_assoc_bindings_for_generic_args
(
args
);
let
tcx
=
self
.tcx
();
let
bound_vars
=
tcx
.late_bound_vars
(
hir_id
);
let
poly_trait_ref
=
ty
::
Binder
::
bind_with_vars
(
ty
::
TraitRef
::
new
(
trait_def_id
,
substs
),
bound_vars
);
bounds
.trait_bounds
.push
((
poly_trait_ref
,
span
,
ty
::
BoundConstness
::
NotConst
));
let
mut
dup_bindings
=
FxHashMap
::
default
();
for
binding
in
assoc_bindings
{
let
_
:
Result
<
_
,
ErrorReported
>
=
self
.add_predicates_for_ast_type_binding
(
hir_id
,
poly_trait_ref
,
&
binding
,
bounds
,
false
,
&
mut
dup_bindings
,
span
,
);
}
}
fn
ast_path_to_mono_trait_ref
(
...
...
@@ -935,45 +968,43 @@ pub(crate) fn add_implicitly_sized<'hir>(
/// **A note on binders:** there is an implied binder around
/// `param_ty` and `ast_bounds`. See `instantiate_poly_trait_ref`
/// for more details.
#[tracing::instrument(level
=
"debug"
,
skip(self,
bounds))]
fn
add_bounds
(
#[tracing::instrument(level
=
"debug"
,
skip(self,
ast_bounds,
bounds))]
pub
(
crate
)
fn
add_bounds
<
'hir
,
I
:
Iterator
<
Item
=
&
'hir
hir
::
GenericBound
<
'hir
>>>
(
&
self
,
param_ty
:
Ty
<
'tcx
>
,
ast_bounds
:
&
[
hir
::
GenericBound
<
'_
>
]
,
ast_bounds
:
I
,
bounds
:
&
mut
Bounds
<
'tcx
>
,
bound_vars
:
&
'tcx
ty
::
List
<
ty
::
BoundVariableKind
>
,
)
{
for
ast_bound
in
ast_bounds
{
match
*
ast_bound
{
hir
::
GenericBound
::
Trait
(
ref
b
,
hir
::
TraitBoundModifier
::
None
)
=>
{
self
.instantiate_poly_trait_ref
(
&
b
.trait_ref
,
b
.span
,
ty
::
BoundConstness
::
NotConst
,
match
ast_bound
{
hir
::
GenericBound
::
Trait
(
poly_trait_ref
,
modifier
)
=>
{
let
constness
=
match
modifier
{
hir
::
TraitBoundModifier
::
MaybeConst
=>
ty
::
BoundConstness
::
ConstIfConst
,
hir
::
TraitBoundModifier
::
None
=>
ty
::
BoundConstness
::
NotConst
,
hir
::
TraitBoundModifier
::
Maybe
=>
continue
,
};
let
_
=
self
.instantiate_poly_trait_ref
(
&
poly_trait_ref
.trait_ref
,
poly_trait_ref
.span
,
constness
,
param_ty
,
bounds
,
false
,
);
}
hir
::
GenericBound
::
Trait
(
ref
b
,
hir
::
TraitBoundModifier
::
MaybeConst
)
=>
{
self
.instantiate_poly_trait_ref
(
&
b
.trait_ref
,
b
.span
,
ty
::
BoundConstness
::
ConstIfConst
,
param_ty
,
bounds
,
false
,
&
hir
::
GenericBound
::
LangItemTrait
(
lang_item
,
span
,
hir_id
,
args
)
=>
{
self
.instantiate_lang_item_trait_ref
(
lang_item
,
span
,
hir_id
,
args
,
param_ty
,
bounds
,
);
}
hir
::
GenericBound
::
Trait
(
_
,
hir
::
TraitBoundModifier
::
Maybe
)
=>
{}
hir
::
GenericBound
::
LangItemTrait
(
lang_item
,
span
,
hir_id
,
args
)
=>
self
.instantiate_lang_item_trait_ref
(
lang_item
,
span
,
hir_id
,
args
,
param_ty
,
bounds
,
),
hir
::
GenericBound
::
Outlives
(
ref
l
)
=>
bounds
.region_bounds
.push
((
ty
::
Binder
::
bind_with_vars
(
self
.ast_region_to_region
(
l
,
None
),
bound_vars
),
l
.span
,
)),
hir
::
GenericBound
::
Outlives
(
lifetime
)
=>
{
let
region
=
self
.ast_region_to_region
(
lifetime
,
None
);
bounds
.region_bounds
.push
((
ty
::
Binder
::
bind_with_vars
(
region
,
bound_vars
),
lifetime
.span
));
}
}
}
}
...
...
@@ -1032,7 +1063,7 @@ fn compute_bounds_inner(
)
->
Bounds
<
'tcx
>
{
let
mut
bounds
=
Bounds
::
default
();
self
.add_bounds
(
param_ty
,
ast_bounds
,
&
mut
bounds
,
ty
::
List
::
empty
());
self
.add_bounds
(
param_ty
,
ast_bounds
.iter
()
,
&
mut
bounds
,
ty
::
List
::
empty
());
bounds
}
...
...
@@ -1224,7 +1255,7 @@ fn add_predicates_for_ast_type_binding(
// Calling `skip_binder` is okay, because `add_bounds` expects the `param_ty`
// parameter to have a skipped binder.
let
param_ty
=
tcx
.mk_ty
(
ty
::
Projection
(
projection_ty
.skip_binder
()));
self
.add_bounds
(
param_ty
,
ast_bounds
,
bounds
,
candidate
.bound_vars
());
self
.add_bounds
(
param_ty
,
ast_bounds
.iter
()
,
bounds
,
candidate
.bound_vars
());
}
}
Ok
(())
...
...
compiler/rustc_typeck/src/collect.rs
浏览文件 @
22ef04e2
...
...
@@ -2220,62 +2220,15 @@ fn gather_explicit_predicates_of(tcx: TyCtxt<'_>, def_id: DefId) -> ty::GenericP
}
}
for
bound
in
bound_pred
.bounds
.iter
()
{
match
bound
{
hir
::
GenericBound
::
Trait
(
poly_trait_ref
,
modifier
)
=>
{
let
constness
=
match
modifier
{
hir
::
TraitBoundModifier
::
None
=>
ty
::
BoundConstness
::
NotConst
,
hir
::
TraitBoundModifier
::
MaybeConst
=>
{
ty
::
BoundConstness
::
ConstIfConst
}
// We ignore `where T: ?Sized`, it is already part of
// type parameter `T`.
hir
::
TraitBoundModifier
::
Maybe
=>
continue
,
};
let
mut
bounds
=
Bounds
::
default
();
let
_
=
<
dyn
AstConv
<
'_
>>
::
instantiate_poly_trait_ref
(
&
icx
,
&
poly_trait_ref
.trait_ref
,
poly_trait_ref
.span
,
constness
,
ty
,
&
mut
bounds
,
false
,
);
predicates
.extend
(
bounds
.predicates
(
tcx
,
ty
));
}
&
hir
::
GenericBound
::
LangItemTrait
(
lang_item
,
span
,
hir_id
,
args
)
=>
{
let
mut
bounds
=
Bounds
::
default
();
<
dyn
AstConv
<
'_
>>
::
instantiate_lang_item_trait_ref
(
&
icx
,
lang_item
,
span
,
hir_id
,
args
,
ty
,
&
mut
bounds
,
);
predicates
.extend
(
bounds
.predicates
(
tcx
,
ty
));
}
hir
::
GenericBound
::
Outlives
(
lifetime
)
=>
{
let
region
=
<
dyn
AstConv
<
'_
>>
::
ast_region_to_region
(
&
icx
,
lifetime
,
None
);
predicates
.insert
((
ty
::
Binder
::
bind_with_vars
(
ty
::
PredicateKind
::
TypeOutlives
(
ty
::
OutlivesPredicate
(
ty
,
region
,
)),
bound_vars
,
)
.to_predicate
(
tcx
),
lifetime
.span
,
));
}
}
}
let
mut
bounds
=
Bounds
::
default
();
<
dyn
AstConv
<
'_
>>
::
add_bounds
(
&
icx
,
ty
,
bound_pred
.bounds
.iter
(),
&
mut
bounds
,
bound_vars
,
);
predicates
.extend
(
bounds
.predicates
(
tcx
,
ty
));
}
hir
::
WherePredicate
::
RegionPredicate
(
region_pred
)
=>
{
...
...
@@ -2489,44 +2442,14 @@ fn predicates_from_bound<'tcx>(
param_ty
:
Ty
<
'tcx
>
,
bound
:
&
'tcx
hir
::
GenericBound
<
'tcx
>
,
)
->
Vec
<
(
ty
::
Predicate
<
'tcx
>
,
Span
)
>
{
match
*
bound
{
hir
::
GenericBound
::
Trait
(
ref
tr
,
modifier
)
=>
{
let
constness
=
match
modifier
{
hir
::
TraitBoundModifier
::
Maybe
=>
return
vec!
[],
hir
::
TraitBoundModifier
::
MaybeConst
=>
ty
::
BoundConstness
::
ConstIfConst
,
hir
::
TraitBoundModifier
::
None
=>
ty
::
BoundConstness
::
NotConst
,
};
let
mut
bounds
=
Bounds
::
default
();
let
_
=
astconv
.instantiate_poly_trait_ref
(
&
tr
.trait_ref
,
tr
.span
,
constness
,
param_ty
,
&
mut
bounds
,
false
,
);
bounds
.predicates
(
astconv
.tcx
(),
param_ty
)
}
hir
::
GenericBound
::
LangItemTrait
(
lang_item
,
span
,
hir_id
,
args
)
=>
{
let
mut
bounds
=
Bounds
::
default
();
astconv
.instantiate_lang_item_trait_ref
(
lang_item
,
span
,
hir_id
,
args
,
param_ty
,
&
mut
bounds
,
);
bounds
.predicates
(
astconv
.tcx
(),
param_ty
)
}
hir
::
GenericBound
::
Outlives
(
ref
lifetime
)
=>
{
let
region
=
astconv
.ast_region_to_region
(
lifetime
,
None
);
let
pred
=
ty
::
PredicateKind
::
TypeOutlives
(
ty
::
OutlivesPredicate
(
param_ty
,
region
))
.to_predicate
(
astconv
.tcx
());
vec!
[(
pred
,
lifetime
.span
)]
}
}
let
mut
bounds
=
Bounds
::
default
();
astconv
.add_bounds
(
param_ty
,
std
::
array
::
IntoIter
::
new
([
bound
]),
&
mut
bounds
,
ty
::
List
::
empty
(),
);
bounds
.predicates
(
astconv
.tcx
(),
param_ty
)
}
fn
compute_sig_of_foreign_fn_decl
<
'tcx
>
(
...
...
src/librustdoc/clean/mod.rs
浏览文件 @
22ef04e2
...
...
@@ -129,7 +129,6 @@ impl Clean<GenericBound> for hir::GenericBound<'_> {
fn
clean
(
&
self
,
cx
:
&
mut
DocContext
<
'_
>
)
->
GenericBound
{
match
*
self
{
hir
::
GenericBound
::
Outlives
(
lt
)
=>
GenericBound
::
Outlives
(
lt
.clean
(
cx
)),
hir
::
GenericBound
::
Unsized
(
_
)
=>
GenericBound
::
maybe_sized
(
cx
),
hir
::
GenericBound
::
LangItemTrait
(
lang_item
,
span
,
_
,
generic_args
)
=>
{
let
def_id
=
cx
.tcx
.require_lang_item
(
lang_item
,
Some
(
span
));
...
...
@@ -557,19 +556,13 @@ fn is_elided_lifetime(param: &hir::GenericParam<'_>) -> bool {
WherePredicate
::
BoundPredicate
{
ty
:
Generic
(
ref
name
),
ref
mut
bounds
,
..
}
=>
{
if
let
[]
|
[
GenericBound
::
TraitBound
(
_
,
hir
::
TraitBoundModifier
::
Maybe
)]
=
&
bounds
[
..
]
{
if
bounds
.is_empty
()
{
for
param
in
&
mut
generics
.params
{
match
param
.kind
{
GenericParamDefKind
::
Lifetime
{
..
}
=>
{}
GenericParamDefKind
::
Type
{
bounds
:
ref
mut
ty_bounds
,
..
}
=>
{
if
&
param
.name
==
name
{
mem
::
swap
(
bounds
,
ty_bounds
);
// We now keep track of `?Sized` obligations in the HIR.
// If we don't clear `ty_bounds` we end up with
// `fn foo<X: ?Sized>(_: X) where X: ?Sized`.
ty_bounds
.clear
();
break
;
}
}
...
...
src/test/ui/error-codes/e0119/complex-impl.stderr
浏览文件 @
22ef04e2
...
...
@@ -6,7 +6,7 @@ LL | impl<R> External for (Q, R) {}
|
= note: conflicting implementation in crate `complex_impl_support`:
- impl<'a, 'b, 'c, T, U, V, W> External for (T, M<'a, 'b, 'c, Box<U>, V, W>)
where <U as FnOnce<(T,)>>::Output == V, <V as Iterator>::Item == T, 'b: 'a, T: 'a, U:
FnOnce<(T,)>, U: 'static
, V: Iterator, V: Clone, W: Add, <W as Add>::Output: Copy;
where <U as FnOnce<(T,)>>::Output == V, <V as Iterator>::Item == T, 'b: 'a, T: 'a, U:
'static, U: FnOnce<(T,)>
, V: Iterator, V: Clone, W: Add, <W as Add>::Output: Copy;
error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
--> $DIR/complex-impl.rs:9:1
...
...
src/test/ui/generics/wrong-number-of-args.stderr
浏览文件 @
22ef04e2
...
...
@@ -440,17 +440,6 @@ note: trait defined here, with 1 lifetime parameter: `'a`
LL | trait GenericLifetimeAT<'a> {
| ^^^^^^^^^^^^^^^^^ --
error[E0106]: missing lifetime specifier
--> $DIR/wrong-number-of-args.rs:169:44
|
LL | type C = Box<dyn GenericLifetimeAT<(), AssocTy=()>>;
| ^ expected named lifetime parameter
|
help: consider introducing a named lifetime parameter
|
LL | type C<'a> = Box<dyn GenericLifetimeAT<'a, (), AssocTy=()>>;
| ++++ +++
error[E0107]: this trait takes 0 generic arguments but 1 generic argument was supplied
--> $DIR/wrong-number-of-args.rs:169:26
|
...
...
@@ -465,6 +454,17 @@ note: trait defined here, with 0 generic parameters
LL | trait GenericLifetimeAT<'a> {
| ^^^^^^^^^^^^^^^^^
error[E0106]: missing lifetime specifier
--> $DIR/wrong-number-of-args.rs:169:44
|
LL | type C = Box<dyn GenericLifetimeAT<(), AssocTy=()>>;
| ^ expected named lifetime parameter
|
help: consider introducing a named lifetime parameter
|
LL | type C<'a> = Box<dyn GenericLifetimeAT<'a, (), AssocTy=()>>;
| ++++ +++
error[E0107]: this trait takes 1 generic argument but 0 generic arguments were supplied
--> $DIR/wrong-number-of-args.rs:181:26
|
...
...
@@ -525,17 +525,6 @@ help: add missing generic argument
LL | type C = Box<dyn GenericTypeAT<'static, A, AssocTy=()>>;
| +++
error[E0106]: missing lifetime specifier
--> $DIR/wrong-number-of-args.rs:201:48
|
LL | type A = Box<dyn GenericLifetimeTypeAT<AssocTy=()>>;
| ^ expected named lifetime parameter
|
help: consider introducing a named lifetime parameter
|
LL | type A<'a> = Box<dyn GenericLifetimeTypeAT<'a, AssocTy=()>>;
| ++++ +++
error[E0107]: this trait takes 1 generic argument but 0 generic arguments were supplied
--> $DIR/wrong-number-of-args.rs:201:26
|
...
...
@@ -552,6 +541,17 @@ help: add missing generic argument
LL | type A = Box<dyn GenericLifetimeTypeAT<A, AssocTy=()>>;
| ++
error[E0106]: missing lifetime specifier
--> $DIR/wrong-number-of-args.rs:201:48
|
LL | type A = Box<dyn GenericLifetimeTypeAT<AssocTy=()>>;
| ^ expected named lifetime parameter
|
help: consider introducing a named lifetime parameter
|
LL | type A<'a> = Box<dyn GenericLifetimeTypeAT<'a, AssocTy=()>>;
| ++++ +++
error[E0107]: this trait takes 1 generic argument but 0 generic arguments were supplied
--> $DIR/wrong-number-of-args.rs:207:26
|
...
...
@@ -609,17 +609,6 @@ help: consider introducing a named lifetime parameter
LL | type D<'a> = Box<dyn GenericLifetimeTypeAT<'a, (), AssocTy=()>>;
| ++++ +++
error[E0106]: missing lifetime specifier
--> $DIR/wrong-number-of-args.rs:221:48
|
LL | type E = Box<dyn GenericLifetimeTypeAT<(), (), AssocTy=()>>;
| ^ expected named lifetime parameter
|
help: consider introducing a named lifetime parameter
|
LL | type E<'a> = Box<dyn GenericLifetimeTypeAT<'a, (), (), AssocTy=()>>;
| ++++ +++
error[E0107]: this trait takes 1 generic argument but 2 generic arguments were supplied
--> $DIR/wrong-number-of-args.rs:221:26
|
...
...
@@ -634,6 +623,17 @@ note: trait defined here, with 1 generic parameter: `A`
LL | trait GenericLifetimeTypeAT<'a, A> {
| ^^^^^^^^^^^^^^^^^^^^^ -
error[E0106]: missing lifetime specifier
--> $DIR/wrong-number-of-args.rs:221:48
|
LL | type E = Box<dyn GenericLifetimeTypeAT<(), (), AssocTy=()>>;
| ^ expected named lifetime parameter
|
help: consider introducing a named lifetime parameter
|
LL | type E<'a> = Box<dyn GenericLifetimeTypeAT<'a, (), (), AssocTy=()>>;
| ++++ +++
error[E0107]: this trait takes 1 lifetime argument but 2 lifetime arguments were supplied
--> $DIR/wrong-number-of-args.rs:227:26
|
...
...
@@ -767,17 +767,6 @@ help: add missing lifetime argument
LL | type B = Box<dyn GenericLifetimeLifetimeAT<'static, 'b, AssocTy=()>>;
| ++++
error[E0106]: missing lifetime specifiers
--> $DIR/wrong-number-of-args.rs:279:56
|
LL | type A = Box<dyn GenericLifetimeLifetimeTypeAT<AssocTy=()>>;
| ^ expected 2 lifetime parameters
|
help: consider introducing a named lifetime parameter
|
LL | type A<'a> = Box<dyn GenericLifetimeLifetimeTypeAT<'a, 'a, AssocTy=()>>;
| ++++ +++++++
error[E0107]: this trait takes 1 generic argument but 0 generic arguments were supplied
--> $DIR/wrong-number-of-args.rs:279:26
|
...
...
@@ -794,6 +783,17 @@ help: add missing generic argument
LL | type A = Box<dyn GenericLifetimeLifetimeTypeAT<A, AssocTy=()>>;
| ++
error[E0106]: missing lifetime specifiers
--> $DIR/wrong-number-of-args.rs:279:56
|
LL | type A = Box<dyn GenericLifetimeLifetimeTypeAT<AssocTy=()>>;
| ^ expected 2 lifetime parameters
|
help: consider introducing a named lifetime parameter
|
LL | type A<'a> = Box<dyn GenericLifetimeLifetimeTypeAT<'a, 'a, AssocTy=()>>;
| ++++ +++++++
error[E0107]: this trait takes 2 lifetime arguments but 1 lifetime argument was supplied
--> $DIR/wrong-number-of-args.rs:285:26
|
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录