Files
rust/compiler
Jynn Nelson fa9162d06f Allow printing a fully-qualified path in def_path_str
Previously, the local crate would always be printed as a leading `crate::`.
Allow resolving it to the crate name instead.

This allows printing a fully qualified path with:
```rust
let qualified_name = with_no_visible_paths!(with_resolve_crate_name!(
    with_no_trimmed_paths!(tcx.def_path_str(def_id))
));
```

I found this useful for an out-of-tree rustc-driver. I do not currently
have a usecase in mind upstream; I'm ok if you don't want this PR for
that reason.

This does not currently have tests. I am not aware of an easy way to
test def-id printing, since it requires having access to a TyCtxt.
2025-10-08 08:38:25 -04:00
..
2025-08-27 20:25:18 +02:00
2025-09-26 16:37:08 +02:00
2025-09-08 09:23:37 -07:00
2025-09-27 11:29:50 +02:00
2025-09-17 04:46:46 +02:00
2025-09-17 04:46:46 +02:00