add the leak check to the new solver
This commit is contained in:
parent
04056b5c04
commit
6f9041bd15
2 changed files with 29 additions and 0 deletions
24
tests/ui/higher-ranked/leak-check-in-selection.rs
Normal file
24
tests/ui/higher-ranked/leak-check-in-selection.rs
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
// run-pass
|
||||
// revisions: old next
|
||||
//[next] compile-flags: -Ztrait-solver=next
|
||||
#![allow(coherence_leak_check)]
|
||||
|
||||
trait Trait: Sized {
|
||||
fn is_higher_ranked(self) -> bool;
|
||||
}
|
||||
|
||||
impl Trait for for<'a> fn(&'a ()) {
|
||||
fn is_higher_ranked(self) -> bool {
|
||||
true
|
||||
}
|
||||
}
|
||||
impl<'a> Trait for fn(&'a ()) {
|
||||
fn is_higher_ranked(self) -> bool {
|
||||
false
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let x: for<'a> fn(&'a ()) = |&()| ();
|
||||
assert!(x.is_higher_ranked());
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue