Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
1fc3c4c1
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,发现更多精彩内容 >>
提交
1fc3c4c1
编写于
12月 31, 2020
作者:
R
Rémy Rakic
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
adjust const generics defaults FIXMEs to the new feature gate
上级
907ba75e
变更
13
隐藏空白更改
内联
并排
Showing
13 changed file
with
14 addition
and
14 deletion
+14
-14
compiler/rustc_ast_passes/src/ast_validation.rs
compiler/rustc_ast_passes/src/ast_validation.rs
+1
-1
compiler/rustc_infer/src/infer/error_reporting/mod.rs
compiler/rustc_infer/src/infer/error_reporting/mod.rs
+1
-1
compiler/rustc_metadata/src/rmeta/encoder.rs
compiler/rustc_metadata/src/rmeta/encoder.rs
+1
-1
compiler/rustc_middle/src/ty/print/mod.rs
compiler/rustc_middle/src/ty/print/mod.rs
+1
-1
compiler/rustc_passes/src/stability.rs
compiler/rustc_passes/src/stability.rs
+1
-1
compiler/rustc_resolve/src/lib.rs
compiler/rustc_resolve/src/lib.rs
+1
-1
compiler/rustc_typeck/src/astconv/generics.rs
compiler/rustc_typeck/src/astconv/generics.rs
+1
-1
compiler/rustc_typeck/src/astconv/mod.rs
compiler/rustc_typeck/src/astconv/mod.rs
+1
-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
+1
-1
compiler/rustc_typeck/src/collect.rs
compiler/rustc_typeck/src/collect.rs
+1
-1
src/librustdoc/clean/mod.rs
src/librustdoc/clean/mod.rs
+2
-2
src/test/ui/const-generics/params-in-ct-in-ty-param-lazy-norm.rs
...t/ui/const-generics/params-in-ct-in-ty-param-lazy-norm.rs
+1
-1
未找到文件。
compiler/rustc_ast_passes/src/ast_validation.rs
浏览文件 @
1fc3c4c1
...
...
@@ -774,7 +774,7 @@ fn validate_generic_param_order(
}
GenericParamKind
::
Type
{
default
:
None
}
=>
(),
GenericParamKind
::
Lifetime
=>
(),
// FIXME(const_generics
:
defaults)
// FIXME(const_generics
_
defaults)
GenericParamKind
::
Const
{
ty
:
_
,
kw_span
:
_
,
default
:
_
}
=>
(),
}
first
=
false
;
...
...
compiler/rustc_infer/src/infer/error_reporting/mod.rs
浏览文件 @
1fc3c4c1
...
...
@@ -958,7 +958,7 @@ fn strip_generic_default_params(
ty
::
GenericParamDefKind
::
Type
{
has_default
,
..
}
=>
{
Some
((
param
.def_id
,
has_default
))
}
ty
::
GenericParamDefKind
::
Const
=>
None
,
// FIXME(const_generics
:
defaults)
ty
::
GenericParamDefKind
::
Const
=>
None
,
// FIXME(const_generics
_
defaults)
})
.peekable
();
let
has_default
=
{
...
...
compiler/rustc_metadata/src/rmeta/encoder.rs
浏览文件 @
1fc3c4c1
...
...
@@ -1834,7 +1834,7 @@ fn encode_info_for_generics(&mut self, generics: &hir::Generics<'tcx>) {
EntryKind
::
ConstParam
,
true
,
);
// FIXME(const_generics
:
defaults)
// FIXME(const_generics
_
defaults)
}
}
}
...
...
compiler/rustc_middle/src/ty/print/mod.rs
浏览文件 @
1fc3c4c1
...
...
@@ -203,7 +203,7 @@ fn generic_args_to_print(
self
.tcx
()
.type_of
(
param
.def_id
)
.subst
(
self
.tcx
(),
substs
),
)
}
ty
::
GenericParamDefKind
::
Const
=>
false
,
// FIXME(const_generics
:
defaults)
ty
::
GenericParamDefKind
::
Const
=>
false
,
// FIXME(const_generics
_
defaults)
}
})
.count
();
...
...
compiler/rustc_passes/src/stability.rs
浏览文件 @
1fc3c4c1
...
...
@@ -443,7 +443,7 @@ 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)
// FIXME(const_generics
_
defaults)
hir
::
GenericParamKind
::
Type
{
default
,
..
}
if
default
.is_some
()
=>
{
AnnotationKind
::
Container
}
...
...
compiler/rustc_resolve/src/lib.rs
浏览文件 @
1fc3c4c1
...
...
@@ -214,7 +214,7 @@ enum ResolutionError<'a> {
/// Error E0530: `X` bindings cannot shadow `Y`s.
BindingShadowsSomethingUnacceptable
(
&
'static
str
,
Symbol
,
&
'a
NameBinding
<
'a
>
),
/// Error E0128: type parameters with a default cannot use forward-declared identifiers.
ForwardDeclaredTyParam
,
// FIXME(const_generics
:
defaults)
ForwardDeclaredTyParam
,
// FIXME(const_generics
_
defaults)
/// ERROR E0770: the type of const parameters must not depend on other generic parameters.
ParamInTyOfConstParam
(
Symbol
),
/// constant values inside of type parameter defaults must not depend on generic parameters.
...
...
compiler/rustc_typeck/src/astconv/generics.rs
浏览文件 @
1fc3c4c1
...
...
@@ -387,7 +387,7 @@ pub(crate) fn check_generic_arg_count(
defaults
.types
+=
has_default
as
usize
}
GenericParamDefKind
::
Const
=>
{
// FIXME(const_generics
:
defaults)
// FIXME(const_generics
_
defaults)
}
};
}
...
...
compiler/rustc_typeck/src/astconv/mod.rs
浏览文件 @
1fc3c4c1
...
...
@@ -486,7 +486,7 @@ fn inferred_kind(
}
GenericParamDefKind
::
Const
=>
{
let
ty
=
tcx
.at
(
self
.span
)
.type_of
(
param
.def_id
);
// FIXME(const_generics
:
defaults)
// FIXME(const_generics
_
defaults)
if
infer_args
{
// No const parameters were provided, we can infer all.
self
.astconv
.ct_infer
(
ty
,
Some
(
param
),
self
.span
)
.into
()
...
...
compiler/rustc_typeck/src/check/fn_ctxt/_impl.rs
浏览文件 @
1fc3c4c1
...
...
@@ -1376,7 +1376,7 @@ fn inferred_kind(
}
}
GenericParamDefKind
::
Const
=>
{
// FIXME(const_generics
:
defaults)
// FIXME(const_generics
_
defaults)
// No const parameters were provided, we have to infer them.
self
.fcx
.var_for_def
(
self
.span
,
param
)
}
...
...
compiler/rustc_typeck/src/check/wfcheck.rs
浏览文件 @
1fc3c4c1
...
...
@@ -785,7 +785,7 @@ fn check_where_clauses<'tcx, 'fcx>(
}
GenericParamDefKind
::
Const
=>
{
// FIXME(const_generics
:
defaults)
// FIXME(const_generics
_
defaults)
fcx
.tcx
.mk_param_from_def
(
param
)
}
}
...
...
compiler/rustc_typeck/src/collect.rs
浏览文件 @
1fc3c4c1
...
...
@@ -228,7 +228,7 @@ fn visit_generics(&mut self, generics: &'tcx hir::Generics<'tcx>) {
hir
::
GenericParamKind
::
Const
{
..
}
=>
{
let
def_id
=
self
.tcx
.hir
()
.local_def_id
(
param
.hir_id
);
self
.tcx
.ensure
()
.type_of
(
def_id
);
// FIXME(const_generics
:
defaults)
// FIXME(const_generics
_
defaults)
}
}
}
...
...
src/librustdoc/clean/mod.rs
浏览文件 @
1fc3c4c1
...
...
@@ -612,7 +612,7 @@ fn clean(&self, cx: &DocContext<'_>) -> GenericParamDef {
GenericParamDefKind
::
Const
{
did
:
cx
.tcx
.hir
()
.local_def_id
(
self
.hir_id
)
.to_def_id
(),
ty
:
ty
.clean
(
cx
),
// FIXME(const_generics_defaults): add `default` field here
to the
docs
// FIXME(const_generics_defaults): add `default` field here
for
docs
},
),
};
...
...
@@ -1386,7 +1386,7 @@ fn clean_qpath(hir_ty: &hir::Ty<'_>, cx: &DocContext<'_>) -> Type {
if
let
Some
(
ct
)
=
const_
{
ct_substs
.insert
(
const_param_def_id
.to_def_id
(),
ct
.clean
(
cx
));
}
// FIXME(const_generics
:
defaults)
// FIXME(const_generics
_
defaults)
indices
.consts
+=
1
;
}
}
...
...
src/test/ui/const-generics/params-in-ct-in-ty-param-lazy-norm.rs
浏览文件 @
1fc3c4c1
...
...
@@ -7,7 +7,7 @@
//[full]~^ ERROR constant values inside of type parameter defaults
//[min]~^^ ERROR generic parameters may not be used in const operations
// FIXME(const_generics
:defaults): We still don't know how to we
deal with type defaults.
// FIXME(const_generics
_defaults): We still don't know how to
deal with type defaults.
struct
Bar
<
T
=
[
u8
;
N
],
const
N
:
usize
>
(
T
);
//~^ ERROR constant values inside of type parameter defaults
//~| ERROR type parameters with a default
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录