内容简介:Rust 1.30 已发布,包含大量更新内容: Language Procedural macros are now available. These kinds of macros allow for more powerful code generation. There is a new chapter available in the Rust Progra...
Rust 1.30 已发布,包含大量更新内容:
Language
Procedural macros are now available. These kinds of macros allow for more powerful code generation. There is a new chapter available in the Rust Programming Language book that goes further in depth.
You can now use keywords as identifiers using the raw identifiers syntax (
r#
), e.g.let r#for = true;
You can now use
crate
in paths. This allows you to refer to the crate root in the path, e.g.use crate::foo;
refers tofoo
insrc/lib.rs
.Using a external crate no longer requires being prefixed with
::
. Previously, using a external crate in a module without a use statement requiredlet json = ::serde_json::from_str(foo);
but can now be written aslet json = serde_json::from_str(foo);
.You can now apply the
#[used]
attribute to static items to prevent the compiler from optimising them away, even if they appear to be unused, e.g.#[used] static FOO: u32 = 1;
You can now import and reexport macros from other crates with the
use
syntax. Macros exported with#[macro_export]
are now placed into the root module of the crate. If your macro relies on calling other local macros, it is recommended to export with the#[macro_export(local_inner_macros)]
attribute so users won't have to import those macros.You can now catch visibility keywords (e.g.
pub
,pub(crate)
) in macros using thevis
specifier.Non-macro attributes now allow all forms of literals, not just strings. Previously, you would write
#[attr("true")]
, and you can now write#[attr(true)]
.
Compiler
Libraries
Stabilized APIs
The following methods are replacement methods for
trim_left
,trim_right
,trim_left_matches
, andtrim_right_matches
, which will be deprecated in 1.33.0:
Cargo
cargo run
doesn't require specifying a package in workspaces.cargo doc
now supports--message-format=json
. This is equivalent to callingrustdoc --error-format=json
.
Misc
rustdoc
allows you to specify what edition to treat your code as with the--edition
option.We now distribute a
rust-gdbgui
script that invokesgdbgui
with Rust debug symbols.Attributes from Rust tools such as
rustfmt
orclippy
are now available, e.g.#[rustfmt::skip]
will skip formatting the next item.
【声明】文章转载自:开源中国社区 [http://www.oschina.net]
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网
猜你喜欢:- Rust 1.30 版本发布,"过程宏"已可用
- MySQL高可用InnoDB Cluster多节点搭建过程
- kafka调优过程在吞吐量,持久性,低延时,可用性等指标的折中选择研究-kafka 商业环境实战
- 构建生产环境可用的高可用kubernetes集群
- 维基百科 – Sparql查询获取dbpedia可用的所有可用电影
- 可用性高达5个9!支付系统高可用架构设计实战
本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
Handbook of Data Structures and Applications
Dinesh P. Mehta / Chapman and Hall/CRC / 2004-10-28 / USD 135.95
In the late sixties, Donald Knuth, winner of the 1974Turing Award, published his landmark book The Art of Computer Programming: Fundamental Algorithms. This book brought to- gether a body of kno......一起来看看 《Handbook of Data Structures and Applications》 这本书的介绍吧!