forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of rust-lang#126409 - pacak:incr-uplorry, r=michaelwoerister
Trying to address an incremental compilation issues This pull request contains two independent changes, one makes it so when `try_force_from_dep_node` fails to recover a query - it marks the node as "red" instead of "green" and the second one makes Debug impl for `DepNode` less panicky if it encounters something from the previous compilation that doesn't map to anything in the current one. I'm not 100% confident that this is the correct approach, but so far I managed to find a bunch of comments suggesting that some things are allowed to fail in a certain way and changes I made are allowing for those things to fail this way and it fixes all the small reproducers I managed to find. Compilation panic this pull request avoids is caused by an automatically generated code on an associated type and it is not happening if something else marks it as outdated first (or close like that, but scenario is quite obscure). Fixes rust-lang#107226 Fixes rust-lang#125367
- Loading branch information
Showing
6 changed files
with
66 additions
and
43 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
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
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(); | ||
} |