about summary refs log tree commit diff
path: root/compiler/rustc_middle/src
diff options
context:
space:
mode:
authorYuki Okushi <jtitor@2k36.org>2021-06-12 01:15:56 +0900
committerGitHub <noreply@github.com>2021-06-12 01:15:56 +0900
commit3b47d337e04a24d5e8cf2d25864d7e9fa949ca0a (patch)
tree0323364d4d49b120d954bc2545b83df1716ab9a6 /compiler/rustc_middle/src
parentdddebf94bccddaa7b8836380c1d90b34553d79d0 (diff)
parent47fe696d8f247d91c67068c25bb91767713aeb60 (diff)
downloadrust-3b47d337e04a24d5e8cf2d25864d7e9fa949ca0a.tar.gz
rust-3b47d337e04a24d5e8cf2d25864d7e9fa949ca0a.zip
Rollup merge of #85800 - BoxyUwU:const-param-default-diagnostics, r=oli-obk
Fix some diagnostic issues with const_generics_defaults feature gate

This PR makes a few changes:
- print out const param defaults in "lifetime ordering" errors rather than discarding them
- update `is_simple_text` to account for const params when checking if a type has no generics, this was causing a note to be failed to add to an error message
- fixes some diagnostic wording that incorrectly said there was ordering restrictions between type/const params despite the `const_generics_defaults` feature gate is active
Diffstat (limited to 'compiler/rustc_middle/src')
-rw-r--r--compiler/rustc_middle/src/ty/diagnostics.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_middle/src/ty/diagnostics.rs b/compiler/rustc_middle/src/ty/diagnostics.rs
index 982c8a354b4..bfb4c0cb538 100644
--- a/compiler/rustc_middle/src/ty/diagnostics.rs
+++ b/compiler/rustc_middle/src/ty/diagnostics.rs
@@ -54,7 +54,7 @@ impl<'tcx> TyS<'tcx> {
     /// ADTs with no type arguments.
     pub fn is_simple_text(&self) -> bool {
         match self.kind() {
-            Adt(_, substs) => substs.types().next().is_none(),
+            Adt(_, substs) => substs.non_erasable_generics().next().is_none(),
             Ref(_, ty, _) => ty.is_simple_text(),
             _ => self.is_simple_ty(),
         }