Skip to content

Commit 85c0fb7

Browse files
committed
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.
2 parents 755f622 + 2f845a5 commit 85c0fb7

File tree

2 files changed

+57
-43
lines changed

2 files changed

+57
-43
lines changed

src/librustc/middle/lang_items.rs

+42-43
Original file line numberDiff line numberDiff line change
@@ -59,36 +59,36 @@ pub enum LangItem {
5959

6060
StrEqFnLangItem, // 19
6161
UniqStrEqFnLangItem, // 20
62-
FailFnLangItem, // 22
63-
FailBoundsCheckFnLangItem, // 23
64-
ExchangeMallocFnLangItem, // 24
65-
ClosureExchangeMallocFnLangItem, // 25
66-
ExchangeFreeFnLangItem, // 26
67-
MallocFnLangItem, // 27
68-
FreeFnLangItem, // 28
69-
BorrowAsImmFnLangItem, // 29
70-
BorrowAsMutFnLangItem, // 30
71-
ReturnToMutFnLangItem, // 31
72-
CheckNotBorrowedFnLangItem, // 32
73-
StrDupUniqFnLangItem, // 33
74-
RecordBorrowFnLangItem, // 34
75-
UnrecordBorrowFnLangItem, // 35
76-
77-
StartFnLangItem, // 36
78-
79-
TyDescStructLangItem, // 37
80-
TyVisitorTraitLangItem, // 38
81-
OpaqueStructLangItem, // 39
62+
FailFnLangItem, // 21
63+
FailBoundsCheckFnLangItem, // 22
64+
ExchangeMallocFnLangItem, // 23
65+
ClosureExchangeMallocFnLangItem, // 24
66+
ExchangeFreeFnLangItem, // 25
67+
MallocFnLangItem, // 26
68+
FreeFnLangItem, // 27
69+
BorrowAsImmFnLangItem, // 28
70+
BorrowAsMutFnLangItem, // 29
71+
ReturnToMutFnLangItem, // 30
72+
CheckNotBorrowedFnLangItem, // 31
73+
StrDupUniqFnLangItem, // 32
74+
RecordBorrowFnLangItem, // 33
75+
UnrecordBorrowFnLangItem, // 34
76+
77+
StartFnLangItem, // 35
78+
79+
TyDescStructLangItem, // 36
80+
TyVisitorTraitLangItem, // 37
81+
OpaqueStructLangItem, // 38
8282
}
8383

8484
pub struct LanguageItems {
85-
items: [Option<DefId>, ..41]
85+
items: [Option<DefId>, ..39]
8686
}
8787

8888
impl LanguageItems {
8989
pub fn new() -> LanguageItems {
9090
LanguageItems {
91-
items: [ None, ..41 ]
91+
items: [ None, ..39 ]
9292
}
9393
}
9494

@@ -122,27 +122,26 @@ impl LanguageItems {
122122

123123
19 => "str_eq",
124124
20 => "uniq_str_eq",
125-
21 => "log_type",
126-
22 => "fail_",
127-
23 => "fail_bounds_check",
128-
24 => "exchange_malloc",
129-
25 => "closure_exchange_malloc",
130-
26 => "exchange_free",
131-
27 => "malloc",
132-
28 => "free",
133-
29 => "borrow_as_imm",
134-
30 => "borrow_as_mut",
135-
31 => "return_to_mut",
136-
32 => "check_not_borrowed",
137-
33 => "strdup_uniq",
138-
34 => "record_borrow",
139-
35 => "unrecord_borrow",
140-
141-
36 => "start",
142-
143-
37 => "ty_desc",
144-
38 => "ty_visitor",
145-
39 => "opaque",
125+
21 => "fail_",
126+
22 => "fail_bounds_check",
127+
23 => "exchange_malloc",
128+
24 => "closure_exchange_malloc",
129+
25 => "exchange_free",
130+
26 => "malloc",
131+
27 => "free",
132+
28 => "borrow_as_imm",
133+
29 => "borrow_as_mut",
134+
30 => "return_to_mut",
135+
31 => "check_not_borrowed",
136+
32 => "strdup_uniq",
137+
33 => "record_borrow",
138+
34 => "unrecord_borrow",
139+
140+
35 => "start",
141+
142+
36 => "ty_desc",
143+
37 => "ty_visitor",
144+
38 => "opaque",
146145

147146
_ => "???"
148147
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
#[no_std];
12+
13+
// error-pattern:requires `start` lang_item
14+
15+
fn main() {}

0 commit comments

Comments
 (0)