-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
fix Expr::can_have_side_effects for [x; N] style array literal and binary expressions
#150385
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
base: main
Are you sure you want to change the base?
Conversation
|
rustbot has assigned @jdonszelmann. Use |
|
The job Click to see the possible cause of the failure (guessed by this bot) |
|
Would you like to add a test for this, to reflect new behaviour you changed here Because on a first glance it's not obvious (at least to me) |
|
I'm not sure where should I add a test:
|
AFAIK
[0; 3]is basically a syntax sugar for[0, 0, 0]so it should return whether the repeat's element can have side effects, like what it does on arrays.And it seems that the rule for unary operators and indexings can be applied to binary operators as well.