jiebi/CodeConvo huggingface dataset:
Code change:
<ins> // Regression test for https://github.com/rust-lang/rust/issues/122549 // was fixed by https://github.com/rust-lang/rust/pull/122749 trait ConstChunksExactTrait<T> { fn const_chunks_exact<const N: usize>(&self) -> ConstChunksExact<'a, T, { N }>; //~^ ERROR undeclared lifetime } impl<T> ConstChunksExactTrait<T> for [T] {} //~^ ERROR not all trait items implemented, missing: `const_chunks_exact` struct ConstChunksExact<'rem, T: 'a, const N: usize> {} //~^ ERROR use of undeclared lifetime name `'a` //~^^ ERROR lifetime parameter //~^^^ ERROR type parameter impl<'a, T, const N: usize> Iterator for ConstChunksExact<'a, T, {}> { //~^ ERROR the const parameter `N` is not constrained by the impl trait, self type, or predicates //~^^ ERROR mismatched types type Item = &'a [T; N]; } fn main() { let slice = &[1i32, 2, 3, 4, 5, 6, 7, 8, 9, 10]; let mut iter = [[1, 2, 3], [4, 5, 6], [7, 8, 9]].iter(); for a in slice.const_chunks_exact::<3>() { assert_eq!(a, iter.next().unwrap()); } } </ins>

Related discussion:
text: ?0c: usize]stack backtrace: 0: 0x7ff8073a4912 - std::backtracers::backtrace::libunwind::trace::h2da6c6ec1776ed1b at 1: 0x7ff8073a4912 - std::backtracers::backtrace::traceunsynchronized::h0cb696e9cf0107ba at 2: 0x7ff8073a4912 - std::syscommon::backtrace::printfmt::hfb11ed7a7d38a028 at 3: 0x7ff8073a4912 - <std::syscommon::backtrace::print::DisplayBacktrace as core::fmt::Display::fmt::h1048d052a888b26c at 4: 0x7ff8073f5c8c - core::fmt::rt::Argument::fmt::hcf8265a03a389e34 at 5: 0x7ff8073f5c8c - core::fmt::write::hd12c3a84e62e1cec at 6: 0x7ff80739980f - std::io::Write::writefmt::h236993be0d5d91de at 7: 0x7ff8073a46e4 - std::syscommon::backtrace::print::he44e9b7b149d34c3 at 8: 0x7ff8073a46e4 - std::syscommon::backtrace::print::h6f8e8e3b9f052551 at 9: 0x7ff8073a73eb - std::panicking::defaulthook::{{closure}}::h321d04c9179dccca 10: 0x7ff8073a7143 - std::panicking::defaulthook::hd949d1362c2e5565 at 11: 0x7ff803fa68ef - std[]::panicking::updatehook::<alloc[]::boxed::Box<rustcdriverimpl[]::installicehook::{closure}::{closure} 12: 0x7ff8073a7b50 - <alloc::boxed::Box<F,
Code change:
<ins> // Regression test for https://github.com/rust-lang/rust/issues/122549 // was fixed by https://github.com/rust-lang/rust/pull/122749 trait ConstChunksExactTrait<T> { fn const_chunks_exact<const N: usize>(&self) -> ConstChunksExact<'a, T, { N }>; //~^ ERROR undeclared lifetime } impl<T> ConstChunksExactTrait<T> for [T] {} //~^ ERROR not all trait items implemented, missing: `const_chunks_exact` struct ConstChunksExact<'rem, T: 'a, const N: usize> {} //~^ ERROR use of undeclared lifetime name `'a` //~^^ ERROR lifetime parameter //~^^^ ERROR type parameter impl<'a, T, const N: usize> Iterator for ConstChunksExact<'a, T, {}> { //~^ ERROR the const parameter `N` is not constrained by the impl trait, self type, or predicates //~^^ ERROR mismatched types type Item = &'a [T; N]; } fn main() { let slice = &[1i32, 2, 3, 4, 5, 6, 7, 8, 9, 10]; let mut iter = [[1, 2, 3], [4, 5, 6], [7, 8, 9]].iter(); for a in slice.const_chunks_exact::<3>() { assert_eq!(a, iter.next().unwrap()); } } </ins>

