Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
253a970c
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,发现更多精彩内容 >>
提交
253a970c
编写于
2月 03, 2021
作者:
C
Camelid
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Miscellaneous small diagnostics cleanup
上级
e708cbd9
变更
16
显示空白变更内容
内联
并排
Showing
16 changed file
with
20 addition
and
20 deletion
+20
-20
compiler/rustc_trait_selection/src/traits/const_evaluatable.rs
...ler/rustc_trait_selection/src/traits/const_evaluatable.rs
+1
-1
compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs
...r/rustc_trait_selection/src/traits/error_reporting/mod.rs
+1
-1
compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs
...trait_selection/src/traits/error_reporting/suggestions.rs
+1
-1
compiler/rustc_typeck/src/check/mod.rs
compiler/rustc_typeck/src/check/mod.rs
+1
-1
src/test/ui/const-generics/const_evaluatable_checked/cross_crate_predicate.stderr
...cs/const_evaluatable_checked/cross_crate_predicate.stderr
+4
-4
src/test/ui/const-generics/const_evaluatable_checked/different-fn.stderr
...st-generics/const_evaluatable_checked/different-fn.stderr
+1
-1
src/test/ui/const_evaluatable/needs_where_clause.stderr
src/test/ui/const_evaluatable/needs_where_clause.stderr
+1
-1
src/test/ui/const_evaluatable/no_where_clause.stderr
src/test/ui/const_evaluatable/no_where_clause.stderr
+1
-1
src/test/ui/issues/issue-18919.stderr
src/test/ui/issues/issue-18919.stderr
+1
-1
src/test/ui/issues/issue-23281.stderr
src/test/ui/issues/issue-23281.stderr
+1
-1
src/test/ui/suggestions/adt-param-with-implicit-sized-bound.stderr
...ui/suggestions/adt-param-with-implicit-sized-bound.stderr
+2
-2
src/test/ui/unsized/unsized-enum.stderr
src/test/ui/unsized/unsized-enum.stderr
+1
-1
src/test/ui/unsized/unsized-inherent-impl-self-type.stderr
src/test/ui/unsized/unsized-inherent-impl-self-type.stderr
+1
-1
src/test/ui/unsized/unsized-struct.stderr
src/test/ui/unsized/unsized-struct.stderr
+1
-1
src/test/ui/unsized/unsized-trait-impl-self-type.stderr
src/test/ui/unsized/unsized-trait-impl-self-type.stderr
+1
-1
src/test/ui/wf/wf-fn-where-clause.stderr
src/test/ui/wf/wf-fn-where-clause.stderr
+1
-1
未找到文件。
compiler/rustc_trait_selection/src/traits/const_evaluatable.rs
浏览文件 @
253a970c
...
...
@@ -117,7 +117,7 @@ enum FailureKind {
{
err
.span_help
(
tcx
.def_span
(
def
.did
),
&
format!
(
"try adding a `where` bound using this expression:
where [u8; {}]: Sized
"
,
snippet
),
&
format!
(
"try adding a `where` bound using this expression:
`where [u8; {}]: Sized`
"
,
snippet
),
);
}
else
{
err
.span_help
(
...
...
compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs
浏览文件 @
253a970c
...
...
@@ -1780,7 +1780,7 @@ fn suggest_unsized_bound_if_applicable(
multispan
.push_span_label
(
sp
,
format!
(
"...if indirection w
as
used here: `Box<{}>`"
,
"...if indirection w
ere
used here: `Box<{}>`"
,
param
.name
.ident
(),
),
);
...
...
compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs
浏览文件 @
253a970c
...
...
@@ -1103,7 +1103,7 @@ fn suggest_impl_trait(
// This is currently not possible to trigger because E0038 takes precedence, but
// leave it in for completeness in case anything changes in an earlier stage.
err
.note
(
&
format!
(
"if trait `{}` w
as object
safe, you could return a trait object"
,
"if trait `{}` w
ere object-
safe, you could return a trait object"
,
trait_obj
,
));
}
...
...
compiler/rustc_typeck/src/check/mod.rs
浏览文件 @
253a970c
...
...
@@ -838,7 +838,7 @@ fn missing_items_err(
// Obtain the level of indentation ending in `sugg_sp`.
let
indentation
=
tcx
.sess
.source_map
()
.span_to_margin
(
sugg_sp
)
.unwrap_or
(
0
);
// Make the whitespace that will make the suggestion have the right indentation.
let
padding
:
String
=
(
0
..
indentation
)
.map
(|
_
|
" "
)
.collect
();
let
padding
:
String
=
std
::
iter
::
repeat
(
" "
)
.take
(
indentation
)
.collect
();
for
trait_item
in
missing_items
{
let
snippet
=
suggestion_signature
(
&
trait_item
,
tcx
);
...
...
src/test/ui/const-generics/const_evaluatable_checked/cross_crate_predicate.stderr
浏览文件 @
253a970c
...
...
@@ -4,7 +4,7 @@ error: unconstrained generic constant
LL | let _ = const_evaluatable_lib::test1::<T>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
help: try adding a `where` bound using this expression:
where [u8; std::mem::size_of::<T>() - 1]: Sized
help: try adding a `where` bound using this expression:
`where [u8; std::mem::size_of::<T>() - 1]: Sized`
--> $DIR/auxiliary/const_evaluatable_lib.rs:6:10
|
LL | [u8; std::mem::size_of::<T>() - 1]: Sized,
...
...
@@ -16,7 +16,7 @@ error: unconstrained generic constant
LL | let _ = const_evaluatable_lib::test1::<T>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
help: try adding a `where` bound using this expression:
where [u8; std::mem::size_of::<T>() - 1]: Sized
help: try adding a `where` bound using this expression:
`where [u8; std::mem::size_of::<T>() - 1]: Sized`
--> $DIR/auxiliary/const_evaluatable_lib.rs:4:27
|
LL | pub fn test1<T>() -> [u8; std::mem::size_of::<T>() - 1]
...
...
@@ -28,7 +28,7 @@ error: unconstrained generic constant
LL | let _ = const_evaluatable_lib::test1::<T>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
help: try adding a `where` bound using this expression:
where [u8; std::mem::size_of::<T>() - 1]: Sized
help: try adding a `where` bound using this expression:
`where [u8; std::mem::size_of::<T>() - 1]: Sized`
--> $DIR/auxiliary/const_evaluatable_lib.rs:6:10
|
LL | [u8; std::mem::size_of::<T>() - 1]: Sized,
...
...
@@ -40,7 +40,7 @@ error: unconstrained generic constant
LL | let _ = const_evaluatable_lib::test1::<T>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
help: try adding a `where` bound using this expression:
where [u8; std::mem::size_of::<T>() - 1]: Sized
help: try adding a `where` bound using this expression:
`where [u8; std::mem::size_of::<T>() - 1]: Sized`
--> $DIR/auxiliary/const_evaluatable_lib.rs:4:27
|
LL | pub fn test1<T>() -> [u8; std::mem::size_of::<T>() - 1]
...
...
src/test/ui/const-generics/const_evaluatable_checked/different-fn.stderr
浏览文件 @
253a970c
...
...
@@ -4,7 +4,7 @@ error: unconstrained generic constant
LL | [0; size_of::<Foo<T>>()]
| ^^^^^^^^^^^^^^^^^^^
|
help: try adding a `where` bound using this expression:
where [u8; size_of::<Foo<T>>()]: Sized
help: try adding a `where` bound using this expression:
`where [u8; size_of::<Foo<T>>()]: Sized`
--> $DIR/different-fn.rs:10:9
|
LL | [0; size_of::<Foo<T>>()]
...
...
src/test/ui/const_evaluatable/needs_where_clause.stderr
浏览文件 @
253a970c
...
...
@@ -4,7 +4,7 @@ error: unconstrained generic constant
LL | b: [f32; complex_maths::<T>(N)],
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
help: try adding a `where` bound using this expression:
where [u8; complex_maths::<T>(N)]: Sized
help: try adding a `where` bound using this expression:
`where [u8; complex_maths::<T>(N)]: Sized`
--> $DIR/needs_where_clause.rs:11:12
|
LL | b: [f32; complex_maths::<T>(N)],
...
...
src/test/ui/const_evaluatable/no_where_clause.stderr
浏览文件 @
253a970c
...
...
@@ -4,7 +4,7 @@ error: unconstrained generic constant
LL | b: [f32; complex_maths(N)],
| ^^^^^^^^^^^^^^^^^^^^^^^
|
help: try adding a `where` bound using this expression:
where [u8; complex_maths(N)]: Sized
help: try adding a `where` bound using this expression:
`where [u8; complex_maths(N)]: Sized`
--> $DIR/no_where_clause.rs:10:12
|
LL | b: [f32; complex_maths(N)],
...
...
src/test/ui/issues/issue-18919.stderr
浏览文件 @
253a970c
...
...
@@ -14,7 +14,7 @@ help: you could relax the implicit `Sized` bound on `T` if it were used through
LL | enum Option<T> {
| ^ this could be changed to `T: ?Sized`...
LL | Some(T),
| - ...if indirection w
as
used here: `Box<T>`
| - ...if indirection w
ere
used here: `Box<T>`
error: aborting due to previous error
...
...
src/test/ui/issues/issue-23281.stderr
浏览文件 @
253a970c
...
...
@@ -14,7 +14,7 @@ help: you could relax the implicit `Sized` bound on `T` if it were used through
LL | struct Vec<T> {
| ^ this could be changed to `T: ?Sized`...
LL | t: T,
| - ...if indirection w
as
used here: `Box<T>`
| - ...if indirection w
ere
used here: `Box<T>`
error: aborting due to previous error
...
...
src/test/ui/suggestions/adt-param-with-implicit-sized-bound.stderr
浏览文件 @
253a970c
...
...
@@ -13,7 +13,7 @@ help: you could relax the implicit `Sized` bound on `T` if it were used through
--> $DIR/adt-param-with-implicit-sized-bound.rs:18:10
|
LL | struct X<T>(T);
| ^ - ...if indirection w
as
used here: `Box<T>`
| ^ - ...if indirection w
ere
used here: `Box<T>`
| |
| this could be changed to `T: ?Sized`...
...
...
@@ -68,7 +68,7 @@ help: you could relax the implicit `Sized` bound on `T` if it were used through
LL | struct Struct3<T>{
| ^ this could be changed to `T: ?Sized`...
LL | _t: T,
| - ...if indirection w
as
used here: `Box<T>`
| - ...if indirection w
ere
used here: `Box<T>`
help: consider further restricting `Self`
|
LL | fn func3() -> Struct3<Self> where Self: Sized;
...
...
src/test/ui/unsized/unsized-enum.stderr
浏览文件 @
253a970c
...
...
@@ -13,7 +13,7 @@ help: you could relax the implicit `Sized` bound on `U` if it were used through
--> $DIR/unsized-enum.rs:4:10
|
LL | enum Foo<U> { FooSome(U), FooNone }
| ^ - ...if indirection w
as
used here: `Box<U>`
| ^ - ...if indirection w
ere
used here: `Box<U>`
| |
| this could be changed to `U: ?Sized`...
...
...
src/test/ui/unsized/unsized-inherent-impl-self-type.stderr
浏览文件 @
253a970c
...
...
@@ -13,7 +13,7 @@ help: you could relax the implicit `Sized` bound on `Y` if it were used through
--> $DIR/unsized-inherent-impl-self-type.rs:5:11
|
LL | struct S5<Y>(Y);
| ^ - ...if indirection w
as
used here: `Box<Y>`
| ^ - ...if indirection w
ere
used here: `Box<Y>`
| |
| this could be changed to `Y: ?Sized`...
...
...
src/test/ui/unsized/unsized-struct.stderr
浏览文件 @
253a970c
...
...
@@ -13,7 +13,7 @@ help: you could relax the implicit `Sized` bound on `T` if it were used through
--> $DIR/unsized-struct.rs:4:12
|
LL | struct Foo<T> { data: T }
| ^ - ...if indirection w
as
used here: `Box<T>`
| ^ - ...if indirection w
ere
used here: `Box<T>`
| |
| this could be changed to `T: ?Sized`...
...
...
src/test/ui/unsized/unsized-trait-impl-self-type.stderr
浏览文件 @
253a970c
...
...
@@ -13,7 +13,7 @@ help: you could relax the implicit `Sized` bound on `Y` if it were used through
--> $DIR/unsized-trait-impl-self-type.rs:8:11
|
LL | struct S5<Y>(Y);
| ^ - ...if indirection w
as
used here: `Box<Y>`
| ^ - ...if indirection w
ere
used here: `Box<Y>`
| |
| this could be changed to `Y: ?Sized`...
...
...
src/test/ui/wf/wf-fn-where-clause.stderr
浏览文件 @
253a970c
...
...
@@ -28,7 +28,7 @@ help: you could relax the implicit `Sized` bound on `T` if it were used through
LL | struct Vec<T> {
| ^ this could be changed to `T: ?Sized`...
LL | t: T,
| - ...if indirection w
as
used here: `Box<T>`
| - ...if indirection w
ere
used here: `Box<T>`
error[E0038]: the trait `Copy` cannot be made into an object
--> $DIR/wf-fn-where-clause.rs:12:16
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录