Skip to content

Ref.Type.Constr and the STAR token #141

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
tohava opened this issue Aug 2, 2010 · 2 comments
Closed

Ref.Type.Constr and the STAR token #141

tohava opened this issue Aug 2, 2010 · 2 comments

Comments

@tohava
Copy link
Contributor

tohava commented Aug 2, 2010

It seems like the star token is not handled in constrained types as it should be. This can be noticed in the parse_carg function, it begins by matching (peek ps) against IDENT _, the IDENT token doesn't include stars (that is what the STAR token is for). Note that parse_carg_base seems to be able to handle stars (it matches against STAR).

An example of non-working code for this is:
// -- rust --

type list = tag(cons(int,@list), nil());
type bubu = rec(int x, int y);

fn less_than(int x, int y) -> bool { ret x < y; }

type ordered_range = rec(int low, int high) : less_than(*.low, *.high);

fn main() {
cons(10, @COns(11, @COns(12, @nil())));
}

This code returns with an error saying that * is unexpected.

@graydon
Copy link
Contributor

graydon commented Aug 3, 2010

Add tests and fix pexp bug. Closed by 1fc4e9f.

@graydon
Copy link
Contributor

graydon commented Aug 3, 2010

Fixed at a parse level. There's a new test to handle this code; it doesn't actually work yet.

mbrubeck pushed a commit to mbrubeck/rust that referenced this issue Oct 17, 2011
oli-obk pushed a commit to oli-obk/rust that referenced this issue Jul 19, 2017
fix a bug in drop code of structs with unsized fields
kazcw pushed a commit to kazcw/rust that referenced this issue Oct 23, 2018
* [readme] badges

* [crates.io] add badges, categories, etc.
dlrobertson pushed a commit to dlrobertson/rust that referenced this issue Nov 29, 2018
rchaser53 pushed a commit to rchaser53/rust that referenced this issue Jan 19, 2019
rchaser53 pushed a commit to rchaser53/rust that referenced this issue Jan 19, 2019
bors pushed a commit to rust-lang-ci/rust that referenced this issue Oct 1, 2021
djtech-dev pushed a commit to djtech-dev/rust that referenced this issue Dec 9, 2021
Add `no-llvm-linking` feature to prevent linking LLVM while building
bjorn3 pushed a commit to bjorn3/rust that referenced this issue Mar 26, 2022
…d-shift

Fix shift of unsigned integer by signed integer
celinval pushed a commit to celinval/rust-dev that referenced this issue Jun 4, 2024
This issue was closed.
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