mirror of
https://github.com/rust-lang/rust
synced 2024-10-14 04:23:37 +00:00
auto merge of #9295 : alexcrichton/rust/fix-lang-items, r=thestinger
Also add a test to help prevent this from getting out of sync again.
This commit is contained in:
commit
85c0fb7b8a
|
@ -59,36 +59,36 @@ pub enum LangItem {
|
|||
|
||||
StrEqFnLangItem, // 19
|
||||
UniqStrEqFnLangItem, // 20
|
||||
FailFnLangItem, // 22
|
||||
FailBoundsCheckFnLangItem, // 23
|
||||
ExchangeMallocFnLangItem, // 24
|
||||
ClosureExchangeMallocFnLangItem, // 25
|
||||
ExchangeFreeFnLangItem, // 26
|
||||
MallocFnLangItem, // 27
|
||||
FreeFnLangItem, // 28
|
||||
BorrowAsImmFnLangItem, // 29
|
||||
BorrowAsMutFnLangItem, // 30
|
||||
ReturnToMutFnLangItem, // 31
|
||||
CheckNotBorrowedFnLangItem, // 32
|
||||
StrDupUniqFnLangItem, // 33
|
||||
RecordBorrowFnLangItem, // 34
|
||||
UnrecordBorrowFnLangItem, // 35
|
||||
FailFnLangItem, // 21
|
||||
FailBoundsCheckFnLangItem, // 22
|
||||
ExchangeMallocFnLangItem, // 23
|
||||
ClosureExchangeMallocFnLangItem, // 24
|
||||
ExchangeFreeFnLangItem, // 25
|
||||
MallocFnLangItem, // 26
|
||||
FreeFnLangItem, // 27
|
||||
BorrowAsImmFnLangItem, // 28
|
||||
BorrowAsMutFnLangItem, // 29
|
||||
ReturnToMutFnLangItem, // 30
|
||||
CheckNotBorrowedFnLangItem, // 31
|
||||
StrDupUniqFnLangItem, // 32
|
||||
RecordBorrowFnLangItem, // 33
|
||||
UnrecordBorrowFnLangItem, // 34
|
||||
|
||||
StartFnLangItem, // 36
|
||||
StartFnLangItem, // 35
|
||||
|
||||
TyDescStructLangItem, // 37
|
||||
TyVisitorTraitLangItem, // 38
|
||||
OpaqueStructLangItem, // 39
|
||||
TyDescStructLangItem, // 36
|
||||
TyVisitorTraitLangItem, // 37
|
||||
OpaqueStructLangItem, // 38
|
||||
}
|
||||
|
||||
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",
|
||||
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",
|
||||
|
||||
36 => "start",
|
||||
35 => "start",
|
||||
|
||||
37 => "ty_desc",
|
||||
38 => "ty_visitor",
|
||||
39 => "opaque",
|
||||
36 => "ty_desc",
|
||||
37 => "ty_visitor",
|
||||
38 => "opaque",
|
||||
|
||||
_ => "???"
|
||||
}
|
||||
|
|
15
src/test/compile-fail/required-lang-item.rs
Normal file
15
src/test/compile-fail/required-lang-item.rs
Normal file
|
@ -0,0 +1,15 @@
|
|||
// 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() {}
|
Loading…
Reference in a new issue