review comments: modify note wording and change println

- Don't print the newline on its own to avoid the possibility of
  printing it out of order due to `stdout` locking.
- Modify wording of `concat!()` with non-literals to not mislead into
  believing that only `&str` literals are accepted.
- Add test for `concat!()` with non-literals.
This commit is contained in:
Esteban Küber
2018-07-15 11:52:11 -07:00
committed by Esteban Küber
parent f53c145ef1
commit fbce952193
5 changed files with 34 additions and 14 deletions

View File

@@ -58,7 +58,7 @@ pub fn expand_syntax_ext(
}
if missing_literal.len() > 0 {
let mut err = cx.struct_span_err(missing_literal, "expected a literal");
err.note("only `&str` literals can be passed to `concat!()`");
err.note("only literals (like `\"foo\"`, `42` and `3.14`) can be passed to `concat!()`");
err.emit();
}
let sp = sp.apply_mark(cx.current_expansion.mark);