rust/compiler/rustc_trait_selection/src
许杰友 Jieyou Xu (Joe) b477f89041
Rollup merge of #125750 - compiler-errors:expect, r=lcnr
Align `Term` methods with `GenericArg` methods, add `Term::expect_*`

* `Term::ty` -> `Term::as_type`.
* `Term::ct` -> `Term::as_const`.
* Adds `Term::expect_type` and `Term::expect_const`, and uses them in favor of `.ty().unwrap()`, etc.

I could also shorten these to `as_ty` and then do `GenericArg::as_ty` as well, but I do think the `as_` is important to signal that this is a conversion method, and not a getter, like `Const::ty` is.

r? types
2024-06-04 08:25:48 +01:00
..
solve Rollup merge of #125750 - compiler-errors:expect, r=lcnr 2024-06-04 08:25:48 +01:00
traits Rollup merge of #125750 - compiler-errors:expect, r=lcnr 2024-06-04 08:25:48 +01:00
errors.rs Lift TraitRef into rustc_type_ir 2024-05-10 15:44:03 -04:00
infer.rs Add cycle errors to ScrubbedTraitError to remove a couple more calls to new_with_diagnostics 2024-06-03 09:27:52 -04:00
lib.rs Remove extern crate rustc_middle from rustc_trait_selection. 2024-05-13 08:20:18 +10:00
regions.rs Add cycle errors to ScrubbedTraitError to remove a couple more calls to new_with_diagnostics 2024-06-03 09:27:52 -04:00