Related discussion:
text: Aas core::ops::function::Fn<Args::call::h4f6c988be7bdee68 at 13: 0x7ff8073a7b50 - std::panicking::rustpanicwithhook::hb71de646be3b3469 at 14: 0x7ff8073a7892 - std::panicking::beginpanichandler::{{closure}}::hbca15a8a0a3dee72 at 15: 0x7ff8073a4de6 - std::syscommon::backtrace::rustendshortbacktrace::h885125d06f4d13f0 at 16: 0x7ff8073a75c4 - rustbeginunwind at 17: 0x7ff8073f21a5 - core::panicking::panicfmt::ha3facef8c988a935 at 18: 0x7ff80529d0a8 - <rustcborrowck[]::typecheck::relatetys::NllTypeRelating as rustcmiddle[]::ty::relate::TypeRelation::tys 19: 0x7ff80608d936 - <rustcborrowck[]::typecheck::TypeChecker::typeckmir 20: 0x7ff802afa5fa - rustcborrowck[]::typecheck::typecheck 21: 0x7ff802b34257 - rustcborrowck[]::nll::computeregions 22: 0x7ff80601edc1 - rustcborrowck[]::domirborrowck 23: 0x7ff806011128 - rustcborrowck[]::mirborrowck 24: 0x7ff806010c17 - rustcqueryimpl[]::plumbing::rustbeginshortbacktrace::<rustcqueryimpl[]::queryimpl::mirborrowck::dynamicquery::{closure}::{closure}, rustcmiddle[]::query::erase::Erased<[u8; 8usize]25: 0x7ff80540ff2e - rustcquerysystem[]::query::plumbing::tryexecutequery::<rustcqueryimpl[]::DynamicConfig<rustcquerysystem[]::query::caches::VecCache<rustcspan[]::defid::LocalDefId,
Code change:
<ins> // Regression test for https://github.com/rust-lang/rust/issues/122549 // was fixed by https://github.com/rust-lang/rust/pull/122749 trait ConstChunksExactTrait<T> { fn const_chunks_exact<const N: usize>(&self) -> ConstChunksExact<'a, T, { N }>; //~^ ERROR undeclared lifetime } impl<T> ConstChunksExactTrait<T> for [T] {} //~^ ERROR not all trait items implemented, missing: `const_chunks_exact` struct ConstChunksExact<'rem, T: 'a, const N: usize> {} //~^ ERROR use of undeclared lifetime name `'a` //~^^ ERROR lifetime parameter //~^^^ ERROR type parameter impl<'a, T, const N: usize> Iterator for ConstChunksExact<'a, T, {}> { //~^ ERROR the const parameter `N` is not constrained by the impl trait, self type, or predicates //~^^ ERROR mismatched types type Item = &'a [T; N]; } fn main() { let slice = &[1i32, 2, 3, 4, 5, 6, 7, 8, 9, 10]; let mut iter = [[1, 2, 3], [4, 5, 6], [7, 8, 9]].iter(); for a in slice.const_chunks_exact::<3>() { assert_eq!(a, iter.next().unwrap()); } } </ins>

