![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
rust
junwen12221
编程语言爱好者,在信息安全领域,数据库领域有一定研究,qq:294712221
展开
-
linux安装rust环境
1.https://www.rust-lang.org/zh-CN/tools/install2.curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | shRust is installed now. Great!To get started you need Cargo's bin directory ($HOME/...原创 2020-05-20 09:48:53 · 3333 阅读 · 0 评论 -
[翻译]Rust借用模型-基于栈的借用模型-操作语义学的正式定义
Stacked Borrows: An Aliasing Model for Rust笔记本节的目的是正式定义到目前为止我们在本文中非正式描述的内容。完整的正式定义可以在我们的技术附录中找到[Jung等。 2019]。高层结构在较高的层次上,我们将堆积借款定义为带标签的过渡系统,其中标签是事件(最重要的是读写访问和重新标记),状态由以下记录描述(某些其余相关域如图2所示:...原创 2020-02-05 16:43:21 · 257 阅读 · 0 评论 -
[翻译]Rust借用模型-基于栈的借用模型-支持内部可变性
Stacked Borrows: An Aliasing Model for Rust笔记我们已经看到Stacked Borrows支持它旨在实现的所有转换:在未知代码之间上下移动共享和可变引用的使用。这已经为编译器提供了必要的自由度,可以利用引用类型进行别名分析。但是要采用Stacked Borrows,我们还需要确保现有Rust代码的大部分实际上与Stacked Borrows的规则兼容...原创 2020-02-05 16:43:36 · 391 阅读 · 0 评论 -
[翻译]Rust借用模型-基于栈的借用模型,第二部分
Stacked Borrows: An Aliasing Model for Rust笔记到目前为止,我们已经看到了两种优化方法,它们利用了即使不安全的代码也必须符合Stacked Borrows的假设。动态分析,反映了Rust借阅检查器执行的静态分析。两者都遵循类似的模式:重新引用了一些参考文献(证明草图中的步骤(1)),然后我们进行了一些更改/观察(我们写了mutablereferenc...原创 2020-02-05 16:42:56 · 157 阅读 · 0 评论 -
Stacked Borrows: An Aliasing Model for Rust笔记-第一部分(2)
共享引用到目前为止,我们仅考虑了可变引用和原始指针。我们已经看到,stack borrow对可变引用强制执行一种唯一性形式,足以证明程序转换可以对未知代码周围的内存访问进行重新排序。在本节中,我们将研究共享引用。目标是强制它们是只读的,以再次证明程序转换的合理性,该转换将未知代码周围的内存访问重新排序。就像我们为可变参考所做的一样。我们通过重述借阅检查器以避免提及生命周期的方式来重新定义...原创 2019-12-25 09:42:12 · 178 阅读 · 0 评论 -
Stacked Borrows: An Aliasing Model for Rust笔记-第一部分(1)
栈借用模型,第一部分大前提(1)引用及其衍生的所有引用只能在他们的生命周期内使用(2)在借出的有效期到期之前,借出者不会被使用。一句话:对借入者引用的使用(及其衍生的所有引用)必须在下一次使用借出者引用之前进行操作语义tag(PointerId,指针ID)区分指向同一个内存区域的引用,每一个引用使用一个id来标识,叫做PointerId,当引用创建的时候,对应一个Po...原创 2019-12-23 14:11:30 · 259 阅读 · 0 评论 -
Rust中为什么&String可以当做是&str
https://doc.rust-lang.org/reference/type-coercions.htmlhttps://doc.rust-lang.org/std/ops/trait.Deref.html原创 2019-12-20 23:04:50 · 329 阅读 · 0 评论 -
Rust Trait std::borrow::Borrow与Trait std::convert::AsRef
Borrow有两个方面实现Borrow接口https://doc.rust-lang.org/std/borrow/trait.Borrow.html然后又需要接收Borrow接口的函数(一般自己实现)fn check<T: Borrow<str>>(s: T) { assert_eq!("Hello", s.borrow());}约...原创 2019-12-20 22:01:35 · 536 阅读 · 0 评论 -
Rust-MIR相关链接
https://rust-lang.github.io/rustc-guide/mir/mir_detailed.svgIntroducing MIRhttps://blog.rust-lang.org/2016/04/19/MIR.htmlhttps://rust-lang.github.io/rustc-guide/mir/construction.htmlHIRhttps:/...原创 2019-12-10 15:13:15 · 584 阅读 · 1 评论