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

Fix an implied bounds bug #206

Merged
merged 1 commit into from
Feb 22, 2019
Merged

Fix an implied bounds bug #206

merged 1 commit into from
Feb 22, 2019

Conversation

scalexm
Copy link
Member

@scalexm scalexm commented Feb 8, 2019

r? @nikomatsakis

Let's find some time to discuss again about this WellFormed / FromEnv duality. The proof I mentioned for soundness of the implied bounds setup did not model implied bounds from types, only those from traits. But I now understand better the recursive_where_clause_on_type test, how implied bounds from types and traits intertwine, and why this fix is the correct one.

@nikomatsakis nikomatsakis merged commit fc2d9ce into rust-lang:master Feb 22, 2019
bors added a commit to rust-lang/rust that referenced this pull request Mar 24, 2019
(WIP) Small fixes in chalkification

Small fixes around region constraints and builtin impls. There are still some type inference errors, for example the following code errors out:
```rust
fn main() {
    let mut x: Vec<i32> = Vec::new();
    //                    ^^^^^^^^ cannot infer type for `std::vec::Vec<_>`
}
```
but explicitly specifying `Vec::<i32>::new` works.

With these few fixes, the following code now passes type-checking:
```rust
fn main() {
    let mut x: Vec<i32> = Vec::<i32>::new();
    x.push(5);
    println!("{:?}", x);
}
```

I also fixed the implied bounds bug as discussed on Zulip and in rust-lang/chalk#206

cc @tmandry
r? @nikomatsakis
scalexm added a commit to scalexm/chalk that referenced this pull request Jun 24, 2021
scalexm added a commit to scalexm/chalk that referenced this pull request Jun 24, 2021
bors added a commit that referenced this pull request Jun 29, 2021
Update "implied bounds" rules for types to match #206

The rules were changed in #206, but the book was not updated.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants