@@ -44,7 +44,7 @@ Previously, `panic!` made use of the `file!()`, `line!()`, and `column!()` macro
44
44
location, so functions which intentionally invoked ` panic! ` couldn't provide their own location,
45
45
hiding the actual source of error.
46
46
47
- Internally, ` panic!() ` now calls [ ` core::panid ::Location::caller() ` ] [ wrapper ] to find out where it
47
+ Internally, ` panic!() ` now calls [ ` core::panic ::Location::caller() ` ] [ wrapper ] to find out where it
48
48
was expanded. This function is itself annotated with ` #[track_caller] ` and wraps the
49
49
[ ` caller_location ` ] [ intrinsic ] compiler intrinsic implemented by rustc. This intrinsic is easiest
50
50
explained in terms of how it works in a ` const ` context.
@@ -67,7 +67,7 @@ return the span of the *previous* frame which was the "topmost" tracked function
67
67
68
68
### Allocating a static ` Location `
69
69
70
- Once we have a ` Span ` we need to allocate static memory for the ` Location ` , which is performed by
70
+ Once we have a ` Span ` , we need to allocate static memory for the ` Location ` , which is performed by
71
71
the [ ` TyCtxt::const_caller_location() ` ] [ const-location-query ] query. Internally this calls
72
72
[ ` InterpCx::alloc_caller_location() ` ] [ alloc-location ] and results in a unique
73
73
[ memory kind] [ location-memory-kind ] . The SSA codegen backend is able to emit code for these same
@@ -77,7 +77,7 @@ Once our `Location` has been allocated in static memory, our intrinsic returns a
77
77
78
78
## Generating code for ` #[track_caller] ` callees
79
79
80
- To generate efficient code for a tracked function and its callers we need to provide the same
80
+ To generate efficient code for a tracked function and its callers, we need to provide the same
81
81
behavior from the intrinsic's point of view without having a stack to walk up at runtime. We invert
82
82
the approach: as we grow the stack down we pass an additional argument to calls of tracked functions
83
83
rather than walking up the stack when the intrinsic is called. That additional argument can be
@@ -157,8 +157,8 @@ probably the best we can do without modifying fully-stabilized type signatures.
157
157
158
158
The ` #[track_caller] ` attribute is checked alongside other codegen attrs to ensure the function:
159
159
160
- * has ` "Rust" ` ABI (as opposed to ` "C" ` , etc... )
161
- * is not a foreign import (e.g. in an ` extern {...} ` block)
160
+ * has the ` "Rust" ` ABI (as opposed to e.g., ` "C" ` )
161
+ * is not a foreign import (e.g., in an ` extern {...} ` block)
162
162
* is not a closure
163
163
* is not ` #[naked] `
164
164
0 commit comments