-
Notifications
You must be signed in to change notification settings - Fork 12.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Select obligations before processing wf obligation in compare_method_…
…predicate_entailment
- Loading branch information
1 parent
ebbd715
commit b6b5a65
Showing
3 changed files
with
62 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
tests/ui/implied-bounds/implied-bounds-entailment-wf-vars-issue-114783-1.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// 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() {} |
26 changes: 26 additions & 0 deletions
26
tests/ui/implied-bounds/implied-bounds-entailment-wf-vars-issue-114783-2.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// 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() {} |