Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9b3a511

Browse files
committed
Auto merge ofrust-lang#120639 - fee1-dead-contrib:new-effects-desugaring, r=oli-obk
Implement new effects desugaringcc `@rust-lang/project-const-traits.` Will write down notes once I have finished.* [x] See if we want `T: Tr` to desugar into `T: Tr, T::Effects: Compat<true>`* [x] Fix ICEs on `type Assoc: ~const Tr` and `type Assoc<T: ~const Tr>`* [ ] add types and traits to minicore test* [ ] update rustc-dev-guideFixesrust-lang#119717Fixesrust-lang#123664Fixesrust-lang#124857Fixesrust-lang#126148
2 parents171f5db +729a10a commit9b3a511

File tree

2 files changed

+47
-0
lines changed

2 files changed

+47
-0
lines changed

‎core/src/lib.rs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,7 @@
231231
#![feature(let_chains)]
232232
#![feature(link_llvm_intrinsics)]
233233
#![feature(macro_metavar_expr)]
234+
#![feature(marker_trait_attr)]
234235
#![feature(min_exhaustive_patterns)]
235236
#![feature(min_specialization)]
236237
#![feature(multiple_supertrait_upcastable)]

‎core/src/marker.rs‎

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1024,3 +1024,49 @@ pub trait FnPtr: Copy + Clone {
10241024
pub macroSmartPointer($item:item){
10251025
/* compiler built-in */
10261026
}
1027+
1028+
// Support traits and types for the desugaring of const traits and
1029+
// `~const` bounds. Not supposed to be used by anything other than
1030+
// the compiler.
1031+
#[doc(hidden)]
1032+
#[unstable(
1033+
feature ="effect_types",
1034+
issue ="none",
1035+
reason ="internal module for implementing effects"
1036+
)]
1037+
#[allow(missing_debug_implementations)]// these unit structs don't need `Debug` impls.
1038+
#[cfg(not(bootstrap))]
1039+
pubmod effects{
1040+
#[lang ="EffectsNoRuntime"]
1041+
pubstructNoRuntime;
1042+
#[lang ="EffectsMaybe"]
1043+
pubstructMaybe;
1044+
#[lang ="EffectsRuntime"]
1045+
pubstructRuntime;
1046+
1047+
#[lang ="EffectsCompat"]
1048+
pubtraitCompat<#[rustc_runtime]constRUNTIME:bool>{}
1049+
1050+
implCompat<false>forNoRuntime{}
1051+
implCompat<true>forRuntime{}
1052+
impl<#[rustc_runtime]constRUNTIME:bool>Compat<RUNTIME>forMaybe{}
1053+
1054+
#[lang ="EffectsTyCompat"]
1055+
#[marker]
1056+
pubtraitTyCompat<T: ?Sized>{}
1057+
1058+
impl<T: ?Sized>TyCompat<T>forT{}
1059+
impl<T: ?Sized>TyCompat<T>forMaybe{}
1060+
impl<T: ?Sized>TyCompat<Maybe>forT{}
1061+
1062+
#[lang ="EffectsIntersection"]
1063+
pubtraitIntersection{
1064+
#[lang ="EffectsIntersectionOutput"]
1065+
typeOutput: ?Sized;
1066+
}
1067+
1068+
// FIXME(effects): remove this after next trait solver lands
1069+
implIntersectionfor(){
1070+
typeOutput =Maybe;
1071+
}
1072+
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp