diff options
| author | Dylan MacKenzie <ecstaticmorse@gmail.com> | 2019-11-13 10:46:44 -0800 |
|---|---|---|
| committer | Dylan MacKenzie <ecstaticmorse@gmail.com> | 2019-11-13 10:46:44 -0800 |
| commit | 7552bd662f89c67c54e61e2f7c1c1979f6b510e2 (patch) | |
| tree | 01bfb70673480a89165ef0063a47fc5a3d37be8c /src | |
| parent | 5e048da5a553cae9a6842856fb5eb61425e51f96 (diff) | |
Use `ast::Mutability`
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustc_passes/check_const.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/librustc_passes/check_const.rs b/src/librustc_passes/check_const.rs index 3263ee512a9..a6d7eeabc88 100644 --- a/src/librustc_passes/check_const.rs +++ b/src/librustc_passes/check_const.rs @@ -14,6 +14,7 @@ use rustc::hir; use rustc::session::Session; use rustc::ty::TyCtxt; use rustc::ty::query::Providers; +use syntax::ast::Mutability; use syntax::span_err; use syntax_pos::Span; @@ -35,8 +36,8 @@ impl ConstKind { let owner = hir_map.body_owner(body.id()); let const_kind = match hir_map.body_owner_kind(owner) { hir::BodyOwnerKind::Const => Self::Const, - hir::BodyOwnerKind::Static(hir::Mutability::MutMutable) => Self::StaticMut, - hir::BodyOwnerKind::Static(hir::Mutability::MutImmutable) => Self::Static, + hir::BodyOwnerKind::Static(Mutability::Mutable) => Self::StaticMut, + hir::BodyOwnerKind::Static(Mutability::Immutable) => Self::Static, hir::BodyOwnerKind::Fn if is_const_fn(owner) => Self::ConstFn, hir::BodyOwnerKind::Fn | hir::BodyOwnerKind::Closure => return None, |
