Skip to content

Commit

Permalink
Rollup merge of rust-lang#110387 - nnethercote:rm-use-rustc_hir-as-as…
Browse files Browse the repository at this point in the history
…t, r=fee1-dead

Don't `use rustc_hir as ast`(!)

It makes for confusing code.

This was introduced in a large commit in rust-lang#67886 that rearranged a lot of `use` statements. I suspect it was an accident.
  • Loading branch information
fee1-dead authored Apr 16, 2023
2 parents 4d868c9 + 1ffa331 commit 312cad1
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions compiler/rustc_middle/src/ty/relate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use crate::ty::error::{ExpectedFound, TypeError};
use crate::ty::{self, Expr, ImplSubject, Term, TermKind, Ty, TyCtxt, TypeFoldable};
use crate::ty::{GenericArg, GenericArgKind, SubstsRef};
use rustc_hir as ast;
use rustc_hir as hir;
use rustc_hir::def_id::DefId;
use rustc_target::spec::abi;
use std::iter;
Expand Down Expand Up @@ -123,8 +123,8 @@ pub fn relate_type_and_mut<'tcx, R: TypeRelation<'tcx>>(
} else {
let mutbl = a.mutbl;
let (variance, info) = match mutbl {
ast::Mutability::Not => (ty::Covariant, ty::VarianceDiagInfo::None),
ast::Mutability::Mut => {
hir::Mutability::Not => (ty::Covariant, ty::VarianceDiagInfo::None),
hir::Mutability::Mut => {
(ty::Invariant, ty::VarianceDiagInfo::Invariant { ty: base_ty, param_index: 0 })
}
};
Expand Down Expand Up @@ -239,12 +239,12 @@ impl<'tcx> Relate<'tcx> for ty::BoundConstness {
}
}

impl<'tcx> Relate<'tcx> for ast::Unsafety {
impl<'tcx> Relate<'tcx> for hir::Unsafety {
fn relate<R: TypeRelation<'tcx>>(
relation: &mut R,
a: ast::Unsafety,
b: ast::Unsafety,
) -> RelateResult<'tcx, ast::Unsafety> {
a: hir::Unsafety,
b: hir::Unsafety,
) -> RelateResult<'tcx, hir::Unsafety> {
if a != b {
Err(TypeError::UnsafetyMismatch(expected_found(relation, a, b)))
} else {
Expand Down

0 comments on commit 312cad1

Please sign in to comment.