Skip to content

const_caller_location should use real Span instead of DUMMY_SP #146990

@cachebag

Description

@cachebag

Background:
I was reading through the codebase and in caller_location.rs, I noticed a FIXME about the usage of DUMMY_SP but I couldn't find or see any existing tracking issue for it.

I tried this code:

// internal API, not user-facing
// fn span_as_caller_location(self, span: Span) -> ConstValue

I expected to see this happen: A tracking issue or documentation for why Span is used directly here, or any design notes.

Instead, this happened: The function passes a placeholder span, but there is no associated issue or explanation of next steps (that I could find at least, I could very well be wrong about this).

Meta

rustc --version --verbose:

rustc 1.88.0 (6b00bc388 2025-06-23)
binary: rustc
commit-hash: 6b00bc3880198600130e1cf62b8f8a93494488cc
commit-date: 2025-06-23
host: x86_64-unknown-linux-gnu
release: 1.88.0
LLVM version: 20.1.5
Backtrace

N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions