Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
b6b5a65a
R
Rust
项目概览
int
/
Rust
12 个月 前同步成功
通知
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,发现更多精彩内容 >>
提交
b6b5a65a
编写于
8月 13, 2023
作者:
M
Michael Goulet
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Select obligations before processing wf obligation in compare_method_predicate_entailment
上级
ebbd7154
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
62 addition
and
1 deletion
+62
-1
compiler/rustc_hir_analysis/src/check/compare_impl_item.rs
compiler/rustc_hir_analysis/src/check/compare_impl_item.rs
+10
-1
tests/ui/implied-bounds/implied-bounds-entailment-wf-vars-issue-114783-1.rs
...ounds/implied-bounds-entailment-wf-vars-issue-114783-1.rs
+26
-0
tests/ui/implied-bounds/implied-bounds-entailment-wf-vars-issue-114783-2.rs
...ounds/implied-bounds-entailment-wf-vars-issue-114783-2.rs
+26
-0
未找到文件。
compiler/rustc_hir_analysis/src/check/compare_impl_item.rs
浏览文件 @
b6b5a65a
...
...
@@ -308,6 +308,15 @@ fn compare_method_predicate_entailment<'tcx>(
}
if
check_implied_wf
==
CheckImpliedWfMode
::
Check
&&
!
(
impl_sig
,
trait_sig
)
.references_error
()
{
// Select obligations to make progress on inference before processing
// the wf obligation below.
// FIXME(-Ztrait-solver=next): Not needed when the hack below is removed.
let
errors
=
ocx
.select_where_possible
();
if
!
errors
.is_empty
()
{
let
reported
=
infcx
.err_ctxt
()
.report_fulfillment_errors
(
&
errors
);
return
Err
(
reported
);
}
// See #108544. Annoying, we can end up in cases where, because of winnowing,
// we pick param env candidates over a more general impl, leading to more
// stricter lifetime requirements than we would otherwise need. This can
...
...
@@ -378,7 +387,7 @@ fn compare_method_predicate_entailment<'tcx>(
// lifetime parameters.
let
outlives_env
=
OutlivesEnvironment
::
with_bounds
(
param_env
,
infcx
.implied_bounds_tys
(
param_env
,
impl_m_def_id
,
wf_tys
.clone
()
),
infcx
.implied_bounds_tys
(
param_env
,
impl_m_def_id
,
wf_tys
),
);
let
errors
=
infcx
.resolve_regions
(
&
outlives_env
);
if
!
errors
.is_empty
()
{
...
...
tests/ui/implied-bounds/implied-bounds-entailment-wf-vars-issue-114783-1.rs
0 → 100644
浏览文件 @
b6b5a65a
// check-pass
pub
trait
Foo
{
type
Error
:
Error
;
fn
foo
(
&
self
,
stream
:
&<
Self
::
Error
as
Error
>
::
Span
);
}
pub
struct
Wrapper
<
Inner
>
(
Inner
);
impl
<
E
:
Error
,
Inner
>
Foo
for
Wrapper
<
Inner
>
where
Inner
:
Foo
<
Error
=
E
>
,
{
type
Error
=
E
;
fn
foo
(
&
self
,
stream
:
&<
Self
::
Error
as
Error
>
::
Span
)
{
todo!
()
}
}
pub
trait
Error
{
type
Span
;
}
fn
main
()
{}
tests/ui/implied-bounds/implied-bounds-entailment-wf-vars-issue-114783-2.rs
0 → 100644
浏览文件 @
b6b5a65a
// check-pass
trait
AsBufferView
{
type
Device
;
}
trait
Error
{
type
Span
;
}
trait
Foo
{
type
Error
:
Error
;
fn
foo
(
&
self
)
->
&<
Self
::
Error
as
Error
>
::
Span
;
}
impl
<
D
:
Error
,
VBuf0
>
Foo
for
VBuf0
where
VBuf0
:
AsBufferView
<
Device
=
D
>
,
{
type
Error
=
D
;
fn
foo
(
&
self
)
->
&<
Self
::
Error
as
Error
>
::
Span
{
todo!
()
}
}
fn
main
()
{}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录