about summary refs log tree commit diff
path: root/compiler/rustc_ast
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-08-08 19:23:41 +0000
committerbors <bors@rust-lang.org>2023-08-08 19:23:41 +0000
commitf88a8b71cebb730cbd5058c45ebcae1d4d9be377 (patch)
treecb6151402989f498dd13def70bbab6d54dc50878 /compiler/rustc_ast
parentf525bb4e2afac6d2491a86c178aa98e3f3931130 (diff)
parent057be381c60bf9b5c26497a42ad51917c3027b65 (diff)
downloadrust-f88a8b71cebb730cbd5058c45ebcae1d4d9be377.tar.gz
rust-f88a8b71cebb730cbd5058c45ebcae1d4d9be377.zip
Auto merge of #114545 - fee1-dead-contrib:lower-impl-effect, r=oli-obk
correctly lower `impl const` to bind to host effect param

r? `@oli-obk`
Diffstat (limited to 'compiler/rustc_ast')
-rw-r--r--compiler/rustc_ast/src/ast.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/compiler/rustc_ast/src/ast.rs b/compiler/rustc_ast/src/ast.rs
index f2e90fd8eed..58725a08c7c 100644
--- a/compiler/rustc_ast/src/ast.rs
+++ b/compiler/rustc_ast/src/ast.rs
@@ -313,6 +313,16 @@ pub enum TraitBoundModifier {
     MaybeConstMaybe,
 }
 
+impl TraitBoundModifier {
+    pub fn to_constness(self) -> Const {
+        match self {
+            // FIXME(effects) span
+            Self::MaybeConst => Const::Yes(DUMMY_SP),
+            _ => Const::No,
+        }
+    }
+}
+
 /// The AST represents all type param bounds as types.
 /// `typeck::collect::compute_bounds` matches these against
 /// the "special" built-in traits (see `middle::lang_items`) and