Related discussion:
text: rustcmiddle[]::query::erase::Erased<[u8; 8usize], false, false, false, rustcqueryimpl[]::plumbing::QueryCtxt, false26: 0x7ff80540fa4c - rustcqueryimpl[]::queryimpl::mirborrowck::getquerynonincr::rustendshortbacktrace 27: 0x7ff80599919e - rustcinterface[]::passes::analysis 28: 0x7ff805998425 - rustcqueryimpl[]::plumbing::rustbeginshortbacktrace::<rustcqueryimpl[]::queryimpl::analysis::dynamicquery::{closure}::{closure}, rustcmiddle[]::query::erase::Erased<[u8; 1usize]29: 0x7ff806006165 - rustcquerysystem[]::query::plumbing::tryexecutequery::<rustcqueryimpl[]::DynamicConfig<rustcquerysystem[]::query::caches::SingleCache<rustcmiddle[]::query::erase::Erased<[u8; 1usize], false, false, false, rustcqueryimpl[]::plumbing::QueryCtxt, false30: 0x7ff806005ec9 - rustcqueryimpl[]::queryimpl::analysis::getquerynonincr::rustendshortbacktrace 31: 0x7ff805d5e284 - rustcinterface[]::interface::runcompiler::<core[]::result::Result<(), rustcspan[]::ErrorGuaranteed, rustcdriverimpl[]::runcompiler::{closure}::{closure} 32: 0x7ff806223805 - std[]::syscommon::backtrace::rustbeginshortbacktrace::<rustcinterface[]::util::runinthreadwithglobals<rustcinterface[]::util::runinthreadpoolwithglobals<rustcinterface[]::interface::runcompiler<core[]::result::Result<(), rustcspan[]::ErrorGuaranteed, rustcdriverimpl[]::runcompiler::{closure}::{closure}, core[]::result::Result<(), rustcspan[]::ErrorGuaranteed::{closure}, core[]::result::Result<(), rustcspan[]::ErrorGuaranteed::{closure}::{closure}, core[]::result::Result<(),
Code change:
<ins> // Regression test for https://github.com/rust-lang/rust/issues/122549 // was fixed by https://github.com/rust-lang/rust/pull/122749 trait ConstChunksExactTrait<T> { fn const_chunks_exact<const N: usize>(&self) -> ConstChunksExact<'a, T, { N }>; //~^ ERROR undeclared lifetime } impl<T> ConstChunksExactTrait<T> for [T] {} //~^ ERROR not all trait items implemented, missing: `const_chunks_exact` struct ConstChunksExact<'rem, T: 'a, const N: usize> {} //~^ ERROR use of undeclared lifetime name `'a` //~^^ ERROR lifetime parameter //~^^^ ERROR type parameter impl<'a, T, const N: usize> Iterator for ConstChunksExact<'a, T, {}> { //~^ ERROR the const parameter `N` is not constrained by the impl trait, self type, or predicates //~^^ ERROR mismatched types type Item = &'a [T; N]; } fn main() { let slice = &[1i32, 2, 3, 4, 5, 6, 7, 8, 9, 10]; let mut iter = [[1, 2, 3], [4, 5, 6], [7, 8, 9]].iter(); for a in slice.const_chunks_exact::<3>() { assert_eq!(a, iter.next().unwrap()); } } </ins>

