about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2013-09-19 11:11:01 -0700
committerbors <bors@rust-lang.org>2013-09-19 11:11:01 -0700
commit85c0fb7b8a81fc48a2155decd20abf16b1c5eeb6 (patch)
tree391ceb609f943146aacbadfaafc0c93451522037
parent755f6229da1d436f4cb23fffea644ba13291b434 (diff)
parent2f845a5e0aa9cdd4bc5dc25341bb241643f76f11 (diff)
downloadrust-85c0fb7b8a81fc48a2155decd20abf16b1c5eeb6.tar.gz
rust-85c0fb7b8a81fc48a2155decd20abf16b1c5eeb6.zip
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.
-rw-r--r--src/librustc/middle/lang_items.rs85
-rw-r--r--src/test/compile-fail/required-lang-item.rs15
2 files changed, 57 insertions, 43 deletions
diff --git a/src/librustc/middle/lang_items.rs b/src/librustc/middle/lang_items.rs
index 41bdba49845..1d5ed61154a 100644
--- a/src/librustc/middle/lang_items.rs
+++ b/src/librustc/middle/lang_items.rs
@@ -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
-
-    StartFnLangItem,                   // 36
-
-    TyDescStructLangItem,              // 37
-    TyVisitorTraitLangItem,            // 38
-    OpaqueStructLangItem,              // 39
+    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,                   // 35
+
+    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 @@ impl LanguageItems {
 
             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",
 
             _ => "???"
         }
diff --git a/src/test/compile-fail/required-lang-item.rs b/src/test/compile-fail/required-lang-item.rs
new file mode 100644
index 00000000000..2a564990c53
--- /dev/null
+++ b/src/test/compile-fail/required-lang-item.rs
@@ -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() {}