Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove EvaluationResult::EvaluatedTo{Unknown,Recur} #114249

Closed
wants to merge 1 commit into from

Conversation

aliemjay
Copy link
Member

@aliemjay aliemjay commented Jul 30, 2023

I was confused by them while reviewing #114023.

EvaluatedToRecur was introduced in #42840, seemingly with intent to support inductive cycles in the current solver, but that's not something we plan to have in the old solver. It is broken anyway because it's never converted into EvaluatedToErr in the root predicate, see the FIXME in the docs.

EvaluatedToUnknown is not handled any differently than EvaluatedtoAmbig.

r? @lcnr @compiler-errors

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jul 30, 2023
// Avoid caching results that depend on more than just the trait-ref
// - the stack can create recursion.
if result.is_stack_dependent() {
return;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How is it sound to remove this? Aren't we caching things that should not be cached?

@aliemjay
Copy link
Member Author

aliemjay commented Aug 7, 2023

as @compiler-errors noted, this example breaks under this PR because fn match_fresh_trait_refs is incomplete. See also rust-lang/trait-system-refactor-initiative#56.
Box<u16>: Trait<_> is cached as ambiguous although it clearly doesn't hold.

trait Trait<J> {}
// This impl doesn't hold
impl<J> Trait<J> for Box<u32>
where
    Box<u16>: Trait<J>,
    Option<u8>: Trait<J>,
{}
// This impl holds
impl Trait<()> for Box<u8> {}

// --- Trait2
trait Trait2<J> {}
// This impl doesn't hold
impl<J> Trait2<J> for Box<u32> where Box<u16>: Trait<J> {}
// This impl holds
impl Trait2<()> for Box<u8> {}

fn impls_trait1<T: Trait<J>, J>() {}
fn impls_trait2<T: Trait2<J>, J>() {}

fn main() {
    impls_trait1::<Box<_>, _>;
    impls_trait2::<Box<_>, _>;
}

@rustbot author

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 7, 2023
@aliemjay aliemjay marked this pull request as draft August 7, 2023 13:40
@bors
Copy link
Contributor

bors commented Aug 15, 2023

☔ The latest upstream changes (presumably #114023) made this pull request unmergeable. Please resolve the merge conflicts.

@Dylan-DPC
Copy link
Member

@aliemjay any updates on this?

@Dylan-DPC
Copy link
Member

Closing this as inactive. Feel free to reöpen this pr or create a new pr if you get the time to work on this. Thanks

@Dylan-DPC Dylan-DPC closed this Feb 12, 2024
@Dylan-DPC Dylan-DPC added S-inactive Status: Inactive and waiting on the author. This is often applied to closed PRs. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Feb 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-inactive Status: Inactive and waiting on the author. This is often applied to closed PRs. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants