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

Can't define types as resources #601

Closed
brson opened this issue Jun 30, 2011 · 2 comments
Closed

Can't define types as resources #601

brson opened this issue Jun 30, 2011 · 2 comments

Comments

@brson
Copy link
Contributor

brson commented Jun 30, 2011

The following doesn't work:

type rtype = resource(int i);

Then I would expect to be able to:

resource r1(int i) {};
resource r2(int i) {};

let rtype i1 <- r1(0);
let rtype i2 <- r2(0);

Currently I don't see any way to make polymorphic resources.

@marijnh marijnh closed this as completed Jun 30, 2011
@marijnh marijnh reopened this Jun 30, 2011
@marijnh
Copy link
Contributor

marijnh commented Jun 30, 2011

Resources are nominal types. The use case you show just isn't how they work.

@brson
Copy link
Contributor Author

brson commented Jun 30, 2011

Ah, ok. Patrick straightened me out on the resource use case.

@brson brson closed this as completed Jun 30, 2011
keeperofdakeys pushed a commit to keeperofdakeys/rust that referenced this issue Dec 12, 2017
Added the sync() function from unistd.h

This fixes rust-lang#601.
pdietl pushed a commit to pdietl/rust that referenced this issue Apr 23, 2020
Remove unneeded | from AssignmentExpression
ZuseZ4 pushed a commit to EnzymeAD/rust that referenced this issue Mar 7, 2023
* Don't overflow bit size

* Improve activity analysis

* Fixup

* Fix activity

* Fix enzyme test

* Handle pointer return
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

No branches or pull requests

2 participants