Skip to content

Commit ebd5bea

Browse files
committed
Revert inference failure from Deref/Borrow constification
1 parent 469357e commit ebd5bea

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

library/alloc/src/borrow.rs

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,13 @@ use crate::fmt;
1616
#[cfg(not(no_global_oom_handling))]
1717
use crate::string::String;
1818

19+
// FIXME(inference): const bounds removed due to inference regressions found by crater;
20+
// see https://github.com/rust-lang/rust/issues/147964
21+
// #[rustc_const_unstable(feature = "const_convert", issue = "143773")]
1922
#[stable(feature = "rust1", since = "1.0.0")]
20-
#[rustc_const_unstable(feature = "const_convert", issue = "143773")]
21-
impl<'a, B: ?Sized> const Borrow<B> for Cow<'a, B>
22-
where
23-
B: ToOwned,
24-
B::Owned: [const] Borrow<B>,
23+
impl<'a, B: ?Sized + ToOwned> Borrow<B> for Cow<'a, B>
24+
// where
25+
// B::Owned: [const] Borrow<B>,
2526
{
2627
fn borrow(&self) -> &B {
2728
&**self
@@ -327,11 +328,13 @@ impl<B: ?Sized + ToOwned> Cow<'_, B> {
327328
}
328329
}
329330

331+
// FIXME(inference): const bounds removed due to inference regressions found by crater;
332+
// see https://github.com/rust-lang/rust/issues/147964
333+
// #[rustc_const_unstable(feature = "const_convert", issue = "143773")]
330334
#[stable(feature = "rust1", since = "1.0.0")]
331-
#[rustc_const_unstable(feature = "const_convert", issue = "143773")]
332-
impl<B: ?Sized + ToOwned> const Deref for Cow<'_, B>
333-
where
334-
B::Owned: [const] Borrow<B>,
335+
impl<B: ?Sized + ToOwned> Deref for Cow<'_, B>
336+
// where
337+
// B::Owned: [const] Borrow<B>,
335338
{
336339
type Target = B;
337340

0 commit comments

Comments
 (0)