Rollup merge of #96143 - Urgau:rustdoc-fix-snapshot-bless, r=GuillaumeGomez

Fix snapshot --bless not working anymore in htmldocck

I broke it in https://github.com/rust-lang/rust/pull/95933

r? ```@GuillaumeGomez```
This commit is contained in:
Dylan DPC 2022-04-18 18:22:05 +02:00 committed by GitHub
commit 9c1c8b2dff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -423,8 +423,12 @@ def check_snapshot(snapshot_name, actual_tree, normalize_to_text):
else:
actual_str = flatten(actual_tree)
# Conditions:
# 1. Is --bless
# 2. Are actual and expected tree different
# 3. Are actual and expected text different
if not expected_str \
or (not normalize_to_text and
or (not normalize_to_text and \
not compare_tree(make_xml(actual_str), make_xml(expected_str), stderr)) \
or (normalize_to_text and actual_str != expected_str):