Skip to content

Higher-order argument modes generate contradictory compile errors #2721

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

Closed
bblum opened this issue Jun 26, 2012 · 8 comments
Closed

Higher-order argument modes generate contradictory compile errors #2721

bblum opened this issue Jun 26, 2012 · 8 comments
Labels
A-type-system Area: Type system

Comments

@bblum
Copy link
Contributor

bblum commented Jun 26, 2012

error: mismatched types: expected fn@(&&<V1>) but found native fn(str) (expected argument mode ++ but found &&)

This arose when passing a fn(str) as an argument to a function expecting fn@(T). No explicit argument mode annotation was used.

note the contradiction: "expected ..&&.." at first followed by "expected ..++.." later. Patrick seems to think they must be referring to the same thing (the argument of the function being passed) because it wouldn't come up without higher-order arguments.

@catamorphism
Copy link
Contributor

This problem will hopefully go away when argument modes go away, which is hopefully soon.

@bblum
Copy link
Contributor Author

bblum commented Jun 26, 2012

hopefully!

in the meantime i will also note that it appears to simply have it backwards. changing the fn(str) to fn(-str) produces:

error: mismatched types: expected fn@(&&uint) but found native fn(-<V10>) (expected argument mode - but found &&)

@catamorphism
Copy link
Contributor

Yeah, those "backwards" errors are endemic in typeck -- keep reporting them.

@catamorphism
Copy link
Contributor

(marking as "postponed" since we can probably close this when argument modes go away)

@kud1ing
Copy link

kud1ing commented Jun 29, 2012

Is there a "remove argument mode" issue to link this issue to? Also #2585 is waiting for this.

@nikomatsakis
Copy link
Contributor

The fix is to modify infer to track which value comes "from the user" and which does not.

@nikomatsakis
Copy link
Contributor

I think I opened an issue for this... I'll search and open one if not. Or maybe just fix it. It's just some tedious work.

@nikomatsakis
Copy link
Contributor

closing as a dup of #2806.

RalfJung pushed a commit to RalfJung/rust that referenced this issue Dec 24, 2022
Allow configurable and platform-specific page sizes

This fixes rust-lang#2644 by setting platform-default page sizes along with a command line flag to override size to a specific value (e.g. in the case of aarch64 Linux on M1 silicon). There's still some code cleanup to be done and tests need to be added but I'm opening this for now.
Aaron1011 pushed a commit to Aaron1011/rust that referenced this issue Jan 6, 2023
Allow configurable and platform-specific page sizes

This fixes rust-lang#2644 by setting platform-default page sizes along with a command line flag to override size to a specific value (e.g. in the case of aarch64 Linux on M1 silicon). There's still some code cleanup to be done and tests need to be added but I'm opening this for now.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-type-system Area: Type system
Projects
None yet
Development

No branches or pull requests

4 participants