File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 199199 - [ Inference details] ( ./opaque-types-impl-trait-inference.md )
200200 - [ Return Position Impl Trait In Trait] ( ./return-position-impl-trait-in-trait.md )
201201 - [ Region inference restrictions] ( ./borrow-check/opaque-types-region-inference-restrictions.md )
202- - [ Const condition checking] ( ./effects.md )
202+ - [ Const traits and const condition checking] ( ./effects.md )
203203- [ Pattern and exhaustiveness checking] ( ./pat-exhaustive-checking.md )
204204- [ Unsafety checking] ( ./unsafety-checking.md )
205205- [ MIR dataflow] ( ./mir/dataflow.md )
Original file line number Diff line number Diff line change 1- # Effects and const condition checking
1+ # Effects, const traits, and const condition checking
22
33## The ` HostEffect ` predicate
44
@@ -154,3 +154,18 @@ be dropped at compile time.
154154
155155[ old solver ] : https://doc.rust-lang.org/nightly/nightly-rustc/src/rustc_trait_selection/traits/effects.rs.html
156156[ new trait solver ] : https://doc.rust-lang.org/nightly/nightly-rustc/src/rustc_next_trait_solver/solve/effect_goals.rs.html
157+
158+ ## More on const traits
159+
160+ To be expanded later.
161+
162+ ### The ` #[rustc_non_const_trait_method] ` attribute
163+
164+ This is intended for internal (standard library) usage only. With this attribute
165+ applied to a trait method, the compiler will not check the default body of this
166+ method for ability to run in compile time. Users of the trait will also not be
167+ allowed to use this trait method in const contexts. This attribute is primarily
168+ used for constifying large traits such as ` Iterator ` without having to make all
169+ its methods ` const ` at the same time.
170+
171+ This attribute should not be present while stabilizing the trait as ` const ` .
You can’t perform that action at this time.
0 commit comments