Skip to content

Commit 03a6465

Browse files
authored
Merge pull request #20453 from jackh726/nts-part2
Fix webrender-2022 metrics - shift vars when mapping dyn
2 parents 70fcdd5 + fb53fdc commit 03a6465

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

crates/hir-ty/src/next_solver/mapping.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1147,6 +1147,9 @@ pub(crate) fn convert_ty_for_result<'db>(interner: DbInterner<'db>, ty: Ty<'db>)
11471147
}
11481148
}),
11491149
);
1150+
1151+
let p = shift_vars(interner, p, 1);
1152+
11501153
let where_clause = match p.skip_binder() {
11511154
rustc_type_ir::ExistentialPredicate::Trait(trait_ref) => {
11521155
let trait_ref = TraitRef::new(

xtask/src/metrics.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ struct Host {
160160

161161
impl Metrics {
162162
fn new(sh: &Shell) -> anyhow::Result<Metrics> {
163-
let host = Host::new(sh)?;
163+
let host = Host::new(sh).unwrap_or_else(|_| Host::unknown());
164164
let timestamp = SystemTime::now();
165165
let revision = cmd!(sh, "git rev-parse HEAD").read()?;
166166
let perf_revision = "a584462e145a0c04760fd9391daefb4f6bd13a99".into();
@@ -191,9 +191,13 @@ impl Metrics {
191191
}
192192

193193
impl Host {
194+
fn unknown() -> Host {
195+
Host { os: "unknown".into(), cpu: "unknown".into(), mem: "unknown".into() }
196+
}
197+
194198
fn new(sh: &Shell) -> anyhow::Result<Host> {
195199
if cfg!(not(target_os = "linux")) {
196-
return Ok(Host { os: "unknown".into(), cpu: "unknown".into(), mem: "unknown".into() });
200+
return Ok(Host::unknown());
197201
}
198202

199203
let os = read_field(sh, "/etc/os-release", "PRETTY_NAME=")?.trim_matches('"').to_owned();

0 commit comments

Comments
 (0)