about summary refs log tree commit diff
path: root/compiler
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-04-19 19:11:05 +0000
committerbors <bors@rust-lang.org>2023-04-19 19:11:05 +0000
commit9c51cf7e7ffd4ca1b7159657a76e1d4fbab18276 (patch)
tree966375423147a92549520540aad967d289d9d464 /compiler
parentdf0d9b492da81a647eedf17210cf55b86a44888c (diff)
parent0820e31a00c02cdefe2e47a5b6c1df27ad531f69 (diff)
downloadrust-9c51cf7e7ffd4ca1b7159657a76e1d4fbab18276.tar.gz
rust-9c51cf7e7ffd4ca1b7159657a76e1d4fbab18276.zip
Auto merge of #110546 - matthiaskrgr:rollup-346kik6, r=matthiaskrgr
Rollup of 10 pull requests

Successful merges:

 - #110123 ('./configure' now checks if 'config.toml' exists before writing to that destination)
 - #110429 (Spelling src bootstrap)
 - #110430 (Spelling src ci)
 - #110515 (Don't special-case download-rustc in `maybe_install_llvm`)
 - #110521 (Fix `x test lint-docs linkchecker` when download-rustc is enabled)
 - #110525 (Fix `tests/run-make-translation` when download-rustc is enabled)
 - #110531 (small type system cleanup)
 - #110533 (Missing blanket impl trait not public)
 - #110540 (Fix wrong comment in rustc_hir/src/hir.rs)
 - #110541 (Fix various configure bugs)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'compiler')
-rw-r--r--compiler/rustc_hir/src/hir.rs2
-rw-r--r--compiler/rustc_middle/src/ty/flags.rs8
-rw-r--r--compiler/rustc_trait_selection/src/traits/wf.rs31
3 files changed, 16 insertions, 25 deletions
diff --git a/compiler/rustc_hir/src/hir.rs b/compiler/rustc_hir/src/hir.rs
index fb0c087bfb4..486718ea6a0 100644
--- a/compiler/rustc_hir/src/hir.rs
+++ b/compiler/rustc_hir/src/hir.rs
@@ -1960,7 +1960,7 @@ pub enum ExprKind<'hir> {
     Lit(&'hir Lit),
     /// A cast (e.g., `foo as f64`).
     Cast(&'hir Expr<'hir>, &'hir Ty<'hir>),
-    /// A type reference (e.g., `Foo`).
+    /// A type ascription (e.g., `x: Foo`). See RFC 3307.
     Type(&'hir Expr<'hir>, &'hir Ty<'hir>),
     /// Wraps the expression in a terminating scope.
     /// This makes it semantically equivalent to `{ let _t = expr; _t }`.
diff --git a/compiler/rustc_middle/src/ty/flags.rs b/compiler/rustc_middle/src/ty/flags.rs
index 5a6ee123811..68002bfcfbd 100644
--- a/compiler/rustc_middle/src/ty/flags.rs
+++ b/compiler/rustc_middle/src/ty/flags.rs
@@ -178,7 +178,7 @@ impl FlagComputation {
 
             &ty::Alias(ty::Projection, data) => {
                 self.add_flags(TypeFlags::HAS_TY_PROJECTION);
-                self.add_projection_ty(data);
+                self.add_alias_ty(data);
             }
 
             &ty::Alias(ty::Opaque, ty::AliasTy { substs, .. }) => {
@@ -267,7 +267,7 @@ impl FlagComputation {
                 projection_ty,
                 term,
             })) => {
-                self.add_projection_ty(projection_ty);
+                self.add_alias_ty(projection_ty);
                 self.add_term(term);
             }
             ty::PredicateKind::WellFormed(arg) => {
@@ -372,8 +372,8 @@ impl FlagComputation {
         }
     }
 
-    fn add_projection_ty(&mut self, projection_ty: ty::AliasTy<'_>) {
-        self.add_substs(projection_ty.substs);
+    fn add_alias_ty(&mut self, alias_ty: ty::AliasTy<'_>) {
+        self.add_substs(alias_ty.substs);
     }
 
     fn add_substs(&mut self, substs: &[GenericArg<'_>]) {
diff --git a/compiler/rustc_trait_selection/src/traits/wf.rs b/compiler/rustc_trait_selection/src/traits/wf.rs
index 3d026506a5a..6808861d643 100644
--- a/compiler/rustc_trait_selection/src/traits/wf.rs
+++ b/compiler/rustc_trait_selection/src/traits/wf.rs
@@ -170,29 +170,20 @@ pub fn predicate_obligations<'tcx>(
         ty::PredicateKind::WellFormed(arg) => {
             wf.compute(arg);
         }
-        ty::PredicateKind::ObjectSafe(_) => {}
-        ty::PredicateKind::ClosureKind(..) => {}
-        ty::PredicateKind::Subtype(ty::SubtypePredicate { a, b, a_is_expected: _ }) => {
-            wf.compute(a.into());
-            wf.compute(b.into());
-        }
-        ty::PredicateKind::Coerce(ty::CoercePredicate { a, b }) => {
-            wf.compute(a.into());
-            wf.compute(b.into());
-        }
+
         ty::PredicateKind::ConstEvaluatable(ct) => {
             wf.compute(ct.into());
         }
-        ty::PredicateKind::ConstEquate(c1, c2) => {
-            wf.compute(c1.into());
-            wf.compute(c2.into());
-        }
-        ty::PredicateKind::Ambiguous => {}
-        ty::PredicateKind::TypeWellFormedFromEnv(..) => {
-            bug!("TypeWellFormedFromEnv is only used for Chalk")
-        }
-        ty::PredicateKind::AliasRelate(..) => {
-            bug!("We should only wf check where clauses and `AliasRelate` is not a `Clause`")
+
+        ty::PredicateKind::ObjectSafe(_)
+        | ty::PredicateKind::ClosureKind(..)
+        | ty::PredicateKind::Subtype(..)
+        | ty::PredicateKind::Coerce(..)
+        | ty::PredicateKind::ConstEquate(..)
+        | ty::PredicateKind::Ambiguous
+        | ty::PredicateKind::AliasRelate(..)
+        | ty::PredicateKind::TypeWellFormedFromEnv(..) => {
+            bug!("We should only wf check where clauses, unexpected predicate: {predicate:?}")
         }
     }