Skip to content

Commit 8e47182

Browse files
authored
Rollup merge of rust-lang#72445 - anp:stabilize-track-caller, r=oli-obk
Stabilize `#[track_caller]`. # Stabilization Report RFC: [2091] Tracking issue: rust-lang#47809 ## Summary From the [rustc-dev-guide chapter][dev-guide]: > Take this example program: ```rust fn main() { let foo: Option<()> = None; foo.unwrap(); // this should produce a useful panic message! } ``` > Prior to Rust 1.42, panics like this `unwrap()` printed a location in libcore: ``` $ rustc +1.41.0 example.rs; example.exe thread 'main' panicked at 'called `Option::unwrap()` on a `None` value',...core\macros\mod.rs:15:40 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace. ``` > As of 1.42, we get a much more helpful message: ``` $ rustc +1.42.0 example.rs; example.exe thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', example.rs:3:5 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace ``` > These error messages are achieved through a combination of changes to `panic!` internals to make use of `core::panic::Location::caller` and a number of `#[track_caller]` annotations in the standard library which propagate caller information. The attribute adds an implicit caller location argument to the ABI of annotated functions, but does not affect the type or MIR of the function. We implement the feature entirely in codegen and in the const evaluator. ## Bottom Line This PR stabilizes the use of `#[track_caller]` everywhere, including traits and extern blocks. It also stabilizes `core::panic::Location::caller`, although the use of that function in a const context remains gated by `#![feature(const_caller_location)]`. The implementation for the feature already changed the output of panic messages for a number of std functions, as described in the [1.42 release announcement]. The attribute's use in `Index` and `IndexMut` traits is visible to users since 1.44. ## Tests All of the tests for this feature live under [src/test/ui/rfc-2091-track-caller][tests] in the repo. Noteworthy cases: * [use of attr in std] * validates user-facing benefit of the feature * [trait attribute inheritance] * covers subtle behavior designed during implementation and not RFC'd * [const/codegen equivalence] * this was the result of a suspected edge case and investigation * [diverging function support] * covers an unresolved question from the RFC * [fn pointers and shims] * covers important potential sources of unsoundness ## Documentation The rustc-dev-guide now has a chapter on [Implicit Caller Location][dev-guide]. I have an [open PR to the reference][attr-reference-pr] documenting the attribute. The intrinsic's [wrapper] includes some examples as well. ## Implementation History * 2019-10-02: [`#[track_caller]` feature gate (RFC 2091 1/N) rust-lang#65037](rust-lang#65037) * Picked up the patch that @ayosec had started on the feature gate. * 2019-10-13: [Add `Instance::resolve_for_fn_ptr` (RFC 2091 rust-lang#2/N) rust-lang#65182](rust-lang#65182) * 2019-10-20: ~~[WIP Add MIR argument for #[track_caller] (RFC 2091 3/N) rust-lang#65258](rust-lang#65258 * Abandoned approach to send location as a MIR argument. * 2019-10-28: [`std::panic::Location` is a lang_item, add `core::intrinsics::caller_location` (RFC 2091 3/N) rust-lang#65664](rust-lang#65664) * 2019-12-07: [Implement #[track_caller] attribute. (RFC 2091 4/N) rust-lang#65881](rust-lang#65881) * 2020-01-04: [libstd uses `core::panic::Location` where possible. rust-lang#67137](rust-lang#67137) * 2020-01-08: [`Option::{expect,unwrap}` and `Result::{expect, expect_err, unwrap, unwrap_err}` have `#[track_caller]` rust-lang#67887](rust-lang#67887) * 2020-01-20: [Fix #[track_caller] and function pointers rust-lang#68302](rust-lang#68302) (fixed rust-lang#68178) * 2020-03-23: [#[track_caller] in traits rust-lang#69251](rust-lang#69251) * 2020-03-24: [#[track_caller] on core::ops::{Index, IndexMut}. rust-lang#70234](rust-lang#70234) * 2020-04-08 [Support `#[track_caller]` on functions in `extern "Rust" { ... }` rust-lang#70916](rust-lang#70916) ## Unresolveds ### From the RFC > Currently the RFC simply prohibit applying #[track_caller] to trait methods as a future-proofing > measure. **Resolved.** See the dev-guide documentation and the tests section above. > Diverging functions should be supported. **Resolved.** See the tests section above. > The closure foo::{{closure}} should inherit most attributes applied to the function foo, ... **Resolved.** This unknown was related to specifics of the implementation which were made irrelevant by the final implementation. ### Binary Size I [instrumented track_caller to use custom sections][measure-size] in a local build and discovered relatively minor binary size usage for the feature overall. I'm leaving the issue open to discuss whether we want to upstream custom section support. There's an [open issue to discuss mitigation strategies][mitigate-size]. Some decisions remain about the "right" strategies to reduce size without overly constraining the compiler implementation. I'd be excited to see someone carry that work forward but my opinion is that we shouldn't block stabilization on implementing compiler flags for redaction. ### Specialization There's an [open issue][specialization] on the semantics of the attribute in specialization chains. I'm inclined to move forward with stabilization without an exact resolution here given that specialization is itself unstable, but I also think it should be an easy question to resolve. ### Location only points to the start of a call span rust-lang#69977 was resolved by rust-lang#73182, and the next step should probably be to [extend `Location` with a notion of the end of a call](rust-lang#73554). ### Regression of std's panic messages rust-lang#70963 should be resolved by serializing span hygeine to crate metadata: rust-lang#68686. [2091]: https://github.com/rust-lang/rfcs/blob/master/text/2091-inline-semantic.md [dev-guide]: https://rustc-dev-guide.rust-lang.org/codegen/implicit-caller-location.html [specialization]: rust-lang#70293 [measure-size]: rust-lang#70579 [mitigate-size]: rust-lang#70580 [attr-reference-pr]: rust-lang/reference#742 [wrapper]: https://doc.rust-lang.org/nightly/core/panic/struct.Location.html#method.caller [tests]: https://github.com/rust-lang/rust/tree/master/src/test/ui/rfc-2091-track-caller [const/codegen equivalence]: https://github.com/rust-lang/rust/blob/master/src/test/ui/rfc-2091-track-caller/caller-location-fnptr-rt-ctfe-equiv.rs [diverging function support]: https://github.com/rust-lang/rust/blob/master/src/test/ui/rfc-2091-track-caller/diverging-caller-location.rs [use of attr in std]: https://github.com/rust-lang/rust/blob/master/src/test/ui/rfc-2091-track-caller/std-panic-locations.rs [fn pointers and shims]: https://github.com/rust-lang/rust/blob/master/src/test/ui/rfc-2091-track-caller/tracked-fn-ptr-with-arg.rs [trait attribute inheritance]: https://github.com/rust-lang/rust/blob/master/src/test/ui/rfc-2091-track-caller/tracked-trait-impls.rs [1.42 release announcement]: https://blog.rust-lang.org/2020/03/12/Rust-1.42.html#useful-line-numbers-in-option-and-result-panic-messages
2 parents a1528c4 + 135ca38 commit 8e47182

