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

Change how fn(&T) parses #3535

Closed
nikomatsakis opened this issue Sep 19, 2012 · 3 comments
Closed

Change how fn(&T) parses #3535

nikomatsakis opened this issue Sep 19, 2012 · 3 comments
Labels
A-grammar Area: The grammar of Rust E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
Milestone

Comments

@nikomatsakis
Copy link
Contributor

Right now, fn(&T) parses as fn(&v: T) rather than fn(v: &T). This should be changed so that modes require explicit variable names. We would also of course then need to update the various legacy fn() types that appear in rustc and elsewhere.

nikomatsakis added a commit that referenced this issue Sep 23, 2012
an explicit variable name. (Step one to changing the defaults)

First step to #3535
@Vincent-Belliard
Copy link
Contributor

I did the patch to disable modes with unamed arguments. However, we have now a quite confusing error message:

error: mismatched types: expected `fn&(&int)` but found `fn(&int)` (expected argument mode ++, but found &)

So I modify the argument dump to display:

error: mismatched types: expected `fn&(&int)` but found `fn(&:int)` (expected argument mode ++, but found &)

I wonder if this display could become a new syntax to specify modes for unamed arguments (that is adding a colon between mode and type).
I you believe so, just tell me and I will add this syntax.

@nikomatsakis
Copy link
Contributor Author

Oh, good point (regarding the conversion of the type to a string). However, I don't think a new syntax is needed, because modes will be removed shortly.

Vincent-Belliard added a commit to Vincent-Belliard/rust that referenced this issue Sep 26, 2012
@catamorphism
Copy link
Contributor

I take it this can be closed, since Vincent's patch is in incoming.

bors pushed a commit to rust-lang-ci/rust that referenced this issue May 15, 2021
RalfJung pushed a commit to RalfJung/rust that referenced this issue May 4, 2024
update host-float comments

Turns out most of these do not have guaranteed precision anyway so it's fine to use host floats (see rust-lang#121793 and rust-lang#118217). The exception are sqrt and mul_add, tracked at rust-lang/miri#3534 and rust-lang/miri#2995.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-grammar Area: The grammar of Rust E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
Projects
None yet
Development

No branches or pull requests

3 participants