Related discussion:
text: rustcspan[]::ErrorGuaranteed33: 0x7ff806223632 - <<std[]::thread::Builder::spawnunchecked<rustcinterface[]::util::runinthreadwithglobals<rustcinterface[]::util::runinthreadpoolwithglobals<rustcinterface[]::interface::runcompiler<core[]::result::Result<(), rustcspan[]::ErrorGuaranteed, rustcdriverimpl[]::runcompiler::{closure}::{closure}, core[]::result::Result<(), rustcspan[]::ErrorGuaranteed::{closure}, core[]::result::Result<(), rustcspan[]::ErrorGuaranteed::{closure}::{closure}, core[]::result::Result<(), rustcspan[]::ErrorGuaranteed::{closure} as core[]::ops::function::FnOnce<()::callonce::{shim:vtable} 34: 0x7ff8073b11e5 - <alloc::boxed::Box<F,Aas core::ops::function::FnOnce<Args::callonce::hab5d072bb143d8fe at 35: 0x7ff8073b11e5 - <alloc::boxed::Box<F,Aas core::ops::function::FnOnce<Args::callonce::he1f566ad483a8fda at 36: 0x7ff8073b11e5 - std::sys::pal::unix::thread::Thread::new::threadstart::h23d47a8da771b95c at 37: 0x7ff800ea955a - <unknown38: 0x7ff800f26a3c - <unknown39: 0x0 - <unknownerror: the compiler unexpectedly panicked. this is a bug. note: we would appreciate a bug report: note: rustc 1.78.0-nightly ( 2024-03-15) running on x8664-unknown-linux-gnu query stack during panic: [mirborrowck] borrow-checking [analysis] running analysis passes on this crate end of query stack error: aborting due to 7 previous errors Some errors have detailed explanations: E0046, E0207, E0261, E0308, E0392. For more information about an error, try .
Code change:
<ins> // Regression test for https://github.com/rust-lang/rust/issues/122549 // was fixed by https://github.com/rust-lang/rust/pull/122749 trait ConstChunksExactTrait<T> { fn const_chunks_exact<const N: usize>(&self) -> ConstChunksExact<'a, T, { N }>; //~^ ERROR undeclared lifetime } impl<T> ConstChunksExactTrait<T> for [T] {} //~^ ERROR not all trait items implemented, missing: `const_chunks_exact` struct ConstChunksExact<'rem, T: 'a, const N: usize> {} //~^ ERROR use of undeclared lifetime name `'a` //~^^ ERROR lifetime parameter //~^^^ ERROR type parameter impl<'a, T, const N: usize> Iterator for ConstChunksExact<'a, T, {}> { //~^ ERROR the const parameter `N` is not constrained by the impl trait, self type, or predicates //~^^ ERROR mismatched types type Item = &'a [T; N]; } fn main() { let slice = &[1i32, 2, 3, 4, 5, 6, 7, 8, 9, 10]; let mut iter = [[1, 2, 3], [4, 5, 6], [7, 8, 9]].iter(); for a in slice.const_chunks_exact::<3>() { assert_eq!(a, iter.next().unwrap()); } } </ins>

Related discussion:
text: </p</details<!-- query stack: 5 | impl<TConstChunksExactTrait<Tfor [T] {} [mirborrowck] borrow-checking [analysis] running analysis passes on this crate --
cc
Code change:
// Parse the arguments, starting out with `self` being allowed... let (mut params, _) = self.parse_paren_comma_seq(|p| { p.recover_diff_marker(); <ins> let snapshot = p.create_snapshot_for_diagnostic(); </ins> let param = p.parse_param_general(req_name, first_param).or_else(|mut e| { e.emit(); let lo = p.prev_token.span; <ins> p.restore_snapshot(snapshot); </ins> // Skip every token until next possible arg or end. p.eat_to_tokens(&[&token::Comma, &token::CloseDelim(Delimiter::Parenthesis)]); // Create a placeholder argument for proper arg count (issue #34264).

