Skip to content

Commit 3ee4a4d

Browse files
committed
fix(cargo): locate binary using target path instead of deps
1 parent 142ffe1 commit 3ee4a4d

5 files changed

Lines changed: 27 additions & 20 deletions

File tree

flake.lock

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rust-toolchain.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
# SPDX-License-Identifier: MIT OR Apache-2.0
44

55
[toolchain]
6-
channel = "nightly-2026-07-29"
6+
channel = "nightly-2026-07-31"
77
components = ["llvm-tools-preview", "rustc-dev", "rust-src"]

src/preempt_count/check.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,8 @@ memoize!(
521521
.iter_identity_copied()
522522
.map(Unnormalized::skip_norm_wip)
523523
.filter_map(|(clause, _)| {
524-
clause.instantiate_supertrait(cx.tcx, trait_ref)
524+
clause
525+
.instantiate_supertrait(cx.tcx, trait_ref)
525526
.as_trait_clause()
526527
});
527528
for supertrait in super_traits {
@@ -546,9 +547,7 @@ memoize!(
546547
let clauses = cx.clauses_of(entry).instantiate_own(cx.tcx, args);
547548
if rustc_trait_selection::traits::impossible_clauses(
548549
cx.tcx,
549-
clauses
550-
.map(|(clause, _)| clause.skip_norm_wip())
551-
.collect(),
550+
clauses.map(|(clause, _)| clause.skip_norm_wip()).collect(),
552551
) {
553552
continue;
554553
}

tests/compile-test.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,13 @@ use std::sync::LazyLock;
1010

1111
static PROFILE_PATH: LazyLock<PathBuf> = LazyLock::new(|| {
1212
let current_exe_path = env::current_exe().unwrap();
13-
let deps_path = current_exe_path.parent().unwrap();
14-
let profile_path = deps_path.parent().unwrap();
15-
profile_path.into()
13+
let components: Vec<_> = current_exe_path.components().collect();
14+
let target_idx = components
15+
.iter()
16+
.rposition(|x| x.as_os_str() == "target")
17+
.unwrap();
18+
let profile_path = components[..=target_idx + 1].iter().collect();
19+
profile_path
1620
});
1721

1822
fn run_ui_tests(bless: bool) {

tests/dep/main.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,13 @@ use std::sync::LazyLock;
88

99
static PROFILE_PATH: LazyLock<PathBuf> = LazyLock::new(|| {
1010
let current_exe_path = env::current_exe().unwrap();
11-
let deps_path = current_exe_path.parent().unwrap();
12-
let profile_path = deps_path.parent().unwrap();
13-
profile_path.into()
11+
let components: Vec<_> = current_exe_path.components().collect();
12+
let target_idx = components
13+
.iter()
14+
.rposition(|x| x.as_os_str() == "target")
15+
.unwrap();
16+
let profile_path = components[..=target_idx + 1].iter().collect();
17+
profile_path
1418
});
1519

1620
#[test]

0 commit comments

Comments
 (0)