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
This commit is contained in:
@@ -946,7 +946,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
|
||||
// since we don't actually use them.
|
||||
&mut vec![],
|
||||
)
|
||||
.ty()
|
||||
.as_type()
|
||||
.unwrap();
|
||||
|
||||
if let ty::Dynamic(data, ..) = ty.kind() { data.principal() } else { None }
|
||||
|
||||
Reference in New Issue
Block a user