A

Admin • 833.24K Points
Coach

Q. What will happen if you try to mutate a borrowed immutable variable?

  • (A) It will compile but crash at runtime
  • (B) It will compile and succeed
  • (C) It will panic
  • (D) It will cause a compile-time error
  • Correct Answer - Option(D)
  • Views: 25
  • Filed under category Rust
  • Hashtags:

Explanation by: Admin

Rust will raise a compile-time error when mutating an immutable borrow.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.