什么是稳定过程? [英] What is the stabilization process?

查看:37
本文介绍了什么是稳定过程?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

稳定过程是什么?阅读发行说明我看到了很多不同的标准库 API 甚至语言特性(例如下划线生命周期).API 如何变得稳定?

What is the stabilization process? Reading the release notes I see a lot of different standard library APIs and even language features (e.g. underscore lifetimes). How does an API become stable?

推荐答案

稳定是向 Rust 添加新功能的方式.与许多语言不同,当添加内容时,它会在下一个版本中使用,Rust 有一个多阶段过程,以便我们可以在功能被计划包含在稳定的 Rust 之前试用它们.

Stabilization is the way that new features are added to Rust. Unlike many languages, where when stuff is added, it goes in the next release, Rust has a multi-stage process so that we can try out features before they're slated to be included in stable Rust.

只需发送拉取请求即可添加小功能,尤其是新的库 API.较大的功能通过RFC 流程,因此可以在设计之前就设计达成一些共识.重新实施.如果接受 RFC,则可以通过 PR 发送实现.每当添加新功能时,它都会进入功能门",即一个特殊属性 #![feature],让您可以选择尝试使用该功能.

Small features, especially new library APIs, can be added by just sending in a pull request. Larger features go through the RFC process, so that there can be some consensus around the design before they're implemented. If an RFC is accepted, an implementation can be sent in via PR. Whenever a new feature is added, it goes behind a "feature gate", that is, a special attribute, #![feature], that lets you opt into giving that feature a try.

每个(好吧有时不是每个但几乎每个)晚上,都会制作一个夜间构建的 Rust.每晚构建用于测试,因此,您可以使用 #![feature] 属性选择新的、不稳定的功能.然后,用户试用这些功能、报告错误并评论 API 或功能在现实世界中的使用方式.

Every (okay sometimes not every but almost every) night, a nightly build of Rust is made. Nightly builds are used for testing, and so, you can opt into new, unstable features using the #![feature] attribute. Users then give these features a whirl, report bugs, and comment on how the API or feature is used in the real world.

每六周,每晚都会变成测试版"版本.Beta 就像发布候选版本,因此它们不允许您使用 #![feature],因此,不要让您使用实验性功能.六周后,一个新的 nightly 变成了 beta,而 beta 版本变成了一个新的稳定"版本.这就是大多数人谈论 Rust 时的意思,也是大多数 Rust 用户使用的内容.Stable Rust 也不允许您使用 #![feature],因为这些功能不稳定.

Every six weeks, a nightly is turned into a "beta" release. Betas are like release candidates, and so they don't allow you to use #![feature], and so, don't let you use experimental features. After six weeks, a new nightly becomes beta, and the beta release becomes a new "stable" release. This is what most people mean when they talk about Rust, and what most Rust users use. Stable Rust also doesn't let you use #![feature], as those features aren't stable.

无论如何,经过一段时间(至少是一个完整的发布周期),如果某个功能很好,团队会讨论是否应该使其稳定.如果他们决定是,那么 #![feature] 要求将被删除,该功能将坐火车"到最终稳定版本.如果他们决定不,它将被弃用并最终被删除.

Anyway, after a time (that's at least one whole release cycle), if a feature is good, the team discusses if it should be made stable. If they decide yes, then the #![feature] requirement is removed, and the feature will "ride the trains" to an eventual stable release. If they decide no, it will be deprecated and eventually removed.

这篇关于什么是稳定过程?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