-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
C-bugCategory: This is a bug.Category: This is a bug.I-unsoundIssue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/SoundnessIssue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/SoundnessT-typesRelevant to the types team, which will review and decide on the PR/issue.Relevant to the types team, which will review and decide on the PR/issue.
Description
I tried this code:
trait Foo {
const ASSOC: [u8];
}
fn bar<T: Foo>() {
let a = [T::ASSOC; 2];
}
fn main() {}
I expected to see this happen: It should not compile as the local variable a
has type [[u8]; 2]
which is not well formed
Instead, this happened: it compiled 😬
Meta
playground version
:
Nightly channel
Build using the Nightly version: 1.71.0-nightly
(2023-04-30 9ecda8de85ce893cc3fc)
Backtrace
<backtrace>
Metadata
Metadata
Assignees
Labels
C-bugCategory: This is a bug.Category: This is a bug.I-unsoundIssue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/SoundnessIssue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/SoundnessT-typesRelevant to the types team, which will review and decide on the PR/issue.Relevant to the types team, which will review and decide on the PR/issue.