File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -136,6 +136,33 @@ impl<'tcx> AnalysisCtxt<'tcx> {
136136 } ;
137137 }
138138
139+ if data. len ( ) == 5
140+ && let DefPathData :: TypeNs ( slice) = data[ 0 ] . data
141+ && slice == sym:: slice
142+ && let DefPathData :: TypeNs ( sort) = data[ 1 ] . data
143+ && sort == * crate :: symbol:: sort
144+ && let DefPathData :: TypeNs ( unstable) = data[ 2 ] . data
145+ && unstable == sym:: unstable
146+ && let DefPathData :: TypeNs ( quicksort) = data[ 3 ] . data
147+ && quicksort == * crate :: symbol:: quicksort
148+ && let DefPathData :: ValueNs ( partition) = data[ 4 ] . data
149+ && partition == * crate :: symbol:: partition
150+ {
151+ // HACK: `core::sort::unstable::quicksort::partition` uses a const fn to produce a
152+ // function pointer which is called at runtime. This means that it'll guarantee to be
153+ // the same function, so in theory we could see through and check, but this is
154+ // currently beyond klint's ability.
155+ //
156+ // Given this is an internal function and it's only called by `quicksort`, which
157+ // already calls into `is_less` in other means, we shouldn't need to depend on
158+ // `partition` to deduce correct property.
159+ return PreemptionCount {
160+ adjustment : Some ( 0 ) ,
161+ expectation : Some ( super :: ExpectationRange :: top ( ) ) ,
162+ unchecked : true ,
163+ } ;
164+ }
165+
139166 Default :: default ( )
140167 }
141168}
Original file line number Diff line number Diff line change 2929 Waker ,
3030 wake,
3131 wake_by_ref,
32+ sort,
33+ quicksort,
34+ partition,
3235}
You can’t perform that action at this time.
0 commit comments