-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
Closed as not planned
Closed as not planned
Copy link
Labels
C-bugCategory: This is a bug.Category: This is a bug.P-mediumMedium priorityMedium priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.Performance or correctness regression from one stable version to another.
Description
The following compiles with rustc 1.7.0 and earlier, but not in 1.8.0 and later:
use std::borrow::Cow;
#[derive(Clone)]
pub struct Node {
// ...
pub children_a: &'static [Node], // Works
pub children_b: Vec<Node>, // Works
pub children_c: Cow<'static, [Node]> // Doesn't compile
}The errors:
error[E0275]: overflow evaluating the requirement `<[Node] as std::borrow::ToOwned>::Owned`
--> src/lib.rs:6:2
|
6 | pub children_a: &'static [Node],
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: required because it appears within the type `Node`
= note: required because of the requirements on the impl of `std::borrow::ToOwned` for `[Node]`
= note: required because it appears within the type `Node`
= note: slice and array elements must have `Sized` type
Since it compiles fine with the first two members (reference to slice, and Vec), I'd expect a Cow of a slice to also work. Is this a regression, or is this supposed to not compile?
LPGhatguy, randomPoison and gui1117TD5
Metadata
Metadata
Assignees
Labels
C-bugCategory: This is a bug.Category: This is a bug.P-mediumMedium priorityMedium priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.Performance or correctness regression from one stable version to another.