D. Compilation error due to ownership rules 📌Ответ: Правильный ответ: C — Panic at runtime due to unwrap failure
Почему: Мы создаем a как Rc<RefCell<i32>>, из него делаем b = a.clone() → теперь у Rc два владельца.
Мы мутируем значение через b.borrow_mut(), увеличиваем его на 1.
Затем пытаемся сделать Rc::try_unwrap(b).
⚠️ Rc::try_unwrap требует, чтобы Rc был единственным владельцем. Но у нас всё ещё есть a, то есть ссылка остаётся → unwrap не срабатывает и unwrap() вызывает паник на runtime.
D. Compilation error due to ownership rules 📌Ответ: Правильный ответ: C — Panic at runtime due to unwrap failure
Почему: Мы создаем a как Rc<RefCell<i32>>, из него делаем b = a.clone() → теперь у Rc два владельца.
Мы мутируем значение через b.borrow_mut(), увеличиваем его на 1.
Затем пытаемся сделать Rc::try_unwrap(b).
⚠️ Rc::try_unwrap требует, чтобы Rc был единственным владельцем. Но у нас всё ещё есть a, то есть ссылка остаётся → unwrap не срабатывает и unwrap() вызывает паник на runtime.
Telegram has exploded as a hub for cybercriminals looking to buy, sell and share stolen data and hacking tools, new research shows, as the messaging app emerges as an alternative to the dark web.An investigation by cyber intelligence group Cyberint, together with the Financial Times, found a ballooning network of hackers sharing data leaks on the popular messaging platform, sometimes in channels with tens of thousands of subscribers, lured by its ease of use and light-touch moderation.
Traders also expressed uncertainty about the situation with China Evergrande, as the indebted property company has not provided clarification about a key interest payment.In economic news, the Commerce Department reported an unexpected increase in U.S. new home sales in August.Crude oil prices climbed Friday and front-month WTI oil futures contracts saw gains for a fifth straight week amid tighter supplies. West Texas Intermediate Crude oil futures for November rose $0.68 or 0.9 percent at 73.98 a barrel. WTI Crude futures gained 2.8 percent for the week.