Skip to content

Commit 6ea218d

Browse files
committed
auto merge of #11433 : brson/rust/minorstylefixes, r=alexcrichton
2 parents c72f984 + 55f81bc commit 6ea218d

File tree

10 files changed

+165
-165
lines changed

10 files changed

+165
-165
lines changed

src/librustc/back/link.rs

+18-18
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,13 @@ use syntax::attr::AttrMetaMethods;
4545
use syntax::crateid::CrateId;
4646

4747
#[deriving(Clone, Eq)]
48-
pub enum output_type {
49-
output_type_none,
50-
output_type_bitcode,
51-
output_type_assembly,
52-
output_type_llvm_assembly,
53-
output_type_object,
54-
output_type_exe,
48+
pub enum OutputType {
49+
OutputTypeNone,
50+
OutputTypeBitcode,
51+
OutputTypeAssembly,
52+
OutputTypeLlvmAssembly,
53+
OutputTypeObject,
54+
OutputTypeExe,
5555
}
5656

5757
pub fn llvm_err(sess: Session, msg: ~str) -> ! {
@@ -86,10 +86,10 @@ pub fn WriteOutputFile(
8686
pub mod write {
8787

8888
use back::lto;
89-
use back::link::{WriteOutputFile, output_type};
90-
use back::link::{output_type_assembly, output_type_bitcode};
91-
use back::link::{output_type_exe, output_type_llvm_assembly};
92-
use back::link::{output_type_object};
89+
use back::link::{WriteOutputFile, OutputType};
90+
use back::link::{OutputTypeAssembly, OutputTypeBitcode};
91+
use back::link::{OutputTypeExe, OutputTypeLlvmAssembly};
92+
use back::link::{OutputTypeObject};
9393
use driver::driver::CrateTranslation;
9494
use driver::session::Session;
9595
use driver::session;
@@ -107,7 +107,7 @@ pub mod write {
107107

108108
pub fn run_passes(sess: Session,
109109
trans: &CrateTranslation,
110-
output_type: output_type,
110+
output_type: OutputType,
111111
output: &Path) {
112112
let llmod = trans.module;
113113
let llcx = trans.context;
@@ -225,20 +225,20 @@ pub mod write {
225225

226226
time(sess.time_passes(), "codegen passes", (), |()| {
227227
match output_type {
228-
output_type_none => {}
229-
output_type_bitcode => {
228+
OutputTypeNone => {}
229+
OutputTypeBitcode => {
230230
output.with_c_str(|buf| {
231231
llvm::LLVMWriteBitcodeToFile(llmod, buf);
232232
})
233233
}
234-
output_type_llvm_assembly => {
234+
OutputTypeLlvmAssembly => {
235235
output.with_c_str(|output| {
236236
with_codegen(tm, llmod, |cpm| {
237237
llvm::LLVMRustPrintModule(cpm, llmod, output);
238238
})
239239
})
240240
}
241-
output_type_assembly => {
241+
OutputTypeAssembly => {
242242
with_codegen(tm, llmod, |cpm| {
243243
WriteOutputFile(sess, tm, cpm, llmod, output,
244244
lib::llvm::AssemblyFile);
@@ -248,7 +248,7 @@ pub mod write {
248248
// could be invoked specially with output_type_assembly,
249249
// so in this case we still want the metadata object
250250
// file.
251-
if sess.opts.output_type != output_type_assembly {
251+
if sess.opts.output_type != OutputTypeAssembly {
252252
with_codegen(tm, trans.metadata_module, |cpm| {
253253
let out = output.with_extension("metadata.o");
254254
WriteOutputFile(sess, tm, cpm,
@@ -257,7 +257,7 @@ pub mod write {
257257
})
258258
}
259259
}
260-
output_type_exe | output_type_object => {
260+
OutputTypeExe | OutputTypeObject => {
261261
with_codegen(tm, llmod, |cpm| {
262262
WriteOutputFile(sess, tm, cpm, llmod, output,
263263
lib::llvm::ObjectFile);

src/librustc/driver/driver.rs

+14-14
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ pub fn phase_5_run_llvm_passes(sess: Session,
362362
outputs: &OutputFilenames) {
363363

364364
if sess.no_integrated_as() {
365-
let output_type = link::output_type_assembly;
365+
let output_type = link::OutputTypeAssembly;
366366
let asm_filename = outputs.obj_filename.with_extension("s");
367367

368368
time(sess.time_passes(), "LLVM passes", (), |_|
@@ -424,7 +424,7 @@ pub fn stop_after_phase_2(sess: Session) -> bool {
424424
}
425425

426426
pub fn stop_after_phase_5(sess: Session) -> bool {
427-
if sess.opts.output_type != link::output_type_exe {
427+
if sess.opts.output_type != link::OutputTypeExe {
428428
debug!("not building executable, returning early from compile_input");
429429
return true;
430430
}
@@ -765,17 +765,17 @@ pub fn build_session_options(binary: ~str,
765765

766766
let output_type =
767767
if parse_only || no_trans {
768-
link::output_type_none
768+
link::OutputTypeNone
769769
} else if matches.opt_present("S") &&
770770
matches.opt_present("emit-llvm") {
771-
link::output_type_llvm_assembly
771+
link::OutputTypeLlvmAssembly
772772
} else if matches.opt_present("S") {
773-
link::output_type_assembly
773+
link::OutputTypeAssembly
774774
} else if matches.opt_present("c") {
775-
link::output_type_object
775+
link::OutputTypeObject
776776
} else if matches.opt_present("emit-llvm") {
777-
link::output_type_bitcode
778-
} else { link::output_type_exe };
777+
link::OutputTypeBitcode
778+
} else { link::OutputTypeExe };
779779
let sysroot_opt = matches.opt_str("sysroot").map(|m| @Path::new(m));
780780
let target = matches.opt_str("target").unwrap_or(host_triple());
781781
let target_cpu = matches.opt_str("target-cpu").unwrap_or(~"generic");
@@ -1039,15 +1039,15 @@ pub fn build_output_filenames(input: &input,
10391039
let obj_path;
10401040
let out_path;
10411041
let sopts = sess.opts;
1042-
let stop_after_codegen = sopts.output_type != link::output_type_exe;
1042+
let stop_after_codegen = sopts.output_type != link::OutputTypeExe;
10431043

10441044
let obj_suffix = match sopts.output_type {
1045-
link::output_type_none => ~"none",
1046-
link::output_type_bitcode => ~"bc",
1047-
link::output_type_assembly => ~"s",
1048-
link::output_type_llvm_assembly => ~"ll",
1045+
link::OutputTypeNone => ~"none",
1046+
link::OutputTypeBitcode => ~"bc",
1047+
link::OutputTypeAssembly => ~"s",
1048+
link::OutputTypeLlvmAssembly => ~"ll",
10491049
// Object and exe output both use the '.o' extension here
1050-
link::output_type_object | link::output_type_exe => ~"o"
1050+
link::OutputTypeObject | link::OutputTypeExe => ~"o"
10511051
};
10521052

10531053
match *ofile {

src/librustc/driver/session.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,9 @@ pub struct options {
145145
llvm_args: ~[~str],
146146
debuginfo: bool,
147147
extra_debuginfo: bool,
148-
lint_opts: ~[(lint::lint, lint::level)],
148+
lint_opts: ~[(lint::Lint, lint::level)],
149149
save_temps: bool,
150-
output_type: back::link::output_type,
150+
output_type: back::link::OutputType,
151151
// This is mutable for rustpkg, which updates search paths based on the
152152
// parsed code.
153153
addl_lib_search_paths: @RefCell<HashSet<Path>>,
@@ -214,7 +214,7 @@ pub struct Session_ {
214214
building_library: Cell<bool>,
215215
working_dir: Path,
216216
lints: RefCell<HashMap<ast::NodeId,
217-
~[(lint::lint, codemap::Span, ~str)]>>,
217+
~[(lint::Lint, codemap::Span, ~str)]>>,
218218
node_id: Cell<ast::NodeId>,
219219
outputs: @RefCell<~[OutputStyle]>,
220220
}
@@ -268,7 +268,7 @@ impl Session_ {
268268
self.span_diagnostic.handler().unimpl(msg)
269269
}
270270
pub fn add_lint(&self,
271-
lint: lint::lint,
271+
lint: lint::Lint,
272272
id: ast::NodeId,
273273
sp: Span,
274274
msg: ~str) {
@@ -385,7 +385,7 @@ pub fn basic_options() -> @options {
385385
extra_debuginfo: false,
386386
lint_opts: ~[],
387387
save_temps: false,
388-
output_type: link::output_type_exe,
388+
output_type: link::OutputTypeExe,
389389
addl_lib_search_paths: @RefCell::new(HashSet::new()),
390390
ar: None,
391391
linker: None,
@@ -443,12 +443,12 @@ pub fn collect_outputs(session: &Session,
443443
Some(n) if "staticlib" == n => Some(OutputStaticlib),
444444
Some(n) if "bin" == n => Some(OutputExecutable),
445445
Some(_) => {
446-
session.add_lint(lint::unknown_crate_type, ast::CRATE_NODE_ID,
446+
session.add_lint(lint::UnknownCrateType, ast::CRATE_NODE_ID,
447447
a.span, ~"invalid `crate_type` value");
448448
None
449449
}
450450
_ => {
451-
session.add_lint(lint::unknown_crate_type, ast::CRATE_NODE_ID,
451+
session.add_lint(lint::UnknownCrateType, ast::CRATE_NODE_ID,
452452
a.span, ~"`crate_type` requires a value");
453453
None
454454
}

src/librustc/front/feature_gate.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ pub fn check_crate(sess: Session, crate: &ast::Crate) {
233233
directive not necessary");
234234
}
235235
None => {
236-
sess.add_lint(lint::unknown_features,
236+
sess.add_lint(lint::UnknownFeatures,
237237
ast::CRATE_NODE_ID,
238238
mi.span,
239239
~"unknown feature");

src/librustc/middle/dead.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
use middle::ty;
1616
use middle::typeck;
1717
use middle::privacy;
18-
use middle::lint::dead_code;
18+
use middle::lint::DeadCode;
1919

2020
use std::hashmap::HashSet;
2121
use syntax::ast;
@@ -328,7 +328,7 @@ impl DeadVisitor {
328328

329329
fn warn_dead_code(&mut self, id: ast::NodeId,
330330
span: codemap::Span, ident: &ast::Ident) {
331-
self.tcx.sess.add_lint(dead_code, id, span,
331+
self.tcx.sess.add_lint(DeadCode, id, span,
332332
format!("code is never used: `{}`",
333333
token::ident_to_str(ident)));
334334
}

0 commit comments

Comments
 (0)