From b968c8e6cd362567bf0047a96d261691dfca43e8 Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Tue, 13 Mar 2012 14:39:28 -0700 Subject: [PATCH] Name types after their modules instead of 't' --- doc/tutorial.md | 12 ++--- src/libcore/comm.rs | 2 +- src/libcore/core.rs | 4 +- src/libcore/either.rs | 39 +++++++------- src/libcore/f32.rs | 2 - src/libcore/f64.rs | 2 - src/libcore/float.rs | 2 - src/libcore/future.rs | 2 - src/libcore/io.rs | 12 ++--- src/libcore/option.rs | 20 +++---- src/libcore/os.rs | 1 - src/libcore/result.rs | 24 +++++---- src/libcore/task.rs | 2 +- src/libstd/c_vec.rs | 42 ++++++++------- src/libstd/four.rs | 52 ++++++++++--------- src/libstd/getopts.rs | 3 +- src/libstd/json.rs | 26 +++++----- src/libstd/test.rs | 2 +- src/libstd/tri.rs | 46 ++++++++-------- src/rustc/front/attr.rs | 2 +- src/rustc/metadata/astencode_gen.rs | 32 ++++++------ src/rustc/middle/trans/closure.rs | 2 +- src/rustc/middle/ty.rs | 4 +- src/rustc/middle/typeck.rs | 10 ++-- src/rustc/syntax/ast.rs | 4 +- src/rustc/syntax/parse/parser.rs | 4 +- src/rustc/util/filesearch.rs | 10 ++-- src/rustdoc/config.rs | 14 ++--- .../fully-qualified-type-name1.rs | 2 +- 29 files changed, 190 insertions(+), 189 deletions(-) diff --git a/doc/tutorial.md b/doc/tutorial.md index bffce15e0a2..a6102123711 100644 --- a/doc/tutorial.md +++ b/doc/tutorial.md @@ -1540,11 +1540,11 @@ You can then declare a function to take a `circular_buf` or return an `option`, or even an `option` if the function itself is generic. -The `option` type given above exists in the core library as -`option::t`, and is the way Rust programs express the thing that in C -would be a nullable pointer. The nice part is that you have to -explicitly unpack an `option` type, so accidental null pointer -dereferences become impossible. +The `option` type given above exists in the core library and is the +way Rust programs express the thing that in C would be a nullable +pointer. The nice part is that you have to explicitly unpack an +`option` type, so accidental null pointer dereferences become +impossible. ## Type-inference and generics @@ -1562,7 +1562,7 @@ you really want to have such a statement, you'll have to write it like this: ~~~~ -let n2: option::t = option::none; +let n2: option = option::none; // or let n = option::none::; ~~~~ diff --git a/src/libcore/comm.rs b/src/libcore/comm.rs index e4f0663c443..1572972ffdf 100644 --- a/src/libcore/comm.rs +++ b/src/libcore/comm.rs @@ -167,7 +167,7 @@ fn recv_(p: *rust_port) -> T { #[doc = "Receive on one of two ports"] fn select2( p_a: port, p_b: port -) -> either::t unsafe { +) -> either unsafe { fn select(dptr: **rust_port, ports: **rust_port, n_ports: libc::size_t, yield: *libc::uintptr_t) { diff --git a/src/libcore/core.rs b/src/libcore/core.rs index f83065ff501..5dfb2522f08 100644 --- a/src/libcore/core.rs +++ b/src/libcore/core.rs @@ -3,7 +3,9 @@ // Export various ubiquitous types, constructors, methods. import option::{some, none}; -import option = option::t; +import option = option::option; +import either = either::either; +import result = result::result; import path = path::path; import vec::vec_len; export path, option, some, none, vec_len, unreachable; diff --git a/src/libcore/either.rs b/src/libcore/either.rs index 175c93a3409..a77f19af4e1 100644 --- a/src/libcore/either.rs +++ b/src/libcore/either.rs @@ -1,13 +1,13 @@ #[doc = "A type that represents one of two alternatives"]; #[doc = "The either type"] -enum t { +enum either { left(T), right(U) } fn either(f_left: fn(T) -> V, - f_right: fn(U) -> V, value: t) -> V { + f_right: fn(U) -> V, value: either) -> V { #[doc = " Applies a function based on the given either value @@ -19,27 +19,27 @@ fn either(f_left: fn(T) -> V, alt value { left(l) { f_left(l) } right(r) { f_right(r) } } } -fn lefts(eithers: [t]) -> [T] { +fn lefts(eithers: [either]) -> [T] { #[doc = "Extracts from a vector of either all the left values"]; let mut result: [T] = []; - for elt: t in eithers { + for elt: either in eithers { alt elt { left(l) { result += [l]; } _ {/* fallthrough */ } } } ret result; } -fn rights(eithers: [t]) -> [U] { +fn rights(eithers: [either]) -> [U] { #[doc = "Extracts from a vector of either all the right values"]; let mut result: [U] = []; - for elt: t in eithers { + for elt: either in eithers { alt elt { right(r) { result += [r]; } _ {/* fallthrough */ } } } ret result; } -fn partition(eithers: [t]) +fn partition(eithers: [either]) -> {lefts: [T], rights: [U]} { #[doc = " Extracts from a vector of either all the left values and right values @@ -50,13 +50,13 @@ fn partition(eithers: [t]) let mut lefts: [T] = []; let mut rights: [U] = []; - for elt: t in eithers { + for elt: either in eithers { alt elt { left(l) { lefts += [l]; } right(r) { rights += [r]; } } } ret {lefts: lefts, rights: rights}; } -pure fn flip(eith: t) -> t { +pure fn flip(eith: either) -> either { #[doc = "Flips between left and right of a given either"]; alt eith { @@ -65,7 +65,8 @@ pure fn flip(eith: t) -> t { } } -pure fn to_result(eith: t) -> result::t { +pure fn to_result( + eith: either) -> result { #[doc = " Converts either::t to a result::t @@ -79,13 +80,13 @@ pure fn to_result(eith: t) -> result::t { } } -pure fn is_left(eith: t) -> bool { +pure fn is_left(eith: either) -> bool { #[doc = "Checks whether the given value is a left"]; alt eith { left(_) { true } _ { false } } } -pure fn is_right(eith: t) -> bool { +pure fn is_right(eith: either) -> bool { #[doc = "Checks whether the given value is a right"]; alt eith { right(_) { true } _ { false } } @@ -116,14 +117,14 @@ fn test_lefts() { #[test] fn test_lefts_none() { - let input: [t] = [right(10), right(10)]; + let input: [either] = [right(10), right(10)]; let result = lefts(input); assert (vec::len(result) == 0u); } #[test] fn test_lefts_empty() { - let input: [t] = []; + let input: [either] = []; let result = lefts(input); assert (vec::len(result) == 0u); } @@ -137,14 +138,14 @@ fn test_rights() { #[test] fn test_rights_none() { - let input: [t] = [left(10), left(10)]; + let input: [either] = [left(10), left(10)]; let result = rights(input); assert (vec::len(result) == 0u); } #[test] fn test_rights_empty() { - let input: [t] = []; + let input: [either] = []; let result = rights(input); assert (vec::len(result) == 0u); } @@ -162,7 +163,7 @@ fn test_partition() { #[test] fn test_partition_no_lefts() { - let input: [t] = [right(10), right(11)]; + let input: [either] = [right(10), right(11)]; let result = partition(input); assert (vec::len(result.lefts) == 0u); assert (vec::len(result.rights) == 2u); @@ -170,7 +171,7 @@ fn test_partition_no_lefts() { #[test] fn test_partition_no_rights() { - let input: [t] = [left(10), left(11)]; + let input: [either] = [left(10), left(11)]; let result = partition(input); assert (vec::len(result.lefts) == 2u); assert (vec::len(result.rights) == 0u); @@ -178,7 +179,7 @@ fn test_partition_no_rights() { #[test] fn test_partition_empty() { - let input: [t] = []; + let input: [either] = []; let result = partition(input); assert (vec::len(result.lefts) == 0u); assert (vec::len(result.rights) == 0u); diff --git a/src/libcore/f32.rs b/src/libcore/f32.rs index 3e3a172ba81..5b9d090db4f 100644 --- a/src/libcore/f32.rs +++ b/src/libcore/f32.rs @@ -20,8 +20,6 @@ export lgamma, ln, log_radix, ln1p, log10, log2, ilog_radix; export modf, pow, round, sin, sinh, sqrt, tan, tanh, tgamma, trunc; export signbit; -type t = f32; - // These are not defined inside consts:: for consistency with // the integer types diff --git a/src/libcore/f64.rs b/src/libcore/f64.rs index 214fcc80188..7cc2846a421 100644 --- a/src/libcore/f64.rs +++ b/src/libcore/f64.rs @@ -21,8 +21,6 @@ export modf, pow, round, sin, sinh, sqrt, tan, tanh, tgamma, trunc; export signbit; export epsilon; -type t = f64; - // These are not defined inside consts:: for consistency with // the integer types diff --git a/src/libcore/float.rs b/src/libcore/float.rs index aec7fd8b0ed..e9aa803e137 100644 --- a/src/libcore/float.rs +++ b/src/libcore/float.rs @@ -26,8 +26,6 @@ export j0, j1, jn, y0, y1, yn; import m_float = f64; import f64::*; -type t = float; - /** * Section: String Conversions */ diff --git a/src/libcore/future.rs b/src/libcore/future.rs index faf5cca0e6c..7d2ce8ef44d 100644 --- a/src/libcore/future.rs +++ b/src/libcore/future.rs @@ -20,8 +20,6 @@ export get; export with; export spawn; -import either = either::t; - #[doc = "The future type"] enum future = { mutable v: either<@A, fn@() -> A> diff --git a/src/libcore/io.rs b/src/libcore/io.rs index 23974b789c3..e28876f2134 100644 --- a/src/libcore/io.rs +++ b/src/libcore/io.rs @@ -218,7 +218,7 @@ fn FILE_reader(f: *libc::FILE, cleanup: bool) -> reader { fn stdin() -> reader { rustrt::rust_get_stdin() as reader } -fn file_reader(path: str) -> result::t { +fn file_reader(path: str) -> result { let f = os::as_c_charp(path, {|pathbuf| os::as_c_charp("r", {|modebuf| libc::fopen(pathbuf, modebuf) @@ -374,7 +374,7 @@ fn fd_writer(fd: fd_t, cleanup: bool) -> writer { fn mk_file_writer(path: str, flags: [fileflag]) - -> result::t { + -> result { #[cfg(target_os = "win32")] fn wb() -> c_int { (O_WRONLY | O_BINARY) as c_int } @@ -487,13 +487,13 @@ impl writer_util for writer { fn write_u8(n: u8) { self.write([n]) } } -fn file_writer(path: str, flags: [fileflag]) -> result::t { +fn file_writer(path: str, flags: [fileflag]) -> result { result::chain(mk_file_writer(path, flags), { |w| result::ok(w)}) } // FIXME: fileflags -fn buffered_file_writer(path: str) -> result::t { +fn buffered_file_writer(path: str) -> result { let f = os::as_c_charp(path) {|pathbuf| os::as_c_charp("w") {|modebuf| libc::fopen(pathbuf, modebuf) @@ -581,7 +581,7 @@ fn seek_in_buf(offset: int, pos: uint, len: uint, whence: seek_style) -> ret bpos as uint; } -fn read_whole_file_str(file: str) -> result::t { +fn read_whole_file_str(file: str) -> result { result::chain(read_whole_file(file), { |bytes| result::ok(str::from_bytes(bytes)) }) @@ -589,7 +589,7 @@ fn read_whole_file_str(file: str) -> result::t { // FIXME implement this in a low-level way. Going through the abstractions is // pointless. -fn read_whole_file(file: str) -> result::t<[u8], str> { +fn read_whole_file(file: str) -> result<[u8], str> { result::chain(file_reader(file), { |rdr| result::ok(rdr.read_whole_stream()) }) diff --git a/src/libcore/option.rs b/src/libcore/option.rs index 47e407e4952..02957cc9f3b 100644 --- a/src/libcore/option.rs +++ b/src/libcore/option.rs @@ -8,12 +8,12 @@ languages you might use a nullable type, in Rust you would use an option type. "]; #[doc = "The option type"] -enum t { +enum option { none, some(T), } -pure fn get(opt: t) -> T { +pure fn get(opt: option) -> T { #[doc = " Gets the value out of an option @@ -25,13 +25,13 @@ pure fn get(opt: t) -> T { alt opt { some(x) { ret x; } none { fail "option none"; } } } -fn map(opt: t, f: fn(T) -> U) -> t { +fn map(opt: option, f: fn(T) -> U) -> option { #[doc = "Maps a `some` value from one type to another"]; alt opt { some(x) { some(f(x)) } none { none } } } -fn chain(opt: t, f: fn(T) -> t) -> t { +fn chain(opt: option, f: fn(T) -> option) -> option { #[doc = " Update an optional value by optionally running its content through a function that returns an option. @@ -40,37 +40,37 @@ fn chain(opt: t, f: fn(T) -> t) -> t { alt opt { some(x) { f(x) } none { none } } } -pure fn is_none(opt: t) -> bool { +pure fn is_none(opt: option) -> bool { #[doc = "Returns true if the option equals `none`"]; alt opt { none { true } some(_) { false } } } -pure fn is_some(opt: t) -> bool { +pure fn is_some(opt: option) -> bool { #[doc = "Returns true if the option contains some value"]; !is_none(opt) } -pure fn from_maybe(def: T, opt: t) -> T { +pure fn from_maybe(def: T, opt: option) -> T { #[doc = "Returns the contained value or a default"]; alt opt { some(x) { x } none { def } } } -fn maybe(def: U, opt: t, f: fn(T) -> U) -> U { +fn maybe(def: U, opt: option, f: fn(T) -> U) -> U { #[doc = "Applies a function to the contained value or returns a default"]; alt opt { none { def } some(t) { f(t) } } } -fn may(opt: t, f: fn(T)) { +fn may(opt: option, f: fn(T)) { #[doc = "Performs an operation on the contained value or does nothing"]; alt opt { none { } some(t) { f(t); } } } -fn unwrap(-opt: t) -> T unsafe { +fn unwrap(-opt: option) -> T unsafe { #[doc = " Moves a value out of an option type and returns it. diff --git a/src/libcore/os.rs b/src/libcore/os.rs index e13ccc709ff..1b1474d23fd 100644 --- a/src/libcore/os.rs +++ b/src/libcore/os.rs @@ -21,7 +21,6 @@ import libc::{c_char, c_void, c_int, c_uint, size_t, ssize_t, import libc::{close, fclose}; import option::{some, none}; -import option = option::t; import getcwd = rustrt::rust_getcwd; import consts::*; diff --git a/src/libcore/result.rs b/src/libcore/result.rs index b3c01f62f9d..a8ba34b2f3a 100644 --- a/src/libcore/result.rs +++ b/src/libcore/result.rs @@ -1,7 +1,7 @@ #[doc = "A type representing either success or failure"]; #[doc = "The result type"] -enum t { +enum result { #[doc = "Contains the successful result value"] ok(T), #[doc = "Contains the error value"] @@ -15,7 +15,7 @@ Get the value out of a successful result If the result is an error "] -fn get(res: t) -> T { +fn get(res: result) -> T { alt res { ok(t) { t } err(_) { @@ -33,7 +33,7 @@ Get the value out of an error result If the result is not an error "] -fn get_err(res: t) -> U { +fn get_err(res: result) -> U { alt res { err(u) { u } ok(_) { @@ -43,7 +43,7 @@ fn get_err(res: t) -> U { } #[doc = "Returns true if the result is `ok`"] -pure fn success(res: t) -> bool { +pure fn success(res: result) -> bool { alt res { ok(_) { true } err(_) { false } @@ -51,7 +51,7 @@ pure fn success(res: t) -> bool { } #[doc = "Returns true if the result is `error`"] -pure fn failure(res: t) -> bool { +pure fn failure(res: result) -> bool { !success(res) } @@ -61,7 +61,7 @@ Convert to the `either` type `ok` result variants are converted to `either::right` variants, `err` result variants are converted to `either::left`. "] -pure fn to_either(res: t) -> either::t { +pure fn to_either(res: result) -> either { alt res { ok(res) { either::right(res) } err(fail_) { either::left(fail_) } @@ -81,8 +81,8 @@ Example: ok(parse_buf(buf)) } "] -fn chain(res: t, op: fn(T) -> t) - -> t { +fn chain(res: result, op: fn(T) -> result) + -> result { alt res { ok(t) { op(t) } err(e) { err(e) } @@ -91,11 +91,13 @@ fn chain(res: t, op: fn(T) -> t) #[cfg(test)] mod tests { - fn op1() -> result::t { result::ok(666) } + fn op1() -> result::result { result::ok(666) } - fn op2(&&i: int) -> result::t { result::ok(i as uint + 1u) } + fn op2(&&i: int) -> result::result { + result::ok(i as uint + 1u) + } - fn op3() -> result::t { result::err("sadface") } + fn op3() -> result::result { result::err("sadface") } #[test] fn chain_success() { diff --git a/src/libcore/task.rs b/src/libcore/task.rs index 806fd951189..c673fbf9b84 100644 --- a/src/libcore/task.rs +++ b/src/libcore/task.rs @@ -406,7 +406,7 @@ fn spawn_sched(mode: sched_mode, +f: fn~()) { run(builder, f); } -fn try(+f: fn~() -> T) -> result::t { +fn try(+f: fn~() -> T) -> result { #[doc = " Execute a function in another task and return either the return value of the function or result::err. diff --git a/src/libstd/c_vec.rs b/src/libstd/c_vec.rs index 532f2903af3..28ee44690ee 100644 --- a/src/libstd/c_vec.rs +++ b/src/libstd/c_vec.rs @@ -25,7 +25,7 @@ form -- for instance, to pass memory back into C -- but great care must be taken to ensure that a reference to the c_vec::t is still held if needed. "]; -export t; +export c_vec; export c_vec, c_vec_with_dtor; export get, set; export len; @@ -37,8 +37,8 @@ The type representing a native chunk of memory Wrapped in a enum for opacity; FIXME #818 when it is possible to have truly opaque types, this should be revisited. "] -enum t { - t({ base: *mutable T, len: uint, rsrc: @dtor_res}) +enum c_vec { + c_vec_({ base: *mutable T, len: uint, rsrc: @dtor_res}) } resource dtor_res(dtor: option) { @@ -53,22 +53,23 @@ resource dtor_res(dtor: option) { */ #[doc = " -Create a c_vec::t from a native buffer with a given length. +Create a `c_vec` from a native buffer with a given length. # Arguments * base - A native pointer to a buffer * len - The number of elements in the buffer "] -unsafe fn c_vec(base: *mutable T, len: uint) -> t { - ret t({base: base, - len: len, - rsrc: @dtor_res(option::none) - }); +unsafe fn c_vec(base: *mutable T, len: uint) -> c_vec { + ret c_vec_({ + base: base, + len: len, + rsrc: @dtor_res(option::none) + }); } #[doc = " -Create a c_vec::t from a native buffer, with a given length, +Create a `c_vec` from a native buffer, with a given length, and a function to run upon destruction. # Arguments @@ -79,11 +80,12 @@ and a function to run upon destruction. for freeing the buffer, etc. "] unsafe fn c_vec_with_dtor(base: *mutable T, len: uint, dtor: fn@()) - -> t { - ret t({base: base, - len: len, - rsrc: @dtor_res(option::some(dtor)) - }); + -> c_vec { + ret c_vec_({ + base: base, + len: len, + rsrc: @dtor_res(option::some(dtor)) + }); } /* @@ -95,7 +97,7 @@ Retrieves an element at a given index Fails if `ofs` is greater or equal to the length of the vector "] -fn get(t: t, ofs: uint) -> T { +fn get(t: c_vec, ofs: uint) -> T { assert ofs < len(t); ret unsafe { *ptr::mut_offset((*t).base, ofs) }; } @@ -105,7 +107,7 @@ Sets the value of an element at a given index Fails if `ofs` is greater or equal to the length of the vector "] -fn set(t: t, ofs: uint, v: T) { +fn set(t: c_vec, ofs: uint, v: T) { assert ofs < len(t); unsafe { *ptr::mut_offset((*t).base, ofs) = v }; } @@ -115,12 +117,12 @@ fn set(t: t, ofs: uint, v: T) { */ #[doc = "Returns the length of the vector"] -fn len(t: t) -> uint { +fn len(t: c_vec) -> uint { ret (*t).len; } #[doc = "Returns a pointer to the first element of the vector"] -unsafe fn ptr(t: t) -> *mutable T { +unsafe fn ptr(t: c_vec) -> *mutable T { ret (*t).base; } @@ -128,7 +130,7 @@ unsafe fn ptr(t: t) -> *mutable T { mod tests { import libc::*; - fn malloc(n: size_t) -> t { + fn malloc(n: size_t) -> c_vec { let mem = libc::malloc(n); assert mem as int != 0; diff --git a/src/libstd/four.rs b/src/libstd/four.rs index 744dc0a4c91..e2565d67306 100644 --- a/src/libstd/four.rs +++ b/src/libstd/four.rs @@ -12,7 +12,7 @@ on current cpus. import tri; -export t, none, true, false, both; +export four, none, true, false, both; export not, and, or, xor, implies, implies_materially; export eq, ne, is_true, is_false; export from_str, to_str, all_values, to_trit, to_bit; @@ -22,58 +22,60 @@ The type of fourrternary logic values It may be thought of as tuple `(y, x)` of two bools "] -type t = u8; +type four = u8; const b0: u8 = 1u8; const b1: u8 = 2u8; const b01: u8 = 3u8; #[doc = "Logic value `(0, 0)` for bottom (neither true or false)"] -const none: t = 0u8; +const none: four = 0u8; #[doc = "Logic value `(0, 1)` for truth"] -const true: t = 1u8; +const true: four = 1u8; #[doc = "Logic value `(1, 0)` for falsehood"] -const false: t = 2u8; +const false: four = 2u8; #[doc = "Logic value `(1, 1)` for top (both true and false)"] -const both: t = 3u8; +const both: four = 3u8; #[doc = " Negation/Inverse Returns `'(v.y, v.x)` "] -pure fn not(v: t) -> t { ((v << 1u8) | (v >> 1u8)) & b01 } +pure fn not(v: four) -> four { ((v << 1u8) | (v >> 1u8)) & b01 } #[doc = " Conjunction Returns `(a.x | b.x, a.y & b.y)` "] -pure fn and(a: t, b: t) -> t { ((a & b) & b0) | ((a | b) & b1) } +pure fn and(a: four, b: four) -> four { ((a & b) & b0) | ((a | b) & b1) } #[doc = " Disjunction Returns `(a.x & b.x, a.y | b.y)` "] -pure fn or(a: t, b: t) -> t { ((a | b) & b0) | ((a & b) & b1) } +pure fn or(a: four, b: four) -> four { ((a | b) & b0) | ((a & b) & b1) } #[doc = " Classic exclusive or Returns `or(and(a, not(b)), and(not(a), b))` "] -pure fn xor(a: t, b: t) -> t { or(and(a, not(b)), and(not(a), b)) } +pure fn xor(a: four, b: four) -> four { or(and(a, not(b)), and(not(a), b)) } #[doc = " Strong implication (from `a` strongly follows `b`) Returns `( x1 & y2, !x1 | x2)` "] -pure fn implies(a: t, b: t) -> t { ((a << 1u8) & b & b1) | (((!a) | b) & b0) } +pure fn implies(a: four, b: four) -> four { + ((a << 1u8) & b & b1) | (((!a) | b) & b0) +} #[doc = " Classic (material) implication in the logic @@ -81,30 +83,30 @@ Classic (material) implication in the logic Returns `or(not(a), b)` "] -pure fn implies_materially(a: t, b: t) -> t { or(not(a), b) } +pure fn implies_materially(a: four, b: four) -> four { or(not(a), b) } #[doc = " Returns true if truth values `a` and `b` are indistinguishable in the logic "] -pure fn eq(a: t, b: t) -> bool { a == b } +pure fn eq(a: four, b: four) -> bool { a == b } #[doc = " Returns true if truth values `a` and `b` are distinguishable in the logic "] -pure fn ne(a: t, b: t) -> bool { a != b } +pure fn ne(a: four, b: four) -> bool { a != b } #[doc = " Returns true if `v` represents truth in the logic (is `true` or `both`) "] -pure fn is_true(v: t) -> bool { (v & b0) != 0u8 } +pure fn is_true(v: four) -> bool { (v & b0) != 0u8 } #[doc = " Returns true if `v` represents falsehood in the logic (is `false` or `none`) "] -pure fn is_false(v: t) -> bool { (v & b0) == 0u8 } +pure fn is_false(v: four) -> bool { (v & b0) == 0u8 } #[doc = "Parse logic value from `s`"] -pure fn from_str(s: str) -> t { +pure fn from_str(s: str) -> four { alt check s { "none" { none } "false" { four::false } @@ -114,7 +116,7 @@ pure fn from_str(s: str) -> t { } #[doc = "Convert `v` into a string"] -pure fn to_str(v: t) -> str { +pure fn to_str(v: four) -> str { // FIXME replace with consts as soon as that works alt check v { 0u8 { "none" } @@ -128,7 +130,7 @@ pure fn to_str(v: t) -> str { Iterates over all truth values by passing them to `blk` in an unspecified order "] -fn all_values(blk: fn(v: t)) { +fn all_values(blk: fn(v: four)) { blk(both); blk(four::true); blk(four::false); @@ -138,21 +140,21 @@ fn all_values(blk: fn(v: t)) { #[doc = " Returns an `u8` whose first bit is set if `if_true(v)` holds "] -fn to_bit(v: t) -> u8 { v & b0 } +fn to_bit(v: four) -> u8 { v & b0 } #[doc = " Returns a trit of `v` (`both` and `none` are both coalesced into `trit::unknown`) "] -fn to_trit(v: t) -> tri::t { v & (v ^ not(v)) } +fn to_trit(v: four) -> tri::tri { v & (v ^ not(v)) } #[cfg(test)] mod tests { - fn eq1(a: four::t, b: four::t) -> bool { four::eq(a , b) } - fn ne1(a: four::t, b: four::t) -> bool { four::ne(a , b) } + fn eq1(a: four, b: four) -> bool { four::eq(a , b) } + fn ne1(a: four, b: four) -> bool { four::ne(a , b) } - fn eq2(a: four::t, b: four::t) -> bool { eq1( a, b ) && eq1( b, a ) } + fn eq2(a: four, b: four) -> bool { eq1( a, b ) && eq1( b, a ) } #[test] fn test_four_req_eq() { @@ -190,7 +192,7 @@ mod tests { } } - fn to_tup(v: four::t) -> (bool, bool) { + fn to_tup(v: four) -> (bool, bool) { alt check v { 0u8 { (false, false) } 1u8 { (false, true) } diff --git a/src/libstd/getopts.rs b/src/libstd/getopts.rs index 19d941fe9f8..8d6aade9fad 100644 --- a/src/libstd/getopts.rs +++ b/src/libstd/getopts.rs @@ -45,7 +45,6 @@ name following -o, and accepts both -h and --help as optional flags. "]; -import core::result; import core::result::{err, ok}; import core::option; import core::option::{some, none}; @@ -159,7 +158,7 @@ fn fail_str(f: fail_) -> str { The result of parsing a command line with a set of options (result::t) "] -type result = result::t; +type result = result::result; #[doc = " Parse command line arguments according to the provided options diff --git a/src/libstd/json.rs b/src/libstd/json.rs index ca3d9f8b4d7..4e197d30c95 100644 --- a/src/libstd/json.rs +++ b/src/libstd/json.rs @@ -133,11 +133,11 @@ impl parser for parser { self.ch } - fn error(msg: str) -> result::t { + fn error(msg: str) -> result { err({ line: self.line, col: self.col, msg: msg }) } - fn parse() -> result::t { + fn parse() -> result { alt self.parse_value() { ok(value) { // Skip trailing whitespaces. @@ -153,7 +153,7 @@ impl parser for parser { } } - fn parse_value() -> result::t { + fn parse_value() -> result { self.parse_whitespace(); if self.eof() { ret self.error("EOF while parsing value"); } @@ -179,7 +179,7 @@ impl parser for parser { while char::is_whitespace(self.ch) { self.bump(); } } - fn parse_ident(ident: str, value: json) -> result::t { + fn parse_ident(ident: str, value: json) -> result { if str::all(ident, { |c| c == self.next_char() }) { self.bump(); ok(value) @@ -188,7 +188,7 @@ impl parser for parser { } } - fn parse_number() -> result::t { + fn parse_number() -> result { let neg = 1f; if self.ch == '-' { @@ -218,7 +218,7 @@ impl parser for parser { ok(num(neg * res)) } - fn parse_integer() -> result::t { + fn parse_integer() -> result { let res = 0f; alt self.ch { @@ -250,7 +250,7 @@ impl parser for parser { ok(res) } - fn parse_decimal(res: float) -> result::t { + fn parse_decimal(res: float) -> result { self.bump(); // Make sure a digit follows the decimal place. @@ -276,7 +276,7 @@ impl parser for parser { ok(res) } - fn parse_exponent(res: float) -> result::t { + fn parse_exponent(res: float) -> result { self.bump(); let res = res; @@ -317,7 +317,7 @@ impl parser for parser { ok(res) } - fn parse_str() -> result::t { + fn parse_str() -> result { let escape = false; let res = ""; @@ -372,7 +372,7 @@ impl parser for parser { self.error("EOF while parsing string") } - fn parse_list() -> result::t { + fn parse_list() -> result { self.bump(); self.parse_whitespace(); @@ -402,7 +402,7 @@ impl parser for parser { }; } - fn parse_object() -> result::t { + fn parse_object() -> result { self.bump(); self.parse_whitespace(); @@ -454,7 +454,7 @@ impl parser for parser { } #[doc = "Deserializes a json value from an io::reader"] -fn from_reader(rdr: io::reader) -> result::t { +fn from_reader(rdr: io::reader) -> result { let parser = { rdr: rdr, mutable ch: rdr.read_char(), @@ -466,7 +466,7 @@ fn from_reader(rdr: io::reader) -> result::t { } #[doc = "Deserializes a json value from a string"] -fn from_str(s: str) -> result::t { +fn from_str(s: str) -> result { io::with_str_reader(s, from_reader) } diff --git a/src/libstd/test.rs b/src/libstd/test.rs index 009da2e440d..d28912bae12 100644 --- a/src/libstd/test.rs +++ b/src/libstd/test.rs @@ -58,7 +58,7 @@ fn test_main(args: [str], tests: [test_desc]) { type test_opts = {filter: option, run_ignored: bool}; -type opt_res = either::t; +type opt_res = either; // Parses command line arguments into test options fn parse_opts(args: [str]) -> opt_res { diff --git a/src/libstd/tri.rs b/src/libstd/tri.rs index b40444a8a07..95eea29dc7e 100644 --- a/src/libstd/tri.rs +++ b/src/libstd/tri.rs @@ -10,44 +10,44 @@ all operations are done using bit operations which is fast on current cpus. "]; -export t, true, false, unknown; +export tri, true, false, unknown; export not, and, or, xor, implies, eq, ne, is_true, is_false; export from_str, to_str, all_values, to_bit; #[doc = "The type of ternary logic values"] -type t = u8; +type tri = u8; const b0: u8 = 1u8; const b1: u8 = 2u8; const b01: u8 = 3u8; #[doc = "Logic value for unknown (maybe true xor maybe false)"] -const unknown: t = 0u8; +const unknown: tri = 0u8; #[doc = "Logic value for truth"] -const true: t = 1u8; +const true: tri = 1u8; #[doc = "Logic value for falsehood"] -const false: t = 2u8; +const false: tri = 2u8; #[doc = "Negation/Inverse"] -pure fn not(v: t) -> t { ((v << 1u8) | (v >> 1u8)) & b01 } +pure fn not(v: tri) -> tri { ((v << 1u8) | (v >> 1u8)) & b01 } #[doc = "Conjunction"] -pure fn and(a: t, b: t) -> t { ((a | b) & b1) | ((a & b) & b0) } +pure fn and(a: tri, b: tri) -> tri { ((a | b) & b1) | ((a & b) & b0) } #[doc = "Disjunction"] -pure fn or(a: t, b: t) -> t { ((a & b) & b1) | ((a | b) & b0) } +pure fn or(a: tri, b: tri) -> tri { ((a & b) & b1) | ((a | b) & b0) } #[doc = "Exclusive or"] -pure fn xor(a: t, b: t) -> t { +pure fn xor(a: tri, b: tri) -> tri { let anb = a & b; let aob = a & not(b); ret ((anb & b1) | (anb << 1u8) | (aob >> 1u8) | (aob & b0)) & b01; } #[doc = "Classic implication, i.e. from `a` follows `b`"] -pure fn implies(a: t, b: t) -> t { +pure fn implies(a: tri, b: tri) -> tri { ret ((a & b1) >> 1u8) | (b & b0) | ((a << 1u8) & b & b1); } @@ -56,38 +56,38 @@ pure fn implies(a: t, b: t) -> t { true if truth values `a` and `b` are indistinguishable in the logic "] -pure fn eq(a: t, b: t) -> bool { a == b } +pure fn eq(a: tri, b: tri) -> bool { a == b } #[doc = " # Return value true if truth values `a` and `b` are distinguishable in the logic "] -pure fn ne(a: t, b: t) -> bool { a != b } +pure fn ne(a: tri, b: tri) -> bool { a != b } #[doc = " # Return value true if `v` represents truth in the logic "] -pure fn is_true(v: t) -> bool { v == tri::true } +pure fn is_true(v: tri) -> bool { v == tri::true } #[doc = " # Return value true if `v` represents false in the logic "] -pure fn is_false(v: t) -> bool { v == tri::false } +pure fn is_false(v: tri) -> bool { v == tri::false } #[doc = " # Return value true if `v` represents the unknown state in the logic "] -pure fn is_unknown(v: t) -> bool { v == unknown } +pure fn is_unknown(v: tri) -> bool { v == unknown } #[doc = "Parse logic value from `s`"] -pure fn from_str(s: str) -> t { +pure fn from_str(s: str) -> tri { alt check s { "unknown" { unknown } "true" { tri::true } @@ -96,7 +96,7 @@ pure fn from_str(s: str) -> t { } #[doc = "Convert `v` into a string"] -pure fn to_str(v: t) -> str { +pure fn to_str(v: tri) -> str { // FIXME replace with consts as soon as that works alt check v { 0u8 { "unknown" } @@ -109,7 +109,7 @@ pure fn to_str(v: t) -> str { Iterates over all truth values by passing them to `blk` in an unspecified order "] -fn all_values(blk: fn(v: t)) { +fn all_values(blk: fn(v: tri)) { blk(tri::false); blk(unknown); blk(tri::true); @@ -120,15 +120,17 @@ fn all_values(blk: fn(v: t)) { An u8 whose first bit is set if `if_true(v)` holds "] -fn to_bit(v: t) -> u8 { v & b0 } +fn to_bit(v: tri) -> u8 { v & b0 } #[cfg(test)] mod tests { - pure fn eq1(a: tri::t, b: tri::t) -> bool { tri::eq(a , b) } - pure fn ne1(a: tri::t, b: tri::t) -> bool { tri::ne(a , b) } + pure fn eq1(a: tri::tri, b: tri::tri) -> bool { tri::eq(a , b) } + pure fn ne1(a: tri::tri, b: tri::tri) -> bool { tri::ne(a , b) } - pure fn eq2(a: tri::t, b: tri::t) -> bool { eq1( a, b ) && eq1( b, a ) } + pure fn eq2(a: tri::tri, b: tri::tri) -> bool { + eq1( a, b ) && eq1( b, a ) + } #[test] fn test_eq2() { diff --git a/src/rustc/front/attr.rs b/src/rustc/front/attr.rs index fc9c50a1e00..9bd817fb36a 100644 --- a/src/rustc/front/attr.rs +++ b/src/rustc/front/attr.rs @@ -231,7 +231,7 @@ fn require_unique_names(sess: session, metas: [@ast::meta_item]) { } } -fn native_abi(attrs: [ast::attribute]) -> either::t { +fn native_abi(attrs: [ast::attribute]) -> either { ret alt attr::get_meta_item_value_str_by_name(attrs, "abi") { option::none { either::right(ast::native_abi_cdecl) diff --git a/src/rustc/metadata/astencode_gen.rs b/src/rustc/metadata/astencode_gen.rs index 7b1c2fdf9d9..9292490ff6b 100644 --- a/src/rustc/metadata/astencode_gen.rs +++ b/src/rustc/metadata/astencode_gen.rs @@ -261,7 +261,7 @@ fn serialize_20(s: S, v: uint) { /*core::option::t*/ fn serialize_26(s: S, v: - core::option::t) { + core::option) { s.emit_enum("core::option::t", /*syntax::codemap::span*/ @@ -291,7 +291,7 @@ fn serialize_25(s: S, v: {name: str, span: - core::option::t,}) { + core::option,}) { s.emit_rec(/*str*//*core::option::t*/ {|| { @@ -311,7 +311,7 @@ fn serialize_24(s: S, callie: {name: str, span: - core::option::t,},}) { + core::option,},}) { s.emit_rec(/*syntax::codemap::span*/ /*{name: str,span: core::option::t}*/ {|| @@ -1269,7 +1269,7 @@ fn serialize_76(s: S, /*core::option::t<@syntax::ast::expr>*/ fn serialize_79(s: S, v: - core::option::t<@syntax::ast::expr>) { + core::option<@syntax::ast::expr>) { s.emit_enum("core::option::t", /*@syntax::ast::expr*/ @@ -1297,7 +1297,7 @@ fn serialize_79(s: S, /*[core::option::t<@syntax::ast::expr>]*/ fn serialize_80(s: S, v: - [core::option::t<@syntax::ast::expr>]) { + [core::option<@syntax::ast::expr>]) { s.emit_vec(vec::len(v), /*core::option::t<@syntax::ast::expr>*/ {|| vec::iteri(v, @@ -1712,7 +1712,7 @@ fn serialize_85(s: S, /*core::option::t<@syntax::ast::pat>*/ fn serialize_112(s: S, v: - core::option::t<@syntax::ast::pat>) { + core::option<@syntax::ast::pat>) { s.emit_enum("core::option::t", /*@syntax::ast::pat*/ @@ -1973,7 +1973,7 @@ fn serialize_117(s: S, /*core::option::t*/ fn serialize_116(s: S, v: - core::option::t) { + core::option) { s.emit_enum("core::option::t", /*syntax::ast::initializer*/ @@ -3950,7 +3950,7 @@ fn serialize_159(s: S, /*core::option::t<@syntax::ast::ty>*/ fn serialize_161(s: S, v: - core::option::t<@syntax::ast::ty>) { + core::option<@syntax::ast::ty>) { s.emit_enum("core::option::t", /*@syntax::ast::ty*/ @@ -4471,7 +4471,7 @@ fn deserialize_20(s: S) -> uint { } /*core::option::t*/ fn deserialize_26(s: S) -> - core::option::t { + core::option { s.read_enum("core::option::t", @@ -4492,7 +4492,7 @@ fn deserialize_26(s: S) -> } /*{name: str,span: core::option::t}*/ fn deserialize_25(s: S) -> - {name: str, span: core::option::t,} { + {name: str, span: core::option,} { s.read_rec( @@ -4513,7 +4513,7 @@ fn deserialize_25(s: S) -> /*{call_site: syntax::codemap::span,callie: {name: str,span: core::option::t}}*/ fn deserialize_24(s: S) -> {call_site: syntax::codemap::span, - callie: {name: str, span: core::option::t,},} { + callie: {name: str, span: core::option,},} { s.read_rec( @@ -5501,7 +5501,7 @@ fn deserialize_76(s: S) -> } /*core::option::t<@syntax::ast::expr>*/ fn deserialize_79(s: S) -> - core::option::t<@syntax::ast::expr> { + core::option<@syntax::ast::expr> { s.read_enum("core::option::t", @@ -5522,7 +5522,7 @@ fn deserialize_79(s: S) -> } /*[core::option::t<@syntax::ast::expr>]*/ fn deserialize_80(s: S) -> - [core::option::t<@syntax::ast::expr>] { + [core::option<@syntax::ast::expr>] { s.read_vec( /*core::option::t<@syntax::ast::expr>*/ @@ -5886,7 +5886,7 @@ fn deserialize_85(s: S) -> } /*core::option::t<@syntax::ast::pat>*/ fn deserialize_112(s: S) -> - core::option::t<@syntax::ast::pat> { + core::option<@syntax::ast::pat> { s.read_enum("core::option::t", @@ -6114,7 +6114,7 @@ fn deserialize_117(s: S) -> } /*core::option::t*/ fn deserialize_116(s: S) -> - core::option::t { + core::option { s.read_enum("core::option::t", @@ -7890,7 +7890,7 @@ fn deserialize_159(s: S) -> } /*core::option::t<@syntax::ast::ty>*/ fn deserialize_161(s: S) -> - core::option::t<@syntax::ast::ty> { + core::option<@syntax::ast::ty> { s.read_enum("core::option::t", diff --git a/src/rustc/middle/trans/closure.rs b/src/rustc/middle/trans/closure.rs index 25215be9ef9..a6bc7cbb732 100644 --- a/src/rustc/middle/trans/closure.rs +++ b/src/rustc/middle/trans/closure.rs @@ -183,7 +183,7 @@ fn allocate_cbox(bcx: block, fn store_uniq_tydesc(bcx: block, cdata_ty: ty::t, box: ValueRef, - &ti: option::t<@tydesc_info>) -> block { + &ti: option<@tydesc_info>) -> block { let ccx = bcx.ccx(); let bound_tydesc = GEPi(bcx, box, [0, abi::box_field_tydesc]); let {bcx, val: td} = base::get_tydesc(bcx, cdata_ty, true, ti); diff --git a/src/rustc/middle/ty.rs b/src/rustc/middle/ty.rs index ea5347a6074..5f5ac939a22 100644 --- a/src/rustc/middle/ty.rs +++ b/src/rustc/middle/ty.rs @@ -1509,7 +1509,7 @@ fn arg_mode(cx: ctxt, a: arg) -> ast::rmode { resolved_mode(cx, a.mode) } // Unifies `m1` and `m2`. Returns unified value or failure code. fn unify_mode(cx: ctxt, m1: ast::mode, m2: ast::mode) - -> result::t { + -> result { alt (canon_mode(cx, m1), canon_mode(cx, m2)) { (m1, m2) if (m1 == m2) { result::ok(m1) @@ -1758,7 +1758,7 @@ mod unify { }; } fn unify_args(cx: @uctxt, e_args: [arg], a_args: [arg], - variance: variance) -> either::t { + variance: variance) -> either { if !vec::same_length(e_args, a_args) { ret either::left(ures_err(terr_arg_count)); } diff --git a/src/rustc/middle/typeck.rs b/src/rustc/middle/typeck.rs index 8341c8f2e7b..e8d47886665 100644 --- a/src/rustc/middle/typeck.rs +++ b/src/rustc/middle/typeck.rs @@ -1701,7 +1701,7 @@ fn impl_self_ty(tcx: ty::ctxt, did: ast::def_id) -> {n_tps: uint, ty: ty::t} { fn lookup_method(fcx: @fn_ctxt, expr: @ast::expr, node_id: ast::node_id, name: ast::ident, ty: ty::t, tps: [ty::t]) - -> option::t { + -> option { alt lookup_method_inner(fcx, expr, name, ty) { some({method_ty: fty, n_tps: method_n_tps, substs, origin, self_sub}) { let tcx = fcx.ccx.tcx; @@ -1743,9 +1743,9 @@ fn lookup_method(fcx: @fn_ctxt, expr: @ast::expr, node_id: ast::node_id, fn lookup_method_inner(fcx: @fn_ctxt, expr: @ast::expr, name: ast::ident, ty: ty::t) - -> option::t<{method_ty: ty::t, n_tps: uint, substs: [ty::t], + -> option<{method_ty: ty::t, n_tps: uint, substs: [ty::t], origin: method_origin, - self_sub: option::t}> { + self_sub: option}> { let tcx = fcx.ccx.tcx; // First, see whether this is an interface-bounded parameter alt ty::get(ty).struct { @@ -2120,8 +2120,8 @@ fn check_expr_with_unifier(fcx: @fn_ctxt, expr: @ast::expr, unify: unifier, } } fn lookup_op_method(fcx: @fn_ctxt, op_ex: @ast::expr, self_t: ty::t, - opname: str, args: [option::t<@ast::expr>]) - -> option::t { + opname: str, args: [option<@ast::expr>]) + -> option { let callee_id = ast_util::op_expr_callee_id(op_ex); alt lookup_method(fcx, op_ex, callee_id, opname, self_t, []) { some(origin) { diff --git a/src/rustc/syntax/ast.rs b/src/rustc/syntax/ast.rs index 46e31799232..91a884ce57c 100644 --- a/src/rustc/syntax/ast.rs +++ b/src/rustc/syntax/ast.rs @@ -291,10 +291,10 @@ enum blk_sort { type mac = spanned; -type mac_arg = option::t<@expr>; +type mac_arg = option<@expr>; type mac_body_ = {span: span}; -type mac_body = option::t; +type mac_body = option; enum mac_ { mac_invoc(@path, mac_arg, mac_body), diff --git a/src/rustc/syntax/parse/parser.rs b/src/rustc/syntax/parse/parser.rs index 6fd61bc9db4..4beefe21632 100644 --- a/src/rustc/syntax/parse/parser.rs +++ b/src/rustc/syntax/parse/parser.rs @@ -643,7 +643,7 @@ fn parse_seq(bra: token::token, ket: token::token, ret spanned(lo, hi, result); } -fn have_dollar(p: parser) -> option::t { +fn have_dollar(p: parser) -> option { alt p.token { token::DOLLAR_NUM(num) { p.bump(); @@ -2384,7 +2384,7 @@ else { ret none; } // A type to distingush between the parsing of item attributes or syntax // extensions, which both begin with token.POUND -type attr_or_ext = option>; +type attr_or_ext = option>; fn parse_outer_attrs_or_ext( p: parser, diff --git a/src/rustc/util/filesearch.rs b/src/rustc/util/filesearch.rs index 82469b5cb32..c37bb519702 100644 --- a/src/rustc/util/filesearch.rs +++ b/src/rustc/util/filesearch.rs @@ -109,12 +109,12 @@ fn get_sysroot(maybe_sysroot: option) -> path { } } -fn get_cargo_sysroot() -> result::t { +fn get_cargo_sysroot() -> result { let path = [get_default_sysroot(), libdir(), "cargo"]; result::ok(path::connect_many(path)) } -fn get_cargo_root() -> result::t { +fn get_cargo_root() -> result { alt os::getenv("CARGO_ROOT") { some(_p) { result::ok(_p) } none { @@ -126,7 +126,7 @@ fn get_cargo_root() -> result::t { } } -fn get_cargo_root_nearest() -> result::t { +fn get_cargo_root_nearest() -> result { result::chain(get_cargo_root()) { |p| let cwd = os::getcwd(); let dirname = path::dirname(cwd); @@ -151,13 +151,13 @@ fn get_cargo_root_nearest() -> result::t { } } -fn get_cargo_lib_path() -> result::t { +fn get_cargo_lib_path() -> result { result::chain(get_cargo_root()) { |p| result::ok(path::connect(p, libdir())) } } -fn get_cargo_lib_path_nearest() -> result::t { +fn get_cargo_lib_path_nearest() -> result { result::chain(get_cargo_root_nearest()) { |p| result::ok(path::connect(p, libdir())) } diff --git a/src/rustdoc/config.rs b/src/rustdoc/config.rs index 88ffffaa212..3ffbe70c6a0 100644 --- a/src/rustdoc/config.rs +++ b/src/rustdoc/config.rs @@ -86,14 +86,14 @@ fn mock_program_output(_prog: str, _args: [str]) -> { } } -fn parse_config(args: [str]) -> result::t { +fn parse_config(args: [str]) -> result { parse_config_(args, run::program_output) } fn parse_config_( args: [str], program_output: program_output -) -> result::t { +) -> result { let args = vec::tail(args); let opts = tuple::first(vec::unzip(opts())); alt getopts::getopts(args, opts) { @@ -117,7 +117,7 @@ fn config_from_opts( input_crate: str, match: getopts::match, program_output: program_output -) -> result::t { +) -> result { let config = default_config(input_crate); let result = result::ok(config); @@ -165,7 +165,7 @@ fn config_from_opts( ret result; } -fn parse_output_format(output_format: str) -> result::t { +fn parse_output_format(output_format: str) -> result { alt output_format { "markdown" { result::ok(markdown) } "html" { result::ok(pandoc_html) } @@ -173,7 +173,7 @@ fn parse_output_format(output_format: str) -> result::t { } } -fn parse_output_style(output_style: str) -> result::t { +fn parse_output_style(output_style: str) -> result { alt output_style { "doc-per-crate" { result::ok(doc_per_crate) } "doc-per-mod" { result::ok(doc_per_mod) } @@ -185,7 +185,7 @@ fn maybe_find_pandoc( config: config, maybe_pandoc_cmd: option, program_output: program_output -) -> result::t, str> { +) -> result, str> { if config.output_format != pandoc_html { ret result::ok(maybe_pandoc_cmd); } @@ -251,7 +251,7 @@ fn should_error_with_no_pandoc() { #[cfg(test)] mod test { - fn parse_config(args: [str]) -> result::t { + fn parse_config(args: [str]) -> result { parse_config_(args, mock_program_output) } } diff --git a/src/test/compile-fail/fully-qualified-type-name1.rs b/src/test/compile-fail/fully-qualified-type-name1.rs index 1790acffd50..db574f6f2bc 100644 --- a/src/test/compile-fail/fully-qualified-type-name1.rs +++ b/src/test/compile-fail/fully-qualified-type-name1.rs @@ -3,5 +3,5 @@ fn main() { let x: option; x = 5; - //!^ ERROR mismatched types: expected `core::option::t` + //!^ ERROR mismatched types: expected `core::option::option` }