Skip to content

Commit cba7ac5

Browse files
committed
auto merge of #12065 : mrshu/rust/error-formating-fix, r=alexcrichton
This pull request tries to fix #12050. I went after these wrong errors quite aggressively so it might be that I also changed some strings that are not actual errors. Please point those out and I will update this pull request accordingly.
2 parents c8759f6 + ee3fa68 commit cba7ac5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+167
-167
lines changed

src/librustc/back/link.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ pub fn WriteOutputFile(
7676
let result = llvm::LLVMRustWriteOutputFile(
7777
Target, PM, M, Output, FileType);
7878
if !result {
79-
llvm_err(sess, ~"Could not write output");
79+
llvm_err(sess, ~"could not write output");
8080
}
8181
})
8282
}
@@ -189,7 +189,7 @@ pub mod write {
189189
for pass in sess.opts.custom_passes.iter() {
190190
pass.with_c_str(|s| {
191191
if !llvm::LLVMRustAddPass(mpm, s) {
192-
sess.warn(format!("Unknown pass {}, ignoring", *pass));
192+
sess.warn(format!("unknown pass {}, ignoring", *pass));
193193
}
194194
})
195195
}
@@ -876,11 +876,11 @@ fn link_binary_output(sess: Session,
876876
let obj_is_writeable = is_writeable(&obj_filename);
877877
let out_is_writeable = is_writeable(&out_filename);
878878
if !out_is_writeable {
879-
sess.fatal(format!("Output file {} is not writeable -- check its permissions.",
879+
sess.fatal(format!("output file {} is not writeable -- check its permissions.",
880880
out_filename.display()));
881881
}
882882
else if !obj_is_writeable {
883-
sess.fatal(format!("Object file {} is not writeable -- check its permissions.",
883+
sess.fatal(format!("object file {} is not writeable -- check its permissions.",
884884
obj_filename.display()));
885885
}
886886

src/librustc/driver/session.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ impl Session_ {
308308
// This exists to help with refactoring to eliminate impossible
309309
// cases later on
310310
pub fn impossible_case(&self, sp: Span, msg: &str) -> ! {
311-
self.span_bug(sp, format!("Impossible case reached: {}", msg));
311+
self.span_bug(sp, format!("impossible case reached: {}", msg));
312312
}
313313
pub fn verbose(&self) -> bool { self.debugging_opt(VERBOSE) }
314314
pub fn time_passes(&self) -> bool { self.debugging_opt(TIME_PASSES) }

src/librustc/metadata/tydecode.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,7 @@ fn parse_sig(st: &mut PState, conv: conv_did) -> ty::FnSig {
527527
let variadic = match next(st) {
528528
'V' => true,
529529
'N' => false,
530-
r => fail!(format!("Bad variadic: {}", r)),
530+
r => fail!(format!("bad variadic: {}", r)),
531531
};
532532
let ret_ty = parse_ty(st, |x,y| conv(x,y));
533533
ty::FnSig {binder_id: id,

src/librustc/metadata/tyencode.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ fn enc_region(w: &mut MemWriter, cx: @ctxt, r: ty::Region) {
195195
}
196196
ty::ReInfer(_) => {
197197
// these should not crop up after typeck
198-
cx.diag.handler().bug("Cannot encode region variables");
198+
cx.diag.handler().bug("cannot encode region variables");
199199
}
200200
}
201201
}
@@ -320,7 +320,7 @@ fn enc_sty(w: &mut MemWriter, cx: @ctxt, st: &ty::sty) {
320320
enc_bare_fn_ty(w, cx, f);
321321
}
322322
ty::ty_infer(_) => {
323-
cx.diag.handler().bug("Cannot encode inference variable types");
323+
cx.diag.handler().bug("cannot encode inference variable types");
324324
}
325325
ty::ty_param(param_ty {idx: id, def_id: did}) => {
326326
mywrite!(w, "p{}|{}", (cx.ds)(did), id);
@@ -334,7 +334,7 @@ fn enc_sty(w: &mut MemWriter, cx: @ctxt, st: &ty::sty) {
334334
enc_substs(w, cx, substs);
335335
mywrite!(w, "]");
336336
}
337-
ty::ty_err => fail!("Shouldn't encode error type")
337+
ty::ty_err => fail!("shouldn't encode error type")
338338
}
339339
}
340340

src/librustc/middle/borrowck/gather_loans/lifetime.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ impl<'a> GuaranteeLifetimeContext<'a> {
215215
// the check above should fail for anything is not ReScope
216216
self.bccx.tcx.sess.span_bug(
217217
cmt_base.span,
218-
format!("Cannot issue root for scope region: {:?}",
218+
format!("cannot issue root for scope region: {:?}",
219219
self.loan_region));
220220
}
221221
};

src/librustc/middle/borrowck/gather_loans/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ impl<'a> GatherLoanCtxt<'a> {
496496
ty::ReInfer(..) => {
497497
self.tcx().sess.span_bug(
498498
cmt.span,
499-
format!("Invalid borrow lifetime: {:?}", loan_region));
499+
format!("invalid borrow lifetime: {:?}", loan_region));
500500
}
501501
};
502502
debug!("loan_scope = {:?}", loan_scope);
@@ -820,7 +820,7 @@ impl<'a> GatherLoanCtxt<'a> {
820820
_ => {
821821
self.tcx().sess.span_bug(
822822
pat.span,
823-
format!("Type of slice pattern is not a slice"));
823+
format!("type of slice pattern is not a slice"));
824824
}
825825
}
826826
}

src/librustc/middle/borrowck/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -769,14 +769,14 @@ impl BorrowckCtxt {
769769
}
770770
_ => {
771771
self.tcx.sess.bug(
772-
format!("Loan path LpVar({:?}) maps to {:?}, not local",
772+
format!("loan path LpVar({:?}) maps to {:?}, not local",
773773
id, pat));
774774
}
775775
}
776776
}
777777
r => {
778778
self.tcx.sess.bug(
779-
format!("Loan path LpVar({:?}) maps to {:?}, not local",
779+
format!("loan path LpVar({:?}) maps to {:?}, not local",
780780
id, r));
781781
}
782782
}

src/librustc/middle/borrowck/move_data.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,7 @@ impl MoveData {
494494
dfcx_assign.add_kill(kill_id, assignment_index);
495495
}
496496
LpExtend(..) => {
497-
tcx.sess.bug("Var assignment for non var path");
497+
tcx.sess.bug("var assignment for non var path");
498498
}
499499
}
500500
}

src/librustc/middle/cfg/construct.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -507,13 +507,13 @@ impl CFGBuilder {
507507
}
508508
self.tcx.sess.span_bug(
509509
expr.span,
510-
format!("No loop scope for id {:?}", loop_id));
510+
format!("no loop scope for id {:?}", loop_id));
511511
}
512512

513513
r => {
514514
self.tcx.sess.span_bug(
515515
expr.span,
516-
format!("Bad entry `{:?}` in def_map for label", r));
516+
format!("bad entry `{:?}` in def_map for label", r));
517517
}
518518
}
519519
}

src/librustc/middle/check_match.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -971,7 +971,7 @@ fn check_legality_of_move_bindings(cx: &MatchCheckCtxt,
971971
_ => {
972972
cx.tcx.sess.span_bug(
973973
p.span,
974-
format!("Binding pattern {} is \
974+
format!("binding pattern {} is \
975975
not an identifier: {:?}",
976976
p.id, p.node));
977977
}

0 commit comments

Comments
 (0)