Remove impl traits bindings error message handling on AST lowering

This commit is contained in:
Santiago Pastorino 2021-07-14 15:48:33 -03:00
parent ac3a43b316
commit bc106ebb5a
No known key found for this signature in database
GPG Key ID: 8131A24E0C79EFAF

View File

@ -1465,17 +1465,12 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
))
}
ImplTraitContext::Disallowed(pos) => {
let allowed_in = if self.sess.features_untracked().impl_trait_in_bindings {
"bindings or function and inherent method return types"
} else {
"function and inherent method return types"
};
let mut err = struct_span_err!(
self.sess,
t.span,
E0562,
"`impl Trait` not allowed outside of {}",
allowed_in,
"function and inherent method return types",
);
if pos == ImplTraitPosition::Binding && self.sess.is_nightly_build() {
err.help(