Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
8ef81388
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,发现更多精彩内容 >>
提交
8ef81388
编写于
12月 30, 2020
作者:
V
varkor
提交者:
kadmin
3月 23, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Some refactoring
上级
e4e5db4e
变更
27
隐藏空白更改
内联
并排
Showing
27 changed file
with
74 addition
and
89 deletion
+74
-89
compiler/rustc_ast/src/mut_visit.rs
compiler/rustc_ast/src/mut_visit.rs
+1
-1
compiler/rustc_ast_passes/src/ast_validation.rs
compiler/rustc_ast_passes/src/ast_validation.rs
+1
-1
compiler/rustc_ast_pretty/src/pprust/state.rs
compiler/rustc_ast_pretty/src/pprust/state.rs
+1
-0
compiler/rustc_infer/src/infer/error_reporting/mod.rs
compiler/rustc_infer/src/infer/error_reporting/mod.rs
+2
-3
compiler/rustc_metadata/src/rmeta/encoder.rs
compiler/rustc_metadata/src/rmeta/encoder.rs
+5
-2
compiler/rustc_passes/src/stability.rs
compiler/rustc_passes/src/stability.rs
+3
-4
compiler/rustc_privacy/src/lib.rs
compiler/rustc_privacy/src/lib.rs
+1
-0
compiler/rustc_resolve/src/diagnostics.rs
compiler/rustc_resolve/src/diagnostics.rs
+2
-2
compiler/rustc_resolve/src/late.rs
compiler/rustc_resolve/src/late.rs
+14
-14
compiler/rustc_resolve/src/lib.rs
compiler/rustc_resolve/src/lib.rs
+9
-5
compiler/rustc_typeck/src/astconv/mod.rs
compiler/rustc_typeck/src/astconv/mod.rs
+2
-1
compiler/rustc_typeck/src/check/fn_ctxt/_impl.rs
compiler/rustc_typeck/src/check/fn_ctxt/_impl.rs
+1
-1
compiler/rustc_typeck/src/check/wfcheck.rs
compiler/rustc_typeck/src/check/wfcheck.rs
+4
-3
compiler/rustc_typeck/src/collect.rs
compiler/rustc_typeck/src/collect.rs
+5
-1
compiler/rustc_typeck/src/collect/type_of.rs
compiler/rustc_typeck/src/collect/type_of.rs
+1
-2
src/test/ui/const-generics/defaults/const-default.rs
src/test/ui/const-generics/defaults/const-default.rs
+1
-4
src/test/ui/const-generics/min_const_generics/default_function_param.rs
...nst-generics/min_const_generics/default_function_param.rs
+4
-5
src/test/ui/const-generics/min_const_generics/default_function_param.stderr
...generics/min_const_generics/default_function_param.stderr
+4
-7
src/test/ui/const-generics/min_const_generics/default_trait_param.rs
.../const-generics/min_const_generics/default_trait_param.rs
+2
-0
src/test/ui/error-codes/E0128.stderr
src/test/ui/error-codes/E0128.stderr
+2
-2
src/test/ui/feature-gate/feature-gate-const_generic_defaults.rs
...st/ui/feature-gate/feature-gate-const_generic_defaults.rs
+0
-5
src/test/ui/feature-gate/feature-gate-const_generic_defaults.stderr
...i/feature-gate/feature-gate-const_generic_defaults.stderr
+0
-10
src/test/ui/generics/generic-non-trailing-defaults.stderr
src/test/ui/generics/generic-non-trailing-defaults.stderr
+1
-8
src/test/ui/generics/generic-type-params-forward-mention.stderr
...st/ui/generics/generic-type-params-forward-mention.stderr
+2
-2
src/test/ui/issues/issue-18183.stderr
src/test/ui/issues/issue-18183.stderr
+2
-2
src/test/ui/issues/issue-26812.stderr
src/test/ui/issues/issue-26812.stderr
+2
-2
src/test/ui/panic-handler/weak-lang-item.stderr
src/test/ui/panic-handler/weak-lang-item.stderr
+2
-2
未找到文件。
compiler/rustc_ast/src/mut_visit.rs
浏览文件 @
8ef81388
...
...
@@ -785,8 +785,8 @@ pub fn noop_flat_map_generic_param<T: MutVisitor>(
visit_opt
(
default
,
|
default
|
vis
.visit_ty
(
default
));
}
GenericParamKind
::
Const
{
ty
,
kw_span
:
_
,
default
}
=>
{
visit_opt
(
default
,
|
default
|
vis
.visit_anon_const
(
default
));
vis
.visit_ty
(
ty
);
visit_opt
(
default
,
|
default
|
vis
.visit_anon_const
(
default
));
}
}
smallvec!
[
param
]
...
...
compiler/rustc_ast_passes/src/ast_validation.rs
浏览文件 @
8ef81388
...
...
@@ -1180,7 +1180,7 @@ fn visit_generics(&mut self, generics: &'a Generics) {
default
.value.span
,
"default values for const generic parameters are unstable"
,
);
err
.
note
(
"to enable them use #![feature(const_generic_defaults)]
"
);
err
.
help
(
"add `#![feature(const_generic_defaults)]` to the crate attributes to enable
"
);
err
.emit
();
break
;
}
...
...
compiler/rustc_ast_pretty/src/pprust/state.rs
浏览文件 @
8ef81388
...
...
@@ -2659,6 +2659,7 @@ pub fn print_type_bounds(&mut self, prefix: &'static str, bounds: &[ast::Generic
s
.word_space
(
":"
);
s
.print_type
(
ty
);
s
.print_type_bounds
(
":"
,
&
param
.bounds
);
// FIXME(const_generic_defaults)
if
let
Some
(
ref
_
default
)
=
default
{
// FIXME(const_generics_defaults): print the `default` value here
s
.s
.space
();
...
...
compiler/rustc_infer/src/infer/error_reporting/mod.rs
浏览文件 @
8ef81388
...
...
@@ -963,9 +963,8 @@ fn strip_generic_default_params(
.rev
()
.filter_map
(|
param
|
match
param
.kind
{
ty
::
GenericParamDefKind
::
Lifetime
=>
None
,
ty
::
GenericParamDefKind
::
Type
{
has_default
,
..
}
|
ty
::
GenericParamDefKind
::
Const
{
has_default
}
=>
{
ty
::
GenericParamDefKind
::
Const
{
has_default
}
|
ty
::
GenericParamDefKind
::
Type
{
has_default
,
..
}
=>
{
Some
((
param
.def_id
,
has_default
))
}
})
...
...
compiler/rustc_metadata/src/rmeta/encoder.rs
浏览文件 @
8ef81388
...
...
@@ -1876,13 +1876,16 @@ fn encode_info_for_generics(&mut self, generics: &hir::Generics<'tcx>) {
default
.is_some
(),
);
}
GenericParamKind
::
Const
{
..
}
=>
{
GenericParamKind
::
Const
{
ref
default
,
..
}
=>
{
self
.encode_info_for_generic_param
(
def_id
.to_def_id
(),
EntryKind
::
ConstParam
,
true
,
);
// FIXME(const_generics_defaults)
if
default
.is_some
()
{
self
.encode_stability
(
def_id
.to_def_id
());
}
// FIXME(const_generic_defaults)
}
}
}
...
...
compiler/rustc_passes/src/stability.rs
浏览文件 @
8ef81388
...
...
@@ -507,10 +507,9 @@ fn visit_macro_def(&mut self, md: &'tcx hir::MacroDef<'tcx>) {
fn
visit_generic_param
(
&
mut
self
,
p
:
&
'tcx
hir
::
GenericParam
<
'tcx
>
)
{
let
kind
=
match
&
p
.kind
{
// FIXME(const_generics_defaults)
hir
::
GenericParamKind
::
Type
{
default
,
..
}
if
default
.is_some
()
=>
{
AnnotationKind
::
Container
}
// Allow stability attributes on default generic arguments.
hir
::
GenericParamKind
::
Type
{
default
:
Some
(
_
),
..
}
|
hir
::
GenericParamKind
::
Const
{
default
:
Some
(
_
),
..
}
=>
AnnotationKind
::
Container
,
_
=>
AnnotationKind
::
Prohibited
,
};
...
...
compiler/rustc_privacy/src/lib.rs
浏览文件 @
8ef81388
...
...
@@ -931,6 +931,7 @@ fn generics(&mut self) -> &mut Self {
GenericParamDefKind
::
Const
{
has_default
,
..
}
=>
{
self
.visit
(
self
.ev.tcx
.type_of
(
param
.def_id
));
if
has_default
{
// FIXME(const_generic_defaults)
// how should the error case be handled here?
// let default_const = self.ev.tcx.const_eval_poly(param.def_id).unwrap();
// self.visit(default_const);
...
...
compiler/rustc_resolve/src/diagnostics.rs
浏览文件 @
8ef81388
...
...
@@ -450,12 +450,12 @@ impl<'a> Resolver<'a> {
self
.session
,
span
,
E0128
,
"
type
parameters with a default cannot use
\
"
generic
parameters with a default cannot use
\
forward declared identifiers"
);
err
.span_label
(
span
,
"defaulted
type
parameters cannot be forward declared"
.to_string
(),
"defaulted
generic
parameters cannot be forward declared"
.to_string
(),
);
err
}
...
...
compiler/rustc_resolve/src/late.rs
浏览文件 @
8ef81388
...
...
@@ -132,10 +132,10 @@ enum PatBoundCtx {
/// We passed through a `macro_rules!` statement
MacroDefinition
(
DefId
),
/// All bindings in this rib are
type
parameters that can't be used
/// from the default of a
type
parameter because they're not declared
/// before said
type
parameter. Also see the `visit_generics` override.
Forward
Ty
ParamBanRibKind
,
/// All bindings in this rib are
generic
parameters that can't be used
/// from the default of a
generic
parameter because they're not declared
/// before said
generic
parameter. Also see the `visit_generics` override.
Forward
Generic
ParamBanRibKind
,
/// We are inside of the type of a const parameter. Can't refer to any
/// parameters.
...
...
@@ -154,7 +154,7 @@ impl RibKind<'_> {
|
ModuleRibKind
(
_
)
|
MacroDefinition
(
_
)
|
ConstParamTyRibKind
=>
false
,
AssocItemRibKind
|
ItemRibKind
(
_
)
|
Forward
Ty
ParamBanRibKind
=>
true
,
AssocItemRibKind
|
ItemRibKind
(
_
)
|
Forward
Generic
ParamBanRibKind
=>
true
,
}
}
}
...
...
@@ -555,15 +555,16 @@ fn visit_generics(&mut self, generics: &'ast Generics) {
// provide previous type parameters as they're built. We
// put all the parameters on the ban list and then remove
// them one by one as they are processed and become available.
let
mut
default_ban_rib
=
Rib
::
new
(
Forward
Ty
ParamBanRibKind
);
let
mut
default_ban_rib
=
Rib
::
new
(
Forward
Generic
ParamBanRibKind
);
let
mut
found_default
=
false
;
default_ban_rib
.bindings
.extend
(
generics
.params
.iter
()
.filter_map
(
|
param
|
match
param
.kind
{
GenericParamKind
::
Const
{
..
}
|
GenericParamKind
::
Lifetime
{
..
}
=>
None
,
GenericParamKind
::
Type
{
ref
default
,
..
}
=>
{
found_default
|
=
default
.is_some
()
;
found_default
.then_s
ome
((
Ident
::
with_dummy_span
(
param
.ident.name
),
Res
::
Err
))
GenericParamKind
::
Type
{
default
:
Some
(
_
),
..
}
|
GenericParamKind
::
Const
{
default
:
Some
(
_
)
,
..
}
=>
{
found_default
=
true
;
S
ome
((
Ident
::
with_dummy_span
(
param
.ident.name
),
Res
::
Err
))
}
_
=>
None
,
},
));
...
...
@@ -591,8 +592,8 @@ fn visit_generics(&mut self, generics: &'ast Generics) {
if
let
Some
(
ref
ty
)
=
default
{
self
.ribs
[
TypeNS
]
.push
(
default_ban_rib
);
self
.with_rib
(
ValueNS
,
Forward
Ty
ParamBanRibKind
,
|
this
|
{
// HACK: We use an empty `Forward
Ty
ParamBanRibKind` here which
self
.with_rib
(
ValueNS
,
Forward
Generic
ParamBanRibKind
,
|
this
|
{
// HACK: We use an empty `Forward
Generic
ParamBanRibKind` here which
// is only used to forbid the use of const parameters inside of
// type defaults.
//
...
...
@@ -616,7 +617,6 @@ fn visit_generics(&mut self, generics: &'ast Generics) {
self
.visit_ty
(
ty
);
self
.ribs
[
TypeNS
]
.pop
()
.unwrap
();
self
.ribs
[
ValueNS
]
.pop
()
.unwrap
();
// FIXME(const_generics:default) do something with default here?
}
}
}
...
...
@@ -866,7 +866,7 @@ fn is_label_valid_from_rib(&self, rib_index: usize) -> bool {
|
ItemRibKind
(
..
)
|
ConstantItemRibKind
(
..
)
|
ModuleRibKind
(
..
)
|
Forward
Ty
ParamBanRibKind
|
Forward
Generic
ParamBanRibKind
|
ConstParamTyRibKind
=>
{
return
false
;
}
...
...
compiler/rustc_resolve/src/lib.rs
浏览文件 @
8ef81388
...
...
@@ -2592,8 +2592,8 @@ fn validate_res_from_ribs(
debug!
(
"validate_res_from_ribs({:?})"
,
res
);
let
ribs
=
&
all_ribs
[
rib_index
+
1
..
];
// An invalid forward use of a
type
parameter from a previous default.
if
let
Forward
Ty
ParamBanRibKind
=
all_ribs
[
rib_index
]
.kind
{
// An invalid forward use of a
generic
parameter from a previous default.
if
let
Forward
Generic
ParamBanRibKind
=
all_ribs
[
rib_index
]
.kind
{
if
record_used
{
let
res_error
=
if
rib_ident
.name
==
kw
::
SelfUpper
{
ResolutionError
::
SelfInTyParamDefault
...
...
@@ -2617,7 +2617,7 @@ fn validate_res_from_ribs(
|
ClosureOrAsyncRibKind
|
ModuleRibKind
(
..
)
|
MacroDefinition
(
..
)
|
Forward
Ty
ParamBanRibKind
=>
{
|
Forward
Generic
ParamBanRibKind
=>
{
// Nothing to do. Continue.
}
ItemRibKind
(
_
)
|
FnItemRibKind
|
AssocItemRibKind
=>
{
...
...
@@ -2689,7 +2689,9 @@ fn validate_res_from_ribs(
// We only forbid constant items if we are inside of type defaults,
// for example `struct Foo<T, U = [u8; std::mem::size_of::<T>()]>`
ForwardTyParamBanRibKind
=>
{
ForwardGenericParamBanRibKind
=>
{
// FIXME(const_generic_defaults): we may need to distinguish between
// being in type parameter defaults and const parameter defaults
in_ty_param_default
=
true
;
continue
;
}
...
...
@@ -2782,7 +2784,9 @@ fn validate_res_from_ribs(
// We only forbid constant items if we are inside of type defaults,
// for example `struct Foo<T, U = [u8; std::mem::size_of::<T>()]>`
ForwardTyParamBanRibKind
=>
{
ForwardGenericParamBanRibKind
=>
{
// FIXME(const_generic_defaults): we may need to distinguish between
// being in type parameter defaults and const parameter defaults
in_ty_param_default
=
true
;
continue
;
}
...
...
compiler/rustc_typeck/src/astconv/mod.rs
浏览文件 @
8ef81388
...
...
@@ -507,7 +507,7 @@ fn inferred_kind(
GenericParamDefKind
::
Const
{
has_default
}
=>
{
let
ty
=
tcx
.at
(
self
.span
)
.type_of
(
param
.def_id
);
if
!
infer_args
&&
has_default
{
let
c
=
ty
::
Const
::
from_anon_const
(
tcx
,
param
.def_id
.expect_local
()
);
let
c
=
substs
.unwrap
()[
param
.index
as
usize
]
.expect_const
(
);
ty
::
subst
::
GenericArg
::
from
(
c
)
}
else
if
infer_args
{
self
.astconv
.ct_infer
(
ty
,
Some
(
param
),
self
.span
)
.into
()
...
...
@@ -515,6 +515,7 @@ fn inferred_kind(
// We've already errored above about the mismatch.
tcx
.const_error
(
ty
)
.into
()
}
// FIXME(const_generic_defaults)
/*
if !infer_args && has_default {
/*
...
...
compiler/rustc_typeck/src/check/fn_ctxt/_impl.rs
浏览文件 @
8ef81388
...
...
@@ -1447,7 +1447,7 @@ fn inferred_kind(
if
infer_args
||
!
has_default
{
return
self
.fcx
.var_for_def
(
self
.span
,
param
);
}
// FIXME(const_generic
s:
defaults)
// FIXME(const_generic
_
defaults)
// No const parameters were provided, we have to infer them.
todo!
()
}
...
...
compiler/rustc_typeck/src/check/wfcheck.rs
浏览文件 @
8ef81388
...
...
@@ -713,10 +713,11 @@ fn check_where_clauses<'tcx, 'fcx>(
let
generics
=
tcx
.generics_of
(
def_id
);
let
is_our_default
=
|
def
:
&
ty
::
GenericParamDef
|
match
def
.kind
{
GenericParamDefKind
::
Type
{
has_default
,
..
}
=>
{
GenericParamDefKind
::
Type
{
has_default
,
..
}
|
GenericParamDefKind
::
Const
{
has_default
}
=>
{
has_default
&&
def
.index
>=
generics
.parent_count
as
u32
}
_
=>
unreachable!
(),
GenericParamDefKind
::
Lifetime
=>
unreachable!
(),
};
// Check that concrete defaults are well-formed. See test `type-check-defaults.rs`.
...
...
@@ -758,7 +759,7 @@ fn check_where_clauses<'tcx, 'fcx>(
fcx
.tcx
.mk_param_from_def
(
param
)
}
GenericParamDefKind
::
Const
{
..
}
|
GenericParamDefKind
::
Type
{
..
}
=>
{
GenericParamDefKind
::
Type
{
..
}
|
GenericParamDefKind
::
Const
{
..
}
=>
{
// If the param has a default, ...
if
is_our_default
(
param
)
{
let
default_ty
=
fcx
.tcx
.type_of
(
param
.def_id
);
...
...
compiler/rustc_typeck/src/collect.rs
浏览文件 @
8ef81388
...
...
@@ -254,10 +254,14 @@ fn visit_generics(&mut self, generics: &'tcx hir::Generics<'tcx>) {
self
.tcx
.ensure
()
.type_of
(
def_id
);
}
hir
::
GenericParamKind
::
Type
{
..
}
=>
{}
hir
::
GenericParamKind
::
Const
{
..
}
=>
{
hir
::
GenericParamKind
::
Const
{
default
,
..
}
=>
{
let
def_id
=
self
.tcx
.hir
()
.local_def_id
(
param
.hir_id
);
self
.tcx
.ensure
()
.type_of
(
def_id
);
// FIXME(const_generics_defaults)
if
let
Some
(
default
)
=
default
{
let
def_id
=
self
.tcx
.hir
()
.local_def_id
(
default
.hir_id
);
self
.tcx
.ensure
()
.type_of
(
def_id
);
}
}
}
}
...
...
compiler/rustc_typeck/src/collect/type_of.rs
浏览文件 @
8ef81388
...
...
@@ -83,8 +83,7 @@ pub(super) fn opt_const_param_of(tcx: TyCtxt<'_>, def_id: LocalDefId) -> Option<
return
generics
.params
.iter
()
.filter
(|
param
|
matches!
(
param
.kind
,
ty
::
GenericParamDefKind
::
Const
{
..
}))
.filter
(|
param
|
matches!
(
param
.kind
,
ty
::
GenericParamDefKind
::
Const
{
..
}))
.nth
(
arg_index
)
.map
(|
param
|
param
.def_id
);
}
...
...
src/test/ui/const-generics/defaults/const-default.rs
浏览文件 @
8ef81388
...
...
@@ -5,10 +5,7 @@
#![allow(incomplete_features)]
#[derive(Default)]
pub
struct
ConstDefault
<
const
N
:
usize
=
3
>
{
items
:
[
u32
;
N
]
}
pub
struct
ConstDefault
<
const
N
:
usize
=
3
>
{}
pub
fn
main
()
{
let
s
=
ConstDefault
::
default
();
...
...
src/test/ui/const-generics/min_const_generics/default_function_param.rs
浏览文件 @
8ef81388
#![feature(const_generic_defaults)]
#![crate_type
=
"lib"
]
#![feature(const_generics_defaults)]
#![feature(min_const_generics)]
#![allow(incomplete_features)]
fn
foo
<
const
SIZE
:
usize
=
5
>
()
{}
//~^ ERROR default values for const generic parameters are experimental
fn
main
()
{}
fn
foo
<
const
SIZE
:
usize
=
5u
size
>
()
{}
src/test/ui/const-generics/min_const_generics/default_function_param.stderr
浏览文件 @
8ef81388
error[E0
658]: default values for const generic parameters are experimental
--> $DIR/default_function_param.rs:
1:26
error[E0
282]: type annotations needed
--> $DIR/default_function_param.rs:
6:28
|
LL | fn foo<const SIZE: usize = 5>() {}
| ^^^
|
= note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
= help: add `#![feature(const_generics_defaults)]` to the crate attributes to enable
| ^ cannot infer type for type `{integer}`
error: aborting due to previous error
For more information about this error, try `rustc --explain E0
658
`.
For more information about this error, try `rustc --explain E0
282
`.
src/test/ui/const-generics/min_const_generics/default_trait_param.rs
浏览文件 @
8ef81388
trait
Foo
<
const
KIND
:
bool
=
true
>
{}
//~^ ERROR default values for const generic parameters are experimental
fn
main
()
{}
src/test/ui/error-codes/E0128.stderr
浏览文件 @
8ef81388
error[E0128]:
type
parameters with a default cannot use forward declared identifiers
error[E0128]:
generic
parameters with a default cannot use forward declared identifiers
--> $DIR/E0128.rs:1:14
|
LL | struct Foo<T=U, U=()> {
| ^ defaulted
type
parameters cannot be forward declared
| ^ defaulted
generic
parameters cannot be forward declared
error: aborting due to previous error
...
...
src/test/ui/feature-gate/feature-gate-const_generic_defaults.rs
已删除
100644 → 0
浏览文件 @
e4e5db4e
#![feature(min_const_generics)]
#![crate_type=
"lib"
]
struct
A
<
const
N
:
usize
=
3
>
;
//~^ ERROR default values for
src/test/ui/feature-gate/feature-gate-const_generic_defaults.stderr
已删除
100644 → 0
浏览文件 @
e4e5db4e
error: default values for const generic parameters are unstable
--> $DIR/feature-gate-const_generic_defaults.rs:4:27
|
LL | struct A<const N: usize = 3>;
| ^
|
= note: to enable them use #![feature(const_generic_defaults)]
error: aborting due to previous error
src/test/ui/generics/generic-non-trailing-defaults.stderr
浏览文件 @
8ef81388
...
...
@@ -10,12 +10,5 @@ error: type parameters with a default must be trailing
LL | struct Foo<A, B = Vec<C>, C>(A, B, C);
| ^
error[E0128]: type parameters with a default cannot use forward declared identifiers
--> $DIR/generic-non-trailing-defaults.rs:6:23
|
LL | struct Foo<A, B = Vec<C>, C>(A, B, C);
| ^ defaulted type parameters cannot be forward declared
error: aborting due to 3 previous errors
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0128`.
src/test/ui/generics/generic-type-params-forward-mention.stderr
浏览文件 @
8ef81388
error[E0128]:
type
parameters with a default cannot use forward declared identifiers
error[E0128]:
generic
parameters with a default cannot use forward declared identifiers
--> $DIR/generic-type-params-forward-mention.rs:2:23
|
LL | struct Foo<T = Option<U>, U = bool>(T, U);
| ^ defaulted
type
parameters cannot be forward declared
| ^ defaulted
generic
parameters cannot be forward declared
error: aborting due to previous error
...
...
src/test/ui/issues/issue-18183.stderr
浏览文件 @
8ef81388
error[E0128]:
type
parameters with a default cannot use forward declared identifiers
error[E0128]:
generic
parameters with a default cannot use forward declared identifiers
--> $DIR/issue-18183.rs:1:20
|
LL | pub struct Foo<Bar=Bar>(Bar);
| ^^^ defaulted
type
parameters cannot be forward declared
| ^^^ defaulted
generic
parameters cannot be forward declared
error: aborting due to previous error
...
...
src/test/ui/issues/issue-26812.stderr
浏览文件 @
8ef81388
error[E0128]:
type
parameters with a default cannot use forward declared identifiers
error[E0128]:
generic
parameters with a default cannot use forward declared identifiers
--> $DIR/issue-26812.rs:3:10
|
LL | fn avg<T=T::Item>(_: T) {}
| ^^^^^^^ defaulted
type
parameters cannot be forward declared
| ^^^^^^^ defaulted
generic
parameters cannot be forward declared
error: aborting due to previous error
...
...
src/test/ui/panic-handler/weak-lang-item.stderr
浏览文件 @
8ef81388
...
...
@@ -10,10 +10,10 @@ help: you can use `as` to change the binding name of the import
LL | extern crate core as other_core;
|
error: language item required, but not found: `eh_personality`
error: `#[panic_handler]` function required, but not found
error: language item required, but not found: `eh_personality`
error: aborting due to 3 previous errors
For more information about this error, try `rustc --explain E0259`.
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录