File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
compiler/rustc_middle/src/mir/interpret Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -127,6 +127,15 @@ impl<Tag> Allocation<Tag> {
127
127
pub fn uninit ( size : Size , align : Align ) -> InterpResult < ' static , Self > {
128
128
let mut bytes = Vec :: new ( ) ;
129
129
bytes. try_reserve ( size. bytes_usize ( ) ) . map_err ( |_| {
130
+ // This results in an error that can happen non-deterministically, since the memory
131
+ // available to the compiler can change between runs. Normally queries are always
132
+ // deterministic. However, we can be non-determinstic here because all uses of const
133
+ // evaluation do one of:
134
+ // - cause a fatal compiler error when they see this error as the result of const
135
+ // evaluation
136
+ // - panic on evaluation failure
137
+ // - always evaluate very small constants that are practically unlikely to result in
138
+ // memory exhaustion
130
139
InterpError :: ResourceExhaustion ( ResourceExhaustionInfo :: MemoryExhausted )
131
140
} ) ?;
132
141
bytes. resize ( size. bytes_usize ( ) , 0 ) ;
You can’t perform that action at this time.
0 commit comments