Skip to content

Commit 59a3518

Browse files
author
Jose Narvaez
committed
Manual fixups done.
1 parent 4f16396 commit 59a3518

File tree

3 files changed

+54
-56
lines changed

3 files changed

+54
-56
lines changed

src/librustc_driver/driver.rs

+45-45
Original file line numberDiff line numberDiff line change
@@ -137,40 +137,40 @@ pub fn compile_input(sess: Session,
137137
control.make_glob_map,
138138
|tcx, analysis| {
139139

140-
{
141-
let state =
142-
CompileState::state_after_analysis(input,
143-
&tcx.sess,
144-
outdir,
145-
&expanded_crate,
146-
tcx.map.krate(),
147-
&analysis,
148-
tcx,
149-
&lcx);
150-
(control.after_analysis.callback)(state);
151-
152-
tcx.sess.abort_if_errors();
153-
if control.after_analysis.stop == Compilation::Stop {
154-
return Err(());
155-
}
156-
}
157-
158-
if log_enabled!(::log::INFO) {
159-
println!("Pre-trans");
160-
tcx.print_debug_stats();
161-
}
162-
let trans = phase_4_translate_to_llvm(tcx, analysis);
163-
164-
if log_enabled!(::log::INFO) {
165-
println!("Post-trans");
166-
tcx.print_debug_stats();
167-
}
140+
{
141+
let state =
142+
CompileState::state_after_analysis(input,
143+
&tcx.sess,
144+
outdir,
145+
&expanded_crate,
146+
tcx.map.krate(),
147+
&analysis,
148+
tcx,
149+
&lcx);
150+
(control.after_analysis.callback)(state);
151+
152+
tcx.sess.abort_if_errors();
153+
if control.after_analysis.stop == Compilation::Stop {
154+
return Err(());
155+
}
156+
}
157+
158+
if log_enabled!(::log::INFO) {
159+
println!("Pre-trans");
160+
tcx.print_debug_stats();
161+
}
162+
let trans = phase_4_translate_to_llvm(tcx, analysis);
163+
164+
if log_enabled!(::log::INFO) {
165+
println!("Post-trans");
166+
tcx.print_debug_stats();
167+
}
168168

169169
// Discard interned strings as they are no longer required.
170-
token::get_ident_interner().clear();
170+
token::get_ident_interner().clear();
171171

172-
Ok((outputs, trans))
173-
})
172+
Ok((outputs, trans))
173+
})
174174
};
175175

176176
let (outputs, trans) = if let Ok(out) = result {
@@ -708,7 +708,7 @@ pub fn phase_3_run_analysis_passes<'tcx, F, R>(sess: &'tcx Session,
708708
stability::Index::new(krate),
709709
|tcx| {
710710

711-
// passes are timed inside typeck
711+
// passes are timed inside typeck
712712
typeck::check_crate(tcx, trait_map);
713713

714714
time(time_passes,
@@ -722,7 +722,7 @@ pub fn phase_3_run_analysis_passes<'tcx, F, R>(sess: &'tcx Session,
722722
external_exports)
723723
});
724724

725-
// Do not move this check past lint
725+
// Do not move this check past lint
726726
time(time_passes, "stability index", || {
727727
tcx.stability.borrow_mut().build(tcx, krate, &public_items)
728728
});
@@ -755,11 +755,11 @@ pub fn phase_3_run_analysis_passes<'tcx, F, R>(sess: &'tcx Session,
755755
"rvalue checking",
756756
|| middle::check_rvalues::check_crate(tcx, krate));
757757

758-
// Avoid overwhelming user with errors if type checking failed.
759-
// I'm not sure how helpful this is, to be honest, but it avoids a
760-
// lot of annoying errors in the compile-fail tests (basically,
761-
// lint warnings and so on -- kindck used to do this abort, but
762-
// kindck is gone now). -nmatsakis
758+
// Avoid overwhelming user with errors if type checking failed.
759+
// I'm not sure how helpful this is, to be honest, but it avoids a
760+
// lot of annoying errors in the compile-fail tests (basically,
761+
// lint warnings and so on -- kindck used to do this abort, but
762+
// kindck is gone now). -nmatsakis
763763
tcx.sess.abort_if_errors();
764764

765765
let reachable_map =
@@ -787,7 +787,7 @@ pub fn phase_3_run_analysis_passes<'tcx, F, R>(sess: &'tcx Session,
787787
"lint checking",
788788
|| lint::check_crate(tcx, krate, &exported_items));
789789