Related discussion:
text: File: auto-reduced (treereduce-rust): original: Version information ` Command: <!-- Include a backtrace in the code block by setting in your environment. E.g. . --<details<summary<strongProgram output</strong</summary<p</p</details<!-- TRIAGEBOTSTART --<!-- TRIAGEBOTASSIGNSTART --<!-- TRIAGEBOTASSIGNDATASTARTTRIAGEBOTASSIGNDATAEND --<!-- TRIAGEBOTASSIGNEND --<!-- TRIAGEBOTEND --
Regression in nightly-2021-04-12 finding bors merge commits found 9 bors merge commits in the specified range commit[0] 2021-04-10: Auto merge of - Aaron1011:new-preexp-tests, r=petrochenkov commit[1] 2021-04-10: Auto merge of - Aaron1011:derive-invoc-order, r=petrochenkov commit[2] 2021-04-11: Auto merge of - RalfJung:liballoc-miri, r=Manishearth commit[3] 2021-04-11: Auto merge of - nagisa:nixos-patching-fix, r=Mark-Simulacrum commit[4] 2021-04-11: Auto merge of - JohnTitor:issue-, r=estebank commit[5] 2021-04-11: Auto merge of - Aaron1011:feature/final-preexp-tts, r=petrochenkov commit[6] 2021-04-11: Auto merge of - LingMan:patch-1, r=nagisa commit[7] 2021-04-11: Auto merge of - tweksteen:androidsetmessage, r=m-ou-se commit[8] 2021-04-11: Auto merge of - hyd-dev:uwtable, r=nagisa
claim
Reduced reproduction:
claim
Code change:
#[serde(rename_all = "snake_case")] #[serde(tag = "variant_kind", content = "variant_inner")] pub enum Variant { <ins> /// A variant with no parentheses, and possible discriminant. /// /// ```rust /// enum Demo { ///     PlainVariant, ///     PlainWithDiscriminant = 1, /// } /// ``` </ins> Plain(Option<Discriminant>), <del> Tuple(Vec<Type>), Struct(Vec<Id>), </del> <ins> /// A variant with unnamed fields. /// /// Unlike most of json, `#[doc(hidden)]` fields will be given as `None` /// instead of being ommited, because order matters. /// /// ```rust /// enum Demo { ///     TupleVariant(i32), ///     EmptyTupleVariant(), /// } /// ``` Tuple(Vec<Option<Id>>), /// A variant with named fields. /// /// ```rust /// enum Demo { ///     StructVariant { x: i32 }, ///     EmptyStructVariant {}, /// } /// ``` Struct { fields: Vec<Id>, fields_stripped: bool }, </ins> } #[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]

