Skip to content

Commit 4e78c1e

Browse files
committed
auto merge of #7479 : mozilla/rust/rollup, r=thestinger
22b7eb3 r=thestinger 28a3613 r=cmr a0c31ec r=bstrie ee7307e r=thestinger b9cf6a3 r=thestinger
2 parents d681bcc + 21cc0cc commit 4e78c1e

File tree

16 files changed

+67
-60
lines changed

16 files changed

+67
-60
lines changed

src/etc/zsh/_rust

Lines changed: 36 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -29,36 +29,30 @@ _rustc_opts_switches=(
2929
--target'[Target triple cpu-manufacturer-kernel\[-os\] to compile]'
3030
--target-feature'[Target specific attributes (llc -mattr=help for detail)]'
3131
--android-cross-path'[The path to the Android NDK]'
32-
{-W,--warn}'[Set lint warnings]'
33-
{-A,--allow}'[Set lint allowed]'
34-
{-D,--deny}'[Set lint denied]'
35-
{-F,--forbid}'[Set lint forbidden]'
36-
-Z'[Set internal debugging options]'
3732
{-v,--version}'[Print version info and exit]'
3833
)
39-
4034
_rustc_opts_lint=(
41-
'path-statement:path statements with no effect'
42-
'deprecated-pattern:warn about deprecated uses of pattern bindings'
43-
'non-implicitly-copyable-typarams:passing non implicitly copyable types as copy type params'
44-
'missing-trait-doc:detects missing documentation for traits'
45-
'missing-struct-doc:detects missing documentation for structs'
46-
'ctypes:proper use of core::libc types in foreign modules'
47-
'implicit-copies:implicit copies of non implicitly copyable data'
48-
"unused-mut:detect mut variables which don't need to be mutable"
49-
'unused-imports:imports that are never used'
50-
'heap-memory:use of any (~ type or @ type) heap memory'
51-
'default-methods:allow default methods'
52-
'unused-variable:detect variables which are not used in any way'
53-
'dead-assignment:detect assignments that will never be read'
54-
'unrecognized-lint:unrecognized lint attribute'
55-
'type-limits:comparisons made useless by limits of the types involved'
56-
'unused-unsafe:unnecessary use of an `unsafe` block'
57-
'while-true:suggest using loop { } instead of while(true) { }'
58-
'non-camel-case-types:types, variants and traits should have camel case names'
59-
'managed-heap-memory:use of managed (@ type) heap memory'
60-
'unnecessary-allocation:detects unnecessary allocations that can be eliminated'
61-
'owned-heap-memory:use of owned (~ type) heap memory'
35+
'path-statement[path statements with no effect]'
36+
'deprecated-pattern[warn about deprecated uses of pattern bindings]'
37+
'non-implicitly-copyable-typarams[passing non implicitly copyable types as copy type params]'
38+
'missing-trait-doc[detects missing documentation for traits]'
39+
'missing-struct-doc[detects missing documentation for structs]'
40+
'ctypes[proper use of core::libc types in foreign modules]'
41+
'implicit-copies[implicit copies of non implicitly copyable data]'
42+
"unused-mut[detect mut variables which don't need to be mutable]"
43+
'unused-imports[imports that are never used]'
44+
'heap-memory[use of any (~ type or @ type) heap memory]'
45+
'default-methods[allow default methods]'
46+
'unused-variable[detect variables which are not used in any way]'
47+
'dead-assignment[detect assignments that will never be read]'
48+
'unrecognized-lint[unrecognized lint attribute]'
49+
'type-limits[comparisons made useless by limits of the types involved]'
50+
'unused-unsafe[unnecessary use of an `unsafe` block]'
51+
'while-true[suggest using loop { } instead of while(true) { }]'
52+
'non-camel-case-types[types, variants and traits should have camel case names]'
53+
'managed-heap-memory[use of managed (@ type) heap memory]'
54+
'unnecessary-allocation[detects unnecessary allocations that can be eliminated]'
55+
'owned-heap-memory[use of owned (~ type) heap memory]'
6256
)
6357

6458
_rustc_opts_debug=(
@@ -90,13 +84,20 @@ _rustc_opts_debug=(
9084
'lint-llvm:Run the LLVM lint pass on the pre-optimization IR'
9185
)
9286

93-
_rustc() {
94-
case $words[2] in
95-
-[WADF]) _describe 'options' _rustc_opts_lint ;;
96-
-Z) _describe 'options' _rustc_opts_debug ;;
97-
-) _arguments -s -w : "$_rustc_opts_switches[@]" ;;
98-
*) _files -g "*.rs" ;;
99-
esac
87+
_rustc_opts_fun_lint(){
88+
_values -s , 'options' \
89+
"$_rustc_opts_lint[@]"
90+
}
91+
92+
_rustc_opts_fun_debug(){
93+
_describe 'options' _rustc_opts_debug
10094
}
10195

