Stabilize AFIT and RPITIT

This commit is contained in:
Michael Goulet
2023-09-13 16:04:42 +00:00
parent 57ef889852
commit 59315b8a63
229 changed files with 284 additions and 1032 deletions

View File

@@ -783,21 +783,21 @@ fn check_impl_items_against_trait<'tcx>(
let (msg, feature) = if tcx.asyncness(def_id).is_async() {
(
format!("async {descr} in trait cannot be specialized"),
sym::async_fn_in_trait,
"async functions in traits",
)
} else {
(
format!(
"{descr} with return-position `impl Trait` in trait cannot be specialized"
),
sym::return_position_impl_trait_in_trait,
"return position `impl Trait` in traits",
)
};
tcx.sess
.struct_span_err(tcx.def_span(def_id), msg)
.note(format!(
"specialization behaves in inconsistent and \
surprising ways with `#![feature({feature})]`, \
surprising ways with {feature}, \
and for now is disallowed"
))
.emit();

View File

@@ -633,8 +633,6 @@ fn compare_asyncness<'tcx>(
/// For example, given the sample code:
///
/// ```
/// #![feature(return_position_impl_trait_in_trait)]
///
/// use std::ops::Deref;
///
/// trait Foo {