-fn format_stable_since_msg(feature: Symbol, since: Symbol) -> String {
- // "this feature has been stable since {}. Attribute no longer needed"
- format!("the feature `{}` has been stable since {} and no longer requires \
- an attribute to enable", feature, since)
+fn unnecessary_stable_feature_lint<'a, 'tcx>(
+ tcx: TyCtxt<'a, 'tcx, 'tcx>,
+ span: Span,
+ feature: Symbol,
+ since: Symbol
+) {
+ tcx.lint_node(lint::builtin::STABLE_FEATURES,
+ ast::CRATE_NODE_ID,
+ span,
+ &format!("the feature `{}` has been stable since {} and no longer requires \
+ an attribute to enable", feature, since));
+}
+
+fn duplicate_feature_err(sess: &Session, span: Span, feature: Symbol) {
+ struct_span_err!(sess, span, E0636, "the feature `{}` has already been declared", feature)
+ .emit();