1
Fork 0

Rollup merge of #122813 - nnethercote:nicer-quals, r=compiler-errors

Qualifier tweaking

Adding and removing qualifiers in some cases that make things nicer. Details in individual commits.

r? `@compiler-errors`
This commit is contained in:
Matthias Krüger 2024-04-17 05:44:52 +02:00 committed by GitHub
commit 45940fe6d8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
62 changed files with 346 additions and 399 deletions

View file

@ -168,7 +168,7 @@ impl<'ck, 'mir, 'tcx> TypeVisitor<TyCtxt<'tcx>> for LocalReturnTyVisitor<'ck, 'm
match t.kind() {
ty::FnPtr(_) => {}
ty::Ref(_, _, hir::Mutability::Mut) => {
self.checker.check_op(ops::ty::MutRef(self.kind));
self.checker.check_op(ops::mut_ref::MutRef(self.kind));
t.super_visit_with(self)
}
_ => t.super_visit_with(self),

View file

@ -9,9 +9,10 @@ use rustc_infer::infer::TyCtxtInferExt;
use rustc_infer::traits::{ImplSource, Obligation, ObligationCause};
use rustc_middle::mir::{self, CallSource};
use rustc_middle::ty::print::with_no_trimmed_paths;
use rustc_middle::ty::TraitRef;
use rustc_middle::ty::{suggest_constraining_type_param, Adt, Closure, FnDef, FnPtr, Param, Ty};
use rustc_middle::ty::{GenericArgKind, GenericArgsRef};
use rustc_middle::ty::{
self, suggest_constraining_type_param, Closure, FnDef, FnPtr, GenericArgKind, GenericArgsRef,
Param, TraitRef, Ty,
};
use rustc_middle::util::{call_kind, CallDesugaringKind, CallKind};
use rustc_session::parse::feature_err;
use rustc_span::symbol::sym;
@ -123,7 +124,7 @@ impl<'tcx> NonConstOp<'tcx> for FnCallNonConst<'tcx> {
);
}
}
Adt(..) => {
ty::Adt(..) => {
let obligation =
Obligation::new(tcx, ObligationCause::dummy(), param_env, trait_ref);
@ -620,7 +621,7 @@ impl<'tcx> NonConstOp<'tcx> for ThreadLocalAccess {
}
/// Types that cannot appear in the signature or locals of a `const fn`.
pub mod ty {
pub mod mut_ref {
use super::*;
#[derive(Debug)]