Skip to content

Commit 9bedca8

Browse files
committed
---
yaml --- r: 31453 b: refs/heads/dist-snap c: dbbaa50 h: refs/heads/master i: 31451: e8a5403 v: v3
1 parent 57d0d26 commit 9bedca8

File tree

21 files changed

+226
-141
lines changed

21 files changed

+226
-141
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: d0c6ce338884ee21843f4b40bf6bf18d222ce5df
99
refs/heads/incoming: d9317a174e434d4c99fc1a37fd7dc0d2f5328d37
10-
refs/heads/dist-snap: c60a6b93fbb11751dfb411ee2909fa85644fe76f
10+
refs/heads/dist-snap: dbbaa50290ed7c97154bbc44e7bd73937a9dcb5e
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/dist-snap/src/cargo/cargo.rc

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
// indent-tabs-mode: nil
88
// c-basic-offset: 4
99
// buffer-file-coding-system: utf-8-unix
10-
// compile-command: "make -k -C $RBUILD 2>&1 | sed -e 's/\\/x\\//x:\\//g'";
1110
// End:
1211

1312
#[link(name = "cargo",
@@ -19,7 +18,15 @@
1918

2019
#[no_core];
2120

22-
#[warn(no_non_implicitly_copyable_typarams,no_vecs_not_implicitly_copyable)];
21+
22+
// NB: transitional for stage0:
23+
#[allow(unrecognized_lint)];
24+
#[warn(no_unrecognized_warning)];
25+
#[warn(no_non_implicitly_copyable_typarams,
26+
no_vecs_not_implicitly_copyable)];
27+
// The new version:
28+
#[allow(vecs_implicitly_copyable,
29+
non_implicitly_copyable_typarams)];
2330

2431
use core(vers = "0.3");
2532
use std(vers = "0.3");

branches/dist-snap/src/compiletest/compiletest.rc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,12 @@
22

33
#[no_core];
44

5+
// NB: transitional for stage0:
6+
#[allow(unrecognized_lint)];
7+
#[warn(no_unrecognized_warning)];
58
#[warn(no_vecs_not_implicitly_copyable)];
9+
// The new version:
10+
#[allow(vecs_implicitly_copyable)];
611

712
use core(vers = "0.3");
813
use std(vers = "0.3");

branches/dist-snap/src/fuzzer/fuzzer.rc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,12 @@
44

55
#[no_core];
66

7+
// NB: transitional for stage0:
8+
#[allow(unrecognized_lint)];
9+
#[warn(no_unrecognized_warning)];
710
#[warn(no_vecs_not_implicitly_copyable)];
11+
// The new version:
12+
#[allow(vecs_implicitly_copyable)];
813

914
use core(vers = "0.3");
1015
use std(vers = "0.3");
@@ -17,5 +22,4 @@ import core::*;
1722
// indent-tabs-mode: nil
1823
// c-basic-offset: 4
1924
// buffer-file-coding-system: utf-8-unix
20-
// compile-command: "make -k -C $RBUILD 2>&1 | sed -e 's/\\/x\\//x:\\//g'";
2125
// End:

branches/dist-snap/src/libcore/core.rc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,12 @@
3131
// Don't link to core. We are core.
3232
#[no_core];
3333

34+
// NB: transitional for stage0:
35+
#[allow(unrecognized_lint)];
36+
#[warn(no_unrecognized_warning)];
3437
#[warn(no_vecs_not_implicitly_copyable)];
38+
// The new version:
39+
#[allow(vecs_implicitly_copyable)];
3540

3641
export int, i8, i16, i32, i64;
3742
export uint, u8, u16, u32, u64;

branches/dist-snap/src/libstd/std.rc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,12 @@
1010

1111
#[no_core];
1212

13+
// NB: transitional for stage0:
14+
#[allow(unrecognized_lint)];
15+
#[warn(no_unrecognized_warning)];
1316
#[warn(no_vecs_not_implicitly_copyable)];
17+
// The new version:
18+
#[allow(vecs_implicitly_copyable)];
1419

1520
use core(vers = "0.3");
1621
import core::*;

