about summary refs log tree commit diff
path: root/compiler/rustc_middle/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-04-25 15:05:51 +0000
committerbors <bors@rust-lang.org>2024-04-25 15:05:51 +0000
commit9e6c4fddda9d3e5d6cf1b20a0fb82c128efe27ef (patch)
tree0c8f7087e062f6d18ae044a4d37976554aee376a /compiler/rustc_middle/src
parent6a9758d4f38d4763bd437c48fa7e5246cecf8d04 (diff)
parent870ed4bfa2be044bafba589b9d53def3f0a8b005 (diff)
downloadrust-9e6c4fddda9d3e5d6cf1b20a0fb82c128efe27ef.tar.gz
rust-9e6c4fddda9d3e5d6cf1b20a0fb82c128efe27ef.zip
Auto merge of #123531 - compiler-errors:closure-wf, r=oli-obk
Enforce closure args + return type are WF

I found this out when investigating https://github.com/rust-lang/rust/issues/123461#issuecomment-2040894359. Turns out we don't register WF obligations for closure args and return types, leading to the ICE.

~~I think this is a useful thing to check for, but I'd like to check what the fallout is.~~ crater is complete.

~~Worst case, I think we should enforce this across an edition boundary (and possibly eventually migrate this for all editions) -- this should be super easy to do, since this is a check in HIR wfcheck, so it can be made edition dependent.~~ I believe the regressions are manageable enough to not necessitate edition-specific behavior.

Fixes #123461
Diffstat (limited to 'compiler/rustc_middle/src')
-rw-r--r--compiler/rustc_middle/src/traits/mod.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_middle/src/traits/mod.rs b/compiler/rustc_middle/src/traits/mod.rs
index ceee3ea48e3..c4eef8e7728 100644
--- a/compiler/rustc_middle/src/traits/mod.rs
+++ b/compiler/rustc_middle/src/traits/mod.rs
@@ -487,7 +487,7 @@ pub enum WellFormedLoc {
         /// The index of the parameter to use.
         /// Parameters are indexed from 0, with the return type
         /// being the last 'parameter'
-        param_idx: u16,
+        param_idx: usize,
     },
 }