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

Limit number of arguments for a function to u16::MAX #686

Open
flip1995 opened this issue Sep 21, 2021 · 1 comment
Open

Limit number of arguments for a function to u16::MAX #686

flip1995 opened this issue Sep 21, 2021 · 1 comment
Labels
diagnostic diagnostic static analysis parser

Comments

@flip1995
Copy link
Member

Kind of funny PR:

This limits the number of arguments that can be used by a function to 65535 = u16::MAX and emits an error if more arguments are used.

I think this is currently hard to implement a test for, since it practically requires macro expansion, but this is something that should be tested in the future.

@flip1995 flip1995 added diagnostic diagnostic static analysis parser labels Sep 21, 2021
@bjorn3
Copy link

bjorn3 commented Sep 21, 2021

I think this can be considered an implementation detail just like the 4GB limit on the total size of all source files loaded in by a single rustc invocation from both the current crate and all dependencies. (spans use 32bit ints to indicate the start and end within the source map, which is a concatenated string of all sources) I won't oppose adding this limitation to gccrs too though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
diagnostic diagnostic static analysis parser
Projects
None yet
Development

No branches or pull requests

2 participants