790-
// The above three passes generate errors w/o aborting
790+
// The above three passes generate errors w/o aborting
791791
tcx.sess.abort_if_errors();
792792

793793
f(tcx,
@@ -859,7 +859,7 @@ pub fn phase_6_link_output(sess: &Session,
859859
fn escape_dep_filename(filename: &str) -> String {
860860
// Apparently clang and gcc *only* escape spaces:
861861
// http://llvm.org/klaus/clang/commit/9d50634cfc268ecc9a7250226dd5ca0e945240d4
862-
filename.replace(" ", "\")
862+
filename.replace(" ", "\\")
863863
}
864864

865865
fn write_out_deps(sess: &Session, outputs: &OutputFilenames, id: &str) {
@@ -887,8 +887,8 @@ fn write_out_deps(sess: &Session, outputs: &OutputFilenames, id: &str) {
887887

888888
let result =
889889
(|| -> io::Result<()> {
890-
// Build a list of files used to compile the output and
891-
// write Makefile-compatible dependency rules
890+
// Build a list of files used to compile the output and
891+
// write Makefile-compatible dependency rules
892892
let files: Vec<String> = sess.codemap()
893893
.files
894894
.borrow()
@@ -902,9 +902,9 @@ fn write_out_deps(sess: &Session, outputs: &OutputFilenames, id: &str) {
902902
try!(write!(file, "{}: {}\n\n", path.display(), files.join(" ")));
903903
}
904904

905-
// Emit a fake target for each input file to the compilation. This
906-
// prevents `make` from spitting out an error if a file is later
907-
// deleted. For more info see #28735
905+
// Emit a fake target for each input file to the compilation. This
906+
// prevents `make` from spitting out an error if a file is later
907+
// deleted. For more info see #28735
908908
for path in files {
909909
try!(writeln!(file, "{}:", path));
910910
}

src/librustc_driver/lib.rs

+8-9
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,8 @@ pub fn run_compiler<'a>(args: &[String], callbacks: &mut CompilerCalls<'a>) {
153153
pretty::pretty_print_input(sess, cfg, &input, ppm, opt_uii, ofile);
154154
return;
155155
}
156-
None => {/* continue */
156+
// continue
157+
None => {
157158
}
158159
}
159160

@@ -509,6 +510,7 @@ pub fn version(binary: &str, matches: &getopts::Matches) {
509510
}
510511
}
511512

513+
#[rustfmt_skip]
512514
fn usage(verbose: bool, include_unstable_options: bool) {
513515
let groups = if verbose {
514516
config::rustc_optgroups()
@@ -527,23 +529,20 @@ fn usage(verbose: bool, include_unstable_options: bool) {
527529
};
528530
println!("{}\nAdditional help:
529531
-C help Print codegen options
530-
-W help \
531-
Print 'lint' options and default settings
532-
-Z help Print internal \
533-
options for debugging rustc{}\n",
532+
-W help Print 'lint' options and default settings
533+
-Z help Print internal options for debugging rustc{}\n",
534534
getopts::usage(&message, &groups),
535535
extra_help);
536536
}
537537

538+
#[rustfmt_skip]
538539
fn describe_lints(lint_store: &lint::LintStore, loaded_plugins: bool) {
539540
println!("
540541
Available lint options:
541542
-W <foo> Warn about <foo>
542-
-A <foo> \
543-
Allow <foo>
543+
-A <foo> Allow <foo>
544544
-D <foo> Deny <foo>
545-
-F <foo> Forbid <foo> \
546-
(deny, and deny all overrides)
545+
-F <foo> Forbid <foo> deny, and deny all overrides)
547546
548547
");
549548

src/librustc_driver/pretty.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -793,8 +793,7 @@ pub fn pretty_print_input(sess: Session,
793793
debug!("pretty printing flow graph for {:?}", opt_uii);
794794
let uii = opt_uii.unwrap_or_else(|| {
795795
sess.fatal(&format!("`pretty flowgraph=..` needs NodeId (int) or
796-
\
797-
unique path suffix (b::c::d)"))
796+
unique path suffix (b::c::d)"))
798797

799798
});
800799
let ast_map = ast_map.expect("--pretty flowgraph missing ast_map");

0 commit comments

Comments
 (0)