Unnamed repository; edit this file 'description' to name the repository.
| -rw-r--r-- | Cargo.lock | 44 | ||||
| -rw-r--r-- | Cargo.toml | 16 | ||||
| -rw-r--r-- | crates/hir-ty/src/autoderef.rs | 2 | ||||
| -rw-r--r-- | crates/hir-ty/src/infer/coerce.rs | 6 | ||||
| -rw-r--r-- | crates/hir-ty/src/infer/expr.rs | 2 | ||||
| -rw-r--r-- | crates/hir-ty/src/infer/unify.rs | 6 | ||||
| -rw-r--r-- | crates/hir-ty/src/method_resolution.rs | 6 | ||||
| -rw-r--r-- | crates/hir-ty/src/next_solver/fulfill.rs | 14 | ||||
| -rw-r--r-- | crates/hir-ty/src/next_solver/infer/mod.rs | 2 | ||||
| -rw-r--r-- | crates/hir-ty/src/next_solver/inspect.rs | 2 | ||||
| -rw-r--r-- | crates/hir-ty/src/next_solver/normalize.rs | 4 | ||||
| -rw-r--r-- | crates/hir-ty/src/next_solver/obligation_ctxt.rs | 8 | ||||
| -rw-r--r-- | crates/hir-ty/src/next_solver/structural_normalize.rs | 2 | ||||
| -rw-r--r-- | crates/ide-db/src/imports/merge_imports.rs | 2 | ||||
| -rw-r--r-- | crates/test-fixture/src/lib.rs | 2 | ||||
| -rw-r--r-- | rust-version | 2 |
16 files changed, 62 insertions, 58 deletions
diff --git a/Cargo.lock b/Cargo.lock index 6625403572..37cadeed9f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1842,9 +1842,9 @@ dependencies = [ [[package]] name = "ra-ap-rustc_abi" -version = "0.132.0" +version = "0.134.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "597bb303548ddcca3a2eb05af254508aaf39cf334d4350bb5da51de1eb728859" +checksum = "26dbfcf847c69bcb0c8adcebefdd35ee28ff16b1cb4fa8784f65aa6170d9dd91" dependencies = [ "bitflags 2.9.4", "ra-ap-rustc_hashes", @@ -1854,24 +1854,24 @@ dependencies = [ [[package]] name = "ra-ap-rustc_ast_ir" -version = "0.132.0" +version = "0.134.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78982b4e4432ee4b938e47bb5c8f1a5a5a88c27c782f193aefcc12a3250bd2e2" +checksum = "cf0ce9892d2004018c2d9a3b533031c67d5923b6b7abe67e06e384b56a41254f" [[package]] name = "ra-ap-rustc_hashes" -version = "0.132.0" +version = "0.134.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f7f33a422f724cc1ab43972cdd76a556b17fc256f301d23be620adfc8351df7" +checksum = "be2f85649737b83c679bcafa69694a0a0dcd69eaece83443734655ebbb422a57" dependencies = [ "rustc-stable-hash", ] [[package]] name = "ra-ap-rustc_index" -version = "0.132.0" +version = "0.134.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a6006023c8be18c3ac225d69c1b42f55b3f597f3db03fb40764b4cf1454fd13" +checksum = "3c07f764f87b3c8b5b777f25f04ae9aae11aa9496d470c64eff0ea2e8b137854" dependencies = [ "ra-ap-rustc_index_macros", "smallvec", @@ -1879,9 +1879,9 @@ dependencies = [ [[package]] name = "ra-ap-rustc_index_macros" -version = "0.132.0" +version = "0.134.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9217c29f7fcc30d07ed13a62262144f665410ef1460202599ae924f9ae47ad78" +checksum = "a1ff78ecd915242249ad3ac4550ae078062d6ba49aeae683208cc5f9fb77891a" dependencies = [ "proc-macro2", "quote", @@ -1890,9 +1890,9 @@ dependencies = [ [[package]] name = "ra-ap-rustc_lexer" -version = "0.132.0" +version = "0.134.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "573ad4f5da620e8ba1849d8862866abd7bc765c3d81cb2488c3ecbef33ce2c69" +checksum = "e308242408d1be72be340ba6471cd648be11d95b35bfa4a36ab43b86ab8ca180" dependencies = [ "memchr", "unicode-properties", @@ -1901,9 +1901,9 @@ dependencies = [ [[package]] name = "ra-ap-rustc_next_trait_solver" -version = "0.132.0" +version = "0.134.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d42b095b99e988aeb94622ae62ebda4b7de55d7d98846eec352b8a5a2b8a858" +checksum = "c5c4518700f9f2eb723235ecd5bb2e1177d440ad366a34b81fbabcefcd9dae2d" dependencies = [ "derive-where", "ra-ap-rustc_index", @@ -1914,9 +1914,9 @@ dependencies = [ [[package]] name = "ra-ap-rustc_parse_format" -version = "0.132.0" +version = "0.134.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a21b4e95cb45f840c172493c05f5b9471cf44adb2eccf95d76a0d76e88007870" +checksum = "91256e24fcafc1124831a658906d200db0afecac5d037b3ae3d17795c5cbc25c" dependencies = [ "ra-ap-rustc_lexer", "rustc-literal-escaper 0.0.5", @@ -1924,9 +1924,9 @@ dependencies = [ [[package]] name = "ra-ap-rustc_pattern_analysis" -version = "0.132.0" +version = "0.134.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6aeacef1248066f7b67e7296ef135eeab6446d5d2a5c7f02b8d7b747b41e39b" +checksum = "59e2e227c6297bfd7966bbe1a36c1d28de14acc14cbb78f21ab79c33505459f9" dependencies = [ "ra-ap-rustc_index", "rustc-hash 2.1.1", @@ -1937,9 +1937,9 @@ dependencies = [ [[package]] name = "ra-ap-rustc_type_ir" -version = "0.132.0" +version = "0.134.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52e35ee9e052406035016b8e6d54ca202bc39ccba1702780b33b2d5fb10d1da8" +checksum = "31b221f4055328870cbe52a487f7dfa3c801f99756c68c3bc33ee1c352db9be3" dependencies = [ "arrayvec", "bitflags 2.9.4", @@ -1957,9 +1957,9 @@ dependencies = [ [[package]] name = "ra-ap-rustc_type_ir_macros" -version = "0.132.0" +version = "0.134.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b934c956b0c88df8176803416b69d85d2c392a69c8aa794a4c338f22c527d38" +checksum = "f2654d56a28339d6c445762b78cba400d5e528808ede1c779aeae23b4c6f17ff" dependencies = [ "proc-macro2", "quote", diff --git a/Cargo.toml b/Cargo.toml index 6702bfed87..f94fd37e52 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -88,14 +88,14 @@ vfs-notify = { path = "./crates/vfs-notify", version = "0.0.0" } vfs = { path = "./crates/vfs", version = "0.0.0" } edition = { path = "./crates/edition", version = "0.0.0" } -ra-ap-rustc_lexer = { version = "0.132", default-features = false } -ra-ap-rustc_parse_format = { version = "0.132", default-features = false } -ra-ap-rustc_index = { version = "0.132", default-features = false } -ra-ap-rustc_abi = { version = "0.132", default-features = false } -ra-ap-rustc_pattern_analysis = { version = "0.132", default-features = false } -ra-ap-rustc_ast_ir = { version = "0.132", default-features = false } -ra-ap-rustc_type_ir = { version = "0.132", default-features = false } -ra-ap-rustc_next_trait_solver = { version = "0.132", default-features = false } +ra-ap-rustc_lexer = { version = "0.133", default-features = false } +ra-ap-rustc_parse_format = { version = "0.133", default-features = false } +ra-ap-rustc_index = { version = "0.133", default-features = false } +ra-ap-rustc_abi = { version = "0.133", default-features = false } +ra-ap-rustc_pattern_analysis = { version = "0.133", default-features = false } +ra-ap-rustc_ast_ir = { version = "0.133", default-features = false } +ra-ap-rustc_type_ir = { version = "0.133", default-features = false } +ra-ap-rustc_next_trait_solver = { version = "0.133", default-features = false } # local crates that aren't published to crates.io. These should not have versions. diff --git a/crates/hir-ty/src/autoderef.rs b/crates/hir-ty/src/autoderef.rs index abd1b8b155..6dd3cdb745 100644 --- a/crates/hir-ty/src/autoderef.rs +++ b/crates/hir-ty/src/autoderef.rs @@ -327,7 +327,7 @@ fn structurally_normalize_ty<'db>( // evaluate/fulfill mismatches, but that's not a reason for an ICE. return None; }; - let errors = ocx.select_where_possible(); + let errors = ocx.try_evaluate_obligations(); if !errors.is_empty() { unreachable!(); } diff --git a/crates/hir-ty/src/infer/coerce.rs b/crates/hir-ty/src/infer/coerce.rs index ce5c98979d..4620da7147 100644 --- a/crates/hir-ty/src/infer/coerce.rs +++ b/crates/hir-ty/src/infer/coerce.rs @@ -160,7 +160,7 @@ impl<'a, 'b, 'db> Coerce<'a, 'b, 'db> { Ok(InferOk { value, obligations }) => { let mut ocx = ObligationCtxt::new(this.infer_ctxt()); ocx.register_obligations(obligations); - if ocx.select_where_possible().is_empty() { + if ocx.try_evaluate_obligations().is_empty() { Ok(InferOk { value, obligations: ocx.into_pending_obligations() }) } else { Err(TypeError::Mismatch) @@ -722,7 +722,7 @@ impl<'a, 'b, 'db> Coerce<'a, 'b, 'db> { Some(PredicateKind::AliasRelate(..)) => { let mut ocx = ObligationCtxt::new(self.infer_ctxt()); ocx.register_obligation(obligation); - if !ocx.select_where_possible().is_empty() { + if !ocx.try_evaluate_obligations().is_empty() { return Err(TypeError::Mismatch); } coercion.obligations.extend(ocx.into_pending_obligations()); @@ -1093,7 +1093,7 @@ impl<'db> InferenceContext<'_, 'db> { prev_ty, new_ty, )?; - if ocx.select_where_possible().is_empty() { + if ocx.try_evaluate_obligations().is_empty() { Ok(InferOk { value, obligations: ocx.into_pending_obligations() }) } else { Err(TypeError::Mismatch) diff --git a/crates/hir-ty/src/infer/expr.rs b/crates/hir-ty/src/infer/expr.rs index 859dfef70f..179eaccc65 100644 --- a/crates/hir-ty/src/infer/expr.rs +++ b/crates/hir-ty/src/infer/expr.rs @@ -2023,7 +2023,7 @@ impl<'db> InferenceContext<'_, 'db> { // No argument expectations are produced if unification fails. let origin = ObligationCause::new(); ocx.sup(&origin, self.table.trait_env.env, expected_output, formal_output)?; - if !ocx.select_where_possible().is_empty() { + if !ocx.try_evaluate_obligations().is_empty() { return Err(TypeError::Mismatch); } diff --git a/crates/hir-ty/src/infer/unify.rs b/crates/hir-ty/src/infer/unify.rs index 114c90c7be..8f754f0e1a 100644 --- a/crates/hir-ty/src/infer/unify.rs +++ b/crates/hir-ty/src/infer/unify.rs @@ -117,7 +117,7 @@ pub fn could_unify<'db>( env: Arc<TraitEnvironment<'db>>, tys: &Canonical<'db, (Ty<'db>, Ty<'db>)>, ) -> bool { - could_unify_impl(db, env, tys, |ctxt| ctxt.select_where_possible()) + could_unify_impl(db, env, tys, |ctxt| ctxt.try_evaluate_obligations()) } /// Check if types unify eagerly making sure there are no unresolved goals. @@ -129,7 +129,7 @@ pub fn could_unify_deeply<'db>( env: Arc<TraitEnvironment<'db>>, tys: &Canonical<'db, (Ty<'db>, Ty<'db>)>, ) -> bool { - could_unify_impl(db, env, tys, |ctxt| ctxt.select_all_or_error()) + could_unify_impl(db, env, tys, |ctxt| ctxt.evaluate_obligations_error_on_ambiguity()) } fn could_unify_impl<'db>( @@ -608,7 +608,7 @@ impl<'db> InferenceTable<'db> { } pub(crate) fn select_obligations_where_possible(&mut self) { - self.fulfillment_cx.select_where_possible(&self.infer_ctxt); + self.fulfillment_cx.try_evaluate_obligations(&self.infer_ctxt); } pub(super) fn register_predicate(&mut self, obligation: PredicateObligation<'db>) { diff --git a/crates/hir-ty/src/method_resolution.rs b/crates/hir-ty/src/method_resolution.rs index 98c8f3e890..06c7cdd4e4 100644 --- a/crates/hir-ty/src/method_resolution.rs +++ b/crates/hir-ty/src/method_resolution.rs @@ -822,7 +822,7 @@ pub(crate) fn find_matching_impl<'db>( let mut ocx = ObligationCtxt::new(infcx); let impl_source = selection.map(|obligation| ocx.register_obligation(obligation)); - let errors = ocx.select_all_or_error(); + let errors = ocx.evaluate_obligations_error_on_ambiguity(); if !errors.is_empty() { return None; } @@ -1663,7 +1663,7 @@ fn is_valid_trait_method_candidate<'db>( let mut ctxt = ObligationCtxt::new(&table.infer_ctxt); ctxt.register_obligations(infer_ok.into_obligations()); // FIXME: Are we doing this correctly? Probably better to follow rustc more closely. - check_that!(ctxt.select_where_possible().is_empty()); + check_that!(ctxt.try_evaluate_obligations().is_empty()); } check_that!(table.unify(receiver_ty, expected_receiver)); @@ -1743,7 +1743,7 @@ fn is_valid_impl_fn_candidate<'db>( ) })); - if ctxt.select_where_possible().is_empty() { + if ctxt.try_evaluate_obligations().is_empty() { IsValidCandidate::Yes } else { IsValidCandidate::No diff --git a/crates/hir-ty/src/next_solver/fulfill.rs b/crates/hir-ty/src/next_solver/fulfill.rs index 34dff37972..262da858d4 100644 --- a/crates/hir-ty/src/next_solver/fulfill.rs +++ b/crates/hir-ty/src/next_solver/fulfill.rs @@ -54,7 +54,7 @@ struct ObligationStorage<'db> { /// Obligations which resulted in an overflow in fulfillment itself. /// /// We cannot eagerly return these as error so we instead store them here - /// to avoid recomputing them each time `select_where_possible` is called. + /// to avoid recomputing them each time `try_evaluate_obligations` is called. /// This also allows us to return the correct `FulfillmentError` for them. overflowed: Vec<PredicateObligation<'db>>, pending: PendingObligations<'db>, @@ -95,7 +95,7 @@ impl<'db> ObligationStorage<'db> { // IMPORTANT: we must not use solve any inference variables in the obligations // as this is all happening inside of a probe. We use a probe to make sure // we get all obligations involved in the overflow. We pretty much check: if - // we were to do another step of `select_where_possible`, which goals would + // we were to do another step of `try_evaluate_obligations`, which goals would // change. // FIXME: <https://github.com/Gankra/thin-vec/pull/66> is merged, this can be removed. self.overflowed.extend( @@ -131,7 +131,7 @@ impl<'db> FulfillmentCtxt<'db> { infcx: &InferCtxt<'db>, obligation: PredicateObligation<'db>, ) { - // FIXME: See the comment in `select_where_possible()`. + // FIXME: See the comment in `try_evaluate_obligations()`. // assert_eq!(self.usable_in_snapshot, infcx.num_open_snapshots()); self.obligations.register(obligation, None); } @@ -141,7 +141,7 @@ impl<'db> FulfillmentCtxt<'db> { infcx: &InferCtxt<'db>, obligations: impl IntoIterator<Item = PredicateObligation<'db>>, ) { - // FIXME: See the comment in `select_where_possible()`. + // FIXME: See the comment in `try_evaluate_obligations()`. // assert_eq!(self.usable_in_snapshot, infcx.num_open_snapshots()); obligations.into_iter().for_each(|obligation| self.obligations.register(obligation, None)); } @@ -158,7 +158,7 @@ impl<'db> FulfillmentCtxt<'db> { .collect() } - pub(crate) fn select_where_possible( + pub(crate) fn try_evaluate_obligations( &mut self, infcx: &InferCtxt<'db>, ) -> Vec<NextSolverError<'db>> { @@ -223,11 +223,11 @@ impl<'db> FulfillmentCtxt<'db> { errors } - pub(crate) fn select_all_or_error( + pub(crate) fn evaluate_obligations_error_on_ambiguity( &mut self, infcx: &InferCtxt<'db>, ) -> Vec<NextSolverError<'db>> { - let errors = self.select_where_possible(infcx); + let errors = self.try_evaluate_obligations(infcx); if !errors.is_empty() { return errors; } diff --git a/crates/hir-ty/src/next_solver/infer/mod.rs b/crates/hir-ty/src/next_solver/infer/mod.rs index 1bb6934e07..e1a46fa069 100644 --- a/crates/hir-ty/src/next_solver/infer/mod.rs +++ b/crates/hir-ty/src/next_solver/infer/mod.rs @@ -464,7 +464,7 @@ impl<'db> InferCtxt<'db> { let mut ocx = ObligationCtxt::new(self); ocx.register_obligation(obligation.clone()); let mut result = EvaluationResult::EvaluatedToOk; - for error in ocx.select_all_or_error() { + for error in ocx.evaluate_obligations_error_on_ambiguity() { if error.is_true_error() { return EvaluationResult::EvaluatedToErr; } else { diff --git a/crates/hir-ty/src/next_solver/inspect.rs b/crates/hir-ty/src/next_solver/inspect.rs index bc19d51d23..0db4746721 100644 --- a/crates/hir-ty/src/next_solver/inspect.rs +++ b/crates/hir-ty/src/next_solver/inspect.rs @@ -92,7 +92,7 @@ impl<'db> NormalizesToTermHack<'db> { let mut ocx = ObligationCtxt::new(infcx); ocx.eq(&ObligationCause::dummy(), param_env, self.term, self.unconstrained_term)?; f(&mut ocx); - let errors = ocx.select_all_or_error(); + let errors = ocx.evaluate_obligations_error_on_ambiguity(); if errors.is_empty() { Ok(Certainty::Yes) } else if errors.iter().all(|e| !matches!(e, NextSolverError::TrueError(_))) { diff --git a/crates/hir-ty/src/next_solver/normalize.rs b/crates/hir-ty/src/next_solver/normalize.rs index 41cb488440..2f241f8fec 100644 --- a/crates/hir-ty/src/next_solver/normalize.rs +++ b/crates/hir-ty/src/next_solver/normalize.rs @@ -77,7 +77,7 @@ where stalled_coroutine_goals: vec![], }; let value = value.try_fold_with(&mut folder)?; - let errors = folder.fulfill_cx.select_all_or_error(at.infcx); + let errors = folder.fulfill_cx.evaluate_obligations_error_on_ambiguity(at.infcx); if errors.is_empty() { Ok((value, folder.stalled_coroutine_goals)) } else { Err(errors) } } @@ -138,7 +138,7 @@ impl<'db> NormalizationFolder<'_, 'db> { fn select_all_and_stall_coroutine_predicates( &mut self, ) -> Result<(), Vec<NextSolverError<'db>>> { - let errors = self.fulfill_cx.select_where_possible(self.at.infcx); + let errors = self.fulfill_cx.try_evaluate_obligations(self.at.infcx); if !errors.is_empty() { return Err(errors); } diff --git a/crates/hir-ty/src/next_solver/obligation_ctxt.rs b/crates/hir-ty/src/next_solver/obligation_ctxt.rs index 8e2dc0dec4..e85574a882 100644 --- a/crates/hir-ty/src/next_solver/obligation_ctxt.rs +++ b/crates/hir-ty/src/next_solver/obligation_ctxt.rs @@ -144,13 +144,13 @@ impl<'a, 'db> ObligationCtxt<'a, 'db> { } #[must_use] - pub fn select_where_possible(&mut self) -> Vec<NextSolverError<'db>> { - self.engine.select_where_possible(self.infcx) + pub fn try_evaluate_obligations(&mut self) -> Vec<NextSolverError<'db>> { + self.engine.try_evaluate_obligations(self.infcx) } #[must_use] - pub fn select_all_or_error(&mut self) -> Vec<NextSolverError<'db>> { - self.engine.select_all_or_error(self.infcx) + pub fn evaluate_obligations_error_on_ambiguity(&mut self) -> Vec<NextSolverError<'db>> { + self.engine.evaluate_obligations_error_on_ambiguity(self.infcx) } /// Returns the not-yet-processed and stalled obligations from the diff --git a/crates/hir-ty/src/next_solver/structural_normalize.rs b/crates/hir-ty/src/next_solver/structural_normalize.rs index 18859d8b79..00c3708358 100644 --- a/crates/hir-ty/src/next_solver/structural_normalize.rs +++ b/crates/hir-ty/src/next_solver/structural_normalize.rs @@ -47,7 +47,7 @@ impl<'db> At<'_, 'db> { ); fulfill_cx.register_predicate_obligation(self.infcx, obligation); - let errors = fulfill_cx.select_where_possible(self.infcx); + let errors = fulfill_cx.try_evaluate_obligations(self.infcx); if !errors.is_empty() { return Err(errors); } diff --git a/crates/ide-db/src/imports/merge_imports.rs b/crates/ide-db/src/imports/merge_imports.rs index 4e779a7d85..635ed7368c 100644 --- a/crates/ide-db/src/imports/merge_imports.rs +++ b/crates/ide-db/src/imports/merge_imports.rs @@ -405,6 +405,8 @@ fn recursive_normalize(use_tree: &ast::UseTree, style: NormalizationStyle) -> Op } else { ted::replace_with_many(subtree.syntax(), elements); } + // Silence unused assignment warning on `modified`. + let _ = modified; modified = true; } else { modified |= recursive_normalize(&subtree, NormalizationStyle::Default).is_some(); diff --git a/crates/test-fixture/src/lib.rs b/crates/test-fixture/src/lib.rs index 7574d12c0c..a4549794db 100644 --- a/crates/test-fixture/src/lib.rs +++ b/crates/test-fixture/src/lib.rs @@ -383,6 +383,8 @@ impl ChangeFixture { } } + let _ = file_id; + let root = match current_source_root_kind { SourceRootKind::Local => SourceRoot::new_local(mem::take(&mut file_set)), SourceRootKind::Library => SourceRoot::new_library(mem::take(&mut file_set)), diff --git a/rust-version b/rust-version index 5e2e5d7d33..c9529fde23 100644 --- a/rust-version +++ b/rust-version @@ -1 +1 @@ -3369e82c6bc03c5cdb66f730dba6f738b74c8e1d +fb24b04b096a980bffd80154f6aba22fd07cb3d9 |