[][src]Module c2rust_refactor::span_fix

This module contains some AST folds for fixing up span information. There are a few sources of bogus spans, which cause major confusion during rewriting.

  • format!. The expansion of format!("...", x) copies the span of the expression x to a number of other nodes, such as &x, the __arg0 pattern used to match x, and the reference to std::fmt::Display::fmt used to format x. We'd like to detect all of these bogus spans and reset them.

Functions

fix_attr_spans
fix_format