forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#127405 - compiler-errors:uplift-predicate-emitting-relation, r=lcnr uplift `PredicateEmittingRelation` Small follow-up to rust-lang#127333 r? lcnr
- Loading branch information
Showing
16 changed files
with
75 additions
and
55 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
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
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 |
---|---|---|
|
@@ -6,5 +6,6 @@ | |
|
||
pub mod canonicalizer; | ||
pub mod delegate; | ||
pub mod relate; | ||
pub mod resolve; | ||
pub mod solve; |
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,15 @@ | ||
pub use rustc_type_ir::relate::*; | ||
|
||
pub mod combine; | ||
|
||
/// Whether aliases should be related structurally or not. Used | ||
/// to adjust the behavior of generalization and combine. | ||
/// | ||
/// This should always be `No` unless in a few special-cases when | ||
/// instantiating canonical responses and in the new solver. Each | ||
/// such case should have a comment explaining why it is used. | ||
#[derive(Debug, Copy, Clone)] | ||
pub enum StructurallyRelateAliases { | ||
Yes, | ||
No, | ||
} |
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,34 @@ | ||
pub use rustc_type_ir::relate::*; | ||
use rustc_type_ir::solve::Goal; | ||
use rustc_type_ir::{InferCtxtLike, Interner, Upcast}; | ||
|
||
use super::StructurallyRelateAliases; | ||
|
||
pub trait PredicateEmittingRelation<Infcx, I = <Infcx as InferCtxtLike>::Interner>: | ||
TypeRelation<I> | ||
where | ||
Infcx: InferCtxtLike<Interner = I>, | ||
I: Interner, | ||
{ | ||
fn span(&self) -> I::Span; | ||
|
||
fn param_env(&self) -> I::ParamEnv; | ||
|
||
/// Whether aliases should be related structurally. This is pretty much | ||
/// always `No` unless you're equating in some specific locations of the | ||
/// new solver. See the comments in these use-cases for more details. | ||
fn structurally_relate_aliases(&self) -> StructurallyRelateAliases; | ||
|
||
/// Register obligations that must hold in order for this relation to hold | ||
fn register_goals(&mut self, obligations: impl IntoIterator<Item = Goal<I, I::Predicate>>); | ||
|
||
/// Register predicates that must hold in order for this relation to hold. | ||
/// This uses the default `param_env` of the obligation. | ||
fn register_predicates( | ||
&mut self, | ||
obligations: impl IntoIterator<Item: Upcast<I, I::Predicate>>, | ||
); | ||
|
||
/// Register `AliasRelate` obligation(s) that both types must be related to each other. | ||
fn register_alias_relate_predicate(&mut self, a: I::Ty, b: I::Ty); | ||
} |
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