Skip to content

Commit d0c5a47

Browse files
committed
---
yaml --- r: 140907 b: refs/heads/try2 c: 030c666 h: refs/heads/master i: 140905: bfdbfe4 140903: 4622018 v: v3
1 parent 9a57535 commit d0c5a47

File tree

20 files changed

+507
-604
lines changed

20 files changed

+507
-604
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 918bfa710c2079ed1a690036eb794694b75faa30
8+
refs/heads/try2: 030c666cc1bc4830eac2f845b114f7c514f6e201
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/libcore/hashmap.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ use container::{Container, Mutable, Map, Set};
1717
use cmp::{Eq, Equiv};
1818
use hash::Hash;
1919
use old_iter::BaseIter;
20-
use hash::Hash;
2120
use old_iter;
2221
use option::{None, Option, Some};
2322
use rand::RngUtil;

branches/try2/src/libcore/rt/stack.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ pub impl StackSegment {
3131

3232
/// Point one word beyond the high end of the allocated stack
3333
fn end(&self) -> *uint {
34-
vec::raw::to_ptr(self.buf).offset(self.buf.len()) as *uint
34+
unsafe {
35+
vec::raw::to_ptr(self.buf).offset(self.buf.len()) as *uint
36+
}
3537
}
3638
}
3739

branches/try2/src/libcore/rt/uv/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ pub type Buf = uvll::uv_buf_t;
362362
363363
/// Borrow a slice to a Buf
364364
pub fn slice_to_uv_buf(v: &[u8]) -> Buf {
365-
let data = vec::raw::to_ptr(v);
365+
let data = unsafe { vec::raw::to_ptr(v) };
366366
unsafe { uvll::buf_init(data, v.len()) }
367367
}
368368

branches/try2/src/librustc/back/link.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,6 @@ pub mod write {
171171
use back::link::{output_type_assembly, output_type_bitcode};
172172
use back::link::{output_type_exe, output_type_llvm_assembly};
173173
use back::link::{output_type_object};
174-
use back::link::output_type;
175174
use driver::session::Session;
176175
use driver::session;
177176
use lib::llvm::llvm;

branches/try2/src/librustc/driver/driver.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ use middle;
2222
use util::common::time;
2323
use util::ppaux;
2424

25+
use core::hashmap::HashMap;
2526
use core::int;
2627
use core::io;
2728
use core::os;
@@ -200,9 +201,6 @@ pub fn compile_rest(sess: Session,
200201
crate = time(time_passes, ~"core injection", ||
201202
front::core_inject::maybe_inject_libcore_ref(sess, crate));
202203

203-
time(time_passes, ~"building lint settings table", ||
204-
lint::build_settings_crate(sess, crate));
205-
206204
let ast_map = time(time_passes, ~"ast indexing", ||
207205
syntax::ast_map::map_crate(sess.diagnostic(), crate));
208206

@@ -709,7 +707,6 @@ pub fn build_session_(sopts: @session::options,
709707
&sopts.maybe_sysroot,
710708
sopts.target_triple,
711709
/*bad*/copy sopts.addl_lib_search_paths);
712-
let lint_settings = lint::mk_lint_settings();
713710
@Session_ {
714711
targ_cfg: target_cfg,
715712
opts: sopts,
@@ -723,7 +720,7 @@ pub fn build_session_(sopts: @session::options,
723720
filesearch: filesearch,
724721
building_library: @mut false,
725722
working_dir: os::getcwd(),
726-
lint_settings: lint_settings
723+
lints: @mut HashMap::new(),
727724
}
728725
}
729726

branches/try2/src/librustc/driver/session.rs

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ use syntax::{ast, codemap};
2626
use syntax::abi;
2727
use syntax;
2828

29+
use core::hashmap::HashMap;
30+
2931
#[deriving(Eq)]
3032
pub enum os { os_win32, os_macos, os_linux, os_android, os_freebsd, }
3133

@@ -170,7 +172,7 @@ pub struct Session_ {
170172
filesearch: @filesearch::FileSearch,
171173
building_library: @mut bool,
172174
working_dir: Path,
173-
lint_settings: lint::LintSettings
175+
lints: @mut HashMap<ast::node_id, ~[(lint::lint, codemap::span, ~str)]>,
174176
}
175177

176178
pub type Session = @Session_;
@@ -230,15 +232,12 @@ pub impl Session_ {
230232
}
231233
}
232234
}
233-
fn span_lint(@self, lint_mode: lint::lint,
234-
expr_id: ast::node_id,
235-
item_id: ast::node_id,
236-
span: span,
237-
msg: &str) {
238-
let level = lint::get_lint_settings_level(
239-
self.lint_settings, lint_mode, expr_id, item_id);
240-
let msg = fmt!("%s [-W %s]", msg, lint::get_lint_name(lint_mode));
241-
self.span_lint_level(level, span, msg);
235+
fn add_lint(@self, lint: lint::lint, id: ast::node_id, sp: span, msg: ~str) {
236+
match self.lints.find_mut(&id) {
237+
Some(arr) => { arr.push((lint, sp, msg)); return; }
238+
None => {}
239+
}
240+
self.lints.insert(id, ~[(lint, sp, msg)]);
242241
}
243242
fn next_node_id(@self) -> ast::node_id {
244243
return syntax::parse::next_node_id(self.parse_sess);

0 commit comments

Comments
 (0)