Fix an implied bounds bug#206
Merged
nikomatsakis merged 1 commit intorust-lang:masterfrom Feb 22, 2019
Merged
Conversation
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
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
r? @nikomatsakis
Let's find some time to discuss again about this
WellFormed/FromEnvduality. 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 therecursive_where_clause_on_typetest, how implied bounds from types and traits intertwine, and why this fix is the correct one.