diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2024-07-26 14:02:15 +1000 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2024-07-26 17:37:03 +1000 |
| commit | 6e87858f26bcb9fadbd60f9e8ee24816a55faa80 (patch) | |
| tree | 3db9649b27baed46e9324385c3aeb1f6e4479128 /compiler/rustc_parse/src/errors.rs | |
| parent | a560810a69a09452b4cd0c3173b6af98496dba35 (diff) | |
| download | rust-6e87858f26bcb9fadbd60f9e8ee24816a55faa80.tar.gz rust-6e87858f26bcb9fadbd60f9e8ee24816a55faa80.zip | |
Fix a comment.
Imagine you have replace ranges (2..20,X) and (5..15,Y), and these tokens: ``` a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x ``` If we replace (5..15,Y) first, then (2..20,X) we get this sequence ``` a,b,c,d,e,Y,_,_,_,_,_,_,_,_,_,p,q,r,s,t,u,v,w,x a,b,X,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,u,v,w,x ``` which is what we want. If we do it in the other order, we get this: ``` a,b,X,_,_,_,_,_,_,_,_,_,_,_,_,p,q,r,s,t,u,v,w,x a,b,X,_,_,Y,_,_,_,_,_,_,_,_,_,_,_,_,_,_,u,v,w,x ``` which is wrong. So it's true that we need the `.rev()` but the comment is wrong about why.
Diffstat (limited to 'compiler/rustc_parse/src/errors.rs')
0 files changed, 0 insertions, 0 deletions
