Permalink
Browse files

Change util::unreachable to core::unreachable

Closes #1931
  • Loading branch information...
catamorphism committed Mar 8, 2012
1 parent 0824d15 commit d048a00cf3c275d9f9974960d0db463844da898e
View
@@ -50,7 +50,7 @@ fn weighted_choice<T: copy>(r : rand::rng, v : [weighted<T>]) -> T {
ret item;
}
}
- std::util::unreachable();
+ core::unreachable();
}
fn weighted_vec<T: copy>(v : [weighted<T>]) -> [T] {
View
@@ -6,7 +6,7 @@ import option::{some, none};
import option = option::t;
import path = path::path;
import vec::vec_len;
-export path, option, some, none, vec_len;
+export path, option, some, none, vec_len, unreachable;
// Export the log levels as global constants. Higher levels mean
// more-verbosity. Error is the bottom level, default logging level is
@@ -39,3 +39,15 @@ mod std {
use std;
import std::test;
}
+
+/*
+Function: unreachable
+
+A standard function to use to indicate unreachable code. Because the
+function is guaranteed to fail typestate will correctly identify
+any code paths following the appearance of this function as unreachable.
+*/
+fn unreachable() -> ! {
+ fail "Internal error: entered unreachable code";
+}
+
View
@@ -80,7 +80,7 @@ fn getenv(n: str) -> option<str> {
ret option::some(str::from_bytes(v)); // UTF-8 or fail
} else { nsize = res; }
}
- util::unreachable();
+ core::unreachable();
}
#[cfg(target_os = "win32")]
View
@@ -158,7 +158,7 @@ mod chained {
}
}
}
- util::unreachable();
+ core::unreachable();
}
fn search_tbl<K: copy, V: copy>(
View
@@ -1028,7 +1028,7 @@ mod node {
}
}
}
- util::unreachable();
+ core::unreachable();
}
/*
@@ -1092,7 +1092,7 @@ mod node {
}
}
}
- util::unreachable();
+ core::unreachable();
}
fn concat2(left: @node, right: @node) -> @node {
@@ -1176,7 +1176,7 @@ mod node {
}
}
}
- util::unreachable();
+ core::unreachable();
}
/*
@@ -1209,7 +1209,7 @@ mod node {
}
}
}
- util::unreachable();
+ core::unreachable();
}
mod leaf_iterator {
@@ -1248,7 +1248,7 @@ mod node {
}
}
}
- util::unreachable();
+ core::unreachable();
}
}
@@ -1292,7 +1292,7 @@ mod node {
}
}
}
- util::unreachable();
+ core::unreachable();
}
fn get_current_or_next_leaf(it: t) -> option<leaf> {
View
@@ -9,17 +9,6 @@ The identity function
*/
pure fn id<T: copy>(x: T) -> T { x }
-/*
-Function: unreachable
-
-A standard function to use to indicate unreachable code. Because the
-function is guaranteed to fail typestate will correctly identify
-any code paths following the appearance of this function as unreachable.
-*/
-fn unreachable() -> ! {
- fail "Internal error: entered unreachable code";
-}
-
/* FIXME (issue #141): See test/run-pass/constrained-type.rs. Uncomment
* the constraint once fixed. */
/*
View
@@ -106,7 +106,7 @@ fn get_rpath_relative_to_output(os: session::os,
session::os_linux { "$ORIGIN" + fs::path_sep() }
session::os_freebsd { "$ORIGIN" + fs::path_sep() }
session::os_macos { "@executable_path" + fs::path_sep() }
- session::os_win32 { std::util::unreachable(); }
+ session::os_win32 { core::unreachable(); }
};
prefix + get_relative_to(
@@ -6,7 +6,7 @@ import syntax::visit;
import visit::vt;
import std::list;
import std::map::hashmap;
-import std::util::unreachable;
+import core::unreachable;
import option::is_none;
import list::list;
import driver::session::session;
@@ -2,7 +2,7 @@ import syntax::{visit, ast_util};
import syntax::ast::*;
import syntax::codemap::span;
import std::list::{is_not_empty, list, nil, cons, tail};
-import std::util::unreachable;
+import core::unreachable;
import std::list;
import std::map::hashmap;
@@ -861,7 +861,7 @@ fn unresolved_err(e: env, cx: ctxt, sp: span, name: ident, kind: str) {
_ { ret none; }
}
}
- std::util::unreachable()
+ core::unreachable()
}
let path = name;
alt cx {
@@ -71,7 +71,7 @@ fn variant_opt(tcx: ty::ctxt, pat_id: ast::node_id) -> opt {
for v: ty::variant_info in *variants {
if vdef.var == v.id { ret var(v.disr_val, vdef); }
}
- std::util::unreachable();
+ core::unreachable();
}
type bind_map = [{ident: ast::ident, val: ValueRef}];
@@ -44,7 +44,7 @@ fn make_free_glue(bcx: block, vptr: ValueRef, t: ty::t)
fn content_ty(t: ty::t) -> ty::t {
alt ty::get(t).struct {
ty::ty_uniq({ty: ct, _}) { ct }
- _ { std::util::unreachable(); }
+ _ { core::unreachable(); }
}
}
@@ -1034,7 +1034,7 @@ fn do_autoderef(fcx: @fn_ctxt, sp: span, t: ty::t) -> ty::t {
_ { ret t1; }
}
}
- std::util::unreachable();
+ core::unreachable();
}
fn resolve_type_vars_if_possible(fcx: @fn_ctxt, typ: ty::t) -> ty::t {
@@ -1321,7 +1321,7 @@ fn parse_capture_clause(p: parser) -> @ast::capture_clause {
_ { ret res; }
}
}
- std::util::unreachable();
+ core::unreachable();
}
let copies = [];
@@ -1419,7 +1419,7 @@ fn operator_prec(op: ast::binop) -> int {
for spec: parse::parser::op_spec in *parse::parser::prec_table() {
if spec.op == op { ret spec.prec; }
}
- std::util::unreachable();
+ core::unreachable();
}
fn need_parens(expr: @ast::expr, outer_prec: int) -> bool {

0 comments on commit d048a00

Please sign in to comment.