forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow for try_force_from_dep_node to fail
The way it is implemented currently try_force_from_dep_node returns true as long as there's a function to force the query. It wasn't this way from the beginning, earlier version was producing forcing result and it was changed in rust-lang#89978, I couldn't find any comments addressing this change. One way it can fail is by failing to recover the query in DepNodeParams::recover - when we are trying to query something that no longer exists in the current environment
- Loading branch information
Showing
2 changed files
with
51 additions
and
7 deletions.
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
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,40 @@ | ||
// If it is impossible to find query arguments just from the hash | ||
// compiler should treat the node as red | ||
|
||
// In this test prior to fixing compiler was having problems figuring out | ||
// drop impl for T inside of m | ||
|
||
//@ revisions:cfail1 cfail2 | ||
//@ compile-flags: --crate-type=lib | ||
//@ build-pass | ||
|
||
pub trait P { | ||
type A; | ||
} | ||
|
||
struct S; | ||
|
||
impl P for S { | ||
type A = C; | ||
} | ||
|
||
struct T<D: P>(D::A, Z<D>); | ||
|
||
struct Z<D: P>(D::A, String); | ||
|
||
impl<D: P> T<D> { | ||
pub fn i() -> Self { | ||
loop {} | ||
} | ||
} | ||
|
||
enum C { | ||
#[cfg(cfail1)] | ||
Up(()), | ||
#[cfg(cfail2)] | ||
Lorry(()), | ||
} | ||
|
||
pub fn m() { | ||
T::<S>::i(); | ||
} |