102-
_rustc "$@"
96+
_arguments -s : \
97+
'(-W --warn)'{-W,--warn}'[Set lint warnings]:lint options:_rustc_opts_fun_lint' \
98+
'(-A --allow)'{-A,--allow}'[Set lint allowed]:lint options:_rustc_opts_fun_lint' \
99+
'(-D --deny)'{-D,--deny}'[Set lint denied]:lint options:_rustc_opts_fun_lint' \
100+
'(-F --forbid)'{-F,--forbid}'[Set lint forbidden]:lint options:_rustc_opts_fun_lint' \
101+
'*-Z[Set internal debugging options]:debug options:_rustc_opts_fun_debug' \
102+
"$_rustc_opts_switches[@]" \
103+
'*::files:_files -g "*.rs"'

src/libextra/arc.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,8 @@ struct RWARCInner<T> { lock: RWlock, failed: bool, data: T }
276276
*
277277
* Unlike mutex_arcs, rw_arcs are safe, because they cannot be nested.
278278
*/
279-
#[mutable]
279+
#[mutable] // XXX remove after snap
280+
#[no_freeze]
280281
struct RWARC<T> {
281282
x: UnsafeAtomicRcBox<RWARCInner<T>>,
282283
}

src/libextra/arena.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ struct Chunk {
6565
is_pod: bool,
6666
}
6767

68-
#[mutable]
68+
#[mutable] // XXX remove after snap
69+
#[no_freeze]
6970
pub struct Arena {
7071
// The head is separated out from the list as a unbenchmarked
7172
// microoptimization, to avoid needing to case on the list to

src/libextra/ebml.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,14 @@ pub mod reader {
9797
use core::cast::transmute;
9898
use core::int;
9999
use core::io;
100+
use core::option::{None, Option, Some};
100101

101102
#[cfg(target_arch = "x86")]
102103
#[cfg(target_arch = "x86_64")]
103-
use core::option::{None, Option, Some};
104104
use core::ptr::offset;
105+
106+
#[cfg(target_arch = "x86")]
107+
#[cfg(target_arch = "x86_64")]
105108
use core::unstable::intrinsics::bswap32;
106109

107110
// ebml reading

src/libextra/rc.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ struct RcBox<T> {
3636

3737
/// Immutable reference counted pointer type
3838
#[unsafe_no_drop_flag]
39-
#[non_sendable]
39+
#[no_send]
4040
pub struct Rc<T> {
4141
priv ptr: *mut RcBox<T>,
4242
}
@@ -168,8 +168,9 @@ struct RcMutBox<T> {
168168

169169
/// Mutable reference counted pointer type
170170
#[non_owned]
171-
#[non_sendable]
172-
#[mutable]
171+
#[no_send]
172+
#[mutable] // XXX remove after snap
173+
#[no_freeze]
173174
#[unsafe_no_drop_flag]
174175
pub struct RcMut<T> {
175176
priv ptr: *mut RcMutBox<T>,

src/libextra/term.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,13 +120,15 @@ impl Terminal {
120120
pub fn reset(&self) {
121121
let mut vars = Variables::new();
122122
let s = do self.ti.strings.find_equiv(&("op"))
123-
.map_consume_default(Err(~"can't find op")) |&op| {
123+
.map_consume_default(Err(~"can't find terminfo capability `op`")) |&op| {
124124
expand(op, [], &mut vars)
125125
};
126126
if s.is_ok() {
127127
self.out.write(s.unwrap());
128-
} else {
128+
} else if self.num_colors > 0 {
129129
warn!("%s", s.unwrap_err());
130+
} else {
131+
debug!("%s", s.unwrap_err());
130132
}
131133
}
132134

src/librustc/middle/trans/meth.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,14 @@ use middle::trans::type_of::*;
2828
use middle::ty;
2929
use middle::typeck;
3030
use util::common::indenter;
31-
use util::ppaux::{Repr, ty_to_str};
31+
use util::ppaux::Repr;
3232

3333
use middle::trans::type_::Type;
3434

3535
use core::vec;
3636
use syntax::ast_map::{path, path_mod, path_name};
3737
use syntax::ast_util;
3838
use syntax::{ast, ast_map};
39-
use syntax::parse::token;
4039

4140
/**
4241
The main "translation" pass for methods. Generates code
@@ -716,10 +715,9 @@ pub fn make_vtable(ccx: &mut CrateContext,
716715
components.push(ptr)
717716
}
718717

719-
let name = fmt!("%s_vtable_%u", ty_to_str(ccx.tcx, tydesc.ty), token::gensym("vtable"));
720-
721718
let tbl = C_struct(components);
722-
let vt_gvar = do name.as_c_str |buf| {
719+
let vtable = ccx.sess.str_of(gensym_name("vtable"));
720+
let vt_gvar = do vtable.as_c_str |buf| {
723721
llvm::LLVMAddGlobal(ccx.llmod, val_ty(tbl).to_ref(), buf)
724722
};
725723
llvm::LLVMSetInitializer(vt_gvar, tbl);

src/librustc/middle/ty.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1969,7 +1969,7 @@ static TC_ONCE_CLOSURE: TypeContents = TypeContents{bits: 0b0001_0000_0000};
19691969
/// An enum with no variants.
19701970
static TC_EMPTY_ENUM: TypeContents = TypeContents{bits: 0b0010_0000_0000};
19711971

1972-
/// Contains a type marked with `#[non_sendable]`
1972+
/// Contains a type marked with `#[no_send]`
19731973
static TC_NON_SENDABLE: TypeContents = TypeContents{bits: 0b0100_0000_0000};
19741974

19751975
/// 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 {
22042204
}
22052205

22062206
fn apply_tc_attr(cx: ctxt, did: def_id, mut tc: TypeContents) -> TypeContents {
2207-
if has_attr(cx, did, "mutable") {
2207+
if has_attr(cx, did, "no_freeze") {
22082208
tc = tc + TC_MUTABLE;
22092209
}
2210-
if has_attr(cx, did, "non_sendable") {
2210+
if has_attr(cx, did, "no_send") {
22112211
tc = tc + TC_NON_SENDABLE;
22122212
}
22132213
tc

src/librustpkg/path_util.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ static path_entry_separator: &'static str = ":";
4040
/// DIR/.rust for any DIR that's the current working directory
4141
/// or an ancestor of it
4242
pub fn rust_path() -> ~[Path] {
43-
let env_path: ~str = os::getenv("RUST_PATH").get_or_default(~"");
4443
let mut env_rust_path: ~[Path] = match os::getenv("RUST_PATH") {
4544
Some(env_path) => {
4645
let env_path_components: ~[&str] =

src/libstd/cell.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ A dynamic, mutable location.
2222
Similar to a mutable option type, but friendlier.
2323
*/
2424

25-
#[mutable]
25+
#[mutable] // XXX remove after snap
26+
#[no_freeze]
2627
#[deriving(Clone, DeepClone, Eq)]
2728
#[allow(missing_doc)]
2829
pub struct Cell<T> {

src/libstd/iterator.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -983,7 +983,7 @@ impl<'self, A, St> UnfoldrIterator<'self, A, St> {
983983
/// Creates a new iterator with the specified closure as the "iterator
984984
/// function" and an initial state to eventually pass to the iterator
985985
#[inline]
986-
pub fn new<'a>(f: &'a fn(&mut St) -> Option<A>, initial_state: St)
986+
pub fn new<'a>(initial_state: St, f: &'a fn(&mut St) -> Option<A>)
987987
-> UnfoldrIterator<'a, A, St> {
988988
UnfoldrIterator {
989989
f: f,
@@ -1174,7 +1174,7 @@ mod tests {
11741174
}
11751175
}
11761176

1177-
let mut it = UnfoldrIterator::new(count, 0);
1177+
let mut it = UnfoldrIterator::new(0, count);
11781178
let mut i = 0;
11791179
for it.advance |counted| {
11801180
assert_eq!(counted, i);

src/test/compile-fail/mutable-enum.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#[mutable]
11+
#[no_freeze]
1212
enum Foo { A }
1313

1414
fn bar<T: Freeze>(_: T) {}

src/test/compile-fail/mutable-struct.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#[mutable]
11+
#[no_freeze]
1212
struct Foo { a: int }
1313

1414
fn bar<T: Freeze>(_: T) {}

src/test/compile-fail/non_owned-enum.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#[non_sendable]
11+
#[no_send]
1212
enum Foo { A }
1313

1414
fn bar<T: Send>(_: T) {}

src/test/compile-fail/non_owned-struct.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#[non_sendable]
11+
#[no_send]
1212
struct Foo { a: int }
1313

1414
fn bar<T: Send>(_: T) {}

src/test/run-pass/unfoldr-cross-crate.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ fn main() {
2424
}
2525
}
2626

27-
let mut it = UnfoldrIterator::new(count, 0);
27+
let mut it = UnfoldrIterator::new(0, count);
2828
let mut i = 0;
2929
for it.advance |counted| {
3030
assert_eq!(counted, i);

0 commit comments

Comments
 (0)