Position::ArgumentNamed(s) if s == sym::from_method => (),
// `{from_desugaring}` is allowed
Position::ArgumentNamed(s) if s == sym::from_desugaring => (),
+ // `{ItemContext}` is allowed
+ Position::ArgumentNamed(s) if s == sym::item_context => (),
// So is `{A}` if A is a type parameter
Position::ArgumentNamed(s) => match generics.params.iter().find(|param| {
param.name == s
let s = self.0.as_str();
let parser = Parser::new(&s, None, vec![], false);
+ let item_context = (options.get(&sym::item_context)).unwrap_or(&empty_string);
parser.map(|p|
match p {
Piece::String(s) => s,
} else if s == sym::from_desugaring || s == sym::from_method {
// don't break messages using these two arguments incorrectly
&empty_string
+ } else if s == sym::item_context {
+ &item_context
} else {
bug!("broken on_unimplemented {:?} for {:?}: \
no argument matching {:?}",