Skip to content

Conversation

@Urgau
Copy link
Member

@Urgau Urgau commented Aug 25, 2023

This PR implements (or at least tries to) RFC 3127 trim-paths, the rustc part. That is -Zremap-path-scope with all of it's components/scopes.

@rustbot label: +F-trim-paths

@rustbot
Copy link
Collaborator

rustbot commented Aug 25, 2023

r? @compiler-errors

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Aug 25, 2023
@rustbot
Copy link
Collaborator

rustbot commented Aug 25, 2023

Some changes occurred in src/tools/clippy

cc @rust-lang/clippy

Some changes occurred to the CTFE / Miri engine

cc @rust-lang/miri

Some changes occurred to MIR optimizations

cc @rust-lang/wg-mir-opt

The Miri subtree was changed

cc @rust-lang/miri

@rustbot rustbot added the F-trim-paths Feature: trim-paths label Aug 25, 2023
@rust-log-analyzer

This comment has been minimized.

@Urgau Urgau force-pushed the rfc-3127-trim-paths branch 2 times, most recently from e0dfc35 to a8ba752 Compare August 25, 2023 15:00
@rust-log-analyzer

This comment has been minimized.

@Urgau Urgau force-pushed the rfc-3127-trim-paths branch from a8ba752 to 60e22dc Compare August 25, 2023 15:38
@rustbot
Copy link
Collaborator

rustbot commented Aug 25, 2023

Some changes occurred in compiler/rustc_codegen_cranelift

cc @bjorn3

@weihanglo
Copy link
Member

@Urgau have you started cargo part of this? I can help do that if you haven't.

@Urgau
Copy link
Member Author

Urgau commented Aug 31, 2023

@Urgau have you started cargo part of this? I can help do that if you haven't.

No, I haven't and to be honest I'm not sure when or if I would have done it any time soon.

@weihanglo
Copy link
Member

PR on cargo side rust-lang/cargo#12625

@bors
Copy link
Collaborator

bors commented Sep 8, 2023

☔ The latest upstream changes (presumably #113492) made this pull request unmergeable. Please resolve the merge conflicts.

@Urgau Urgau force-pushed the rfc-3127-trim-paths branch from 60e22dc to 4652464 Compare September 8, 2023 13:25
@bors
Copy link
Collaborator

bors commented Sep 9, 2023

☔ The latest upstream changes (presumably #115685) made this pull request unmergeable. Please resolve the merge conflicts.

@Urgau Urgau force-pushed the rfc-3127-trim-paths branch from 4652464 to c196537 Compare September 9, 2023 10:22
@bors
Copy link
Collaborator

bors commented Sep 12, 2023

☔ The latest upstream changes (presumably #115671) made this pull request unmergeable. Please resolve the merge conflicts.

@Urgau Urgau force-pushed the rfc-3127-trim-paths branch from c196537 to 5cf0767 Compare September 12, 2023 12:02
@bors
Copy link
Collaborator

bors commented Sep 25, 2023

☔ The latest upstream changes (presumably #115704) made this pull request unmergeable. Please resolve the merge conflicts.

@Urgau Urgau force-pushed the rfc-3127-trim-paths branch from 5cf0767 to 5d10381 Compare September 26, 2023 16:51
@Urgau
Copy link
Member Author

Urgau commented Sep 26, 2023

@compiler-errors This PR is waiting on you (to review).
I will continue to rebase for the time being.

Let me know if you don't have time or prefer that another reviewer takes care of reviewing this PR.

@compiler-errors
Copy link
Contributor

Sorry, I'll try to review this in a few days. If in a couple of days you still haven't heard anything, feel free to eithe bother me or re-roll the reviewer.

@compiler-errors
Copy link
Contributor

@bors r+

@bors
Copy link
Collaborator

bors commented Oct 2, 2023

📌 Commit 5d10381 has been approved by compiler-errors

It is now in the queue for this repository.

@bors bors removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 2, 2023
@Urgau Urgau force-pushed the rfc-3127-trim-paths branch from 87ed797 to 5c41de1 Compare October 17, 2023 08:12
@compiler-errors
Copy link
Contributor

@bors r+

@bors
Copy link
Collaborator

bors commented Oct 19, 2023

📌 Commit 5c41de1 has been approved by compiler-errors

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 19, 2023
@bors
Copy link
Collaborator

bors commented Oct 19, 2023

⌛ Testing commit 5c41de1 with merge 94c4e5c...

@bors
Copy link
Collaborator

bors commented Oct 19, 2023

☀️ Test successful - checks-actions
Approved by: compiler-errors
Pushing 94c4e5c to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Oct 19, 2023
@bors bors merged commit 94c4e5c into rust-lang:master Oct 19, 2023
@rustbot rustbot added this to the 1.75.0 milestone Oct 19, 2023
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (94c4e5c): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-3.4% [-3.4%, -3.4%] 1
Improvements ✅
(secondary)
-4.8% [-4.8%, -4.8%] 1
All ❌✅ (primary) -3.4% [-3.4%, -3.4%] 1

Cycles

This benchmark run did not return any relevant results for this metric.

Binary size

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
0.1% [0.1%, 0.1%] 3
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.1% [0.1%, 0.1%] 3

Bootstrap: 629.154s -> 627.8s (-0.22%)
Artifact size: 304.03 MiB -> 304.02 MiB (-0.00%)

flip1995 pushed a commit to flip1995/rust that referenced this pull request Oct 21, 2023
…r-errors

Implement rustc part of RFC 3127 trim-paths

This PR implements (or at least tries to) [RFC 3127 trim-paths](rust-lang#111540), the rustc part. That is `-Zremap-path-scope` with all of it's components/scopes.

`@rustbot` label: +F-trim-paths
bors-ferrocene bot added a commit to ferrocene/ferrocene that referenced this pull request Oct 31, 2023
74: Automated pull from upstream `master` r=tshepang a=github-actions[bot]


This PR pulls the following changes from the upstream repository:

* rust-lang/rust#117363
* rust-lang/rust#116405
* rust-lang/rust#117415
  * rust-lang/rust#117414
  * rust-lang/rust#117411
  * rust-lang/rust#117403
  * rust-lang/rust#117398
  * rust-lang/rust#117396
  * rust-lang/rust#117389
  * rust-lang/rust#116862
* rust-lang/rust#117405
  * rust-lang/rust#117395
  * rust-lang/rust#117390
  * rust-lang/rust#117383
  * rust-lang/rust#117376
  * rust-lang/rust#117370
  * rust-lang/rust#117357
  * rust-lang/rust#117356
  * rust-lang/rust#117317
  * rust-lang/rust#117132
  * rust-lang/rust#117068
  * rust-lang/rust#112463
* rust-lang/rust#117267
* rust-lang/rust#116939
* rust-lang/rust#117387
  * rust-lang/rust#117385
  * rust-lang/rust#117382
  * rust-lang/rust#117371
  * rust-lang/rust#117365
  * rust-lang/rust#117350
  * rust-lang/rust#117205
  * rust-lang/rust#117177
  * rust-lang/rust#117147
* rust-lang/rust#116485
* rust-lang/rust#117328
* rust-lang/rust#117332
* rust-lang/rust#117089
* rust-lang/rust#116733
* rust-lang/rust#116889
* rust-lang/rust#116270
* rust-lang/rust#117354
  * rust-lang/rust#117337
  * rust-lang/rust#117312
  * rust-lang/rust#117082
  * rust-lang/rust#117043
  * rust-lang/rust#115968
* rust-lang/rust#117336
  * rust-lang/rust#117325
  * rust-lang/rust#117322
  * rust-lang/rust#117259
  * rust-lang/rust#117170
* rust-lang/rust#117335
  * rust-lang/rust#117319
  * rust-lang/rust#117316
  * rust-lang/rust#117311
  * rust-lang/rust#117162
  * rust-lang/rust#115773
* rust-lang/rust#116447
* rust-lang/rust#117149
* rust-lang/rust#116240
* rust-lang/rust#117123
* rust-lang/rust#81746
* rust-lang/rust#117038
* rust-lang/rust#116609
* rust-lang/rust#117309
  * rust-lang/rust#117277
  * rust-lang/rust#117268
  * rust-lang/rust#117256
  * rust-lang/rust#117025
  * rust-lang/rust#116945
  * rust-lang/rust#116816
  * rust-lang/rust#116739
  * rust-lang/rust#116534
* rust-lang/rust#117253
* rust-lang/rust#117302
* rust-lang/rust#117197
* rust-lang/rust#116471
* rust-lang/rust#117294
  * rust-lang/rust#117287
  * rust-lang/rust#117281
  * rust-lang/rust#117270
  * rust-lang/rust#117247
  * rust-lang/rust#117246
  * rust-lang/rust#117212
  * rust-lang/rust#116834
* rust-lang/rust#103208
* rust-lang/rust#117166
* rust-lang/rust#116751
* rust-lang/rust#116858
* rust-lang/rust#117272
  * rust-lang/rust#117266
  * rust-lang/rust#117262
  * rust-lang/rust#117241
  * rust-lang/rust#117240
  * rust-lang/rust#116868
  * rust-lang/rust#114998
* rust-lang/rust#116205
* rust-lang/rust#117260
* rust-lang/rust#116035
* rust-lang/rust#113183
* rust-lang/rust#117249
  * rust-lang/rust#117243
  * rust-lang/rust#117188
  * rust-lang/rust#117114
  * rust-lang/rust#117106
  * rust-lang/rust#117032
  * rust-lang/rust#116968
* rust-lang/rust#116581
* rust-lang/rust#117228
  * rust-lang/rust#117221
  * rust-lang/rust#117214
  * rust-lang/rust#117207
  * rust-lang/rust#117202
  * rust-lang/rust#117194
  * rust-lang/rust#117143
  * rust-lang/rust#117095
  * rust-lang/rust#116905
* rust-lang/rust#117171
* rust-lang/rust#113262
* rust-lang/rust#112875
* rust-lang/rust#116983
* rust-lang/rust#117148
* rust-lang/rust#117115
* rust-lang/rust#116818
* rust-lang/rust#115872
* rust-lang/rust#117193
  * rust-lang/rust#117175
  * rust-lang/rust#117009
  * rust-lang/rust#117008
  * rust-lang/rust#116931
  * rust-lang/rust#116553
  * rust-lang/rust#116401
* rust-lang/rust#117180
  * rust-lang/rust#117173
  * rust-lang/rust#117163
  * rust-lang/rust#117159
  * rust-lang/rust#117154
  * rust-lang/rust#117152
  * rust-lang/rust#117141
  * rust-lang/rust#117111
* rust-lang/rust#117172
  * rust-lang/rust#117168
  * rust-lang/rust#117160
  * rust-lang/rust#117158
  * rust-lang/rust#117150
  * rust-lang/rust#117136
  * rust-lang/rust#117133
  * rust-lang/rust#116801
* rust-lang/rust#117165
* rust-lang/rust#117113
* rust-lang/rust#117102
* rust-lang/rust#117076
* rust-lang/rust#116236
* rust-lang/rust#116993
* rust-lang/rust#117139
* rust-lang/rust#116482
* rust-lang/rust#115796
* rust-lang/rust#117135
  * rust-lang/rust#117127
  * rust-lang/rust#117010
  * rust-lang/rust#116943
  * rust-lang/rust#116841
  * rust-lang/rust#116792
  * rust-lang/rust#116714
  * rust-lang/rust#116396
  * rust-lang/rust#116094
* rust-lang/rust#117126
  * rust-lang/rust#117105
  * rust-lang/rust#117093
  * rust-lang/rust#117092
  * rust-lang/rust#117091
  * rust-lang/rust#117081
* rust-lang/rust#116773
* rust-lang/rust#117124
* rust-lang/rust#116461
* rust-lang/rust#116435
* rust-lang/rust#116319
* rust-lang/rust#116238
* rust-lang/rust#116998
* rust-lang/rust#116300
* rust-lang/rust#117103
  * rust-lang/rust#117086
  * rust-lang/rust#117074
  * rust-lang/rust#117070
  * rust-lang/rust#117046
  * rust-lang/rust#116859
  * rust-lang/rust#107159
* rust-lang/rust#116033
* rust-lang/rust#107009
* rust-lang/rust#117087
  * rust-lang/rust#117073
  * rust-lang/rust#117064
  * rust-lang/rust#117040
  * rust-lang/rust#116978
  * rust-lang/rust#116960
* rust-lang/rust#116837
* rust-lang/rust#116835
* rust-lang/rust#116849
* rust-lang/rust#117071
  * rust-lang/rust#117069
  * rust-lang/rust#117051
  * rust-lang/rust#117049
  * rust-lang/rust#117044
  * rust-lang/rust#117042
  * rust-lang/rust#105666
* rust-lang/rust#116606
* rust-lang/rust#117066
* rust-lang/rust#115324
* rust-lang/rust#117062
* rust-lang/rust#117000
* rust-lang/rust#117007
* rust-lang/rust#117018
* rust-lang/rust#116256
* rust-lang/rust#117041
  * rust-lang/rust#117037
  * rust-lang/rust#117034
  * rust-lang/rust#116989
  * rust-lang/rust#116985
* rust-lang/rust#116950
* rust-lang/rust#116956
* rust-lang/rust#116932
* rust-lang/rust#117031
* rust-lang/rust#117030
  * rust-lang/rust#117028
  * rust-lang/rust#117026
  * rust-lang/rust#116992
  * rust-lang/rust#116981
  * rust-lang/rust#116955
  * rust-lang/rust#116928
  * rust-lang/rust#116312
* rust-lang/rust#116368
* rust-lang/rust#116922
* rust-lang/rust#117021
* rust-lang/rust#117020
  * rust-lang/rust#117019
  * rust-lang/rust#116975
  * rust-lang/rust#106601
* rust-lang/rust#116734
* rust-lang/rust#117013
  * rust-lang/rust#116995
  * rust-lang/rust#116990
  * rust-lang/rust#116974
  * rust-lang/rust#116964
  * rust-lang/rust#116961
  * rust-lang/rust#116917
  * rust-lang/rust#116911
  * rust-lang/rust#114521
* rust-lang/rust#117011
* rust-lang/rust#116958
* rust-lang/rust#116951
* rust-lang/rust#116966
* rust-lang/rust#116965
* rust-lang/rust#116962
* rust-lang/rust#116946
* rust-lang/rust#116899
* rust-lang/rust#116785
* rust-lang/rust#116838
* rust-lang/rust#116875
* rust-lang/rust#116874
* rust-lang/rust#115214
* rust-lang/rust#116810
* rust-lang/rust#116940
  * rust-lang/rust#116921
  * rust-lang/rust#116906
  * rust-lang/rust#116896
  * rust-lang/rust#116650
* rust-lang/rust#116132
* rust-lang/rust#116037
* rust-lang/rust#116923
  * rust-lang/rust#116912
  * rust-lang/rust#116908
  * rust-lang/rust#116883
  * rust-lang/rust#116829
  * rust-lang/rust#116795
  * rust-lang/rust#116761
  * rust-lang/rust#116663
* rust-lang/rust#114534
* rust-lang/rust#116402
* rust-lang/rust#116493
* rust-lang/rust#116046
* rust-lang/rust#116887
* rust-lang/rust#116885
  * rust-lang/rust#116879
  * rust-lang/rust#116870
  * rust-lang/rust#116865
  * rust-lang/rust#116856
  * rust-lang/rust#116812
* rust-lang/rust#116815
* rust-lang/rust#116814
* rust-lang/rust#116713
* rust-lang/rust#116830



Co-authored-by: Matthias Krüger <matthias.krueger@famsik.de>
Co-authored-by: antoyo <antoyo@users.noreply.github.com>
Co-authored-by: Antoni Boucher <bouanto@zoho.com>
Co-authored-by: bors <bors@rust-lang.org>
Co-authored-by: Esteban Küber <esteban@kuber.com.ar>
Co-authored-by: Kjetil Kjeka <kjetilkjeka@gmail.com>
Co-authored-by: clubby789 <jamie@hill-daniel.co.uk>
Co-authored-by: okaneco <47607823+okaneco@users.noreply.github.com>
Co-authored-by: David Tolnay <dtolnay@gmail.com>
Co-authored-by: Nadrieril <nadrieril+git@gmail.com>
Co-authored-by: Celina G. Val <celinval@amazon.com>
Co-authored-by: Ralf Jung <post@ralfj.de>
Co-authored-by: Zalathar <Zalathar@users.noreply.github.com>
Co-authored-by: Havard Eidnes <he@NetBSD.org>
Co-authored-by: Jacob Pratt <jacob@jhpratt.dev>
Co-authored-by: Kjetil Kjeka <kjetil@muybridge.com>
bors-ferrocene bot added a commit to ferrocene/ferrocene that referenced this pull request Oct 31, 2023
74: Automated pull from upstream `master` r=tshepang a=github-actions[bot]


This PR pulls the following changes from the upstream repository:

* rust-lang/rust#117363
* rust-lang/rust#116405
* rust-lang/rust#117415
  * rust-lang/rust#117414
  * rust-lang/rust#117411
  * rust-lang/rust#117403
  * rust-lang/rust#117398
  * rust-lang/rust#117396
  * rust-lang/rust#117389
  * rust-lang/rust#116862
* rust-lang/rust#117405
  * rust-lang/rust#117395
  * rust-lang/rust#117390
  * rust-lang/rust#117383
  * rust-lang/rust#117376
  * rust-lang/rust#117370
  * rust-lang/rust#117357
  * rust-lang/rust#117356
  * rust-lang/rust#117317
  * rust-lang/rust#117132
  * rust-lang/rust#117068
  * rust-lang/rust#112463
* rust-lang/rust#117267
* rust-lang/rust#116939
* rust-lang/rust#117387
  * rust-lang/rust#117385
  * rust-lang/rust#117382
  * rust-lang/rust#117371
  * rust-lang/rust#117365
  * rust-lang/rust#117350
  * rust-lang/rust#117205
  * rust-lang/rust#117177
  * rust-lang/rust#117147
* rust-lang/rust#116485
* rust-lang/rust#117328
* rust-lang/rust#117332
* rust-lang/rust#117089
* rust-lang/rust#116733
* rust-lang/rust#116889
* rust-lang/rust#116270
* rust-lang/rust#117354
  * rust-lang/rust#117337
  * rust-lang/rust#117312
  * rust-lang/rust#117082
  * rust-lang/rust#117043
  * rust-lang/rust#115968
* rust-lang/rust#117336
  * rust-lang/rust#117325
  * rust-lang/rust#117322
  * rust-lang/rust#117259
  * rust-lang/rust#117170
* rust-lang/rust#117335
  * rust-lang/rust#117319
  * rust-lang/rust#117316
  * rust-lang/rust#117311
  * rust-lang/rust#117162
  * rust-lang/rust#115773
* rust-lang/rust#116447
* rust-lang/rust#117149
* rust-lang/rust#116240
* rust-lang/rust#117123
* rust-lang/rust#81746
* rust-lang/rust#117038
* rust-lang/rust#116609
* rust-lang/rust#117309
  * rust-lang/rust#117277
  * rust-lang/rust#117268
  * rust-lang/rust#117256
  * rust-lang/rust#117025
  * rust-lang/rust#116945
  * rust-lang/rust#116816
  * rust-lang/rust#116739
  * rust-lang/rust#116534
* rust-lang/rust#117253
* rust-lang/rust#117302
* rust-lang/rust#117197
* rust-lang/rust#116471
* rust-lang/rust#117294
  * rust-lang/rust#117287
  * rust-lang/rust#117281
  * rust-lang/rust#117270
  * rust-lang/rust#117247
  * rust-lang/rust#117246
  * rust-lang/rust#117212
  * rust-lang/rust#116834
* rust-lang/rust#103208
* rust-lang/rust#117166
* rust-lang/rust#116751
* rust-lang/rust#116858
* rust-lang/rust#117272
  * rust-lang/rust#117266
  * rust-lang/rust#117262
  * rust-lang/rust#117241
  * rust-lang/rust#117240
  * rust-lang/rust#116868
  * rust-lang/rust#114998
* rust-lang/rust#116205
* rust-lang/rust#117260
* rust-lang/rust#116035
* rust-lang/rust#113183
* rust-lang/rust#117249
  * rust-lang/rust#117243
  * rust-lang/rust#117188
  * rust-lang/rust#117114
  * rust-lang/rust#117106
  * rust-lang/rust#117032
  * rust-lang/rust#116968
* rust-lang/rust#116581
* rust-lang/rust#117228
  * rust-lang/rust#117221
  * rust-lang/rust#117214
  * rust-lang/rust#117207
  * rust-lang/rust#117202
  * rust-lang/rust#117194
  * rust-lang/rust#117143
  * rust-lang/rust#117095
  * rust-lang/rust#116905
* rust-lang/rust#117171
* rust-lang/rust#113262
* rust-lang/rust#112875
* rust-lang/rust#116983
* rust-lang/rust#117148
* rust-lang/rust#117115
* rust-lang/rust#116818
* rust-lang/rust#115872
* rust-lang/rust#117193
  * rust-lang/rust#117175
  * rust-lang/rust#117009
  * rust-lang/rust#117008
  * rust-lang/rust#116931
  * rust-lang/rust#116553
  * rust-lang/rust#116401
* rust-lang/rust#117180
  * rust-lang/rust#117173
  * rust-lang/rust#117163
  * rust-lang/rust#117159
  * rust-lang/rust#117154
  * rust-lang/rust#117152
  * rust-lang/rust#117141
  * rust-lang/rust#117111
* rust-lang/rust#117172
  * rust-lang/rust#117168
  * rust-lang/rust#117160
  * rust-lang/rust#117158
  * rust-lang/rust#117150
  * rust-lang/rust#117136
  * rust-lang/rust#117133
  * rust-lang/rust#116801
* rust-lang/rust#117165
* rust-lang/rust#117113
* rust-lang/rust#117102
* rust-lang/rust#117076
* rust-lang/rust#116236
* rust-lang/rust#116993
* rust-lang/rust#117139
* rust-lang/rust#116482
* rust-lang/rust#115796
* rust-lang/rust#117135
  * rust-lang/rust#117127
  * rust-lang/rust#117010
  * rust-lang/rust#116943
  * rust-lang/rust#116841
  * rust-lang/rust#116792
  * rust-lang/rust#116714
  * rust-lang/rust#116396
  * rust-lang/rust#116094
* rust-lang/rust#117126
  * rust-lang/rust#117105
  * rust-lang/rust#117093
  * rust-lang/rust#117092
  * rust-lang/rust#117091
  * rust-lang/rust#117081
* rust-lang/rust#116773
* rust-lang/rust#117124
* rust-lang/rust#116461
* rust-lang/rust#116435
* rust-lang/rust#116319
* rust-lang/rust#116238
* rust-lang/rust#116998
* rust-lang/rust#116300
* rust-lang/rust#117103
  * rust-lang/rust#117086
  * rust-lang/rust#117074
  * rust-lang/rust#117070
  * rust-lang/rust#117046
  * rust-lang/rust#116859
  * rust-lang/rust#107159
* rust-lang/rust#116033
* rust-lang/rust#107009
* rust-lang/rust#117087
  * rust-lang/rust#117073
  * rust-lang/rust#117064
  * rust-lang/rust#117040
  * rust-lang/rust#116978
  * rust-lang/rust#116960
* rust-lang/rust#116837
* rust-lang/rust#116835
* rust-lang/rust#116849
* rust-lang/rust#117071
  * rust-lang/rust#117069
  * rust-lang/rust#117051
  * rust-lang/rust#117049
  * rust-lang/rust#117044
  * rust-lang/rust#117042
  * rust-lang/rust#105666
* rust-lang/rust#116606
* rust-lang/rust#117066
* rust-lang/rust#115324
* rust-lang/rust#117062
* rust-lang/rust#117000
* rust-lang/rust#117007
* rust-lang/rust#117018
* rust-lang/rust#116256
* rust-lang/rust#117041
  * rust-lang/rust#117037
  * rust-lang/rust#117034
  * rust-lang/rust#116989
  * rust-lang/rust#116985
* rust-lang/rust#116950
* rust-lang/rust#116956
* rust-lang/rust#116932
* rust-lang/rust#117031
* rust-lang/rust#117030
  * rust-lang/rust#117028
  * rust-lang/rust#117026
  * rust-lang/rust#116992
  * rust-lang/rust#116981
  * rust-lang/rust#116955
  * rust-lang/rust#116928
  * rust-lang/rust#116312
* rust-lang/rust#116368
* rust-lang/rust#116922
* rust-lang/rust#117021
* rust-lang/rust#117020
  * rust-lang/rust#117019
  * rust-lang/rust#116975
  * rust-lang/rust#106601
* rust-lang/rust#116734
* rust-lang/rust#117013
  * rust-lang/rust#116995
  * rust-lang/rust#116990
  * rust-lang/rust#116974
  * rust-lang/rust#116964
  * rust-lang/rust#116961
  * rust-lang/rust#116917
  * rust-lang/rust#116911
  * rust-lang/rust#114521
* rust-lang/rust#117011
* rust-lang/rust#116958
* rust-lang/rust#116951
* rust-lang/rust#116966
* rust-lang/rust#116965
* rust-lang/rust#116962
* rust-lang/rust#116946
* rust-lang/rust#116899
* rust-lang/rust#116785
* rust-lang/rust#116838
* rust-lang/rust#116875
* rust-lang/rust#116874
* rust-lang/rust#115214
* rust-lang/rust#116810
* rust-lang/rust#116940
  * rust-lang/rust#116921
  * rust-lang/rust#116906
  * rust-lang/rust#116896
  * rust-lang/rust#116650
* rust-lang/rust#116132
* rust-lang/rust#116037
* rust-lang/rust#116923
  * rust-lang/rust#116912
  * rust-lang/rust#116908
  * rust-lang/rust#116883
  * rust-lang/rust#116829
  * rust-lang/rust#116795
  * rust-lang/rust#116761
  * rust-lang/rust#116663
* rust-lang/rust#114534
* rust-lang/rust#116402
* rust-lang/rust#116493
* rust-lang/rust#116046
* rust-lang/rust#116887
* rust-lang/rust#116885
  * rust-lang/rust#116879
  * rust-lang/rust#116870
  * rust-lang/rust#116865
  * rust-lang/rust#116856
  * rust-lang/rust#116812
* rust-lang/rust#116815
* rust-lang/rust#116814
* rust-lang/rust#116713
* rust-lang/rust#116830



Co-authored-by: antoyo <antoyo@users.noreply.github.com>
Co-authored-by: Antoni Boucher <bouanto@zoho.com>
Co-authored-by: bors <bors@rust-lang.org>
Co-authored-by: Esteban Küber <esteban@kuber.com.ar>
Co-authored-by: Kjetil Kjeka <kjetilkjeka@gmail.com>
Co-authored-by: clubby789 <jamie@hill-daniel.co.uk>
Co-authored-by: okaneco <47607823+okaneco@users.noreply.github.com>
Co-authored-by: David Tolnay <dtolnay@gmail.com>
Co-authored-by: Nadrieril <nadrieril+git@gmail.com>
Co-authored-by: Celina G. Val <celinval@amazon.com>
Co-authored-by: Ralf Jung <post@ralfj.de>
Co-authored-by: Zalathar <Zalathar@users.noreply.github.com>
Co-authored-by: Havard Eidnes <he@NetBSD.org>
Co-authored-by: Jacob Pratt <jacob@jhpratt.dev>
Co-authored-by: Kjetil Kjeka <kjetil@muybridge.com>
Co-authored-by: Matthias Krüger <matthias.krueger@famsik.de>
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jan 22, 2024
Fix -Zremap-path-scope typo

This fixes a documentation typo from rust-lang#115214 where `-Zremap-path-prefix=object` should be `-Zremap-path-scope=object`.

`@rustbot` label: +F-trim-paths
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jan 22, 2024
Fix -Zremap-path-scope typo

This fixes a documentation typo from rust-lang#115214 where `-Zremap-path-prefix=object` should be `-Zremap-path-scope=object`.

``@rustbot`` label: +F-trim-paths
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jan 22, 2024
Fix -Zremap-path-scope typo

This fixes a documentation typo from rust-lang#115214 where `-Zremap-path-prefix=object` should be `-Zremap-path-scope=object`.

```@rustbot``` label: +F-trim-paths
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Jan 22, 2024
Rollup merge of rust-lang#120225 - micolous:patch-1, r=michaelwoerister

Fix -Zremap-path-scope typo

This fixes a documentation typo from rust-lang#115214 where `-Zremap-path-prefix=object` should be `-Zremap-path-scope=object`.

```@rustbot``` label: +F-trim-paths
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Jan 20, 2026
…twco

Stabilize `-Zremap-path-scope`

# Stabilization report of `--remap-path-scope`

## Summary

RFC 3127 trim-paths aims to improve the current status of sanitizing paths emitted by the compiler via the `--remap-path-prefix=FROM=TO` command line flag, by offering a profile setting named `trim-paths` in Cargo to sanitize absolute paths introduced during compilation that may be embedded in the compiled binary executable or library.

As part of that RFC the compiler was asked to add the `--remap-path-scope` command-line flag to control the scoping of how paths get remapped in the resulting binary.

Tracking:

- rust-lang#111540

### What is stabilized

The rustc `--remap-path-scope` flag is being stabilized by this PR. It defines which scopes of paths should be remapped by `--remap-path-prefix`.

This flag accepts a comma-separated list of values and may be specified multiple times, in which case the scopes are aggregated together.

The valid scopes are:

- `macro` - apply remappings to the expansion of `std::file!()` macro. This is where paths in embedded panic messages come from
- `diagnostics` - apply remappings to printed compiler diagnostics
- `debuginfo` - apply remappings to debug informations
- `coverage` - apply remappings to coverage informations
- `object` - apply remappings to all paths in compiled executables or libraries, but not elsewhere. Currently an alias for `macro,coverage,debuginfo`.
- `all` (default) - an alias for all of the above, also equivalent to supplying only `--remap-path-prefix` without `--remap-path-scope`.

#### Example

```sh
# With `object` scope only the build outputs will be remapped, the diagnostics won't be remapped.
rustc --remap-path-prefix=$(PWD)=/remapped --remap-path-scope=object main.rs
```

### What isn't stabilized

None of the Cargo facility is being stabilized in this stabilization PR, only the `--remap-path-scope` flag in `rustc` is being stabilized.

## Design

### RFC history

- [RFC3127 - trim-paths](https://rust-lang.github.io/rfcs/3127-trim-paths.html)

### Answers to unresolved questions

> What questions were left unresolved by the RFC? How have they been answered? Link to any relevant lang decisions.

There are no unresolved questions regarding `--remap-path-scope`.

(The tracking issue list a bunch of unresolved questions but they are for `--remap-path-prefix` or the bigger picture `trim-paths` in Cargo and are not related the functionality provided by `--remap-path-scope`.)

### Post-RFC changes

The RFC described more scopes, in particularly regarding split debuginfo. Those scopes where removed after analysis by `michaelwoerister` of all the possible combinations in rust-lang#111540 (comment).

### Nightly extensions

There are no nightly extensions.

### Doors closed

We are committing to having to having a flag that control which paths are being remapped based on a "scope".

## Feedback

### Call for testing

> Has a "call for testing" been done? If so, what feedback was received?

No call for testing has been done per se but feedback has been received on both the rust-lang/rust and rust-lang/cargo tracking issue.

The feedback was mainly related to deficiencies in *our best-effort* `--remap-path-prefix` implementation, in particular regarding linkers added paths, which does not change anything for `--remap-path-scope`.

### Nightly use

> Do any known nightly users use this feature? Counting instances of `#![feature(FEATURE_NAME)]` on GitHub with grep might be informative.

Except for Cargo unstable `trim-paths` there doesn't appear any committed use [on GitHub](https://github.com/search?q=%22--remap-path-scope%22+NOT+path%3A%2F%5Esrc%5C%2Fcargo%5C%2Fcore%5C%2Fcompiler%5C%2F%2F+NOT+path%3A%2F%5Etext%5C%2F%2F+NOT+path%3A%2F%5Erust%5C%2Fsrc%5C%2Fdoc%5C%2Funstable-book%5C%2Fsrc%5C%2Fcompiler-flags%5C%2F%2F+NOT+path%3A%2F%5Esrc%5C%2Fdoc%5C%2Funstable-book%5C%2Fsrc%5C%2Fcompiler-flags%5C%2F%2F+NOT+path%3A%2F%5Ecollector%5C%2Fcompile-benchmarks%5C%2Fcargo-0%5C.87%5C.1%5C%2Fsrc%5C%2Fcargo%5C%2Fcore%5C%2Fcompiler%5C%2F%2F&type=code).

## Implementation

### Major parts

- https://github.com/rust-lang/rust/blob/b3f8586fb1e4859678d6b231e780ff81801d2282/compiler/rustc_session/src/config.rs#L1373-L1384
- https://github.com/rust-lang/rust/blob/b3f8586fb1e4859678d6b231e780ff81801d2282/compiler/rustc_session/src/session.rs#L1526
- https://github.com/rust-lang/rust/blob/b3f8586fb1e4859678d6b231e780ff81801d2282/compiler/rustc_span/src/lib.rs#L352-L372

### Coverage

- [`tests/run-make/split-debuginfo/rmake.rs`](https://github.com/rust-lang/rust/blob/9725c4baacef19345e13f91b27e66e10ef5592ae/tests/run-make/split-debuginfo/rmake.rs#L7)
- [`tests/ui/errors/remap-path-prefix.rs`](https://github.com/rust-lang/rust/blob/9725c4baacef19345e13f91b27e66e10ef5592ae/tests/ui/errors/remap-path-prefix.rs#L4)
- [`tests/ui/errors/remap-path-prefix-macro.rs`](https://github.com/rust-lang/rust/blob/9725c4baacef19345e13f91b27e66e10ef5592ae/tests/ui/errors/remap-path-prefix-macro.rs#L1-L4)
- [`tests/run-make/remap-path-prefix-dwarf/rmake.rs
`](https://github.com/rust-lang/rust/blob/9725c4baacef19345e13f91b27e66e10ef5592ae/tests/run-make/remap-path-prefix-dwarf/rmake.rs)
- [`tests/run-make/remap-path-prefix/rmake.rs`](https://github.com/rust-lang/rust/blob/9725c4baacef19345e13f91b27e66e10ef5592ae/tests/run-make/remap-path-prefix/rmake.rs)
- [`tests/ui/errors/remap-path-prefix-diagnostics.rs`](https://github.com/rust-lang/rust/blob/9725c4baacef19345e13f91b27e66e10ef5592ae/tests/ui/errors/remap-path-prefix-diagnostics.rs)

### Outstanding bugs

> What outstanding bugs involve this feature? List them. Should any block the stabilization? Discuss why or why not.

There are no outstanding bugs regarding `--remap-path-scope`.

### Outstanding FIXMEs

> What FIXMEs are still in the code for that feature and why is it OK to leave them there?

There are no FIXME regarding `--remap-path-scope` in it-self.

### Tool changes

> What changes must be made to our other tools to support this feature. Has this work been done? Link to any relevant PRs and issues.

- rustdoc (both JSON, HTML and doctest)
  - `rustdoc` has support for `--remap-path-prefix`, it should probably also get support for `--remap-path-scope`, although rustdoc maybe want to adapt the scopes for it's use (replace `debuginfo` with `documentation` for example).

## History

> List issues and PRs that are important for understanding how we got here.

- rust-lang#115214
- rust-lang#122450
- rust-lang#139550
- rust-lang#140716

## Acknowledgments

> Summarize contributors to the feature by name for recognition and so that those people are notified about the stabilization. Does anyone who worked on this *not* think it should be stabilized right now? We'd like to hear about that if so.

- @cbeuw
- @michaelwoerister
- @weihanglo
- @Urgau

@rustbot labels +T-compiler +needs-fcp +F-trim-paths
r? @davidtwco
rust-timer added a commit that referenced this pull request Jan 20, 2026
Rollup merge of #147611 - stablize-remap-path-scope, r=davidtwco

Stabilize `-Zremap-path-scope`

# Stabilization report of `--remap-path-scope`

## Summary

RFC 3127 trim-paths aims to improve the current status of sanitizing paths emitted by the compiler via the `--remap-path-prefix=FROM=TO` command line flag, by offering a profile setting named `trim-paths` in Cargo to sanitize absolute paths introduced during compilation that may be embedded in the compiled binary executable or library.

As part of that RFC the compiler was asked to add the `--remap-path-scope` command-line flag to control the scoping of how paths get remapped in the resulting binary.

Tracking:

- #111540

### What is stabilized

The rustc `--remap-path-scope` flag is being stabilized by this PR. It defines which scopes of paths should be remapped by `--remap-path-prefix`.

This flag accepts a comma-separated list of values and may be specified multiple times, in which case the scopes are aggregated together.

The valid scopes are:

- `macro` - apply remappings to the expansion of `std::file!()` macro. This is where paths in embedded panic messages come from
- `diagnostics` - apply remappings to printed compiler diagnostics
- `debuginfo` - apply remappings to debug informations
- `coverage` - apply remappings to coverage informations
- `object` - apply remappings to all paths in compiled executables or libraries, but not elsewhere. Currently an alias for `macro,coverage,debuginfo`.
- `all` (default) - an alias for all of the above, also equivalent to supplying only `--remap-path-prefix` without `--remap-path-scope`.

#### Example

```sh
# With `object` scope only the build outputs will be remapped, the diagnostics won't be remapped.
rustc --remap-path-prefix=$(PWD)=/remapped --remap-path-scope=object main.rs
```

### What isn't stabilized

None of the Cargo facility is being stabilized in this stabilization PR, only the `--remap-path-scope` flag in `rustc` is being stabilized.

## Design

### RFC history

- [RFC3127 - trim-paths](https://rust-lang.github.io/rfcs/3127-trim-paths.html)

### Answers to unresolved questions

> What questions were left unresolved by the RFC? How have they been answered? Link to any relevant lang decisions.

There are no unresolved questions regarding `--remap-path-scope`.

(The tracking issue list a bunch of unresolved questions but they are for `--remap-path-prefix` or the bigger picture `trim-paths` in Cargo and are not related the functionality provided by `--remap-path-scope`.)

### Post-RFC changes

The RFC described more scopes, in particularly regarding split debuginfo. Those scopes where removed after analysis by `michaelwoerister` of all the possible combinations in #111540 (comment).

### Nightly extensions

There are no nightly extensions.

### Doors closed

We are committing to having to having a flag that control which paths are being remapped based on a "scope".

## Feedback

### Call for testing

> Has a "call for testing" been done? If so, what feedback was received?

No call for testing has been done per se but feedback has been received on both the rust-lang/rust and rust-lang/cargo tracking issue.

The feedback was mainly related to deficiencies in *our best-effort* `--remap-path-prefix` implementation, in particular regarding linkers added paths, which does not change anything for `--remap-path-scope`.

### Nightly use

> Do any known nightly users use this feature? Counting instances of `#![feature(FEATURE_NAME)]` on GitHub with grep might be informative.

Except for Cargo unstable `trim-paths` there doesn't appear any committed use [on GitHub](https://github.com/search?q=%22--remap-path-scope%22+NOT+path%3A%2F%5Esrc%5C%2Fcargo%5C%2Fcore%5C%2Fcompiler%5C%2F%2F+NOT+path%3A%2F%5Etext%5C%2F%2F+NOT+path%3A%2F%5Erust%5C%2Fsrc%5C%2Fdoc%5C%2Funstable-book%5C%2Fsrc%5C%2Fcompiler-flags%5C%2F%2F+NOT+path%3A%2F%5Esrc%5C%2Fdoc%5C%2Funstable-book%5C%2Fsrc%5C%2Fcompiler-flags%5C%2F%2F+NOT+path%3A%2F%5Ecollector%5C%2Fcompile-benchmarks%5C%2Fcargo-0%5C.87%5C.1%5C%2Fsrc%5C%2Fcargo%5C%2Fcore%5C%2Fcompiler%5C%2F%2F&type=code).

## Implementation

### Major parts

- https://github.com/rust-lang/rust/blob/b3f8586fb1e4859678d6b231e780ff81801d2282/compiler/rustc_session/src/config.rs#L1373-L1384
- https://github.com/rust-lang/rust/blob/b3f8586fb1e4859678d6b231e780ff81801d2282/compiler/rustc_session/src/session.rs#L1526
- https://github.com/rust-lang/rust/blob/b3f8586fb1e4859678d6b231e780ff81801d2282/compiler/rustc_span/src/lib.rs#L352-L372

### Coverage

- [`tests/run-make/split-debuginfo/rmake.rs`](https://github.com/rust-lang/rust/blob/9725c4baacef19345e13f91b27e66e10ef5592ae/tests/run-make/split-debuginfo/rmake.rs#L7)
- [`tests/ui/errors/remap-path-prefix.rs`](https://github.com/rust-lang/rust/blob/9725c4baacef19345e13f91b27e66e10ef5592ae/tests/ui/errors/remap-path-prefix.rs#L4)
- [`tests/ui/errors/remap-path-prefix-macro.rs`](https://github.com/rust-lang/rust/blob/9725c4baacef19345e13f91b27e66e10ef5592ae/tests/ui/errors/remap-path-prefix-macro.rs#L1-L4)
- [`tests/run-make/remap-path-prefix-dwarf/rmake.rs
`](https://github.com/rust-lang/rust/blob/9725c4baacef19345e13f91b27e66e10ef5592ae/tests/run-make/remap-path-prefix-dwarf/rmake.rs)
- [`tests/run-make/remap-path-prefix/rmake.rs`](https://github.com/rust-lang/rust/blob/9725c4baacef19345e13f91b27e66e10ef5592ae/tests/run-make/remap-path-prefix/rmake.rs)
- [`tests/ui/errors/remap-path-prefix-diagnostics.rs`](https://github.com/rust-lang/rust/blob/9725c4baacef19345e13f91b27e66e10ef5592ae/tests/ui/errors/remap-path-prefix-diagnostics.rs)

### Outstanding bugs

> What outstanding bugs involve this feature? List them. Should any block the stabilization? Discuss why or why not.

There are no outstanding bugs regarding `--remap-path-scope`.

### Outstanding FIXMEs

> What FIXMEs are still in the code for that feature and why is it OK to leave them there?

There are no FIXME regarding `--remap-path-scope` in it-self.

### Tool changes

> What changes must be made to our other tools to support this feature. Has this work been done? Link to any relevant PRs and issues.

- rustdoc (both JSON, HTML and doctest)
  - `rustdoc` has support for `--remap-path-prefix`, it should probably also get support for `--remap-path-scope`, although rustdoc maybe want to adapt the scopes for it's use (replace `debuginfo` with `documentation` for example).

## History

> List issues and PRs that are important for understanding how we got here.

- #115214
- #122450
- #139550
- #140716

## Acknowledgments

> Summarize contributors to the feature by name for recognition and so that those people are notified about the stabilization. Does anyone who worked on this *not* think it should be stabilized right now? We'd like to hear about that if so.

- @cbeuw
- @michaelwoerister
- @weihanglo
- @Urgau

@rustbot labels +T-compiler +needs-fcp +F-trim-paths
r? @davidtwco
github-actions bot pushed a commit to rust-lang/rustc-dev-guide that referenced this pull request Jan 20, 2026
Stabilize `-Zremap-path-scope`

# Stabilization report of `--remap-path-scope`

## Summary

RFC 3127 trim-paths aims to improve the current status of sanitizing paths emitted by the compiler via the `--remap-path-prefix=FROM=TO` command line flag, by offering a profile setting named `trim-paths` in Cargo to sanitize absolute paths introduced during compilation that may be embedded in the compiled binary executable or library.

As part of that RFC the compiler was asked to add the `--remap-path-scope` command-line flag to control the scoping of how paths get remapped in the resulting binary.

Tracking:

- rust-lang/rust#111540

### What is stabilized

The rustc `--remap-path-scope` flag is being stabilized by this PR. It defines which scopes of paths should be remapped by `--remap-path-prefix`.

This flag accepts a comma-separated list of values and may be specified multiple times, in which case the scopes are aggregated together.

The valid scopes are:

- `macro` - apply remappings to the expansion of `std::file!()` macro. This is where paths in embedded panic messages come from
- `diagnostics` - apply remappings to printed compiler diagnostics
- `debuginfo` - apply remappings to debug informations
- `coverage` - apply remappings to coverage informations
- `object` - apply remappings to all paths in compiled executables or libraries, but not elsewhere. Currently an alias for `macro,coverage,debuginfo`.
- `all` (default) - an alias for all of the above, also equivalent to supplying only `--remap-path-prefix` without `--remap-path-scope`.

#### Example

```sh
# With `object` scope only the build outputs will be remapped, the diagnostics won't be remapped.
rustc --remap-path-prefix=$(PWD)=/remapped --remap-path-scope=object main.rs
```

### What isn't stabilized

None of the Cargo facility is being stabilized in this stabilization PR, only the `--remap-path-scope` flag in `rustc` is being stabilized.

## Design

### RFC history

- [RFC3127 - trim-paths](https://rust-lang.github.io/rfcs/3127-trim-paths.html)

### Answers to unresolved questions

> What questions were left unresolved by the RFC? How have they been answered? Link to any relevant lang decisions.

There are no unresolved questions regarding `--remap-path-scope`.

(The tracking issue list a bunch of unresolved questions but they are for `--remap-path-prefix` or the bigger picture `trim-paths` in Cargo and are not related the functionality provided by `--remap-path-scope`.)

### Post-RFC changes

The RFC described more scopes, in particularly regarding split debuginfo. Those scopes where removed after analysis by `michaelwoerister` of all the possible combinations in rust-lang/rust#111540 (comment).

### Nightly extensions

There are no nightly extensions.

### Doors closed

We are committing to having to having a flag that control which paths are being remapped based on a "scope".

## Feedback

### Call for testing

> Has a "call for testing" been done? If so, what feedback was received?

No call for testing has been done per se but feedback has been received on both the rust-lang/rust and rust-lang/cargo tracking issue.

The feedback was mainly related to deficiencies in *our best-effort* `--remap-path-prefix` implementation, in particular regarding linkers added paths, which does not change anything for `--remap-path-scope`.

### Nightly use

> Do any known nightly users use this feature? Counting instances of `#![feature(FEATURE_NAME)]` on GitHub with grep might be informative.

Except for Cargo unstable `trim-paths` there doesn't appear any committed use [on GitHub](https://github.com/search?q=%22--remap-path-scope%22+NOT+path%3A%2F%5Esrc%5C%2Fcargo%5C%2Fcore%5C%2Fcompiler%5C%2F%2F+NOT+path%3A%2F%5Etext%5C%2F%2F+NOT+path%3A%2F%5Erust%5C%2Fsrc%5C%2Fdoc%5C%2Funstable-book%5C%2Fsrc%5C%2Fcompiler-flags%5C%2F%2F+NOT+path%3A%2F%5Esrc%5C%2Fdoc%5C%2Funstable-book%5C%2Fsrc%5C%2Fcompiler-flags%5C%2F%2F+NOT+path%3A%2F%5Ecollector%5C%2Fcompile-benchmarks%5C%2Fcargo-0%5C.87%5C.1%5C%2Fsrc%5C%2Fcargo%5C%2Fcore%5C%2Fcompiler%5C%2F%2F&type=code).

## Implementation

### Major parts

- https://github.com/rust-lang/rust/blob/b3f8586fb1e4859678d6b231e780ff81801d2282/compiler/rustc_session/src/config.rs#L1373-L1384
- https://github.com/rust-lang/rust/blob/b3f8586fb1e4859678d6b231e780ff81801d2282/compiler/rustc_session/src/session.rs#L1526
- https://github.com/rust-lang/rust/blob/b3f8586fb1e4859678d6b231e780ff81801d2282/compiler/rustc_span/src/lib.rs#L352-L372

### Coverage

- [`tests/run-make/split-debuginfo/rmake.rs`](https://github.com/rust-lang/rust/blob/9725c4baacef19345e13f91b27e66e10ef5592ae/tests/run-make/split-debuginfo/rmake.rs#L7)
- [`tests/ui/errors/remap-path-prefix.rs`](https://github.com/rust-lang/rust/blob/9725c4baacef19345e13f91b27e66e10ef5592ae/tests/ui/errors/remap-path-prefix.rs#L4)
- [`tests/ui/errors/remap-path-prefix-macro.rs`](https://github.com/rust-lang/rust/blob/9725c4baacef19345e13f91b27e66e10ef5592ae/tests/ui/errors/remap-path-prefix-macro.rs#L1-L4)
- [`tests/run-make/remap-path-prefix-dwarf/rmake.rs
`](https://github.com/rust-lang/rust/blob/9725c4baacef19345e13f91b27e66e10ef5592ae/tests/run-make/remap-path-prefix-dwarf/rmake.rs)
- [`tests/run-make/remap-path-prefix/rmake.rs`](https://github.com/rust-lang/rust/blob/9725c4baacef19345e13f91b27e66e10ef5592ae/tests/run-make/remap-path-prefix/rmake.rs)
- [`tests/ui/errors/remap-path-prefix-diagnostics.rs`](https://github.com/rust-lang/rust/blob/9725c4baacef19345e13f91b27e66e10ef5592ae/tests/ui/errors/remap-path-prefix-diagnostics.rs)

### Outstanding bugs

> What outstanding bugs involve this feature? List them. Should any block the stabilization? Discuss why or why not.

There are no outstanding bugs regarding `--remap-path-scope`.

### Outstanding FIXMEs

> What FIXMEs are still in the code for that feature and why is it OK to leave them there?

There are no FIXME regarding `--remap-path-scope` in it-self.

### Tool changes

> What changes must be made to our other tools to support this feature. Has this work been done? Link to any relevant PRs and issues.

- rustdoc (both JSON, HTML and doctest)
  - `rustdoc` has support for `--remap-path-prefix`, it should probably also get support for `--remap-path-scope`, although rustdoc maybe want to adapt the scopes for it's use (replace `debuginfo` with `documentation` for example).

## History

> List issues and PRs that are important for understanding how we got here.

- rust-lang/rust#115214
- rust-lang/rust#122450
- rust-lang/rust#139550
- rust-lang/rust#140716

## Acknowledgments

> Summarize contributors to the feature by name for recognition and so that those people are notified about the stabilization. Does anyone who worked on this *not* think it should be stabilized right now? We'd like to hear about that if so.

- @cbeuw
- @michaelwoerister
- @weihanglo
- @Urgau

@rustbot labels +T-compiler +needs-fcp +F-trim-paths
r? @davidtwco
github-actions bot pushed a commit to rust-lang/miri that referenced this pull request Jan 21, 2026
Stabilize `-Zremap-path-scope`

# Stabilization report of `--remap-path-scope`

## Summary

RFC 3127 trim-paths aims to improve the current status of sanitizing paths emitted by the compiler via the `--remap-path-prefix=FROM=TO` command line flag, by offering a profile setting named `trim-paths` in Cargo to sanitize absolute paths introduced during compilation that may be embedded in the compiled binary executable or library.

As part of that RFC the compiler was asked to add the `--remap-path-scope` command-line flag to control the scoping of how paths get remapped in the resulting binary.

Tracking:

- rust-lang/rust#111540

### What is stabilized

The rustc `--remap-path-scope` flag is being stabilized by this PR. It defines which scopes of paths should be remapped by `--remap-path-prefix`.

This flag accepts a comma-separated list of values and may be specified multiple times, in which case the scopes are aggregated together.

The valid scopes are:

- `macro` - apply remappings to the expansion of `std::file!()` macro. This is where paths in embedded panic messages come from
- `diagnostics` - apply remappings to printed compiler diagnostics
- `debuginfo` - apply remappings to debug informations
- `coverage` - apply remappings to coverage informations
- `object` - apply remappings to all paths in compiled executables or libraries, but not elsewhere. Currently an alias for `macro,coverage,debuginfo`.
- `all` (default) - an alias for all of the above, also equivalent to supplying only `--remap-path-prefix` without `--remap-path-scope`.

#### Example

```sh
# With `object` scope only the build outputs will be remapped, the diagnostics won't be remapped.
rustc --remap-path-prefix=$(PWD)=/remapped --remap-path-scope=object main.rs
```

### What isn't stabilized

None of the Cargo facility is being stabilized in this stabilization PR, only the `--remap-path-scope` flag in `rustc` is being stabilized.

## Design

### RFC history

- [RFC3127 - trim-paths](https://rust-lang.github.io/rfcs/3127-trim-paths.html)

### Answers to unresolved questions

> What questions were left unresolved by the RFC? How have they been answered? Link to any relevant lang decisions.

There are no unresolved questions regarding `--remap-path-scope`.

(The tracking issue list a bunch of unresolved questions but they are for `--remap-path-prefix` or the bigger picture `trim-paths` in Cargo and are not related the functionality provided by `--remap-path-scope`.)

### Post-RFC changes

The RFC described more scopes, in particularly regarding split debuginfo. Those scopes where removed after analysis by `michaelwoerister` of all the possible combinations in rust-lang/rust#111540 (comment).

### Nightly extensions

There are no nightly extensions.

### Doors closed

We are committing to having to having a flag that control which paths are being remapped based on a "scope".

## Feedback

### Call for testing

> Has a "call for testing" been done? If so, what feedback was received?

No call for testing has been done per se but feedback has been received on both the rust-lang/rust and rust-lang/cargo tracking issue.

The feedback was mainly related to deficiencies in *our best-effort* `--remap-path-prefix` implementation, in particular regarding linkers added paths, which does not change anything for `--remap-path-scope`.

### Nightly use

> Do any known nightly users use this feature? Counting instances of `#![feature(FEATURE_NAME)]` on GitHub with grep might be informative.

Except for Cargo unstable `trim-paths` there doesn't appear any committed use [on GitHub](https://github.com/search?q=%22--remap-path-scope%22+NOT+path%3A%2F%5Esrc%5C%2Fcargo%5C%2Fcore%5C%2Fcompiler%5C%2F%2F+NOT+path%3A%2F%5Etext%5C%2F%2F+NOT+path%3A%2F%5Erust%5C%2Fsrc%5C%2Fdoc%5C%2Funstable-book%5C%2Fsrc%5C%2Fcompiler-flags%5C%2F%2F+NOT+path%3A%2F%5Esrc%5C%2Fdoc%5C%2Funstable-book%5C%2Fsrc%5C%2Fcompiler-flags%5C%2F%2F+NOT+path%3A%2F%5Ecollector%5C%2Fcompile-benchmarks%5C%2Fcargo-0%5C.87%5C.1%5C%2Fsrc%5C%2Fcargo%5C%2Fcore%5C%2Fcompiler%5C%2F%2F&type=code).

## Implementation

### Major parts

- https://github.com/rust-lang/rust/blob/b3f8586fb1e4859678d6b231e780ff81801d2282/compiler/rustc_session/src/config.rs#L1373-L1384
- https://github.com/rust-lang/rust/blob/b3f8586fb1e4859678d6b231e780ff81801d2282/compiler/rustc_session/src/session.rs#L1526
- https://github.com/rust-lang/rust/blob/b3f8586fb1e4859678d6b231e780ff81801d2282/compiler/rustc_span/src/lib.rs#L352-L372

### Coverage

- [`tests/run-make/split-debuginfo/rmake.rs`](https://github.com/rust-lang/rust/blob/9725c4baacef19345e13f91b27e66e10ef5592ae/tests/run-make/split-debuginfo/rmake.rs#L7)
- [`tests/ui/errors/remap-path-prefix.rs`](https://github.com/rust-lang/rust/blob/9725c4baacef19345e13f91b27e66e10ef5592ae/tests/ui/errors/remap-path-prefix.rs#L4)
- [`tests/ui/errors/remap-path-prefix-macro.rs`](https://github.com/rust-lang/rust/blob/9725c4baacef19345e13f91b27e66e10ef5592ae/tests/ui/errors/remap-path-prefix-macro.rs#L1-L4)
- [`tests/run-make/remap-path-prefix-dwarf/rmake.rs
`](https://github.com/rust-lang/rust/blob/9725c4baacef19345e13f91b27e66e10ef5592ae/tests/run-make/remap-path-prefix-dwarf/rmake.rs)
- [`tests/run-make/remap-path-prefix/rmake.rs`](https://github.com/rust-lang/rust/blob/9725c4baacef19345e13f91b27e66e10ef5592ae/tests/run-make/remap-path-prefix/rmake.rs)
- [`tests/ui/errors/remap-path-prefix-diagnostics.rs`](https://github.com/rust-lang/rust/blob/9725c4baacef19345e13f91b27e66e10ef5592ae/tests/ui/errors/remap-path-prefix-diagnostics.rs)

### Outstanding bugs

> What outstanding bugs involve this feature? List them. Should any block the stabilization? Discuss why or why not.

There are no outstanding bugs regarding `--remap-path-scope`.

### Outstanding FIXMEs

> What FIXMEs are still in the code for that feature and why is it OK to leave them there?

There are no FIXME regarding `--remap-path-scope` in it-self.

### Tool changes

> What changes must be made to our other tools to support this feature. Has this work been done? Link to any relevant PRs and issues.

- rustdoc (both JSON, HTML and doctest)
  - `rustdoc` has support for `--remap-path-prefix`, it should probably also get support for `--remap-path-scope`, although rustdoc maybe want to adapt the scopes for it's use (replace `debuginfo` with `documentation` for example).

## History

> List issues and PRs that are important for understanding how we got here.

- rust-lang/rust#115214
- rust-lang/rust#122450
- rust-lang/rust#139550
- rust-lang/rust#140716

## Acknowledgments

> Summarize contributors to the feature by name for recognition and so that those people are notified about the stabilization. Does anyone who worked on this *not* think it should be stabilized right now? We'd like to hear about that if so.

- @cbeuw
- @michaelwoerister
- @weihanglo
- @Urgau

@rustbot labels +T-compiler +needs-fcp +F-trim-paths
r? @davidtwco
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

F-trim-paths Feature: trim-paths merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants