-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Open
Labels
A-associated-itemsArea: Associated items (types, constants & functions)Area: Associated items (types, constants & functions)C-bugCategory: This is a bug.Category: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️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/SoundnessP-mediumMedium priorityMedium priorityS-bug-has-testStatus: This bug is tracked inside the repo by a `known-bug` test.Status: This bug is tracked inside the repo by a `known-bug` test.T-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.fixed-by-next-solverFixed by the next-generation trait solver, `-Znext-solver`.Fixed by the next-generation trait solver, `-Znext-solver`.glacierICE tracked in rust-lang/glacier.ICE tracked in rust-lang/glacier.
Description
I tried this code: [playground]
trait WellUnformed {
type RequestNormalize;
}
impl<T: ?Sized> WellUnformed for T {
type RequestNormalize = ();
}
const _: <[[[[[[u8]]]]]] as WellUnformed>::RequestNormalize = ();
const _: <Vec<str> as WellUnformed>::RequestNormalize = ();
I expected this to error; [[[[[[u8]]]]]]
is clearly not a well-formed type, as
error[E0277]: the size for values of type
[u8]
cannot be known at compilation time
= help: the traitSized
is not implemented for[u8]
= note: slice and array elements must haveSized
type
Vec<str>
is perhaps even more cursed.
Instead: it compiles.
This is especially relevant for blanket/builtin traits which have associated types, such as marker::DiscriminantKind
and ptr::Pointee
.
- Can cause ICE: Normalization can skip WF #100041 (comment)
- Believed to not be unsound in isolation, as the non-WF type never "fully" exists.
Meta
1.64.0-nightly (2022-07-31 f9cba63)
@rustbot label +A-associated-items
Noratriebjyn514 and fmease
Metadata
Metadata
Assignees
Labels
A-associated-itemsArea: Associated items (types, constants & functions)Area: Associated items (types, constants & functions)C-bugCategory: This is a bug.Category: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️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/SoundnessP-mediumMedium priorityMedium priorityS-bug-has-testStatus: This bug is tracked inside the repo by a `known-bug` test.Status: This bug is tracked inside the repo by a `known-bug` test.T-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.fixed-by-next-solverFixed by the next-generation trait solver, `-Znext-solver`.Fixed by the next-generation trait solver, `-Znext-solver`.glacierICE tracked in rust-lang/glacier.ICE tracked in rust-lang/glacier.
Type
Projects
Status
new solver everywhere