about summary refs log tree commit diff
path: root/tests/codegen/patchable-function-entry
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2024-02-02 15:44:22 +1100
committerNicholas Nethercote <n.nethercote@gmail.com>2024-02-05 21:27:01 +1100
commit18f51f79f31a022257c0c1fe7501d4af141d3bad (patch)
tree5fdab7a24019e67f0460f971192b1a41d2db1c11 /tests/codegen/patchable-function-entry
parenta0958082b36bd47ee5a71cad32f41b2906db46b8 (diff)
downloadrust-18f51f79f31a022257c0c1fe7501d4af141d3bad.tar.gz
rust-18f51f79f31a022257c0c1fe7501d4af141d3bad.zip
Make `Emitter::emit_diagnostic` consuming.
All the other `emit`/`emit_diagnostic` methods were recently made
consuming (e.g. #119606), but this one wasn't. But it makes sense to.

Much of this is straightforward, and lots of `clone` calls are avoided.
There are a couple of tricky bits.
- `Emitter::primary_span_formatted` no longer takes a `Diagnostic` and
  returns a pair. Instead it takes the two fields from `Diagnostic` that
  it used (`span` and `suggestions`) as `&mut`, and modifies them. This
  is necessary to avoid the cloning of `diag.children` in two emitters.
- `from_errors_diagnostic` is rearranged so various uses of `diag` occur
  before the consuming `emit_diagnostic` call.
Diffstat (limited to 'tests/codegen/patchable-function-entry')
0 files changed, 0 insertions, 0 deletions