Remove an unneeded FIXME in coherence.rs
Also, let f; f = ...; is just wrong.
This commit is contained in:
parent
e0d10bb69a
commit
c6b992a53f
@ -60,29 +60,25 @@ fn get_base_type(inference_context: &InferCtxt,
|
|||||||
span: Span,
|
span: Span,
|
||||||
original_type: t)
|
original_type: t)
|
||||||
-> Option<t> {
|
-> Option<t> {
|
||||||
let resolved_type;
|
let resolved_type = match resolve_type(inference_context,
|
||||||
match resolve_type(inference_context,
|
Some(span),
|
||||||
Some(span),
|
original_type,
|
||||||
original_type,
|
resolve_ivar) {
|
||||||
resolve_ivar) {
|
Ok(resulting_type) if !type_is_ty_var(resulting_type) => resulting_type,
|
||||||
Ok(resulting_type) if !type_is_ty_var(resulting_type) => {
|
|
||||||
resolved_type = resulting_type;
|
|
||||||
}
|
|
||||||
_ => {
|
_ => {
|
||||||
inference_context.tcx.sess.span_fatal(span,
|
inference_context.tcx.sess.span_fatal(span,
|
||||||
"the type of this value must be known in order \
|
"the type of this value must be known in order \
|
||||||
to determine the base type");
|
to determine the base type");
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
match get(resolved_type).sty {
|
match get(resolved_type).sty {
|
||||||
ty_enum(..) | ty_struct(..) | ty_unboxed_closure(..) => {
|
ty_enum(..) | ty_struct(..) | ty_unboxed_closure(..) => {
|
||||||
debug!("(getting base type) found base type");
|
debug!("(getting base type) found base type");
|
||||||
Some(resolved_type)
|
Some(resolved_type)
|
||||||
}
|
}
|
||||||
// FIXME(14865) I would prefere to use `_` here, but that causes a
|
|
||||||
// compiler error.
|
_ if ty::type_is_trait(resolved_type) => {
|
||||||
ty_uniq(_) | ty_rptr(_, _) | ty_trait(..) if ty::type_is_trait(resolved_type) => {
|
|
||||||
debug!("(getting base type) found base type (trait)");
|
debug!("(getting base type) found base type (trait)");
|
||||||
Some(resolved_type)
|
Some(resolved_type)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user