TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

An Unfortunate Experience with Rust

4 点作者 alainchabat将近 3 年前

1 comment

afdbcreid将近 3 年前
I only skimmed through the article, but noticed it is complaining that `&amp;mut function` is not `&#x27;static`. This is easily reproducible with:<p><pre><code> fn foo() { let _: &amp;&#x27;static mut _ = &amp;mut foo; } </code></pre> And it is because while `foo` is definitely `&#x27;static`, `&amp;mut foo` needs to be able to mutate something. The hidden secret is that `&amp;mut foo` is desugared into something like<p><pre><code> let mut __temp = foo; &amp;mut __temp </code></pre> And so it is not `&#x27;static`.