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

Minor changes to rust.md, and guide-ffi.md. #16440

Closed
wants to merge 1 commit into from
Closed

Minor changes to rust.md, and guide-ffi.md. #16440

wants to merge 1 commit into from

Conversation

bheesham
Copy link
Contributor

  • rust.md: changes for consistency
  • guide-ffi.md: wrapped inline code

NOTE: This is a duplicate of #16375. I completely messed up that fork, so I made a new fork.

  * `rust.md`: whanges for consistency

  * `guide-ffi.md`: wrapped inline code
@steveklabnik
Copy link
Member

I completely messed up that fork, so I made a new fork.

Once you've fixed things locally, you can just force-push to a branch, and it will fix things. But that's just an aside.

@bheesham
Copy link
Contributor Author

Hm, yeah. I was talking to some people on freenode/#github and it seemed like making a new fork was the easiest way to get things resolved.

If my changes were more substantial I would have looked into alternatives.

bors added a commit that referenced this pull request Aug 14, 2014
  * `rust.md`: changes for consistency

  * `guide-ffi.md`: wrapped inline code

NOTE: This is a duplicate of #16375. I completely messed up that fork, so I made a new fork.
@bors bors closed this Aug 14, 2014
nikomatsakis added a commit to nikomatsakis/rust that referenced this pull request Feb 3, 2015
a trait obligation. Partial fix for rust-lang#16440 -- closure return types are
not handled yet.
alexcrichton added a commit to alexcrichton/rust that referenced this pull request Feb 4, 2015
This *almost* completes the job for rust-lang#16440. The idea is that even if we do not know whether some closure type `C` implements `Fn` or `FnMut` (etc), we still know its argument and return types. So if we see an obligation `C : Fn(_0)`, we can unify `_0` with those argument types while still considering the obligation ambiguous and unsatisfied. This helps to make a lot of progress with type inference even before closure kind inference is done.

As part of this PR, the explicit `:` syntax is removed from the AST and completely ignored. We still infer the closure kind based on the expected type if that is available. There are several reasons for this. First, deciding the closure kind earlier is always better, as it allows us to make more progress. Second, this retains a (admittedly obscure) way for users to manually specify the closure kind, which is useful for writing tests if nothing else. Finally, there are still some cases where inference can fail, so it may be useful to have this manual override. (The expectation is that we will eventually revisit an explicit syntax for specifying the closure kind, but it will not be `:` and may be some sort of generalization of the `||` syntax to handle other traits as well.)

This commit does not *quite* fix rust-lang#16640 because a snapshot is still needed to enable the obsolete syntax errors for explicit `&mut:` and friends.

r? @eddyb as he reviewed the prior patch in this direction
matthiaskrgr pushed a commit to matthiaskrgr/rust that referenced this pull request Feb 5, 2024
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.

3 participants