Skip to content

Commit 9d00daa

Browse files
committed
Start some fixup
1 parent 8ebc470 commit 9d00daa

File tree

9 files changed

+18
-17
lines changed

9 files changed

+18
-17
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ log = "0.4"
88
anyhow = "1.0.75"
99
serde = { version = "1.0.192", features = ["derive"] }
1010
serde_json = "1.0.108"
11-
rustc_utils = { git = "https://github.com/DJMcNab/rustc_plugin", rev = "dee1d90c770bb44a6c3479c1f2a05cd4890e3010" }
11+
rustc_utils = { git = "https://github.com/DJMcNab/rustc_plugin", rev = "70646a67a5591b48a275a7e97cd5f63ff4cf873c" }
1212
fluid-let = "1.0.0"
1313
itertools = "0.14.0"
1414

crates/argus-cli/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ license = "MIT"
1212
[dependencies]
1313
argus-lib = { version = "0.1.19", path = "../argus" }
1414
argus-ext = { version = "0.1.19", path = "../argus-ext" }
15-
rustc_plugin = { git = "https://github.com/DJMcNab/rustc_plugin", rev = "dee1d90c770bb44a6c3479c1f2a05cd4890e3010" }
15+
rustc_plugin = { git = "https://github.com/DJMcNab/rustc_plugin", rev = "70646a67a5591b48a275a7e97cd5f63ff4cf873c" }
1616

1717
rustc_utils.workspace = true
1818
log.workspace = true

crates/argus-ext/src/infer.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ use rustc_hashes::Hash64;
22
use rustc_infer::{infer::InferCtxt, traits::PredicateObligation};
33
use rustc_middle::ty::{self, Predicate, TypeFoldable};
44
use rustc_trait_selection::{
5-
solve::InferCtxtSelectExt, traits::query::NoSolution,
5+
solve::InferCtxtSelectExt,
6+
traits::{query::NoSolution, SelectionContext},
67
};
78

89
use crate::{ty::TyCtxtExt, EvaluationResult};
@@ -67,8 +68,9 @@ impl<'tcx> InferCtxtExt<'tcx> for InferCtxt<'tcx> {
6768
param_env: obligation.param_env,
6869
recursion_depth: obligation.recursion_depth,
6970
};
71+
let mut selection_ctx = SelectionContext::new(self);
7072

71-
match self.select_in_new_trait_solver(&trait_obligation) {
73+
match selection_ctx.poly_select(&trait_obligation) {
7274
Ok(Some(_)) => Ok(Certainty::Yes),
7375
Ok(None) => Ok(Certainty::Maybe(MaybeCause::Ambiguity)),
7476
_ => Err(NoSolution),

crates/argus-ext/src/rustc/fn_ctx.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -163,12 +163,12 @@ impl<'a, 'tcx: 'a> FnCtxtExt<'tcx> for FnCtxtSimulator<'a, 'tcx> {
163163
let find_param_matching = |matches: &dyn Fn(ty::ParamTerm) -> bool| {
164164
predicate_args.iter().find_map(|arg| {
165165
arg.walk().find(|arg| {
166-
if let ty::GenericArgKind::Type(ty) = arg.unpack()
166+
if let ty::GenericArgKind::Type(ty) = arg.kind()
167167
&& let ty::Param(param_ty) = *ty.kind()
168168
&& matches(ty::ParamTerm::Ty(param_ty))
169169
{
170170
true
171-
} else if let ty::GenericArgKind::Const(ct) = arg.unpack()
171+
} else if let ty::GenericArgKind::Const(ct) = arg.kind()
172172
&& let ty::ConstKind::Param(param_ct) = ct.kind()
173173
&& matches(ty::ParamTerm::Const(param_ct))
174174
{
@@ -424,7 +424,7 @@ impl<'a, 'tcx: 'a> FnCtxtExt<'tcx> for FnCtxtSimulator<'a, 'tcx> {
424424
// Handle `Self` param specifically, since it's separated in
425425
// the path representation
426426
if let Some(self_ty) = self_ty
427-
&& let ty::GenericArgKind::Type(ty) = param.unpack()
427+
&& let ty::GenericArgKind::Type(ty) = param.kind()
428428
&& ty == self.tcx.types.self_param
429429
{
430430
error.obligation.cause.span = self_ty
@@ -440,7 +440,7 @@ impl<'a, 'tcx: 'a> FnCtxtExt<'tcx> for FnCtxtSimulator<'a, 'tcx> {
440440
}
441441
// Handle `Self` param specifically, since it's separated in
442442
// the path representation
443-
if let ty::GenericArgKind::Type(ty) = param.unpack()
443+
if let ty::GenericArgKind::Type(ty) = param.kind()
444444
&& ty == self.tcx.types.self_param
445445
{
446446
error.obligation.cause.span = self_ty
@@ -820,7 +820,7 @@ impl<'a, 'tcx: 'a> FnCtxtExt<'tcx> for FnCtxtSimulator<'a, 'tcx> {
820820
return Ok(expr);
821821
}
822822

823-
let ty::GenericArgKind::Type(in_ty) = in_ty.unpack() else {
823+
let ty::GenericArgKind::Type(in_ty) = in_ty.kind() else {
824824
return Err(expr);
825825
};
826826

@@ -1132,7 +1132,7 @@ fn find_param_in_ty<'tcx>(
11321132
if arg == param_to_point_at {
11331133
return true;
11341134
}
1135-
if let ty::GenericArgKind::Type(ty) = arg.unpack()
1135+
if let ty::GenericArgKind::Type(ty) = arg.kind()
11361136
&& let ty::Alias(ty::Projection | ty::Inherent, ..) = ty.kind()
11371137
{
11381138
// This logic may seem a bit strange, but typically when

crates/argus-ext/src/ty/impl.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -328,10 +328,9 @@ impl<'tcx> TyCtxtExt<'tcx> for TyCtxt<'tcx> {
328328
impl PredicateObligationExt for PredicateObligation<'_> {
329329
fn range(&self, tcx: &TyCtxt, body_id: BodyId) -> CharRange {
330330
let source_map = tcx.sess.source_map();
331-
let hir = tcx.hir();
332331

333332
let hir_id = tcx.hir_body_owner(body_id);
334-
let body_span = hir.span(hir_id);
333+
let body_span = tcx.hir_span(hir_id);
335334

336335
// Backup span of the DefId
337336

crates/argus-ser/src/term.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ impl TermDef {
1616
where
1717
S: serde::Serializer,
1818
{
19-
TermKindDef::serialize(&value.unpack(), s)
19+
TermKindDef::serialize(&value.kind(), s)
2020
}
2121
}
2222

crates/argus-ser/src/ty.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ impl<'tcx> AliasTyKindDef<'tcx> {
301301
(
302302
ty::AliasTyKind::Projection
303303
| ty::AliasTyKind::Inherent
304-
| ty::AliasTyKind::Weak,
304+
| ty::AliasTyKind::Free,
305305
ref data,
306306
) => {
307307
if !(infcx.should_print_verbose() || with_no_queries())

crates/argus/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ ts-rs = { version = "7.1.1", features = [
3737
], optional = true }
3838

3939
[dev-dependencies]
40-
rustc_utils = { git = "https://github.com/DJMcNab/rustc_plugin", rev = "dee1d90c770bb44a6c3479c1f2a05cd4890e3010", features = [
40+
rustc_utils = { git = "https://github.com/DJMcNab/rustc_plugin", rev = "70646a67a5591b48a275a7e97cd5f63ff4cf873c", features = [
4141
"serde",
4242
"ts-rs",
4343
] }

0 commit comments

Comments
 (0)