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

librustc: Allow coercions through arrays. #15069

Merged
merged 1 commit into from
Jul 2, 2014
Merged

Conversation

luqmana
Copy link
Member

@luqmana luqmana commented Jun 21, 2014

Fixes #11205.

@sfackler
Copy link
Member

😄

@sfackler
Copy link
Member

Needs a rebase (and review)

@sfackler
Copy link
Member

ping @pcwalton

@pcwalton
Copy link
Contributor

I'm confused as to how this works. Wouldn't trans have to loop through the array to do this properly?

This seems a little too magical…

@luqmana
Copy link
Member Author

luqmana commented Jun 29, 2014

@pcwalton All it's doing is adding an auto adjustment for each element.

If we have something like:

trait Foo {}
impl Foo for int {}

let x: [&Foo, ..2] = [&1i, &2i];

When we typeck [&1i, &2i] we'll have an expected type of [&Foo, ..2] before we'd just fail since the types didn't match up but now instead it'll try and coerce each element to &Foo.

bors added a commit that referenced this pull request Jul 2, 2014
@bors bors closed this Jul 2, 2014
@bors bors merged commit e11503f into rust-lang:master Jul 2, 2014
@luqmana luqmana deleted the cia branch July 2, 2014 06:29
lnicola pushed a commit to lnicola/rust that referenced this pull request Jun 19, 2023
analysis-stats: Add body lowering step, track time of each step separtely
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.

Implicit trait object coercion doesn't work through arrays
4 participants