Skip to content

Commit d2469d9

Browse files
committed
---
yaml --- r: 2588 b: refs/heads/master c: f300de2 h: refs/heads/master v: v3
1 parent 6f23304 commit d2469d9

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 5047ab0b0cc84af577d1a0816d2496986397e967
2+
refs/heads/master: f300de2963a35047fbd317002efea9b017cbb916

trunk/src/comp/driver/session.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,11 @@ state obj session(ast::crate_num cnum,
102102
emit_diagnostic(sp, msg, "warning", 11u8, cm);
103103
}
104104

105+
fn span_note(span sp, str msg) {
106+
// FIXME: Use constants, but rustboot doesn't know how to export them.
107+
emit_diagnostic(sp, msg, "note", 10u8, cm);
108+
}
109+
105110
fn bug(str msg) {
106111
log_err #fmt("error: internal compiler error %s", msg);
107112
fail;

trunk/src/comp/middle/tstate/ck.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,11 @@ fn check_states_against_conditions(&fn_ctxt fcx, &_fn f, &ann a) -> () {
141141
/* fcx.ccx.tcx.sess.span_err(f.body.span, "Function " +
142142
fcx.name + " may not return. Its declared return type is "
143143
+ util.common.ty_to_str(*f.decl.output)); */
144-
log_err("WARNING: Function " +
145-
fcx.name + " may not return. Its declared return type is "
146-
+ ty_to_str(*f.decl.output));
144+
fcx.ccx.tcx.sess.span_warn(f.body.span, "not all control paths " +
145+
"return a value");
146+
fcx.ccx.tcx.sess.span_note(f.decl.output.span,
147+
"see declared return type of '" + ty_to_str(*f.decl.output) +
148+
"'");
147149
}
148150

149151
}

0 commit comments

Comments
 (0)