-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
Returning [i128::MIN; 1] from a function actually returns [0i128; 1] #101585
Copy link
Copy link
Closed
Labels
A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.A-codegenArea: Code generationArea: Code generationC-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/SoundnessP-criticalCritical priorityCritical priority
Metadata
Metadata
Assignees
Labels
A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.A-codegenArea: Code generationArea: Code generationC-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/SoundnessP-criticalCritical priorityCritical priority
Type
Fields
Give feedbackNo fields configured for issues without a type.
Array created using repeat expression
[i128::MIN; 1]and returned from a function actually returns[0i128; 1].Interestingly the problem does not happen when using the list syntax
[i128::MIN]to create the array.I tried this code:
I expected to see this happen: the second
assert_eqshould passInstead, this happened: the second
assert_eqfails screaming thatMeta
Problem exists on stable, beta and nightly
rustc --version --verbose:Backtrace