diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2024-06-15 10:56:40 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-06-15 10:56:40 +0200 |
| commit | 335e320baadce3fe39db3f7cd96acc015e85a9bf (patch) | |
| tree | 429d816b76e883f45b9893c4e41744dedfd8aa94 /compiler/rustc_middle | |
| parent | 8217b412a235407243f2516ebc859e7b3af8345a (diff) | |
| parent | 54fa4b0b741cacb76b3014e96d974283ff81c5d0 (diff) | |
| download | rust-335e320baadce3fe39db3f7cd96acc015e85a9bf.tar.gz rust-335e320baadce3fe39db3f7cd96acc015e85a9bf.zip | |
Rollup merge of #126354 - compiler-errors:variance, r=lcnr
Use `Variance` glob imported variants everywhere Fully commit to using the globbed variance. Could be convinced the other way, and change this PR to not use the globbed variants anywhere, but I'd rather we do one or the other. r? lcnr
Diffstat (limited to 'compiler/rustc_middle')
| -rw-r--r-- | compiler/rustc_middle/src/ty/mod.rs | 1 | ||||
| -rw-r--r-- | compiler/rustc_middle/src/values.rs | 2 |
2 files changed, 1 insertions, 2 deletions
diff --git a/compiler/rustc_middle/src/ty/mod.rs b/compiler/rustc_middle/src/ty/mod.rs index c322c87bce4..5a94a53e175 100644 --- a/compiler/rustc_middle/src/ty/mod.rs +++ b/compiler/rustc_middle/src/ty/mod.rs @@ -16,7 +16,6 @@ pub use self::visit::{TypeSuperVisitable, TypeVisitable, TypeVisitableExt, TypeV pub use self::AssocItemContainer::*; pub use self::BorrowKind::*; pub use self::IntVarValue::*; -pub use self::Variance::*; use crate::error::{OpaqueHiddenTypeMismatch, TypeMismatchReason}; use crate::metadata::ModChild; use crate::middle::privacy::EffectiveVisibilities; diff --git a/compiler/rustc_middle/src/values.rs b/compiler/rustc_middle/src/values.rs index 4ae475d35d1..8c323188826 100644 --- a/compiler/rustc_middle/src/values.rs +++ b/compiler/rustc_middle/src/values.rs @@ -142,7 +142,7 @@ impl<'tcx> Value<TyCtxt<'tcx>> for &[ty::Variance] { && let Some(def_id) = frame.query.def_id { let n = tcx.generics_of(def_id).own_params.len(); - vec![ty::Variance::Bivariant; n].leak() + vec![ty::Bivariant; n].leak() } else { span_bug!( cycle_error.usage.as_ref().unwrap().0, |
