Skip to content

Can't define types as resources #601

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

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
celinval added a commit to celinval/rust-dev that referenced this issue Jun 4, 2024
RMC code generation was creating artifacts even if rustc was run with
-Z no-codegen. I changed the codegen to check for this option before
writing the json files.

This issue was uncovered by my change to move the rmc flags to
rmc-rustc. This script is used during compiletest. In the check stage,
the test runs rustc with --no-codegen.
GuillaumeGomez pushed a commit to GuillaumeGomez/rust that referenced this issue Jan 24, 2025
tgross35 pushed a commit to tgross35/rust that referenced this issue Jun 3, 2025
fix: Add `#[avr_skip]` for `__addsf3` & `__adddf3`
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants