mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-28 02:57:37 +00:00
Add a fast exit to lint_obligations_broken_by_never_type_fallback_change
This commit is contained in:
parent
83f8f9f85d
commit
b88d03b059
@ -8,11 +8,11 @@ use rustc_data_structures::{
|
||||
use rustc_hir as hir;
|
||||
use rustc_hir::intravisit::Visitor;
|
||||
use rustc_hir::HirId;
|
||||
use rustc_middle::bug;
|
||||
use rustc_infer::{
|
||||
infer::{DefineOpaqueTypes, InferOk},
|
||||
traits::ObligationCause,
|
||||
};
|
||||
use rustc_middle::bug;
|
||||
use rustc_middle::ty::{self, Ty, TyCtxt, TypeSuperVisitable, TypeVisitable};
|
||||
use rustc_session::lint;
|
||||
use rustc_span::DUMMY_SP;
|
||||
@ -483,6 +483,11 @@ impl<'tcx> FnCtxt<'_, 'tcx> {
|
||||
) {
|
||||
let DivergingFallbackBehavior::FallbackToUnit = behavior else { return };
|
||||
|
||||
// Fallback happens if and only if there are diverging variables
|
||||
if diverging_vids.is_empty() {
|
||||
return;
|
||||
}
|
||||
|
||||
// Returns errors which happen if fallback is set to `fallback`
|
||||
let try_out = |fallback| {
|
||||
self.probe(|_| {
|
||||
|
Loading…
Reference in New Issue
Block a user