Skip to content
Closed

Rollup #20473

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,14 @@ example, if it's 2014, and you change a Rust file that was created in
// Copyright 2010-2014 The Rust Project Developers.
```

# Coordination and communication

Get feedback from other developers on
[discuss.rust-lang.org][discuss], and
[#rust-internals][pound-rust-internals].

[pound-rust-internals]: http://chat.mibbit.com/?server=irc.mozilla.org&channel=%23rust-internals
[discuss]: http://discuss.rust-lang.org

For more details, please refer to
[Note-development-policy](https://github.com/rust-lang/rust/wiki/Note-development-policy).
2 changes: 1 addition & 1 deletion src/doc/guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ you can access through
[Mibbit](http://chat.mibbit.com/?server=irc.mozilla.org&channel=%23rust). Click
that link, and you'll be chatting with other Rustaceans (a silly nickname we
call ourselves), and we can help you out. Other great resources include [our
mailing list](https://mail.mozilla.org/listinfo/rust-dev), [the /r/rust
forum](http://discuss.rust-lang.org/), [the /r/rust
subreddit](http://www.reddit.com/r/rust), and [Stack
Overflow](http://stackoverflow.com/questions/tagged/rust).

Expand Down
8 changes: 4 additions & 4 deletions src/etc/vim/syntax/rust.vim
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,8 @@ syn region rustString start=+b"+ skip=+\\\\\|\\"+ end=+"+ contains=rustE
syn region rustString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=rustEscape,rustEscapeUnicode,rustEscapeError,rustStringContinuation,@Spell
syn region rustString start='b\?r\z(#*\)"' end='"\z1' contains=@Spell

syn region rustAttribute start="#!\?\[" end="\]" contains=rustString,rustDeriving
syn region rustDeriving start="deriving(" end=")" contained contains=rustTrait
syn region rustAttribute start="#!\?\[" end="\]" contains=rustString,rustDerive
syn region rustDerive start="derive(" end=")" contained contains=rustTrait

" Number literals
syn match rustDecNumber display "\<[0-9][0-9_]*\%([iu]\%(8\|16\|32\|64\)\=\)\="
Expand Down Expand Up @@ -263,7 +263,7 @@ hi def link rustMacro Macro
hi def link rustType Type
hi def link rustTodo Todo
hi def link rustAttribute PreProc
hi def link rustDeriving PreProc
hi def link rustDerive PreProc
hi def link rustStorage StorageClass
hi def link rustObsoleteStorage Error
hi def link rustLifetime Special
Expand All @@ -275,7 +275,7 @@ hi def link rustBoxPlacementExpr rustKeyword

" Other Suggestions:
" hi rustAttribute ctermfg=cyan
" hi rustDeriving ctermfg=cyan
" hi rustDerive ctermfg=cyan
" hi rustAssert ctermfg=yellow
" hi rustPanic ctermfg=red
" hi rustMacro ctermfg=magenta
Expand Down
2 changes: 0 additions & 2 deletions src/liballoc/arc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -600,11 +600,9 @@ mod tests {
use std::ops::Drop;
use std::option::Option;
use std::option::Option::{Some, None};
use std::str::Str;
use std::sync::atomic;
use std::sync::atomic::Ordering::{Acquire, SeqCst};
use std::task;
use std::kinds::Send;
use std::vec::Vec;
use super::{Arc, Weak, weak_count, strong_count};
use std::sync::Mutex;
Expand Down
7 changes: 1 addition & 6 deletions src/libcollections/bit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1876,14 +1876,9 @@ impl<'a> Iterator<uint> for SymmetricDifference<'a> {
#[cfg(test)]
mod tests {
use prelude::*;
use core::iter::range_step;
use core::u32;
use std::rand;
use std::rand::Rng;
use test::{Bencher, black_box};

use super::{Bitv, BitvSet, from_fn, from_bytes};
use bitv;
use super::{Bitv, from_fn, from_bytes};

#[test]
fn test_to_str() {
Expand Down
1 change: 0 additions & 1 deletion src/libcollections/ring_buf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1418,7 +1418,6 @@ mod tests {
use self::Taggy::*;
use self::Taggypar::*;
use prelude::*;
use core::cmp;
use core::iter;
use std::fmt::Show;
use std::hash;
Expand Down
2 changes: 1 addition & 1 deletion src/libcoretest/char.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
//
// ignore-lexer-test FIXME #15679

use core::char::{escape_unicode, escape_default};
use core::char::escape_default;

#[test]
fn test_is_lowercase() {
Expand Down
1 change: 0 additions & 1 deletion src/libcoretest/num/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ use core::fmt::Show;
use core::num::{NumCast, cast};
use core::ops::{Add, Sub, Mul, Div, Rem};
use core::kinds::Copy;
use std::str::from_str;

mod int_macros;
mod i8;
Expand Down
15 changes: 7 additions & 8 deletions src/libgraphviz/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,10 +168,10 @@
//! dot::Id::new(format!("N{}", n)).unwrap()
//! }
//! fn node_label<'b>(&'b self, n: &Nd) -> dot::LabelText<'b> {
//! dot::LabelStr(self.nodes[*n].as_slice().into_cow())
//! dot::LabelText::LabelStr(self.nodes[*n].as_slice().into_cow())
//! }
//! fn edge_label<'b>(&'b self, _: &Ed) -> dot::LabelText<'b> {
//! dot::LabelStr("&sube;".into_cow())
//! dot::LabelText::LabelStr("&sube;".into_cow())
//! }
//! }
//!
Expand Down Expand Up @@ -225,10 +225,10 @@
//! }
//! fn node_label<'b>(&'b self, n: &Nd<'b>) -> dot::LabelText<'b> {
//! let &(i, _) = n;
//! dot::LabelStr(self.nodes[i].as_slice().into_cow())
//! dot::LabelText::LabelStr(self.nodes[i].as_slice().into_cow())
//! }
//! fn edge_label<'b>(&'b self, _: &Ed<'b>) -> dot::LabelText<'b> {
//! dot::LabelStr("&sube;".into_cow())
//! dot::LabelText::LabelStr("&sube;".into_cow())
//! }
//! }
//!
Expand Down Expand Up @@ -274,7 +274,7 @@
#![feature(globs, slicing_syntax)]
#![feature(unboxed_closures)]

pub use self::LabelText::*;
use self::LabelText::*;

use std::borrow::IntoCow;
use std::io;
Expand Down Expand Up @@ -586,10 +586,9 @@ pub fn render_opts<'a, N:Clone+'a, E:Clone+'a, G:Labeller<'a,N,E>+GraphWalk<'a,N
#[cfg(test)]
mod tests {
use self::NodeLabels::*;
use super::{Id, LabelText, LabelStr, EscStr, Labeller};
use super::{Nodes, Edges, GraphWalk, render};
use super::{Id, Labeller, Nodes, Edges, GraphWalk, render};
use super::LabelText::{mod, LabelStr, EscStr};
use std::io::IoResult;
use std::str;
use std::borrow::IntoCow;

/// each node is an index in a vector in the graph.
Expand Down
34 changes: 26 additions & 8 deletions src/liblog/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ use std::mem;
use std::os;
use std::rt;
use std::slice;
use std::sync::{Once, ONCE_INIT};
use std::sync::{Once, ONCE_INIT, StaticMutex, MUTEX_INIT};

use regex::Regex;

Expand All @@ -193,6 +193,8 @@ pub const MAX_LOG_LEVEL: u32 = 255;
/// The default logging level of a crate if no other is specified.
const DEFAULT_LOG_LEVEL: u32 = 1;

static LOCK: StaticMutex = MUTEX_INIT;

/// An unsafe constant that is the maximum logging level of any module
/// specified. This is the first line of defense to determining whether a
/// logging statement should be run.
Expand Down Expand Up @@ -279,9 +281,18 @@ impl Drop for DefaultLogger {
pub fn log(level: u32, loc: &'static LogLocation, args: fmt::Arguments) {
// Test the literal string from args against the current filter, if there
// is one.
match unsafe { FILTER.as_ref() } {
Some(filter) if !filter.is_match(args.to_string()[]) => return,
_ => {}
unsafe {
let _g = LOCK.lock();
match FILTER as uint {
0 => {}
1 => panic!("cannot log after main thread has exited"),
n => {
let filter = mem::transmute::<_, &Regex>(n);
if !filter.is_match(args.to_string().as_slice()) {
return
}
}
}
}

// Completely remove the local logger from TLS in case anyone attempts to
Expand Down Expand Up @@ -363,9 +374,15 @@ pub fn mod_enabled(level: u32, module: &str) -> bool {

// This assertion should never get tripped unless we're in an at_exit
// handler after logging has been torn down and a logging attempt was made.
assert!(unsafe { !DIRECTIVES.is_null() });

enabled(level, module, unsafe { (*DIRECTIVES).iter() })
let _g = LOCK.lock();
unsafe {
assert!(DIRECTIVES as uint != 0);
assert!(DIRECTIVES as uint != 1,
"cannot log after the main thread has exited");

enabled(level, module, (*DIRECTIVES).iter())
}
}

fn enabled(level: u32,
Expand Down Expand Up @@ -421,14 +438,15 @@ fn init() {

// Schedule the cleanup for the globals for when the runtime exits.
rt::at_exit(move |:| {
let _g = LOCK.lock();
assert!(!DIRECTIVES.is_null());
let _directives: Box<Vec<directive::LogDirective>> =
mem::transmute(DIRECTIVES);
DIRECTIVES = 0 as *const Vec<directive::LogDirective>;
DIRECTIVES = 1 as *const Vec<directive::LogDirective>;

if !FILTER.is_null() {
let _filter: Box<Regex> = mem::transmute(FILTER);
FILTER = 0 as *const _;
FILTER = 1 as *const _;
}
});
}
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/middle/cfg/construct.rs
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ impl<'a, 'tcx> CFGBuilder<'a, 'tcx> {
let method_call = ty::MethodCall::expr(call_expr.id);
let return_ty = ty::ty_fn_ret(match self.tcx.method_map.borrow().get(&method_call) {
Some(method) => method.ty,
None => ty::expr_ty(self.tcx, func_or_rcvr)
None => ty::expr_ty_adjusted(self.tcx, func_or_rcvr)
});

let func_or_rcvr_exit = self.expr(func_or_rcvr, pred);
Expand Down
10 changes: 5 additions & 5 deletions src/librustc/middle/cfg/graphviz.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,16 @@ impl<'a, 'ast> dot::Labeller<'a, Node<'a>, Edge<'a>> for LabelledCFG<'a, 'ast> {

fn node_label(&'a self, &(i, n): &Node<'a>) -> dot::LabelText<'a> {
if i == self.cfg.entry {
dot::LabelStr("entry".into_cow())
dot::LabelText::LabelStr("entry".into_cow())
} else if i == self.cfg.exit {
dot::LabelStr("exit".into_cow())
dot::LabelText::LabelStr("exit".into_cow())
} else if n.data.id == ast::DUMMY_NODE_ID {
dot::LabelStr("(dummy_node)".into_cow())
dot::LabelText::LabelStr("(dummy_node)".into_cow())
} else {
let s = self.ast_map.node_to_string(n.data.id);
// left-aligns the lines
let s = replace_newline_with_backslash_l(s);
dot::EscStr(s.into_cow())
dot::LabelText::EscStr(s.into_cow())
}
}

Expand All @@ -87,7 +87,7 @@ impl<'a, 'ast> dot::Labeller<'a, Node<'a>, Edge<'a>> for LabelledCFG<'a, 'ast> {
let s = replace_newline_with_backslash_l(s);
label.push_str(format!("exiting scope_{} {}", i, s[])[]);
}
dot::EscStr(label.into_cow())
dot::LabelText::EscStr(label.into_cow())
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/librustc/middle/liveness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1149,7 +1149,7 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {

ast::ExprCall(ref f, ref args) => {
let diverges = !self.ir.tcx.is_method_call(expr.id) && {
let t_ret = ty::ty_fn_ret(ty::expr_ty(self.ir.tcx, &**f));
let t_ret = ty::ty_fn_ret(ty::expr_ty_adjusted(self.ir.tcx, &**f));
t_ret == ty::FnDiverging
};
let succ = if diverges {
Expand Down
1 change: 0 additions & 1 deletion src/librustc_back/rpath.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,6 @@ fn minimize_rpaths(rpaths: &[String]) -> Vec<String> {
mod test {
use super::{RPathConfig};
use super::{minimize_rpaths, rpaths_to_flags, get_rpath_relative_to_output};
use syntax::abi;

#[test]
fn test_rpaths_to_flags() {
Expand Down
4 changes: 2 additions & 2 deletions src/librustc_borrowck/graphviz.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ impl<'a, 'tcx> dot::Labeller<'a, Node<'a>, Edge<'a>> for DataflowLabeller<'a, 't
let suffix = self.dataflow_for(dataflow::Exit, n);
let inner_label = self.inner.node_label(n);
inner_label
.prefix_line(dot::LabelStr(prefix.into_cow()))
.suffix_line(dot::LabelStr(suffix.into_cow()))
.prefix_line(dot::LabelText::LabelStr(prefix.into_cow()))
.suffix_line(dot::LabelText::LabelStr(suffix.into_cow()))
}
fn edge_label(&'a self, e: &Edge<'a>) -> dot::LabelText<'a> { self.inner.edge_label(e) }
}
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_trans/trans/callee.rs
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,7 @@ pub fn trans_call<'a, 'blk, 'tcx>(in_cx: Block<'blk, 'tcx>,
let _icx = push_ctxt("trans_call");
trans_call_inner(in_cx,
Some(common::expr_info(call_ex)),
expr_ty(in_cx, f),
expr_ty_adjusted(in_cx, f),
|cx, _| trans(cx, f),
args,
Some(dest)).bcx
Expand Down
Loading