Skip to content

Commit f0329ca

Browse files
committed
---
yaml --- r: 16244 b: refs/heads/try c: 5a4e534 h: refs/heads/master v: v3
1 parent b367b64 commit f0329ca

File tree

4 files changed

+132
-111
lines changed

4 files changed

+132
-111
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
refs/heads/master: 61b1875c16de39c166b0f4d54bba19f9c6777d1a
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
5-
refs/heads/try: 2d0e7cd272136f12f8c07cafe57df408d37ada6f
5+
refs/heads/try: 5a4e53487faa94f3ccb966abf278d7ab5e22711a
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105

branches/try/src/rustc/driver/driver.rs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,9 @@ fn compile_upto(sess: session, cfg: ast::crate_cfg,
157157
time(time_passes, "core injection",
158158
bind front::core_inject::maybe_inject_libcore_ref(sess, crate));
159159

160+
time(time_passes, "building warning settings table",
161+
bind lint::build_settings_crate(sess, crate));
162+
160163
let ast_map =
161164
time(time_passes, "ast indexing",
162165
bind syntax::ast_map::map_crate(sess.diagnostic(), *crate));
@@ -204,10 +207,8 @@ fn compile_upto(sess: session, cfg: ast::crate_cfg,
204207
bind middle::alias::check_crate(ty_cx, crate));
205208
time(time_passes, "kind checking",
206209
bind kind::check_crate(ty_cx, method_map, last_use_map, crate));
207-
208-
let _warning_settings =
209-
time(time_passes, "lint checking",
210-
bind lint::check_crate(ty_cx, crate, sess.opts.lint_opts));
210+
time(time_passes, "lint checking",
211+
bind lint::check_crate(ty_cx, crate));
211212

212213
if upto == cu_no_trans { ret {crate: crate, tcx: some(ty_cx)}; }
213214
let outputs = option::get(outputs);
@@ -528,6 +529,7 @@ fn build_session_(
528529
sopts.maybe_sysroot,
529530
sopts.target_triple,
530531
sopts.addl_lib_search_paths);
532+
let warning_settings = lint::mk_warning_settings();
531533
@{targ_cfg: target_cfg,
532534
opts: sopts,
533535
cstore: cstore,
@@ -544,7 +546,8 @@ fn build_session_(
544546
span_diagnostic: span_diagnostic_handler,
545547
filesearch: filesearch,
546548
mut building_library: false,
547-
working_dir: os::getcwd()}
549+
working_dir: os::getcwd(),
550+
warning_settings: warning_settings}
548551
}
549552

550553
fn parse_pretty(sess: session, &&name: str) -> pp_mode {

branches/try/src/rustc/driver/session.rs

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import back::target_strs;
99
import back::link;
1010
import middle::lint;
1111

12+
1213
enum os { os_win32, os_macos, os_linux, os_freebsd, }
1314

1415
enum arch { arch_x86, arch_x86_64, arch_arm, }
@@ -82,7 +83,8 @@ type session = @{targ_cfg: @config,
8283
span_diagnostic: diagnostic::span_handler,
8384
filesearch: filesearch::filesearch,
8485
mut building_library: bool,
85-
working_dir: str};
86+
working_dir: str,
87+
warning_settings: lint::warning_settings};
8688

8789
impl session for session {
8890
fn span_fatal(sp: span, msg: str) -> ! {
@@ -127,6 +129,21 @@ impl session for session {
127129
fn unimpl(msg: str) -> ! {
128130
self.span_diagnostic.handler().unimpl(msg)
129131
}
132+
fn span_lint_level(level: lint::level,
133+
sp: span, msg: str) {
134+
alt level {
135+
lint::ignore { }
136+
lint::warn { self.span_warn(sp, msg); }
137+
lint::error { self.span_err(sp, msg); }
138+
}
139+
}
140+
fn span_lint(lint_mode: lint::lint,
141+
expr_id: ast::node_id, item_id: ast::node_id,
142+
span: span, msg: str) {
143+
let level = lint::get_warning_settings_level(
144+
self.warning_settings, lint_mode, expr_id, item_id);
145+
self.span_lint_level(level, span, msg);
146+
}
130147
fn next_node_id() -> ast::node_id {
131148
ret syntax::parse::next_node_id(self.parse_sess);
132149
}

0 commit comments

Comments
 (0)