Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
82dc99ba
R
Rust
项目概览
int
/
Rust
12 个月 前同步成功
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
Rust
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
82dc99ba
编写于
11月 24, 2020
作者:
C
Camelid
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Use the name "auto traits" everywhere in the compiler
Goodbye, OIBIT!
上级
810324d1
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
20 addition
and
20 deletion
+20
-20
compiler/rustc_middle/src/mir/mod.rs
compiler/rustc_middle/src/mir/mod.rs
+1
-1
compiler/rustc_middle/src/traits/mod.rs
compiler/rustc_middle/src/traits/mod.rs
+1
-1
compiler/rustc_mir_build/src/build/expr/as_rvalue.rs
compiler/rustc_mir_build/src/build/expr/as_rvalue.rs
+1
-1
src/test/rustdoc/auxiliary/rustdoc-impl-parts-crosscrate.rs
src/test/rustdoc/auxiliary/rustdoc-impl-parts-crosscrate.rs
+1
-1
src/test/rustdoc/impl-parts-crosscrate.rs
src/test/rustdoc/impl-parts-crosscrate.rs
+3
-3
src/test/rustdoc/impl-parts.rs
src/test/rustdoc/impl-parts.rs
+5
-5
src/test/ui/phantom-auto-trait.rs
src/test/ui/phantom-auto-trait.rs
+2
-2
src/test/ui/phantom-auto-trait.stderr
src/test/ui/phantom-auto-trait.stderr
+2
-2
src/test/ui/traits/traits-inductive-overflow-supertrait-auto-trait.rs
...traits/traits-inductive-overflow-supertrait-auto-trait.rs
+2
-2
src/test/ui/traits/traits-inductive-overflow-supertrait-auto-trait.stderr
...ts/traits-inductive-overflow-supertrait-auto-trait.stderr
+2
-2
未找到文件。
compiler/rustc_middle/src/mir/mod.rs
浏览文件 @
82dc99ba
...
...
@@ -811,7 +811,7 @@ pub struct LocalDecl<'tcx> {
/// after typeck.
///
/// This should be sound because the drop flags are fully algebraic, and
/// therefore don't affect the
OIBIT
or outlives properties of the
/// therefore don't affect the
auto-trait
or outlives properties of the
/// generator.
pub
internal
:
bool
,
...
...
compiler/rustc_middle/src/traits/mod.rs
浏览文件 @
82dc99ba
...
...
@@ -70,7 +70,7 @@ pub enum Reveal {
/// be observable directly by the user, `Reveal::All`
/// should not be used by checks which may expose
/// type equality or type contents to the user.
/// There are some exceptions, e.g., around
OIBITS
and
/// There are some exceptions, e.g., around
auto traits
and
/// transmute-checking, which expose some details, but
/// not the whole concrete type of the `impl Trait`.
All
,
...
...
compiler/rustc_mir_build/src/build/expr/as_rvalue.rs
浏览文件 @
82dc99ba
...
...
@@ -96,7 +96,7 @@ fn expr_as_rvalue(
ExprKind
::
Box
{
value
}
=>
{
let
value
=
this
.hir
.mirror
(
value
);
// The `Box<T>` temporary created here is not a part of the HIR,
// and therefore is not considered during generator
OIBIT
// and therefore is not considered during generator
auto-trait
// determination. See the comment about `box` at `yield_in_scope`.
let
result
=
this
.local_decls
.push
(
LocalDecl
::
new
(
expr
.ty
,
expr_span
)
.internal
());
this
.cfg
.push
(
...
...
src/test/rustdoc/auxiliary/rustdoc-impl-parts-crosscrate.rs
浏览文件 @
82dc99ba
#![feature(auto_traits)]
pub
auto
trait
An
Oib
it
{}
pub
auto
trait
An
AutoTra
it
{}
src/test/rustdoc/impl-parts-crosscrate.rs
浏览文件 @
82dc99ba
...
...
@@ -12,9 +12,9 @@ pub struct Bar<T> { t: T }
// full impl string. Instead, just make sure something from each part
// is mentioned.
// @has implementors/rustdoc_impl_parts_crosscrate/trait.An
Oib
it.js Bar
// @has implementors/rustdoc_impl_parts_crosscrate/trait.An
AutoTra
it.js Bar
// @has - Send
// @has - !An
Oib
it
// @has - !An
AutoTra
it
// @has - Copy
impl
<
T
:
Send
>
!
rustdoc_impl_parts_crosscrate
::
An
Oib
it
for
Bar
<
T
>
impl
<
T
:
Send
>
!
rustdoc_impl_parts_crosscrate
::
An
AutoTra
it
for
Bar
<
T
>
where
T
:
Copy
{}
src/test/rustdoc/impl-parts.rs
浏览文件 @
82dc99ba
#![feature(negative_impls)]
#![feature(auto_traits)]
pub
auto
trait
An
Oib
it
{}
pub
auto
trait
An
AutoTra
it
{}
pub
struct
Foo
<
T
>
{
field
:
T
}
// @has impl_parts/struct.Foo.html '//*[@class="impl"]//code' \
// "impl<T: Clone> !An
Oib
it for Foo<T> where T: Sync,"
// @has impl_parts/trait.An
Oib
it.html '//*[@class="item-list"]//code' \
// "impl<T: Clone> !An
Oib
it for Foo<T> where T: Sync,"
impl
<
T
:
Clone
>
!
An
Oib
it
for
Foo
<
T
>
where
T
:
Sync
{}
// "impl<T: Clone> !An
AutoTra
it for Foo<T> where T: Sync,"
// @has impl_parts/trait.An
AutoTra
it.html '//*[@class="item-list"]//code' \
// "impl<T: Clone> !An
AutoTra
it for Foo<T> where T: Sync,"
impl
<
T
:
Clone
>
!
An
AutoTra
it
for
Foo
<
T
>
where
T
:
Sync
{}
src/test/ui/phantom-
oib
it.rs
→
src/test/ui/phantom-
auto-tra
it.rs
浏览文件 @
82dc99ba
// Ensure that
OIBIT checks `T` when it encounters a `PhantomData<T>` field, instead of checking
//
the `PhantomData<T>` type itself (which almost always implements an auto trait)
// Ensure that
auto trait checks `T` when it encounters a `PhantomData<T>` field, instead of
//
checking the `PhantomData<T>` type itself (which almost always implements an auto trait).
#![feature(auto_traits)]
...
...
src/test/ui/phantom-
oib
it.stderr
→
src/test/ui/phantom-
auto-tra
it.stderr
浏览文件 @
82dc99ba
error[E0277]: `T` cannot be shared between threads safely
--> $DIR/phantom-
oib
it.rs:21:12
--> $DIR/phantom-
auto-tra
it.rs:21:12
|
LL | fn is_zen<T: Zen>(_: T) {}
| --- required by this bound in `is_zen`
...
...
@@ -16,7 +16,7 @@ LL | fn not_sync<T: Sync>(x: Guard<T>) {
| ^^^^^^
error[E0277]: `T` cannot be shared between threads safely
--> $DIR/phantom-
oib
it.rs:26:12
--> $DIR/phantom-
auto-tra
it.rs:26:12
|
LL | fn is_zen<T: Zen>(_: T) {}
| --- required by this bound in `is_zen`
...
...
src/test/ui/traits/traits-inductive-overflow-supertrait-
oib
it.rs
→
src/test/ui/traits/traits-inductive-overflow-supertrait-
auto-tra
it.rs
浏览文件 @
82dc99ba
//
OIBIT
-based version of #29859, supertrait version. Test that using
// a simple
OIBIT
`..` impl alone still doesn't allow arbitrary bounds
//
Auto-trait
-based version of #29859, supertrait version. Test that using
// a simple
auto trait
`..` impl alone still doesn't allow arbitrary bounds
// to be synthesized.
#![feature(auto_traits)]
...
...
src/test/ui/traits/traits-inductive-overflow-supertrait-
oib
it.stderr
→
src/test/ui/traits/traits-inductive-overflow-supertrait-
auto-tra
it.stderr
浏览文件 @
82dc99ba
error[E0568]: auto traits cannot have super traits
--> $DIR/traits-inductive-overflow-supertrait-
oib
it.rs:8:19
--> $DIR/traits-inductive-overflow-supertrait-
auto-tra
it.rs:8:19
|
LL | auto trait Magic: Copy {}
| ----- ^^^^ help: remove the super traits
...
...
@@ -7,7 +7,7 @@ LL | auto trait Magic: Copy {}
| auto trait cannot have super traits
error[E0277]: the trait bound `NoClone: Copy` is not satisfied
--> $DIR/traits-inductive-overflow-supertrait-
oib
it.rs:16:23
--> $DIR/traits-inductive-overflow-supertrait-
auto-tra
it.rs:16:23
|
LL | fn copy<T: Magic>(x: T) -> (T, T) { (x, x) }
| ----- required by this bound in `copy`
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录