Skip to content

Conversation

@jmh530
Copy link
Contributor

@jmh530 jmh530 commented Feb 14, 2023

Addresses issue #454.

Hopefully checked enough that it works. As is, changes to get working are relatively minimal. Ideally the compiler should be able to optimize away the removal of moves for the const/immutable case.

@9il
Copy link
Member

9il commented Feb 15, 2023

Please add additional overload. One for const, one for mutable. The const overload has to call lightConst and then call the mutable implementation.

@jmh530
Copy link
Contributor Author

jmh530 commented Feb 15, 2023

@9il Can you remind me what the significance of lightConst is?

@9il
Copy link
Member

9il commented Feb 17, 2023

It moves const from slice type to member type.

@jmh530
Copy link
Contributor Author

jmh530 commented Feb 17, 2023

@9il Thanks, see latest commit. It's a little tricky in that core.lifetime.move only works properly when you assign the lightConst to a new variable.

I also need to add UT examples in Slice to really remember on how lightConst works.

@9il
Copy link
Member

9il commented Feb 18, 2023

We will not do that for other functions. A user has to call .lightConst in the code instead.

@jmh530
Copy link
Contributor Author

jmh530 commented Feb 18, 2023

We will not do that for other functions. A user has to call .lightConst in the code instead.

When you refer to "that", I'm not sure what you mean. Could you help me understand what you mean?

@9il
Copy link
Member

9il commented Feb 18, 2023

I mean the const slice support.

@9il 9il merged commit d6a3c5e into libmir:master Feb 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants