Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
2f845a5e
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,发现更多精彩内容 >>
提交
2f845a5e
编写于
9月 18, 2013
作者:
A
Alex Crichton
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Renumber the lang items correctly
Also add a test to help prevent this from getting out of sync again.
上级
4c6bf487
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
57 addition
and
43 deletion
+57
-43
src/librustc/middle/lang_items.rs
src/librustc/middle/lang_items.rs
+42
-43
src/test/compile-fail/required-lang-item.rs
src/test/compile-fail/required-lang-item.rs
+15
-0
未找到文件。
src/librustc/middle/lang_items.rs
浏览文件 @
2f845a5e
...
...
@@ -59,36 +59,36 @@ pub enum LangItem {
StrEqFnLangItem
,
// 19
UniqStrEqFnLangItem
,
// 20
FailFnLangItem
,
// 2
2
FailBoundsCheckFnLangItem
,
// 2
3
ExchangeMallocFnLangItem
,
// 2
4
ClosureExchangeMallocFnLangItem
,
// 2
5
ExchangeFreeFnLangItem
,
// 2
6
MallocFnLangItem
,
// 2
7
FreeFnLangItem
,
// 2
8
BorrowAsImmFnLangItem
,
// 2
9
BorrowAsMutFnLangItem
,
//
30
ReturnToMutFnLangItem
,
// 3
1
CheckNotBorrowedFnLangItem
,
// 3
2
StrDupUniqFnLangItem
,
// 3
3
RecordBorrowFnLangItem
,
// 3
4
UnrecordBorrowFnLangItem
,
// 3
5
StartFnLangItem
,
// 3
6
TyDescStructLangItem
,
// 3
7
TyVisitorTraitLangItem
,
// 3
8
OpaqueStructLangItem
,
// 3
9
FailFnLangItem
,
// 2
1
FailBoundsCheckFnLangItem
,
// 2
2
ExchangeMallocFnLangItem
,
// 2
3
ClosureExchangeMallocFnLangItem
,
// 2
4
ExchangeFreeFnLangItem
,
// 2
5
MallocFnLangItem
,
// 2
6
FreeFnLangItem
,
// 2
7
BorrowAsImmFnLangItem
,
// 2
8
BorrowAsMutFnLangItem
,
//
29
ReturnToMutFnLangItem
,
// 3
0
CheckNotBorrowedFnLangItem
,
// 3
1
StrDupUniqFnLangItem
,
// 3
2
RecordBorrowFnLangItem
,
// 3
3
UnrecordBorrowFnLangItem
,
// 3
4
StartFnLangItem
,
// 3
5
TyDescStructLangItem
,
// 3
6
TyVisitorTraitLangItem
,
// 3
7
OpaqueStructLangItem
,
// 3
8
}
pub
struct
LanguageItems
{
items
:
[
Option
<
DefId
>
,
..
41
]
items
:
[
Option
<
DefId
>
,
..
39
]
}
impl
LanguageItems
{
pub
fn
new
()
->
LanguageItems
{
LanguageItems
{
items
:
[
None
,
..
41
]
items
:
[
None
,
..
39
]
}
}
...
...
@@ -122,27 +122,26 @@ pub fn item_name(index: uint) -> &'static str {
19
=>
"str_eq"
,
20
=>
"uniq_str_eq"
,
21
=>
"log_type"
,
22
=>
"fail_"
,
23
=>
"fail_bounds_check"
,
24
=>
"exchange_malloc"
,
25
=>
"closure_exchange_malloc"
,
26
=>
"exchange_free"
,
27
=>
"malloc"
,
28
=>
"free"
,
29
=>
"borrow_as_imm"
,
30
=>
"borrow_as_mut"
,
31
=>
"return_to_mut"
,
32
=>
"check_not_borrowed"
,
33
=>
"strdup_uniq"
,
34
=>
"record_borrow"
,
35
=>
"unrecord_borrow"
,
36
=>
"start"
,
37
=>
"ty_desc"
,
38
=>
"ty_visitor"
,
39
=>
"opaque"
,
21
=>
"fail_"
,
22
=>
"fail_bounds_check"
,
23
=>
"exchange_malloc"
,
24
=>
"closure_exchange_malloc"
,
25
=>
"exchange_free"
,
26
=>
"malloc"
,
27
=>
"free"
,
28
=>
"borrow_as_imm"
,
29
=>
"borrow_as_mut"
,
30
=>
"return_to_mut"
,
31
=>
"check_not_borrowed"
,
32
=>
"strdup_uniq"
,
33
=>
"record_borrow"
,
34
=>
"unrecord_borrow"
,
35
=>
"start"
,
36
=>
"ty_desc"
,
37
=>
"ty_visitor"
,
38
=>
"opaque"
,
_
=>
"???"
}
...
...
src/test/compile-fail/required-lang-item.rs
0 → 100644
浏览文件 @
2f845a5e
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#[no_std]
;
// error-pattern:requires `start` lang_item
fn
main
()
{}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录