Ask your AI Ask your AI to turn this code into a guided bug-finding exercise.
Claude ChatGPT I am reading "Which reference set may safely access the same ordinary value at one point?" on CodeWiki (https://codewiki.com/practice/mcq/rust/borrowing-rules/shared-versus-exclusive/).
Context (verbatim from the page):
"""
Which reference set may safely access the same ordinary value at one point?
Any number of &T references and no conflicting &mut T reference
Two &mut T references as long as only one writes
One &T and one &mut T when the owner was declared mut
Any references when the code runs on one thread
"""
Introduce three subtle bugs into the example above and let me find them. Reveal each answer only after I have guessed.
Answer in English. Keep code examples in Rust. Where you are unsure, say so.