37 files changed

+35
-98
lines changed

src/doc/unstable-book/src/language-features/track-caller.md

-5
This file was deleted.

src/libcore/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@
118118
#![feature(staged_api)]
119119
#![feature(std_internals)]
120120
#![feature(stmt_expr_attributes)]
121-
#![feature(track_caller)]
121+
#![cfg_attr(bootstrap, feature(track_caller))]
122122
#![feature(transparent_unions)]
123123
#![feature(unboxed_closures)]
124124
#![feature(unsized_locals)]

src/libcore/macros/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#[doc(include = "panic.md")]
22
#[macro_export]
3-
#[allow_internal_unstable(core_panic, track_caller)]
3+
#[allow_internal_unstable(core_panic, const_caller_location)]
44
#[stable(feature = "core", since = "1.6.0")]
55
macro_rules! panic {
66
() => (

src/libcore/panic.rs

+4-10
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,6 @@ impl<'a> Location<'a> {
190190
/// # Examples
191191
///
192192
/// ```
193-
/// #![feature(track_caller)]
194193
/// use core::panic::Location;
195194
///
196195
/// /// Returns the [`Location`] at which it is called.
@@ -206,7 +205,7 @@ impl<'a> Location<'a> {
206205
///
207206
/// let fixed_location = get_just_one_location();
208207
/// assert_eq!(fixed_location.file(), file!());
209-
/// assert_eq!(fixed_location.line(), 15);
208+
/// assert_eq!(fixed_location.line(), 14);
210209
/// assert_eq!(fixed_location.column(), 5);
211210
///
212211
/// // running the same untracked function in a different location gives us the same result
@@ -217,7 +216,7 @@ impl<'a> Location<'a> {
217216
///
218217
/// let this_location = get_caller_location();
219218
/// assert_eq!(this_location.file(), file!());
220-
/// assert_eq!(this_location.line(), 29);
219+
/// assert_eq!(this_location.line(), 28);
221220
/// assert_eq!(this_location.column(), 21);
222221
///
223222
/// // running the tracked function in a different location produces a different value
@@ -226,13 +225,8 @@ impl<'a> Location<'a> {
226225
/// assert_ne!(this_location.line(), another_location.line());
227226
/// assert_ne!(this_location.column(), another_location.column());
228227
/// ```
229-
// FIXME: When stabilizing this method, please also update the documentation
230-
// of `intrinsics::caller_location`.
231-
#[unstable(
232-
feature = "track_caller",
233-
reason = "uses #[track_caller] which is not yet stable",
234-
issue = "47809"
235-
)]
228+
#[stable(feature = "track_caller", since = "1.46.0")]
229+
#[rustc_const_unstable(feature = "const_caller_location", issue = "47809")]
236230
#[track_caller]
237231
pub const fn caller() -> &'static Location<'static> {
238232
crate::intrinsics::caller_location()

src/librustc_error_codes/error_codes/E0736.md

-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
Erroneous code example:
44

55
```compile_fail,E0736
6-
#![feature(track_caller)]
7-
86
#[naked]
97
#[track_caller]
108
fn foo() {}

src/librustc_error_codes/error_codes/E0737.md

-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ restrictions.
55
Erroneous code example:
66

77
```compile_fail,E0737
8-
#![feature(track_caller)]
9-
108
#[track_caller]
119
extern "C" fn foo() {}
1210
```

src/librustc_error_codes/error_codes/E0739.md

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
Erroneous code example:
44

55
```compile_fail,E0739
6-
#![feature(track_caller)]
76
#[track_caller]
87
struct Bar {
98
a: u8,

src/librustc_errors/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/")]
66
#![feature(crate_visibility_modifier)]
77
#![feature(nll)]
8-
#![feature(track_caller)]
8+
#![cfg_attr(bootstrap, feature(track_caller))]
99

1010
pub use emitter::ColorConfig;
1111

src/librustc_feature/accepted.rs

+3
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,9 @@ declare_features! (
265265
(accepted, const_if_match, "1.45.0", Some(49146), None),
266266
/// Allows the use of `loop` and `while` in constants.
267267
(accepted, const_loop, "1.45.0", Some(52000), None),
268+
/// Allows `#[track_caller]` to be used which provides
269+
/// accurate caller location reporting during panic (RFC 2091).
270+
(accepted, track_caller, "1.46.0", Some(47809), None),
268271

269272
// -------------------------------------------------------------------------
270273
// feature-group-end: accepted features

src/librustc_feature/active.rs

-4
Original file line numberDiff line numberDiff line change
@@ -494,10 +494,6 @@ declare_features! (
494494
/// Allows the use of raw-dylibs (RFC 2627).
495495
(active, raw_dylib, "1.40.0", Some(58713), None),
496496

497-
/// Allows `#[track_caller]` to be used which provides
498-
/// accurate caller location reporting during panic (RFC 2091).
499-
(active, track_caller, "1.40.0", Some(47809), None),
500-
501497
/// Allows making `dyn Trait` well-formed even if `Trait` is not object safe.
502498
/// In that case, `dyn Trait: Trait` does not hold. Moreover, coercions and
503499
/// casts in safe Rust to `dyn Trait` for such a `Trait` is also forbidden.

src/librustc_feature/builtin_attrs.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,7 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
260260
ungated!(cold, Whitelisted, template!(Word)),
261261
ungated!(no_builtins, Whitelisted, template!(Word)),
262262
ungated!(target_feature, Whitelisted, template!(List: r#"enable = "name""#)),
263+
ungated!(track_caller, Whitelisted, template!(Word)),
263264
gated!(
264265
no_sanitize, Whitelisted,
265266
template!(List: "address, memory, thread"),
@@ -333,7 +334,6 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
333334
gated!(ffi_returns_twice, Whitelisted, template!(Word), experimental!(ffi_returns_twice)),
334335
gated!(ffi_pure, Whitelisted, template!(Word), experimental!(ffi_pure)),
335336
gated!(ffi_const, Whitelisted, template!(Word), experimental!(ffi_const)),
336-
gated!(track_caller, Whitelisted, template!(Word), experimental!(track_caller)),
337337
gated!(
338338
register_attr, CrateLevel, template!(List: "attr1, attr2, ..."),
339339
experimental!(register_attr),

src/librustc_middle/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
#![feature(or_patterns)]
4343
#![feature(range_is_empty)]
4444
#![feature(min_specialization)]
45-
#![feature(track_caller)]
45+
#![cfg_attr(bootstrap, feature(track_caller))]
4646
#![feature(trusted_len)]
4747
#![feature(stmt_expr_attributes)]
4848
#![feature(test)]

src/libstd/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@
316316
#![feature(toowned_clone_into)]
317317
#![feature(total_cmp)]
318318
#![feature(trace_macros)]
319-
#![feature(track_caller)]
319+
#![cfg_attr(bootstrap, feature(track_caller))]
320320
#![feature(try_reserve)]
321321
#![feature(unboxed_closures)]
322322
#![feature(untagged_unions)]

src/test/ui/feature-gates/feature-gate-track_caller.rs

-5
This file was deleted.

src/test/ui/feature-gates/feature-gate-track_caller.stderr

-12
This file was deleted.

src/test/ui/macros/issue-68060.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#![feature(track_caller)]
2-
31
fn main() {
42
(0..)
53
.map(

src/test/ui/macros/issue-68060.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0658]: `#[target_feature(..)]` can only be applied to `unsafe` functions
2-
--> $DIR/issue-68060.rs:6:13
2+
--> $DIR/issue-68060.rs:4:13
33
|
44
LL | #[target_feature(enable = "")]
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -11,13 +11,13 @@ LL | |_| (),
1111
= help: add `#![feature(target_feature_11)]` to the crate attributes to enable
1212

1313
error: the feature named `` is not valid for this target
14-
--> $DIR/issue-68060.rs:6:30
14+
--> $DIR/issue-68060.rs:4:30
1515
|
1616
LL | #[target_feature(enable = "")]
1717
| ^^^^^^^^^^^ `` is not valid for this target
1818

1919
error[E0737]: `#[track_caller]` requires Rust ABI
20-
--> $DIR/issue-68060.rs:9:13
20+
--> $DIR/issue-68060.rs:7:13
2121
|
2222
LL | #[track_caller]
2323
| ^^^^^^^^^^^^^^^

src/test/ui/numbers-arithmetic/saturating-float-casts.rs

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
// merged.
1010

1111
#![feature(test, stmt_expr_attributes)]
12-
#![feature(track_caller)]
1312
#![deny(overflowing_literals)]
1413
extern crate test;
1514

src/test/ui/rfc-2091-track-caller/call-chain.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
// run-pass
22

3-
#![feature(track_caller)]
4-
53
use std::panic::Location;
64

75
struct Foo;

src/test/ui/rfc-2091-track-caller/caller-location-fnptr-rt-ctfe-equiv.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
// run-pass
77
// compile-flags: -Z unleash-the-miri-inside-of-you
88

9-
#![feature(core_intrinsics, const_caller_location, track_caller, const_fn)]
9+
#![feature(core_intrinsics, const_caller_location, const_fn)]
1010

1111
type L = &'static std::panic::Location<'static>;
1212

src/test/ui/rfc-2091-track-caller/caller-location-intrinsic.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
// run-pass
22

3-
#![feature(track_caller)]
4-
53
#[inline(never)]
64
#[track_caller]
75
fn codegen_caller_loc() -> &'static core::panic::Location<'static> {
@@ -15,13 +13,13 @@ macro_rules! caller_location_from_macro {
1513
fn main() {
1614
let loc = codegen_caller_loc();
1715
assert_eq!(loc.file(), file!());
18-
assert_eq!(loc.line(), 16);
16+
assert_eq!(loc.line(), 14);
1917
assert_eq!(loc.column(), 15);
2018

2119
// `Location::caller()` in a macro should behave similarly to `file!` and `line!`,
2220
// i.e. point to where the macro was invoked, instead of the macro itself.
2321
let loc2 = caller_location_from_macro!();
2422
assert_eq!(loc2.file(), file!());
25-
assert_eq!(loc2.line(), 23);
23+
assert_eq!(loc2.line(), 21);
2624
assert_eq!(loc2.column(), 16);
2725
}

src/test/ui/rfc-2091-track-caller/const-caller-location.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// run-pass
22

3-
#![feature(const_fn, track_caller)]
3+
#![feature(const_caller_location, const_fn)]
44

55
use std::panic::Location;
66

src/test/ui/rfc-2091-track-caller/diverging-caller-location.rs

-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
//! we don't inspect the location returned -- it would be difficult to distinguish between the
77
//! explicit panic and a failed assertion. That it compiles and runs is enough for this one.
88
9-
#![feature(track_caller)]
10-
119
#[track_caller]
1210
fn doesnt_return() -> ! {
1311
let _location = core::panic::Location::caller();

src/test/ui/rfc-2091-track-caller/error-odd-syntax.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#![feature(track_caller)]
2-
31
#[track_caller(1)]
42
fn f() {}
53
//~^^ ERROR malformed `track_caller` attribute input

src/test/ui/rfc-2091-track-caller/error-odd-syntax.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: malformed `track_caller` attribute input
2-
--> $DIR/error-odd-syntax.rs:3:1
2+
--> $DIR/error-odd-syntax.rs:1:1
33
|
44
LL | #[track_caller(1)]
55
| ^^^^^^^^^^^^^^^^^^ help: must be of the form: `#[track_caller]`

src/test/ui/rfc-2091-track-caller/error-with-invalid-abi.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#![feature(track_caller)]
2-
31
#[track_caller]
42
extern "C" fn f() {}
53
//~^^ ERROR `#[track_caller]` requires Rust ABI

src/test/ui/rfc-2091-track-caller/error-with-invalid-abi.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
error[E0737]: `#[track_caller]` requires Rust ABI
2-
--> $DIR/error-with-invalid-abi.rs:3:1
2+
--> $DIR/error-with-invalid-abi.rs:1:1
33
|
44
LL | #[track_caller]
55
| ^^^^^^^^^^^^^^^
66

77
error[E0737]: `#[track_caller]` requires Rust ABI
8-
--> $DIR/error-with-invalid-abi.rs:8:5
8+
--> $DIR/error-with-invalid-abi.rs:6:5
99
|
1010
LL | #[track_caller]
1111
| ^^^^^^^^^^^^^^^

src/test/ui/rfc-2091-track-caller/error-with-naked.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![feature(naked_functions, track_caller)]
1+
#![feature(naked_functions)]
22

33
#[track_caller] //~ ERROR cannot use `#[track_caller]` with `#[naked]`
44
#[naked]
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,19 @@
11
// run-pass
22

3-
#![feature(track_caller)]
4-
53
macro_rules! caller_location_from_macro {
64
() => (core::panic::Location::caller());
75
}
86

97
fn main() {
108
let loc = core::panic::Location::caller();
119
assert_eq!(loc.file(), file!());
12-
assert_eq!(loc.line(), 10);
10+
assert_eq!(loc.line(), 8);
1311
assert_eq!(loc.column(), 15);
1412

1513
// `Location::caller()` in a macro should behave similarly to `file!` and `line!`,
1614
// i.e. point to where the macro was invoked, instead of the macro itself.
1715
let loc2 = caller_location_from_macro!();
1816
assert_eq!(loc2.file(), file!());
19-
assert_eq!(loc2.line(), 17);
17+
assert_eq!(loc2.line(), 15);
2018
assert_eq!(loc2.column(), 16);
2119
}

src/test/ui/rfc-2091-track-caller/only-for-fns.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#![feature(track_caller)]
2-
31
#[track_caller]
42
struct S;
53
//~^^ ERROR attribute should be applied to function

src/test/ui/rfc-2091-track-caller/only-for-fns.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0739]: attribute should be applied to function
2-
--> $DIR/only-for-fns.rs:3:1
2+
--> $DIR/only-for-fns.rs:1:1
33
|
44
LL | #[track_caller]
55
| ^^^^^^^^^^^^^^^

src/test/ui/rfc-2091-track-caller/pass.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
// run-pass
2-
#![feature(track_caller)]
3-
42
#[track_caller]
53
fn f() {}
64

src/test/ui/rfc-2091-track-caller/track-caller-attribute.rs

+4-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
// run-pass
22

3-
#![feature(track_caller)]
4-
53
use std::panic::Location;
64

75
#[track_caller]
@@ -20,21 +18,21 @@ fn nested_tracked() -> &'static Location<'static> {
2018
fn main() {
2119
let location = Location::caller();
2220
assert_eq!(location.file(), file!());
23-
assert_eq!(location.line(), 21);
21+
assert_eq!(location.line(), 19);
2422
assert_eq!(location.column(), 20);
2523

2624
let tracked = tracked();
2725
assert_eq!(tracked.file(), file!());
28-
assert_eq!(tracked.line(), 26);
26+
assert_eq!(tracked.line(), 24);
2927
assert_eq!(tracked.column(), 19);
3028

3129
let nested = nested_intrinsic();
3230
assert_eq!(nested.file(), file!());
33-
assert_eq!(nested.line(), 13);
31+
assert_eq!(nested.line(), 11);
3432
assert_eq!(nested.column(), 5);
3533

3634
let contained = nested_tracked();
3735
assert_eq!(contained.file(), file!());
38-
assert_eq!(contained.line(), 17);
36+
assert_eq!(contained.line(), 15);
3937
assert_eq!(contained.column(), 5);
4038
}

0 commit comments

Comments
 (0)