branches/dist-snap/src/libstd/test.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,9 @@ fn get_concurrency() -> uint {
328328
else { threads * sched_overcommit }
329329
}
330330

331+
// NB: transitional duplication here.
331332
#[warn(no_non_implicitly_copyable_typarams)]
333+
#[allow(non_implicitly_copyable_typarams)]
332334
fn filter_tests(opts: test_opts,
333335
tests: ~[test_desc]) -> ~[test_desc] {
334336
let mut filtered = copy tests;

branches/dist-snap/src/libsyntax/syntax.rc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,12 @@
88

99
#[no_core];
1010

11+
// NB: transitional for stage0:
12+
#[allow(unrecognized_lint)];
13+
#[warn(no_unrecognized_warning)];
1114
#[warn(no_vecs_not_implicitly_copyable)];
15+
// The new version:
16+
#[allow(vecs_implicitly_copyable)];
1217

1318
use core(vers = "0.3");
1419
use std(vers = "0.3");

branches/dist-snap/src/rustc/driver/driver.rs

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ fn compile_upto(sess: session, cfg: ast::crate_cfg,
158158
crate = time(time_passes, ~"core injection", ||
159159
front::core_inject::maybe_inject_libcore_ref(sess, crate));
160160

161-
time(time_passes, ~"building warning settings table", ||
161+
time(time_passes, ~"building lint settings table", ||
162162
lint::build_settings_crate(sess, crate));
163163

164164
let ast_map = time(time_passes, ~"ast indexing", ||
@@ -418,17 +418,28 @@ fn build_session_options(match: getopts::match,
418418
let parse_only = opt_present(match, ~"parse-only");
419419
let no_trans = opt_present(match, ~"no-trans");
420420

421-
let lint_flags = vec::append(getopts::opt_strs(match, ~"W"),
422-
getopts::opt_strs(match, ~"warn"));
421+
let lint_levels = [lint::allow, lint::warn,
422+
lint::deny, lint::forbid];
423+
let mut lint_opts = ~[];
423424
let lint_dict = lint::get_lint_dict();
424-
let lint_opts = do vec::map(lint_flags) |flag| {
425-
alt lint::lookup_lint(lint_dict, flag) {
426-
(flag, none) {
427-
early_error(demitter, #fmt("unknown warning: %s", flag))
428-
}
429-
(_, some(x)) { x }
425+
for lint_levels.each |level| {
426+
let level_name = lint::level_to_str(level);
427+
let level_short = level_name.substr(0,1).to_upper();
428+
let flags = vec::append(getopts::opt_strs(match, level_short),
429+
getopts::opt_strs(match, level_name));
430+
for flags.each |lint_name| {
431+
let lint_name = str::replace(lint_name, ~"-", ~"_");
432+
alt lint_dict.find(lint_name) {
433+
none {
434+
early_error(demitter, #fmt("unknown %s flag: %s",
435+
level_name, lint_name));
436+
}
437+
some(lint) {
438+
vec::push(lint_opts, (lint.lint, level));
439+
}
440+
}
430441
}
431-
};
442+
}
432443

433444
let mut debugging_opts = 0u;
434445
let debug_flags = getopts::opt_strs(match, ~"Z");
@@ -540,7 +551,7 @@ fn build_session_(sopts: @session::options,
540551
sopts.maybe_sysroot,
541552
sopts.target_triple,
542553
sopts.addl_lib_search_paths);
543-
let warning_settings = lint::mk_warning_settings();
554+
let lint_settings = lint::mk_lint_settings();
544555
session_(@{targ_cfg: target_cfg,
545556
opts: sopts,
546557
cstore: cstore,
@@ -553,7 +564,7 @@ fn build_session_(sopts: @session::options,
553564
filesearch: filesearch,
554565
mut building_library: false,
555566
working_dir: os::getcwd(),
556-
warning_settings: warning_settings})
567+
lint_settings: lint_settings})
557568
}
558569

559570
fn parse_pretty(sess: session, &&name: ~str) -> pp_mode {
@@ -582,6 +593,9 @@ fn opts() -> ~[getopts::opt] {
582593
optopt(~"sysroot"), optopt(~"target"),
583594

584595
optmulti(~"W"), optmulti(~"warn"),
596+
optmulti(~"A"), optmulti(~"allow"),
597+
optmulti(~"D"), optmulti(~"deny"),
598+
optmulti(~"F"), optmulti(~"forbid"),
585599

586600
optmulti(~"Z"),
587601

branches/dist-snap/src/rustc/driver/rustc.rs

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
#[no_core];
2+
// NB: transitional for stage0:
3+
#[allow(unrecognized_lint)];
4+
#[warn(no_unrecognized_warning)];
25
#[warn(no_vecs_not_implicitly_copyable)];
6+
// The new version:
7+
#[allow(vecs_implicitly_copyable)];
38

49
use core(vers = "0.3");
510
use std(vers = "0.3");
@@ -66,10 +71,12 @@ Options:
6671
(see http://sources.redhat.com/autobook/autobook/
6772
autobook_17.html for detail)
6873

69-
-W <foo> enable warning <foo>
70-
-W no-<foo> disable warning <foo>
71-
-W err-<foo> enable warning <foo> as an error
72-
-W help Print available warnings and default settings
74+
-(W|A|D|F) help Print available 'lint' checks and default settings
75+
76+
-W <foo> warn about <foo> by default
77+
-A <foo> allow <foo> by default
78+
-D <foo> deny <foo> by default
79+
-F <foo> forbid <foo> (deny, and deny all overrides)
7380

7481
-Z help list internal options for debugging rustc
7582

@@ -84,7 +91,7 @@ fn describe_warnings() {
8491
fn padded(max: uint, s: ~str) -> ~str {
8592
str::from_bytes(vec::from_elem(max - s.len(), ' ' as u8)) + s
8693
}
87-
io::println(#fmt("\nAvailable warnings:\n"));
94+
io::println(#fmt("\nAvailable lint checks:\n"));
8895
io::println(#fmt(" %s %7.7s %s",
8996
padded(max_key, ~"name"), ~"default", ~"meaning"));
9097
io::println(#fmt(" %s %7.7s %s\n",
@@ -93,9 +100,12 @@ fn describe_warnings() {
93100
let k = str::replace(k, ~"_", ~"-");
94101
io::println(#fmt(" %s %7.7s %s",
95102
padded(max_key, k),
96-
alt v.default { lint::warn { ~"warn" }
97-
lint::error { ~"error" }
98-
lint::ignore { ~"ignore" } },
103+
alt v.default {
104+
lint::allow { ~"allow" }
105+
lint::warn { ~"warn" }
106+
lint::deny { ~"deny" }
107+
lint::forbid { ~"forbid" }
108+
},
99109
v.desc));
100110
}
101111
io::println(~"");

branches/dist-snap/src/rustc/driver/session.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ type session_ = {targ_cfg: @config,
101101
filesearch: filesearch::filesearch,
102102
mut building_library: bool,
103103
working_dir: ~str,
104-
warning_settings: lint::warning_settings};
104+
lint_settings: lint::lint_settings};
105105

106106
enum session {
107107
session_(@session_)
@@ -153,16 +153,18 @@ impl session for session {
153153
fn span_lint_level(level: lint::level,
154154
sp: span, msg: ~str) {
155155
alt level {
156-
lint::ignore { }
156+
lint::allow { }
157157
lint::warn { self.span_warn(sp, msg); }
158-
lint::error { self.span_err(sp, msg); }
158+
lint::deny | lint::forbid {
159+
self.span_err(sp, msg);
160+
}
159161
}
160162
}
161163
fn span_lint(lint_mode: lint::lint,
162164
expr_id: ast::node_id, item_id: ast::node_id,
163165
span: span, msg: ~str) {
164-
let level = lint::get_warning_settings_level(
165-
self.warning_settings, lint_mode, expr_id, item_id);
166+
let level = lint::get_lint_settings_level(
167+
self.lint_settings, lint_mode, expr_id, item_id);
166168
self.span_lint_level(level, span, msg);
167169
}
168170
fn next_node_id() -> ast::node_id {

0 commit comments

Comments
 (0)