TPE: Always shadow the original variable#2299
TPE: Always shadow the original variable#2299john-h-kastner-aws merged 2 commits intocedar-policy:mainfrom
Conversation
| value: false.into(), | ||
| ty: ty.clone(), | ||
| }), | ||
| Residual::Partial { .. } => { |
There was a problem hiding this comment.
ugh, this diff doesn't render well in Github (in VS Code it's better). What I did was just to add a new {} block so I could redefine the right variable, and removed the unnecessary clone.
There was a problem hiding this comment.
Setting "hide whitespace" fixes the diff
| _ => Residual::Partial { | ||
| kind: ResidualKind::And { | ||
| left: Arc::new(left), | ||
| right: Arc::new(right), |
There was a problem hiding this comment.
note: I removed the unnecessary clone here now
| _ => Residual::Partial { | ||
| kind: ResidualKind::Or { | ||
| left: Arc::new(left), | ||
| right: Arc::new(right), |
There was a problem hiding this comment.
note: I removed the unnecessary clone here now
f304aad to
ac0831d
Compare
Coverage ReportHead Commit: Base Commit: Download the full coverage report. Coverage of Added or Modified Lines of Rust CodeRequired coverage: 80.00% Actual coverage: 100.00% Status: PASSED ✅ Details
Coverage of All Lines of Rust CodeRequired coverage: 80.00% Actual coverage: 87.65% Status: PASSED ✅ Details
|
ac0831d to
c83b0d9
Compare
Coverage ReportHead Commit: Base Commit: Download the full coverage report. Coverage of Added or Modified Lines of Rust CodeRequired coverage: 80.00% Actual coverage: 100.00% Status: PASSED ✅ Details
Coverage of All Lines of Rust CodeRequired coverage: 80.00% Actual coverage: 87.65% Status: PASSED ✅ Details
|
Signed-off-by: Lucas Käldström <lucas.kaldstrom@upbound.io>
Signed-off-by: Lucas Käldström <lucas.kaldstrom@upbound.io>
c83b0d9 to
b5c08a3
Compare
Coverage ReportHead Commit: Base Commit: Download the full coverage report. Coverage of Added or Modified Lines of Rust CodeRequired coverage: 80.00% Actual coverage: 100.00% Status: PASSED ✅ Details
Coverage of All Lines of Rust CodeRequired coverage: 80.00% Actual coverage: 87.65% Status: PASSED ✅ Details
|
Coverage ReportHead Commit: Base Commit: Download the full coverage report. Coverage of Added or Modified Lines of Rust CodeRequired coverage: 80.00% Actual coverage: 100.00% Status: PASSED ✅ Details
Coverage of All Lines of Rust CodeRequired coverage: 80.00% Actual coverage: 87.65% Status: PASSED ✅ Details
|
Description of changes
Broken out from #2162.
Follow the pattern of shadowing the un-evaluated variable when interpreting it partially, so that the later code can never accidentally use/returned the initial/un-evaluated data.
Issue #, if available
Checklist for requesting a review
The change in this PR is (choose one, and delete the other options):
cedar-policy-core,cedar-validator, etc.)I confirm that this PR (choose one, and delete the other options):
I confirm that
cedar-spec(choose one, and delete the other options):I confirm that
docs.cedarpolicy.com(choose one, and delete the other options):