Change ty_with_args to return Ty instead of Result
Although, we would like to avoid crashes whenever possible, and that's why I wanted to make this API fallible. It's looking pretty hard to do proper validation. I think many of our APIs will unfortunately depend on the user doing the correct thing since at the MIR level we are working on, we expect types to have been checked already.
This commit is contained in:
parent
1720b108f7
commit
326fea0fb8
8 changed files with 148 additions and 33 deletions
|
@ -91,7 +91,7 @@ pub trait Context {
|
|||
fn def_ty(&self, item: DefId) -> Ty;
|
||||
|
||||
/// Returns the type of given definition instantiated with the given arguments.
|
||||
fn def_ty_with_args(&self, item: DefId, args: &GenericArgs) -> Result<Ty, Error>;
|
||||
fn def_ty_with_args(&self, item: DefId, args: &GenericArgs) -> Ty;
|
||||
|
||||
/// Returns literal value of a const as a string.
|
||||
fn const_literal(&self, cnst: &Const) -> String;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue