diff options
| author | bors <bors@rust-lang.org> | 2013-06-28 22:25:48 -0700 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2013-06-28 22:25:48 -0700 |
| commit | 4e78c1e2a89f65a1827e1f65afc741cee05cee0a (patch) | |
| tree | d56131a1a347b4cc8c3e79dfda3b9a47221bcaa4 | |
| parent | d681bccb6a2141012a747cc272991a7440cb2408 (diff) | |
| parent | 21cc0ccea10bb9d1b83612d26c8e62d06fe365a1 (diff) | |
| download | rust-4e78c1e2a89f65a1827e1f65afc741cee05cee0a.tar.gz rust-4e78c1e2a89f65a1827e1f65afc741cee05cee0a.zip | |
auto merge of #7479 : mozilla/rust/rollup, r=thestinger
22b7eb3 r=thestinger 28a3613 r=cmr a0c31ec r=bstrie ee7307e r=thestinger b9cf6a3 r=thestinger
| -rw-r--r-- | src/etc/zsh/_rust | 71 | ||||
| -rw-r--r-- | src/libextra/arc.rs | 3 | ||||
| -rw-r--r-- | src/libextra/arena.rs | 3 | ||||
| -rw-r--r-- | src/libextra/ebml.rs | 5 | ||||
| -rw-r--r-- | src/libextra/rc.rs | 7 | ||||
| -rw-r--r-- | src/libextra/term.rs | 6 | ||||
| -rw-r--r-- | src/librustc/middle/trans/meth.rs | 8 | ||||
| -rw-r--r-- | src/librustc/middle/ty.rs | 6 | ||||
| -rw-r--r-- | src/librustpkg/path_util.rs | 1 | ||||
| -rw-r--r-- | src/libstd/cell.rs | 3 | ||||
| -rw-r--r-- | src/libstd/iterator.rs | 4 | ||||
| -rw-r--r-- | src/test/compile-fail/mutable-enum.rs | 2 | ||||
| -rw-r--r-- | src/test/compile-fail/mutable-struct.rs | 2 | ||||
| -rw-r--r-- | src/test/compile-fail/non_owned-enum.rs | 2 | ||||
| -rw-r--r-- | src/test/compile-fail/non_owned-struct.rs | 2 | ||||
| -rw-r--r-- | src/test/run-pass/unfoldr-cross-crate.rs | 2 |
16 files changed, 67 insertions, 60 deletions
diff --git a/src/etc/zsh/_rust b/src/etc/zsh/_rust index faa21a29616..86dcbab93fd 100644 --- a/src/etc/zsh/_rust +++ b/src/etc/zsh/_rust @@ -29,36 +29,30 @@ _rustc_opts_switches=( --target'[Target triple cpu-manufacturer-kernel\[-os\] to compile]' --target-feature'[Target specific attributes (llc -mattr=help for detail)]' --android-cross-path'[The path to the Android NDK]' - {-W,--warn}'[Set lint warnings]' - {-A,--allow}'[Set lint allowed]' - {-D,--deny}'[Set lint denied]' - {-F,--forbid}'[Set lint forbidden]' - -Z'[Set internal debugging options]' {-v,--version}'[Print version info and exit]' ) - _rustc_opts_lint=( - 'path-statement:path statements with no effect' - 'deprecated-pattern:warn about deprecated uses of pattern bindings' - 'non-implicitly-copyable-typarams:passing non implicitly copyable types as copy type params' - 'missing-trait-doc:detects missing documentation for traits' - 'missing-struct-doc:detects missing documentation for structs' - 'ctypes:proper use of core::libc types in foreign modules' - 'implicit-copies:implicit copies of non implicitly copyable data' - "unused-mut:detect mut variables which don't need to be mutable" - 'unused-imports:imports that are never used' - 'heap-memory:use of any (~ type or @ type) heap memory' - 'default-methods:allow default methods' - 'unused-variable:detect variables which are not used in any way' - 'dead-assignment:detect assignments that will never be read' - 'unrecognized-lint:unrecognized lint attribute' - 'type-limits:comparisons made useless by limits of the types involved' - 'unused-unsafe:unnecessary use of an `unsafe` block' - 'while-true:suggest using loop { } instead of while(true) { }' - 'non-camel-case-types:types, variants and traits should have camel case names' - 'managed-heap-memory:use of managed (@ type) heap memory' - 'unnecessary-allocation:detects unnecessary allocations that can be eliminated' - 'owned-heap-memory:use of owned (~ type) heap memory' + 'path-statement[path statements with no effect]' + 'deprecated-pattern[warn about deprecated uses of pattern bindings]' + 'non-implicitly-copyable-typarams[passing non implicitly copyable types as copy type params]' + 'missing-trait-doc[detects missing documentation for traits]' + 'missing-struct-doc[detects missing documentation for structs]' + 'ctypes[proper use of core::libc types in foreign modules]' + 'implicit-copies[implicit copies of non implicitly copyable data]' + "unused-mut[detect mut variables which don't need to be mutable]" + 'unused-imports[imports that are never used]' + 'heap-memory[use of any (~ type or @ type) heap memory]' + 'default-methods[allow default methods]' + 'unused-variable[detect variables which are not used in any way]' + 'dead-assignment[detect assignments that will never be read]' + 'unrecognized-lint[unrecognized lint attribute]' + 'type-limits[comparisons made useless by limits of the types involved]' + 'unused-unsafe[unnecessary use of an `unsafe` block]' + 'while-true[suggest using loop { } instead of while(true) { }]' + 'non-camel-case-types[types, variants and traits should have camel case names]' + 'managed-heap-memory[use of managed (@ type) heap memory]' + 'unnecessary-allocation[detects unnecessary allocations that can be eliminated]' + 'owned-heap-memory[use of owned (~ type) heap memory]' ) _rustc_opts_debug=( @@ -90,13 +84,20 @@ _rustc_opts_debug=( 'lint-llvm:Run the LLVM lint pass on the pre-optimization IR' ) -_rustc() { - case $words[2] in - -[WADF]) _describe 'options' _rustc_opts_lint ;; - -Z) _describe 'options' _rustc_opts_debug ;; - -) _arguments -s -w : "$_rustc_opts_switches[@]" ;; - *) _files -g "*.rs" ;; - esac +_rustc_opts_fun_lint(){ + _values -s , 'options' \ + "$_rustc_opts_lint[@]" +} + +_rustc_opts_fun_debug(){ + _describe 'options' _rustc_opts_debug } -_rustc "$@" +_arguments -s : \ + '(-W --warn)'{-W,--warn}'[Set lint warnings]:lint options:_rustc_opts_fun_lint' \ + '(-A --allow)'{-A,--allow}'[Set lint allowed]:lint options:_rustc_opts_fun_lint' \ + '(-D --deny)'{-D,--deny}'[Set lint denied]:lint options:_rustc_opts_fun_lint' \ + '(-F --forbid)'{-F,--forbid}'[Set lint forbidden]:lint options:_rustc_opts_fun_lint' \ + '*-Z[Set internal debugging options]:debug options:_rustc_opts_fun_debug' \ + "$_rustc_opts_switches[@]" \ + '*::files:_files -g "*.rs"' diff --git a/src/libextra/arc.rs b/src/libextra/arc.rs index 2fb03fecb59..30067c92300 100644 --- a/src/libextra/arc.rs +++ b/src/libextra/arc.rs @@ -276,7 +276,8 @@ struct RWARCInner<T> { lock: RWlock, failed: bool, data: T } * * Unlike mutex_arcs, rw_arcs are safe, because they cannot be nested. */ -#[mutable] +#[mutable] // XXX remove after snap +#[no_freeze] struct RWARC<T> { x: UnsafeAtomicRcBox<RWARCInner<T>>, } diff --git a/src/libextra/arena.rs b/src/libextra/arena.rs index 2f18b0562e0..2c6e7a30448 100644 --- a/src/libextra/arena.rs +++ b/src/libextra/arena.rs @@ -65,7 +65,8 @@ struct Chunk { is_pod: bool, } -#[mutable] +#[mutable] // XXX remove after snap +#[no_freeze] pub struct Arena { // The head is separated out from the list as a unbenchmarked // microoptimization, to avoid needing to case on the list to diff --git a/src/libextra/ebml.rs b/src/libextra/ebml.rs index 69eb9afad85..4634a7db05e 100644 --- a/src/libextra/ebml.rs +++ b/src/libextra/ebml.rs @@ -97,11 +97,14 @@ pub mod reader { use core::cast::transmute; use core::int; use core::io; + use core::option::{None, Option, Some}; #[cfg(target_arch = "x86")] #[cfg(target_arch = "x86_64")] - use core::option::{None, Option, Some}; use core::ptr::offset; + + #[cfg(target_arch = "x86")] + #[cfg(target_arch = "x86_64")] use core::unstable::intrinsics::bswap32; // ebml reading diff --git a/src/libextra/rc.rs b/src/libextra/rc.rs index 009d68ac026..613c0b1ae41 100644 --- a/src/libextra/rc.rs +++ b/src/libextra/rc.rs @@ -36,7 +36,7 @@ struct RcBox<T> { /// Immutable reference counted pointer type #[unsafe_no_drop_flag] -#[non_sendable] +#[no_send] pub struct Rc<T> { priv ptr: *mut RcBox<T>, } @@ -168,8 +168,9 @@ struct RcMutBox<T> { /// Mutable reference counted pointer type #[non_owned] -#[non_sendable] -#[mutable] +#[no_send] +#[mutable] // XXX remove after snap +#[no_freeze] #[unsafe_no_drop_flag] pub struct RcMut<T> { priv ptr: *mut RcMutBox<T>, diff --git a/src/libextra/term.rs b/src/libextra/term.rs index 880b89f2bbe..d448a1588a6 100644 --- a/src/libextra/term.rs +++ b/src/libextra/term.rs @@ -120,13 +120,15 @@ impl Terminal { pub fn reset(&self) { let mut vars = Variables::new(); let s = do self.ti.strings.find_equiv(&("op")) - .map_consume_default(Err(~"can't find op")) |&op| { + .map_consume_default(Err(~"can't find terminfo capability `op`")) |&op| { expand(op, [], &mut vars) }; if s.is_ok() { self.out.write(s.unwrap()); - } else { + } else if self.num_colors > 0 { warn!("%s", s.unwrap_err()); + } else { + debug!("%s", s.unwrap_err()); } } diff --git a/src/librustc/middle/trans/meth.rs b/src/librustc/middle/trans/meth.rs index f145f83f13c..0b051662781 100644 --- a/src/librustc/middle/trans/meth.rs +++ b/src/librustc/middle/trans/meth.rs @@ -28,7 +28,7 @@ use middle::trans::type_of::*; use middle::ty; use middle::typeck; use util::common::indenter; -use util::ppaux::{Repr, ty_to_str}; +use util::ppaux::Repr; use middle::trans::type_::Type; @@ -36,7 +36,6 @@ use core::vec; use syntax::ast_map::{path, path_mod, path_name}; use syntax::ast_util; use syntax::{ast, ast_map}; -use syntax::parse::token; /** The main "translation" pass for methods. Generates code @@ -716,10 +715,9 @@ pub fn make_vtable(ccx: &mut CrateContext, components.push(ptr) } - let name = fmt!("%s_vtable_%u", ty_to_str(ccx.tcx, tydesc.ty), token::gensym("vtable")); - let tbl = C_struct(components); - let vt_gvar = do name.as_c_str |buf| { + let vtable = ccx.sess.str_of(gensym_name("vtable")); + let vt_gvar = do vtable.as_c_str |buf| { llvm::LLVMAddGlobal(ccx.llmod, val_ty(tbl).to_ref(), buf) }; llvm::LLVMSetInitializer(vt_gvar, tbl); diff --git a/src/librustc/middle/ty.rs b/src/librustc/middle/ty.rs index 175529be206..f1172fb1da6 100644 --- a/src/librustc/middle/ty.rs +++ b/src/librustc/middle/ty.rs @@ -1969,7 +1969,7 @@ static TC_ONCE_CLOSURE: TypeContents = TypeContents{bits: 0b0001_0000_0000}; /// An enum with no variants. static TC_EMPTY_ENUM: TypeContents = TypeContents{bits: 0b0010_0000_0000}; -/// Contains a type marked with `#[non_sendable]` +/// Contains a type marked with `#[no_send]` static TC_NON_SENDABLE: TypeContents = TypeContents{bits: 0b0100_0000_0000}; /// Is a bare vector, str, function, trait, etc (only relevant at top level). @@ -2204,10 +2204,10 @@ pub fn type_contents(cx: ctxt, ty: t) -> TypeContents { } fn apply_tc_attr(cx: ctxt, did: def_id, mut tc: TypeContents) -> TypeContents { - if has_attr(cx, did, "mutable") { + if has_attr(cx, did, "no_freeze") { tc = tc + TC_MUTABLE; } - if has_attr(cx, did, "non_sendable") { + if has_attr(cx, did, "no_send") { tc = tc + TC_NON_SENDABLE; } tc diff --git a/src/librustpkg/path_util.rs b/src/librustpkg/path_util.rs index c0425b4d260..f0a3f24c307 100644 --- a/src/librustpkg/path_util.rs +++ b/src/librustpkg/path_util.rs @@ -40,7 +40,6 @@ static path_entry_separator: &'static str = ":"; /// DIR/.rust for any DIR that's the current working directory /// or an ancestor of it pub fn rust_path() -> ~[Path] { - let env_path: ~str = os::getenv("RUST_PATH").get_or_default(~""); let mut env_rust_path: ~[Path] = match os::getenv("RUST_PATH") { Some(env_path) => { let env_path_components: ~[&str] = diff --git a/src/libstd/cell.rs b/src/libstd/cell.rs index e1d2b246dd3..53ea11f2b05 100644 --- a/src/libstd/cell.rs +++ b/src/libstd/cell.rs @@ -22,7 +22,8 @@ A dynamic, mutable location. Similar to a mutable option type, but friendlier. */ -#[mutable] +#[mutable] // XXX remove after snap +#[no_freeze] #[deriving(Clone, DeepClone, Eq)] #[allow(missing_doc)] pub struct Cell<T> { diff --git a/src/libstd/iterator.rs b/src/libstd/iterator.rs index 78940143f4e..765bf3b36f2 100644 --- a/src/libstd/iterator.rs +++ b/src/libstd/iterator.rs @@ -983,7 +983,7 @@ impl<'self, A, St> UnfoldrIterator<'self, A, St> { /// Creates a new iterator with the specified closure as the "iterator /// function" and an initial state to eventually pass to the iterator #[inline] - pub fn new<'a>(f: &'a fn(&mut St) -> Option<A>, initial_state: St) + pub fn new<'a>(initial_state: St, f: &'a fn(&mut St) -> Option<A>) -> UnfoldrIterator<'a, A, St> { UnfoldrIterator { f: f, @@ -1174,7 +1174,7 @@ mod tests { } } - let mut it = UnfoldrIterator::new(count, 0); + let mut it = UnfoldrIterator::new(0, count); let mut i = 0; for it.advance |counted| { assert_eq!(counted, i); diff --git a/src/test/compile-fail/mutable-enum.rs b/src/test/compile-fail/mutable-enum.rs index db2172b2e57..35842a53a31 100644 --- a/src/test/compile-fail/mutable-enum.rs +++ b/src/test/compile-fail/mutable-enum.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#[mutable] +#[no_freeze] enum Foo { A } fn bar<T: Freeze>(_: T) {} diff --git a/src/test/compile-fail/mutable-struct.rs b/src/test/compile-fail/mutable-struct.rs index 8511bcdcd35..6f29fcfd96d 100644 --- a/src/test/compile-fail/mutable-struct.rs +++ b/src/test/compile-fail/mutable-struct.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#[mutable] +#[no_freeze] struct Foo { a: int } fn bar<T: Freeze>(_: T) {} diff --git a/src/test/compile-fail/non_owned-enum.rs b/src/test/compile-fail/non_owned-enum.rs index 20b571ad614..b436bfb8b0f 100644 --- a/src/test/compile-fail/non_owned-enum.rs +++ b/src/test/compile-fail/non_owned-enum.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#[non_sendable] +#[no_send] enum Foo { A } fn bar<T: Send>(_: T) {} diff --git a/src/test/compile-fail/non_owned-struct.rs b/src/test/compile-fail/non_owned-struct.rs index d4b8e6755a1..542c3aa212b 100644 --- a/src/test/compile-fail/non_owned-struct.rs +++ b/src/test/compile-fail/non_owned-struct.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#[non_sendable] +#[no_send] struct Foo { a: int } fn bar<T: Send>(_: T) {} diff --git a/src/test/run-pass/unfoldr-cross-crate.rs b/src/test/run-pass/unfoldr-cross-crate.rs index 4e98543ae82..7fcae90a8d1 100644 --- a/src/test/run-pass/unfoldr-cross-crate.rs +++ b/src/test/run-pass/unfoldr-cross-crate.rs @@ -24,7 +24,7 @@ fn main() { } } - let mut it = UnfoldrIterator::new(count, 0); + let mut it = UnfoldrIterator::new(0, count); let mut i = 0; for it.advance |counted| { assert_eq!(counted, i); |
