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

Fix type param bounds #385

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

brasswood
Copy link

@brasswood brasswood commented Oct 9, 2024

fixes #384

@kevinmehall
Copy link
Owner

Can you add a test in tests/run-pass for these return types?

@brasswood
Copy link
Author

How do I check if my test compiles?

@kevinmehall
Copy link
Owner

cargo test will run all tests, or cargo test -- trybuild trybuild=somefile.rs to run only a specific file.

@brasswood
Copy link
Author

This is WIP, I need to somehow compare a trait object to something else

@kevinmehall
Copy link
Owner

Since your traits all require Debug, you could format!("{:?}", iter.next()) the trait objects and compare the resulting string.

@brasswood
Copy link
Author

Should users be allowed to write something like grammar assembly<'b, 'input: 'b>() for str? i.e. constrain some lifetime parameter to make sure 'input outlives it? I tried it and it gave me the error:

error: expected one of ",", ">"
   --> tests/run-pass/assembly_ast_dyn_type_param_bounds.rs:110:28
    |
110 | grammar assembly<'b, 'input: 'b>() for str {
    |                            ^

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

Successfully merging this pull request may close these issues.

Bounds on trait objects and impl traits not parsing
2 participants