Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit cf5fd89

Browse files
committedMay 4, 2022
Auto merge of #96692 - ehuss:beta-backports, r=ehuss
[beta] Beta backports * Revert diagnostic duplication and accidental stabilization #96516 * Revert "Re-export core::ffi types from std::ffi" #96492 * Make [e]println macros eagerly drop temporaries (for backport) #96490 * Revert "impl From<&[T; N]> and From<&mut [T; N]> for Vec<T>" #96489 * Cargo: * move workspace inheritance unstable docs to the correct place (rust-lang/cargo#10616)
2 parents 69a6d12 + 1c78743 commit cf5fd89

File tree

53 files changed

+111
-450
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+111
-450
lines changed
 

‎compiler/rustc_typeck/src/check/check.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,12 @@ pub(super) fn check_fn<'a, 'tcx>(
102102
DUMMY_SP,
103103
param_env,
104104
));
105+
// HACK(oli-obk): we rewrite the declared return type, too, so that we don't end up inferring all
106+
// unconstrained RPIT to have `()` as their hidden type. This would happen because further down we
107+
// compare the ret_coercion with declared_ret_ty, and anything uninferred would be inferred to the
108+
// opaque type itself. That again would cause writeback to assume we have a recursive call site
109+
// and do the sadly stabilized fallback to `()`.
110+
let declared_ret_ty = ret_ty;
105111
fcx.ret_coercion = Some(RefCell::new(CoerceMany::new(ret_ty)));
106112
fcx.ret_type_span = Some(decl.output.span());
107113

‎library/alloc/src/vec/mod.rs

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -2931,48 +2931,6 @@ impl<T, const N: usize> From<[T; N]> for Vec<T> {
29312931
}
29322932
}
29332933

2934-
#[cfg(not(no_global_oom_handling))]
2935-
#[stable(feature = "vec_from_array_ref", since = "1.61.0")]
2936-
impl<T: Clone, const N: usize> From<&[T; N]> for Vec<T> {
2937-
/// Allocate a `Vec<T>` and fill it by cloning `s`'s items.
2938-
///
2939-
/// # Examples
2940-
///
2941-
/// ```
2942-
/// assert_eq!(Vec::from(b"raw"), vec![b'r', b'a', b'w']);
2943-
/// ```
2944-
#[cfg(not(test))]
2945-
fn from(s: &[T; N]) -> Vec<T> {
2946-
s.to_vec()
2947-
}
2948-
2949-
#[cfg(test)]
2950-
fn from(s: &[T; N]) -> Vec<T> {
2951-
crate::slice::to_vec(s, Global)
2952-
}
2953-
}
2954-
2955-
#[cfg(not(no_global_oom_handling))]
2956-
#[stable(feature = "vec_from_array_ref", since = "1.61.0")]
2957-
impl<T: Clone, const N: usize> From<&mut [T; N]> for Vec<T> {
2958-
/// Allocate a `Vec<T>` and fill it by cloning `s`'s items.
2959-
///
2960-
/// # Examples
2961-
///
2962-
/// ```
2963-
/// assert_eq!(Vec::from(&mut [1, 2, 3]), vec![1, 2, 3]);
2964-
/// ```
2965-
#[cfg(not(test))]
2966-
fn from(s: &mut [T; N]) -> Vec<T> {
2967-
s.to_vec()
2968-
}
2969-
2970-
#[cfg(test)]
2971-
fn from(s: &mut [T; N]) -> Vec<T> {
2972-
crate::slice::to_vec(s, Global)
2973-
}
2974-
}
2975-
29762934
#[stable(feature = "vec_from_cow_slice", since = "1.14.0")]
29772935
impl<'a, T> From<Cow<'a, [T]>> for Vec<T>
29782936
where

0 commit comments

Comments
 (0)
Please sign in to comment.