rust/compiler/rustc_lint
许杰友 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
..
src Rollup merge of #125750 - compiler-errors:expect, r=lcnr 2024-06-04 08:25:48 +01:00
Cargo.toml non_local_defs: point to Self and Trait to give more context 2024-05-27 23:59:18 +02:00
messages.ftl Change lint_dropping_copy_types to use UseLetUnderscoreIgnoreSuggestion as suggestion. 2024-05-29 18:09:20 +08:00