File tree Expand file tree Collapse file tree 2 files changed +4
-8
lines changed
test/library-tests/type-inference Expand file tree Collapse file tree 2 files changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -352,16 +352,12 @@ class PtrMutType extends PtrType {
352352 PtrMutType ( ) { this .getStruct ( ) instanceof Builtins:: PtrMutType }
353353
354354 override string toString ( ) { result = "*mut" }
355-
356- override Location getLocation ( ) { result instanceof EmptyLocation }
357355}
358356
359357class PtrConstType extends PtrType {
360358 PtrConstType ( ) { this .getStruct ( ) instanceof Builtins:: PtrConstType }
361359
362360 override string toString ( ) { result = "*const" }
363-
364- override Location getLocation ( ) { result instanceof EmptyLocation }
365361}
366362
367363/**
Original file line number Diff line number Diff line change @@ -28,23 +28,23 @@ fn raw_mut_borrow() {
2828
2929fn raw_mut_write ( cond : bool ) {
3030 let a = 10i32 ;
31- // The type of `x ` must be inferred from the write below.
31+ // The type of `ptr_written ` must be inferred from the write below.
3232 let ptr_written = null_mut ( ) ; // $ target=null_mut type=ptr_written:TPtrMut.i32
3333 if cond {
3434 unsafe {
35- // NOTE: This write is undefined behavior because `x ` is a null pointer.
35+ // NOTE: This write is undefined behavior because `ptr_written ` is a null pointer.
3636 * ptr_written = a;
3737 let _y = * ptr_written; // $ type=_y:i32
3838 }
3939 }
4040}
4141
4242fn raw_type_from_deref ( cond : bool ) {
43- // The type of `x ` must be inferred from the read below.
43+ // The type of `ptr_read ` must be inferred from the read below.
4444 let ptr_read = null_mut ( ) ; // $ target=null_mut type=ptr_read:TPtrMut.i64
4545 if cond {
4646 unsafe {
47- // NOTE: This read is undefined behavior because `x ` is a null pointer.
47+ // NOTE: This read is undefined behavior because `ptr_read ` is a null pointer.
4848 let _y: i64 = * ptr_read;
4949 }
5050 }
You can’t perform that action at this time.
0 commit comments