|
10 | 10 |
|
11 | 11 | //! See the Book for more information. |
12 | 12 |
|
13 | | -#![allow(non_camel_case_types)] |
14 | | - |
15 | 13 | pub use self::LateBoundRegionConversionTime::*; |
16 | 14 | pub use self::RegionVariableOrigin::*; |
17 | 15 | pub use self::SubregionOrigin::*; |
18 | 16 | pub use self::TypeOrigin::*; |
19 | 17 | pub use self::ValuePairs::*; |
20 | | -pub use self::fixup_err::*; |
21 | 18 | pub use middle::ty::IntVarValue; |
22 | 19 | pub use self::freshen::TypeFreshener; |
23 | 20 | pub use self::region_inference::GenericKind; |
@@ -65,7 +62,7 @@ pub mod unify_key; |
65 | 62 |
|
66 | 63 | pub type Bound<T> = Option<T>; |
67 | 64 | pub type UnitResult<'tcx> = RelateResult<'tcx, ()>; // "unify result" |
68 | | -pub type fres<T> = Result<T, fixup_err>; // "fixup result" |
| 65 | +pub type FixupResult<T> = Result<T, FixupError>; // "fixup result" |
69 | 66 |
|
70 | 67 | pub struct InferCtxt<'a, 'tcx: 'a> { |
71 | 68 | pub tcx: &'a ty::ctxt<'tcx>, |
@@ -313,23 +310,25 @@ pub enum RegionVariableOrigin { |
313 | 310 | } |
314 | 311 |
|
315 | 312 | #[derive(Copy, Clone, Debug)] |
316 | | -pub enum fixup_err { |
317 | | - unresolved_int_ty(IntVid), |
318 | | - unresolved_float_ty(FloatVid), |
319 | | - unresolved_ty(TyVid) |
| 313 | +pub enum FixupError { |
| 314 | + UnresolvedIntTy(IntVid), |
| 315 | + UnresolvedFloatTy(FloatVid), |
| 316 | + UnresolvedTy(TyVid) |
320 | 317 | } |
321 | 318 |
|
322 | | -pub fn fixup_err_to_string(f: fixup_err) -> String { |
| 319 | +pub fn fixup_err_to_string(f: FixupError) -> String { |
| 320 | + use self::FixupError::*; |
| 321 | + |
323 | 322 | match f { |
324 | | - unresolved_int_ty(_) => { |
| 323 | + UnresolvedIntTy(_) => { |
325 | 324 | "cannot determine the type of this integer; add a suffix to \ |
326 | 325 | specify the type explicitly".to_string() |
327 | 326 | } |
328 | | - unresolved_float_ty(_) => { |
| 327 | + UnresolvedFloatTy(_) => { |
329 | 328 | "cannot determine the type of this number; add a suffix to specify \ |
330 | 329 | the type explicitly".to_string() |
331 | 330 | } |
332 | | - unresolved_ty(_) => "unconstrained type".to_string(), |
| 331 | + UnresolvedTy(_) => "unconstrained type".to_string(), |
333 | 332 | } |
334 | 333 | } |
335 | 334 |
|
@@ -1169,7 +1168,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> { |
1169 | 1168 | if ty.has_infer_types() || ty.references_error() { Err(()) } else { Ok(ty) } |
1170 | 1169 | } |
1171 | 1170 |
|
1172 | | - pub fn fully_resolve<T:TypeFoldable<'tcx>>(&self, value: &T) -> fres<T> { |
| 1171 | + pub fn fully_resolve<T:TypeFoldable<'tcx>>(&self, value: &T) -> FixupResult<T> { |
1173 | 1172 | /*! |
1174 | 1173 | * Attempts to resolve all type/region variables in |
1175 | 1174 | * `value`. Region inference must have been run already (e.g., |
|
0 commit comments