Related discussion:
text: At some point their should also be a for , and probably a way to tell what position each of the non stripped items are, as currently each of these 3 variants are documented with the same inner. but HTML gets a good representation:  The solution is probably to do what we do for structs, and store the , and a , such that each field of a varient gets an to hold the . We also should have a numfields, as even in that schema, you can't tell the difference between This also effects struct AFAIKT. I don't think this needs to be done now. I'll file an issue for it. Originally posted by in modify labels: +A-rustdoc-json +T-rustdoc
Related:
Code change:
iter.map(|e| t!(e)).collect::<Vec<_>>().into_iter() } <del> fn symlink_file<P: AsRef<Path>, Q: AsRef<Path>>(&self, src: P, link: Q) -> io::Result<()> { #[cfg(unix)] use std::os::unix::fs::symlink as symlink_file; #[cfg(windows)] use std::os::windows::fs::symlink_file; if !self.config.dry_run() { symlink_file(src.as_ref(), link.as_ref()) } else { Ok(()) } } </del> /// Returns if config.ninja is enabled, and checks for ninja existence, /// exiting with a nicer error message if not. fn ninja(&self) -> bool {

Related discussion:
text: broke the rust-analyzer config we suggest in the dev-guide: https://rustc-dev- since now rustfmt is in instead of . Originally posted by in <!-- TRIAGEBOTSTART --<!-- TRIAGEBOTASSIGNSTART --<!-- TRIAGEBOTASSIGNDATASTARTTRIAGEBOTASSIGNDATAEND --<!-- TRIAGEBOTASSIGNEND --<!-- TRIAGEBOT_END --
claim
Hi! Just to clarify, the idea is to change to code to match the docs?
I think the idea is changing the docs to match the new behavior.
For reference:
I'd prefer to change the code so that we don't force all contributors to update their config.
I don't think we can put the binary back, or at least, that feels iffy - we'd be trying to overlap two different sysroots. rustfmt used to be statically linked to libstd and librustc_driver, but that's no longer the case.
I suppose we could try to create a symlink from the old path to the new one? That might work, not sure.
Maybe add a proxy? On Linux it might just be
A symlink seems like a good solution to me.
Does the symlink still finds the correct so?
try it and see
I'll experiment adding a symlink.
On Windows, creating a symlink does not find the needed DLLs. Trying to execute the symlink pops two msgbox saying that it doesn't find the and DLLs. You would need to symlink also the DLLs. On Linux, it does find the correct SOs.
Symlinking also works on macOS.
Ok, this is pretty messy. How about doing both: Add the symlink, which will work with both the old and new config on Mac and Linux Update the recommended config in the dev-guide, which will help contributors fix the error message on Windows and from there we can work long-term to using the same toolchain for rustfmt and other tools, without having a time pressure.
cc ,
May I get some guidance and the creation of the symlink? Do I use rust to create the symlink in after the rustfmt_path line or do I use a bash command? If I do use a bash command, is there a file I should be adding it to? Thank you!
use
And just to confirm, I use that symlink function here?
Code change:
iter.map(|e| t!(e)).collect::<Vec<_>>().into_iter() } <del> fn symlink_file<P: AsRef<Path>, Q: AsRef<Path>>(&self, src: P, link: Q) -> io::Result<()> { #[cfg(unix)] use std::os::unix::fs::symlink as symlink_file; #[cfg(windows)] use std::os::windows::fs::symlink_file; if !self.config.dry_run() { symlink_file(src.as_ref(), link.as_ref()) } else { Ok(()) } } </del> /// Returns if config.ninja is enabled, and checks for ninja existence, /// exiting with a nicer error message if not. fn ninja(&self) -> bool {

Related discussion:
text: yes
I think it would be possible to move rustfmt back to the same sysroot as the bootstrap compiler by only taking , and from the nightly rustc component and not copying any other files like the rustc binary. and both contain a hash in their name unique for each rustc version. should contain the rustc version, so that shouldn't conflict either.
Doing the same with the DLLs on Windows could also work.
related (different error with rustfmt, but caused by the same change):
Hi any progress on the symlink? happy to help out if you're running into trouble :)
Hey ! Thanks for reaching out! I'll be starting tomorrow and will reach out to you if/when I need help! Apologies for the delay!
Code change:
let mut_substs = self.tcx.mk_substs_trait(mut_borrowed_found_ty, &[]); // Try to apply the original trait binding obligation by borrowing. <del> let mut try_borrowing = |new_imm_trait_ref: ty::TraitRef<'tcx>, new_mut_trait_ref: ty::TraitRef<'tcx>, expected_trait_ref: ty::TraitRef<'tcx>, </del> <ins> let mut try_borrowing = |new_imm_trait_ref: ty::Binder<'tcx, ty::TraitRef<'tcx>>, new_mut_trait_ref: ty::Binder<'tcx, ty::TraitRef<'tcx>>, expected_trait_ref: ty::Binder<'tcx, ty::TraitRef<'tcx>>, </ins> blacklist: &[DefId]| -> bool { <del> if blacklist.contains(&expected_trait_ref.def_id) { </del> <ins> if blacklist.contains(&expected_trait_ref.def_id()) { </ins> return false; } let imm_result = self.predicate_must_hold_modulo_regions(&Obligation::new( ObligationCause::dummy(), param_env, <del> ty::Binder::dummy(new_imm_trait_ref).without_const().to_predicate(self.tcx), </del> <ins> new_imm_trait_ref.without_const().to_predicate(self.tcx), </ins> )); let mut_result = self.predicate_must_hold_modulo_regions(&Obligation::new( ObligationCause::dummy(), param_env, <del> ty::Binder::dummy(new_mut_trait_ref).without_const().to_predicate(self.tcx), </del> <ins> new_mut_trait_ref.without_const().to_predicate(self.tcx), </ins> )); if imm_result || mut_result {

Related discussion:
text: <!-- Thank you for finding an Internal Compiler Error! If possible, try to provide a minimal verifiable example. You can read "Rust Bug Minimization Patterns" for how to create smaller examples. --When creating this I found that it did not error if the function was not called and it also seemed to require it to be a function not just an argument of type T or (from what I tested) a different impl Trait although it could be any Fn* trait <!-- If you're using the stable version of the compiler, you should also check if the bug also exists in the beta or nightly versions. --: This appears to only happen on nightly while stable and beta generate useful error reports <!-- Include a backtrace in the code block by setting in your environment. E.g. . --<details<summary<strongBacktrace</strong</summary<p</p</details<!-- TRIAGEBOTSTART --<!-- TRIAGEBOTASSIGNSTART --<!-- TRIAGEBOTASSIGNDATASTARTTRIAGEBOTASSIGNDATAEND --<!-- TRIAGEBOTASSIGNEND --<!-- TRIAGEBOTEND --
label regression-from-stable-to-nightly
does not ICE but errors correctly while does ICE
glacier ""
searched nightlies: from nightly-2021-09-17 to nightly-2021-09-18 regressed nightly: nightly-2021-09-18 searched commits: from to regressed commit: <details<summarybisected with <a href=''cargo-bisect-rustc</av0.6.0</summaryHost triple: x86_64-apple-darwin Reproduce with: </detailsThat's , so cc
I've got this. claim Interestingly, this is precisely the kind of thing that is hopefully going to help harden against: "hidden" s when calling and such
Assigning priority as discussed in the of the Prioritization Working Group. label -I-prioritize +P-medium
Code change:
<ins> include ../tools.mk # only-windows-msvc all: # Test that we don't have the full path to the PDB file in the binary $(RUSTC) main.rs -g --crate-name my_crate_name --crate-type bin -Cforce-frame-pointers $(CGREP) "my_crate_name.pdb" < $(TMPDIR)/my_crate_name.exe $(CGREP) -v "my_crate_name.pdb" < $(TMPDIR)/my_crate_name.exe # Test that backtraces still can find debuginfo by checking that they contain symbol names and # source locations. $(TMPDIR)/my_crate_name.exe &> $(TMPDIR)/backtrace.txt $(CGREP) "my_crate_name::fn_in_backtrace" < $(TMPDIR)/backtrace.txt $(CGREP) "main.rs:15" < $(TMPDIR)/backtrace.txt # Test that explicitly passed `-Clink-arg=/PDBALTPATH:...` is respected $(RUSTC) main.rs -g --crate-name my_crate_name --crate-type bin -Clink-arg=/PDBALTPATH:abcdefg.pdb -Cforce-frame-pointers $(CGREP) "abcdefg.pdb" < $(TMPDIR)/my_crate_name.exe $(CGREP) -v "my_crate_name.pdb" < $(TMPDIR)/my_crate_name.exe </ins>

Related discussion:
text: Spawned off of When passing to rustc I would expect all paths that start with to be replaced with , instead a is still present. Note that this happens even in release mode, because rustc always tells the msvc linker to generate files. This can be "fixed" by passing either , or to rustc, but doing so will break backtraces with ( already prints almost nothing in release mode). As a sidenote, do we really need backtraces in release mode, and by consequence files? They will break anyway if only the is distributed or the directory is deleted. Moreover this shouldn't be needed in the first place since promises to "remap source names in all output (compiler messages and output files)" (from the output of ), "including ). Also note that neither nor the rustc book mention the need to pass one of those arguments to rustc to remap/remove the path to the file, which makes it harder for non-experts to know how to remove them. :
Assigning priority as discussed in the of the Prioritization Working Group. label -I-prioritize +P-medium
Perhaps this should be amended to say compiler output but not linker outputs. PDB files are generated at the linking step, which is probably why sees non-determinism for --crate-type=bin (linked) and not for --crate-type=rlib (not linked). Passing to the linker to put a relative path to the PDB files is probably the best choice, as it is the least destructive, and the debugger will look for PDB files next to the executables, so it will be able to find it. Chromium uses this for its Windows linking step as well: ;drc=;l=2358 Doing this with could work if you can figure out which "to-be-remapped" path is going to be the path being written by the linker, and then pass the resulting path to . I must confess I am not sure how linking is being done, but I assume the binary is being linked by a dedicated linker, not by rustc itself? If so that is not too reliable. rustc could provide a switch to remove the absolute path to PDB files, which would just map to . The value proposition there seems low, since you can pass that as the user anyway.