Skip to content

Commit d609c1b

Browse files
author
Paolo Tranquilli
committed
Rust: fix OrPat.toString
1 parent fd45e11 commit d609c1b

File tree

4 files changed

+44
-44
lines changed

4 files changed

+44
-44
lines changed

rust/ql/lib/codeql/rust/elements/internal/OrPatImpl.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ module Impl {
2222
*/
2323
class OrPat extends Generated::OrPat {
2424
override string toString() {
25-
result = concat(int i | | this.getPat(i).toAbbreviatedString() order by i, " | ")
25+
result = concat(int i | | this.getPat(i).toAbbreviatedString(), " | " order by i)
2626
}
2727

2828
/** Gets the last pattern in this or pattern. */
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
| gen_or_pat.rs:6:9:6:38 | ...Option::None | getNumberOfPats: | 2 |
1+
| gen_or_pat.rs:6:9:6:38 | ... \| Option::None | getNumberOfPats: | 2 |
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
| gen_or_pat.rs:6:9:6:38 | ...Option::None | 0 | gen_or_pat.rs:6:9:6:23 | TupleStructPat |
2-
| gen_or_pat.rs:6:9:6:38 | ...Option::None | 1 | gen_or_pat.rs:6:27:6:38 | Option::None |
1+
| gen_or_pat.rs:6:9:6:38 | ... \| Option::None | 0 | gen_or_pat.rs:6:9:6:23 | TupleStructPat |
2+
| gen_or_pat.rs:6:9:6:38 | ... \| Option::None | 1 | gen_or_pat.rs:6:27:6:38 | Option::None |

rust/ql/test/library-tests/variables/Cfg.expected

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -407,10 +407,10 @@ edges
407407
| variables.rs:190:11:190:16 | either | variables.rs:191:9:191:24 | TupleStructPat | |
408408
| variables.rs:191:9:191:24 | TupleStructPat | variables.rs:191:22:191:23 | a3 | match |
409409
| variables.rs:191:9:191:24 | TupleStructPat | variables.rs:191:28:191:44 | TupleStructPat | no-match |
410-
| variables.rs:191:9:191:44 | [match(true)] ...... | variables.rs:192:16:192:24 | print_i64 | match |
411-
| variables.rs:191:22:191:23 | a3 | variables.rs:191:9:191:44 | [match(true)] ...... | match |
410+
| variables.rs:191:9:191:44 | [match(true)] ... \| ... | variables.rs:192:16:192:24 | print_i64 | match |
411+
| variables.rs:191:22:191:23 | a3 | variables.rs:191:9:191:44 | [match(true)] ... \| ... | match |
412412
| variables.rs:191:28:191:44 | TupleStructPat | variables.rs:191:42:191:43 | a3 | match |
413-
| variables.rs:191:42:191:43 | a3 | variables.rs:191:9:191:44 | [match(true)] ...... | match |
413+
| variables.rs:191:42:191:43 | a3 | variables.rs:191:9:191:44 | [match(true)] ... \| ... | match |
414414
| variables.rs:192:16:192:24 | print_i64 | variables.rs:192:26:192:27 | a3 | |
415415
| variables.rs:192:16:192:28 | print_i64(...) | variables.rs:190:5:193:5 | match either { ... } | |
416416
| variables.rs:192:26:192:27 | a3 | variables.rs:192:16:192:28 | print_i64(...) | |
@@ -427,45 +427,45 @@ edges
427427
| variables.rs:204:11:204:12 | tv | variables.rs:205:9:205:30 | TupleStructPat | |
428428
| variables.rs:205:9:205:30 | TupleStructPat | variables.rs:205:28:205:29 | a4 | match |
429429
| variables.rs:205:9:205:30 | TupleStructPat | variables.rs:205:34:205:56 | TupleStructPat | no-match |
430-
| variables.rs:205:9:205:81 | [match(true)] ......... | variables.rs:206:16:206:24 | print_i64 | match |
431-
| variables.rs:205:28:205:29 | a4 | variables.rs:205:9:205:81 | [match(true)] ......... | match |
430+
| variables.rs:205:9:205:81 | [match(true)] ... \| ... \| ... | variables.rs:206:16:206:24 | print_i64 | match |
431+
| variables.rs:205:28:205:29 | a4 | variables.rs:205:9:205:81 | [match(true)] ... \| ... \| ... | match |
432432
| variables.rs:205:34:205:56 | TupleStructPat | variables.rs:205:54:205:55 | a4 | match |
433433
| variables.rs:205:34:205:56 | TupleStructPat | variables.rs:205:60:205:81 | TupleStructPat | no-match |
434-
| variables.rs:205:54:205:55 | a4 | variables.rs:205:9:205:81 | [match(true)] ......... | match |
434+
| variables.rs:205:54:205:55 | a4 | variables.rs:205:9:205:81 | [match(true)] ... \| ... \| ... | match |
435435
| variables.rs:205:60:205:81 | TupleStructPat | variables.rs:205:79:205:80 | a4 | match |
436-
| variables.rs:205:79:205:80 | a4 | variables.rs:205:9:205:81 | [match(true)] ......... | match |
436+
| variables.rs:205:79:205:80 | a4 | variables.rs:205:9:205:81 | [match(true)] ... \| ... \| ... | match |
437437
| variables.rs:206:16:206:24 | print_i64 | variables.rs:206:26:206:27 | a4 | |
438438
| variables.rs:206:16:206:28 | print_i64(...) | variables.rs:204:5:207:5 | match tv { ... } | |
439439
| variables.rs:206:26:206:27 | a4 | variables.rs:206:16:206:28 | print_i64(...) | |
440440
| variables.rs:208:5:211:5 | ExprStmt | variables.rs:208:11:208:12 | tv | |
441441
| variables.rs:208:5:211:5 | match tv { ... } | variables.rs:212:11:212:12 | tv | |
442442
| variables.rs:208:11:208:12 | tv | variables.rs:209:10:209:31 | TupleStructPat | |
443-
| variables.rs:209:9:209:83 | [match(true)] ...... | variables.rs:210:16:210:24 | print_i64 | match |
443+
| variables.rs:209:9:209:83 | [match(true)] ... \| ... | variables.rs:210:16:210:24 | print_i64 | match |
444444
| variables.rs:209:10:209:31 | TupleStructPat | variables.rs:209:29:209:30 | a5 | match |
445445
| variables.rs:209:10:209:31 | TupleStructPat | variables.rs:209:35:209:57 | TupleStructPat | no-match |
446-
| variables.rs:209:10:209:57 | [match(false)] ...... | variables.rs:209:62:209:83 | TupleStructPat | no-match |
447-
| variables.rs:209:10:209:57 | [match(true)] ...... | variables.rs:209:9:209:83 | [match(true)] ...... | match |
448-
| variables.rs:209:29:209:30 | a5 | variables.rs:209:10:209:57 | [match(true)] ...... | match |
449-
| variables.rs:209:35:209:57 | TupleStructPat | variables.rs:209:10:209:57 | [match(false)] ...... | no-match |
446+
| variables.rs:209:10:209:57 | [match(false)] ... \| ... | variables.rs:209:62:209:83 | TupleStructPat | no-match |
447+
| variables.rs:209:10:209:57 | [match(true)] ... \| ... | variables.rs:209:9:209:83 | [match(true)] ... \| ... | match |
448+
| variables.rs:209:29:209:30 | a5 | variables.rs:209:10:209:57 | [match(true)] ... \| ... | match |
449+
| variables.rs:209:35:209:57 | TupleStructPat | variables.rs:209:10:209:57 | [match(false)] ... \| ... | no-match |
450450
| variables.rs:209:35:209:57 | TupleStructPat | variables.rs:209:55:209:56 | a5 | match |
451-
| variables.rs:209:55:209:56 | a5 | variables.rs:209:10:209:57 | [match(true)] ...... | match |
451+
| variables.rs:209:55:209:56 | a5 | variables.rs:209:10:209:57 | [match(true)] ... \| ... | match |
452452
| variables.rs:209:62:209:83 | TupleStructPat | variables.rs:209:81:209:82 | a5 | match |
453-
| variables.rs:209:81:209:82 | a5 | variables.rs:209:9:209:83 | [match(true)] ...... | match |
453+
| variables.rs:209:81:209:82 | a5 | variables.rs:209:9:209:83 | [match(true)] ... \| ... | match |
454454
| variables.rs:210:16:210:24 | print_i64 | variables.rs:210:26:210:27 | a5 | |
455455
| variables.rs:210:16:210:28 | print_i64(...) | variables.rs:208:5:211:5 | match tv { ... } | |
456456
| variables.rs:210:26:210:27 | a5 | variables.rs:210:16:210:28 | print_i64(...) | |
457457
| variables.rs:212:5:215:5 | match tv { ... } | variables.rs:202:21:216:1 | { ... } | |
458458
| variables.rs:212:11:212:12 | tv | variables.rs:213:9:213:30 | TupleStructPat | |
459459
| variables.rs:213:9:213:30 | TupleStructPat | variables.rs:213:28:213:29 | a6 | match |
460460
| variables.rs:213:9:213:30 | TupleStructPat | variables.rs:213:35:213:57 | TupleStructPat | no-match |
461-
| variables.rs:213:9:213:83 | [match(true)] ...... | variables.rs:214:16:214:24 | print_i64 | match |
462-
| variables.rs:213:28:213:29 | a6 | variables.rs:213:9:213:83 | [match(true)] ...... | match |
461+
| variables.rs:213:9:213:83 | [match(true)] ... \| ... | variables.rs:214:16:214:24 | print_i64 | match |
462+
| variables.rs:213:28:213:29 | a6 | variables.rs:213:9:213:83 | [match(true)] ... \| ... | match |
463463
| variables.rs:213:35:213:57 | TupleStructPat | variables.rs:213:55:213:56 | a6 | match |
464464
| variables.rs:213:35:213:57 | TupleStructPat | variables.rs:213:61:213:82 | TupleStructPat | no-match |
465-
| variables.rs:213:35:213:82 | [match(true)] ...... | variables.rs:213:9:213:83 | [match(true)] ...... | match |
466-
| variables.rs:213:55:213:56 | a6 | variables.rs:213:35:213:82 | [match(true)] ...... | match |
465+
| variables.rs:213:35:213:82 | [match(true)] ... \| ... | variables.rs:213:9:213:83 | [match(true)] ... \| ... | match |
466+
| variables.rs:213:55:213:56 | a6 | variables.rs:213:35:213:82 | [match(true)] ... \| ... | match |
467467
| variables.rs:213:61:213:82 | TupleStructPat | variables.rs:213:80:213:81 | a6 | match |
468-
| variables.rs:213:80:213:81 | a6 | variables.rs:213:35:213:82 | [match(true)] ...... | match |
468+
| variables.rs:213:80:213:81 | a6 | variables.rs:213:35:213:82 | [match(true)] ... \| ... | match |
469469
| variables.rs:214:16:214:24 | print_i64 | variables.rs:214:26:214:27 | a6 | |
470470
| variables.rs:214:16:214:28 | print_i64(...) | variables.rs:212:5:215:5 | match tv { ... } | |
471471
| variables.rs:214:26:214:27 | a6 | variables.rs:214:16:214:28 | print_i64(...) | |
@@ -481,12 +481,12 @@ edges
481481
| variables.rs:220:11:220:16 | either | variables.rs:221:9:221:24 | TupleStructPat | |
482482
| variables.rs:221:9:221:24 | TupleStructPat | variables.rs:221:22:221:23 | a7 | match |
483483
| variables.rs:221:9:221:24 | TupleStructPat | variables.rs:221:28:221:44 | TupleStructPat | no-match |
484-
| variables.rs:221:9:221:44 | [match(false)] ...... | variables.rs:224:9:224:9 | _ | no-match |
485-
| variables.rs:221:9:221:44 | [match(true)] ...... | variables.rs:222:16:222:17 | a7 | match |
486-
| variables.rs:221:22:221:23 | a7 | variables.rs:221:9:221:44 | [match(true)] ...... | match |
487-
| variables.rs:221:28:221:44 | TupleStructPat | variables.rs:221:9:221:44 | [match(false)] ...... | no-match |
484+
| variables.rs:221:9:221:44 | [match(false)] ... \| ... | variables.rs:224:9:224:9 | _ | no-match |
485+
| variables.rs:221:9:221:44 | [match(true)] ... \| ... | variables.rs:222:16:222:17 | a7 | match |
486+
| variables.rs:221:22:221:23 | a7 | variables.rs:221:9:221:44 | [match(true)] ... \| ... | match |
487+
| variables.rs:221:28:221:44 | TupleStructPat | variables.rs:221:9:221:44 | [match(false)] ... \| ... | no-match |
488488
| variables.rs:221:28:221:44 | TupleStructPat | variables.rs:221:42:221:43 | a7 | match |
489-
| variables.rs:221:42:221:43 | a7 | variables.rs:221:9:221:44 | [match(true)] ...... | match |
489+
| variables.rs:221:42:221:43 | a7 | variables.rs:221:9:221:44 | [match(true)] ... \| ... | match |
490490
| variables.rs:222:16:222:17 | a7 | variables.rs:222:21:222:21 | 0 | |
491491
| variables.rs:222:16:222:21 | ... > ... | variables.rs:223:16:223:24 | print_i64 | true |
492492
| variables.rs:222:16:222:21 | ... > ... | variables.rs:224:9:224:9 | _ | false |
@@ -509,12 +509,12 @@ edges
509509
| variables.rs:232:9:233:52 | [match(true)] e | variables.rs:235:13:235:27 | ExprStmt | match |
510510
| variables.rs:233:14:233:30 | TupleStructPat | variables.rs:233:27:233:29 | a11 | match |
511511
| variables.rs:233:14:233:30 | TupleStructPat | variables.rs:233:34:233:51 | TupleStructPat | no-match |
512-
| variables.rs:233:14:233:51 | [match(false)] ...... | variables.rs:241:9:241:9 | _ | no-match |
513-
| variables.rs:233:14:233:51 | [match(true)] ...... | variables.rs:232:9:233:52 | [match(true)] e | match |
514-
| variables.rs:233:27:233:29 | a11 | variables.rs:233:14:233:51 | [match(true)] ...... | match |
515-
| variables.rs:233:34:233:51 | TupleStructPat | variables.rs:233:14:233:51 | [match(false)] ...... | no-match |
512+
| variables.rs:233:14:233:51 | [match(false)] ... \| ... | variables.rs:241:9:241:9 | _ | no-match |
513+
| variables.rs:233:14:233:51 | [match(true)] ... \| ... | variables.rs:232:9:233:52 | [match(true)] e | match |
514+
| variables.rs:233:27:233:29 | a11 | variables.rs:233:14:233:51 | [match(true)] ... \| ... | match |
515+
| variables.rs:233:34:233:51 | TupleStructPat | variables.rs:233:14:233:51 | [match(false)] ... \| ... | no-match |
516516
| variables.rs:233:34:233:51 | TupleStructPat | variables.rs:233:48:233:50 | a11 | match |
517-
| variables.rs:233:48:233:50 | a11 | variables.rs:233:14:233:51 | [match(true)] ...... | match |
517+
| variables.rs:233:48:233:50 | a11 | variables.rs:233:14:233:51 | [match(true)] ... \| ... | match |
518518
| variables.rs:234:12:240:9 | { ... } | variables.rs:231:5:242:5 | match either { ... } | |
519519
| variables.rs:235:13:235:21 | print_i64 | variables.rs:235:23:235:25 | a11 | |
520520
| variables.rs:235:13:235:26 | print_i64(...) | variables.rs:236:16:237:15 | let ... = e | |
@@ -546,18 +546,18 @@ edges
546546
| variables.rs:254:11:254:12 | fv | variables.rs:255:9:255:30 | TupleStructPat | |
547547
| variables.rs:255:9:255:30 | TupleStructPat | variables.rs:255:27:255:29 | a13 | match |
548548
| variables.rs:255:9:255:30 | TupleStructPat | variables.rs:255:35:255:57 | TupleStructPat | no-match |
549-
| variables.rs:255:9:255:109 | [match(true)] ......... | variables.rs:256:16:256:24 | print_i64 | match |
550-
| variables.rs:255:27:255:29 | a13 | variables.rs:255:9:255:109 | [match(true)] ......... | match |
549+
| variables.rs:255:9:255:109 | [match(true)] ... \| ... \| ... | variables.rs:256:16:256:24 | print_i64 | match |
550+
| variables.rs:255:27:255:29 | a13 | variables.rs:255:9:255:109 | [match(true)] ... \| ... \| ... | match |
551551
| variables.rs:255:35:255:57 | TupleStructPat | variables.rs:255:54:255:56 | a13 | match |
552552
| variables.rs:255:35:255:57 | TupleStructPat | variables.rs:255:61:255:82 | TupleStructPat | no-match |
553-
| variables.rs:255:35:255:82 | [match(false)] ...... | variables.rs:255:87:255:109 | TupleStructPat | no-match |
554-
| variables.rs:255:35:255:82 | [match(true)] ...... | variables.rs:255:9:255:109 | [match(true)] ......... | match |
555-
| variables.rs:255:54:255:56 | a13 | variables.rs:255:35:255:82 | [match(true)] ...... | match |
556-
| variables.rs:255:61:255:82 | TupleStructPat | variables.rs:255:35:255:82 | [match(false)] ...... | no-match |
553+
| variables.rs:255:35:255:82 | [match(false)] ... \| ... | variables.rs:255:87:255:109 | TupleStructPat | no-match |
554+
| variables.rs:255:35:255:82 | [match(true)] ... \| ... | variables.rs:255:9:255:109 | [match(true)] ... \| ... \| ... | match |
555+
| variables.rs:255:54:255:56 | a13 | variables.rs:255:35:255:82 | [match(true)] ... \| ... | match |
556+
| variables.rs:255:61:255:82 | TupleStructPat | variables.rs:255:35:255:82 | [match(false)] ... \| ... | no-match |
557557
| variables.rs:255:61:255:82 | TupleStructPat | variables.rs:255:79:255:81 | a13 | match |
558-
| variables.rs:255:79:255:81 | a13 | variables.rs:255:35:255:82 | [match(true)] ...... | match |
558+
| variables.rs:255:79:255:81 | a13 | variables.rs:255:35:255:82 | [match(true)] ... \| ... | match |
559559
| variables.rs:255:87:255:109 | TupleStructPat | variables.rs:255:106:255:108 | a13 | match |
560-
| variables.rs:255:106:255:108 | a13 | variables.rs:255:9:255:109 | [match(true)] ......... | match |
560+
| variables.rs:255:106:255:108 | a13 | variables.rs:255:9:255:109 | [match(true)] ... \| ... \| ... | match |
561561
| variables.rs:256:16:256:24 | print_i64 | variables.rs:256:26:256:28 | a13 | |
562562
| variables.rs:256:16:256:29 | print_i64(...) | variables.rs:254:5:257:5 | match fv { ... } | |
563563
| variables.rs:256:26:256:28 | a13 | variables.rs:256:16:256:29 | print_i64(...) | |
@@ -587,10 +587,10 @@ edges
587587
| variables.rs:272:5:272:50 | ...: Either | variables.rs:274:5:274:18 | ExprStmt | |
588588
| variables.rs:272:6:272:21 | TupleStructPat | variables.rs:272:19:272:20 | a9 | match |
589589
| variables.rs:272:6:272:21 | TupleStructPat | variables.rs:272:25:272:41 | TupleStructPat | no-match |
590-
| variables.rs:272:6:272:41 | [match(true)] ...... | variables.rs:272:5:272:50 | ...: Either | match |
591-
| variables.rs:272:19:272:20 | a9 | variables.rs:272:6:272:41 | [match(true)] ...... | match |
590+
| variables.rs:272:6:272:41 | [match(true)] ... \| ... | variables.rs:272:5:272:50 | ...: Either | match |
591+
| variables.rs:272:19:272:20 | a9 | variables.rs:272:6:272:41 | [match(true)] ... \| ... | match |
592592
| variables.rs:272:25:272:41 | TupleStructPat | variables.rs:272:39:272:40 | a9 | match |
593-
| variables.rs:272:39:272:40 | a9 | variables.rs:272:6:272:41 | [match(true)] ...... | match |
593+
| variables.rs:272:39:272:40 | a9 | variables.rs:272:6:272:41 | [match(true)] ... \| ... | match |
594594
| variables.rs:273:9:275:1 | { ... } | variables.rs:271:1:275:1 | exit fn param_pattern2 (normal) | |
595595
| variables.rs:274:5:274:13 | print_i64 | variables.rs:274:15:274:16 | a9 | |
596596
| variables.rs:274:5:274:17 | print_i64(...) | variables.rs:273:9:275:1 | { ... } | |

0 commit comments

Comments
 (0)