Skip to content

Commit e1caf6f

Browse files
committed
1 parent ee50ea2 commit e1caf6f

File tree

21 files changed

+44
-46
lines changed

21 files changed

+44
-46
lines changed

ci/rust-toolchain

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[toolchain]
2-
channel = "nightly-2023-05-26"
3-
components = [ "rustfmt", "rustc-dev", "llvm-tools-preview" ]
2+
channel = "nightly-2023-06-25"
3+
components = [ "rustfmt", "rustc-dev", "llvm-tools" ]

creusot-contracts-proc/src/invariant.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ pub struct Loop {
5656

5757
fn filter_invariants(attrs: &mut Vec<Attribute>) -> Vec<Attribute> {
5858
attrs
59-
.drain_filter(|attr| attr.path().get_ident().map(|i| i == "invariant").unwrap_or(false))
59+
.extract_if(|attr| attr.path().get_ident().map(|i| i == "invariant").unwrap_or(false))
6060
.collect()
6161
}
6262

creusot-contracts-proc/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![feature(box_patterns, drain_filter, extend_one, proc_macro_def_site)]
1+
#![feature(box_patterns, extract_if, extend_one, proc_macro_def_site)]
22
extern crate proc_macro;
33
use extern_spec::ExternSpecs;
44
use pearlite_syn::*;

creusot/src/analysis.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@ pub(crate) fn categorize(context: PlaceContext) -> Option<DefUse> {
111111
PlaceContext::MutatingUse(MutatingUseContext::Borrow) |
112112
PlaceContext::NonMutatingUse(NonMutatingUseContext::SharedBorrow) |
113113
PlaceContext::NonMutatingUse(NonMutatingUseContext::ShallowBorrow) |
114-
PlaceContext::NonMutatingUse(NonMutatingUseContext::UniqueBorrow) |
115114
PlaceContext::NonMutatingUse(NonMutatingUseContext::PlaceMention) |
116115
PlaceContext::MutatingUse(MutatingUseContext::AddressOf) |
117116
PlaceContext::NonMutatingUse(NonMutatingUseContext::AddressOf) |

creusot/src/analysis/frozen_locals.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -121,15 +121,15 @@ impl<'tcx> dataflow::GenKillAnalysis<'tcx> for Borrows<'_, 'tcx> {
121121
type Idx = BorrowIndex;
122122

123123
fn before_statement_effect(
124-
&self,
124+
&mut self,
125125
_trans: &mut impl GenKill<Self::Idx>,
126126
_statement: &mir::Statement<'tcx>,
127127
_location: Location,
128128
) {
129129
}
130130

131131
fn statement_effect(
132-
&self,
132+
&mut self,
133133
trans: &mut impl GenKill<Self::Idx>,
134134
stmt: &mir::Statement<'tcx>,
135135
location: Location,
@@ -184,15 +184,15 @@ impl<'tcx> dataflow::GenKillAnalysis<'tcx> for Borrows<'_, 'tcx> {
184184
}
185185

186186
fn before_terminator_effect(
187-
&self,
187+
&mut self,
188188
_trans: &mut impl GenKill<Self::Idx>,
189189
_terminator: &mir::Terminator<'tcx>,
190190
_location: Location,
191191
) {
192192
}
193193

194194
fn terminator_effect(
195-
&self,
195+
&mut self,
196196
trans: &mut impl GenKill<Self::Idx>,
197197
terminator: &mir::Terminator<'tcx>,
198198
location: Location,
@@ -211,7 +211,7 @@ impl<'tcx> dataflow::GenKillAnalysis<'tcx> for Borrows<'_, 'tcx> {
211211
}
212212

213213
fn call_return_effect(
214-
&self,
214+
&mut self,
215215
_trans: &mut impl GenKill<Self::Idx>,
216216
_block: mir::BasicBlock,
217217
_return_places: dataflow::CallReturnPlaces<'_, 'tcx>,

creusot/src/analysis/init_locals.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ impl<'tcx> GenKillAnalysis<'tcx> for MaybeInitializedLocals {
3434
type Idx = Local;
3535

3636
fn statement_effect(
37-
&self,
37+
&mut self,
3838
trans: &mut impl GenKill<Self::Idx>,
3939
statement: &mir::Statement<'tcx>,
4040
loc: Location,
@@ -43,7 +43,7 @@ impl<'tcx> GenKillAnalysis<'tcx> for MaybeInitializedLocals {
4343
}
4444

4545
fn terminator_effect(
46-
&self,
46+
&mut self,
4747
trans: &mut impl GenKill<Self::Idx>,
4848
terminator: &Terminator<'tcx>,
4949
loc: Location,
@@ -52,7 +52,7 @@ impl<'tcx> GenKillAnalysis<'tcx> for MaybeInitializedLocals {
5252
}
5353

5454
fn call_return_effect(
55-
&self,
55+
&mut self,
5656
trans: &mut impl GenKill<Self::Idx>,
5757
_block: BasicBlock,
5858
return_places: dataflow::CallReturnPlaces<'_, 'tcx>,
@@ -62,7 +62,7 @@ impl<'tcx> GenKillAnalysis<'tcx> for MaybeInitializedLocals {
6262

6363
/// See `Analysis::apply_yield_resume_effect`.
6464
fn yield_resume_effect(
65-
&self,
65+
&mut self,
6666
trans: &mut impl GenKill<Self::Idx>,
6767
_resume_block: BasicBlock,
6868
resume_place: mir::Place<'tcx>,
@@ -114,7 +114,6 @@ where
114114
| NonMutatingUseContext::Copy
115115
| NonMutatingUseContext::SharedBorrow
116116
| NonMutatingUseContext::ShallowBorrow
117-
| NonMutatingUseContext::UniqueBorrow
118117
| NonMutatingUseContext::AddressOf
119118
| NonMutatingUseContext::PlaceMention
120119
| NonMutatingUseContext::Projection,

creusot/src/analysis/liveness_no_drop.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ impl<'tcx> GenKillAnalysis<'tcx> for MaybeLiveExceptDrop {
3535
type Idx = Local;
3636

3737
fn statement_effect(
38-
&self,
38+
&mut self,
3939
trans: &mut impl GenKill<Self::Idx>,
4040
statement: &mir::Statement<'tcx>,
4141
location: Location,
@@ -44,7 +44,7 @@ impl<'tcx> GenKillAnalysis<'tcx> for MaybeLiveExceptDrop {
4444
}
4545

4646
fn terminator_effect(
47-
&self,
47+
&mut self,
4848
trans: &mut impl GenKill<Self::Idx>,
4949
terminator: &mir::Terminator<'tcx>,
5050
location: Location,
@@ -53,7 +53,7 @@ impl<'tcx> GenKillAnalysis<'tcx> for MaybeLiveExceptDrop {
5353
}
5454

5555
fn call_return_effect(
56-
&self,
56+
&mut self,
5757
trans: &mut impl GenKill<Self::Idx>,
5858
_block: mir::BasicBlock,
5959
return_places: CallReturnPlaces<'_, 'tcx>,
@@ -66,7 +66,7 @@ impl<'tcx> GenKillAnalysis<'tcx> for MaybeLiveExceptDrop {
6666
}
6767

6868
fn yield_resume_effect(
69-
&self,
69+
&mut self,
7070
trans: &mut impl GenKill<Self::Idx>,
7171
_resume_block: mir::BasicBlock,
7272
resume_place: mir::Place<'tcx>,
@@ -197,7 +197,6 @@ impl DefUse {
197197
| NonMutatingUseContext::ShallowBorrow
198198
| NonMutatingUseContext::SharedBorrow
199199
| NonMutatingUseContext::PlaceMention
200-
| NonMutatingUseContext::UniqueBorrow,
201200
) => Some(DefUse::Use),
202201
PlaceContext::MutatingUse(MutatingUseContext::Drop) => None,
203202

creusot/src/analysis/uninit_locals.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ impl<'tcx> GenKillAnalysis<'tcx> for MaybeUninitializedLocals {
3535
type Idx = Local;
3636

3737
fn statement_effect(
38-
&self,
38+
&mut self,
3939
trans: &mut impl GenKill<Self::Idx>,
4040
statement: &mir::Statement<'tcx>,
4141
loc: Location,
@@ -44,7 +44,7 @@ impl<'tcx> GenKillAnalysis<'tcx> for MaybeUninitializedLocals {
4444
}
4545

4646
fn terminator_effect(
47-
&self,
47+
&mut self,
4848
trans: &mut impl GenKill<Self::Idx>,
4949
terminator: &Terminator<'tcx>,
5050
loc: Location,
@@ -53,7 +53,7 @@ impl<'tcx> GenKillAnalysis<'tcx> for MaybeUninitializedLocals {
5353
}
5454

5555
fn call_return_effect(
56-
&self,
56+
&mut self,
5757
trans: &mut impl GenKill<Self::Idx>,
5858
_block: BasicBlock,
5959
return_places: dataflow::CallReturnPlaces<'_, 'tcx>,
@@ -67,7 +67,7 @@ impl<'tcx> GenKillAnalysis<'tcx> for MaybeUninitializedLocals {
6767

6868
/// See `Analysis::apply_yield_resume_effect`.
6969
fn yield_resume_effect(
70-
&self,
70+
&mut self,
7171
trans: &mut impl GenKill<Self::Idx>,
7272
_resume_block: BasicBlock,
7373
resume_place: mir::Place<'tcx>,
@@ -112,7 +112,6 @@ where
112112
| NonMutatingUseContext::Copy
113113
| NonMutatingUseContext::SharedBorrow
114114
| NonMutatingUseContext::ShallowBorrow
115-
| NonMutatingUseContext::UniqueBorrow
116115
| NonMutatingUseContext::AddressOf
117116
| NonMutatingUseContext::PlaceMention
118117
| NonMutatingUseContext::Projection,

creusot/src/backend/dependency.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,9 @@ impl<'tcx> Dependency<'tcx> {
109109
};
110110

111111
match &mut self {
112-
Dependency::Item(_, s) => *s = EarlyBinder(*s).subst(tcx, substs),
112+
Dependency::Item(_, s) => *s = EarlyBinder::bind(*s).subst(tcx, substs),
113113
Dependency::Type(ty) | Dependency::TyInv(ty) => {
114-
*ty = EarlyBinder(*ty).subst(tcx, substs)
114+
*ty = EarlyBinder::bind(*ty).subst(tcx, substs)
115115
}
116116
};
117117
self

creusot/src/backend/term.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ pub(super) fn mk_binders(func: Exp, args: Vec<Exp>) -> Exp {
414414
fn is_identity_from<'tcx>(tcx: TyCtxt<'tcx>, id: DefId, subst: SubstsRef<'tcx>) -> bool {
415415
if tcx.def_path_str(id) == "std::convert::From::from" && subst.len() == 1 {
416416
let out_ty: Ty<'tcx> = tcx.fn_sig(id).no_bound_vars().unwrap().output().skip_binder();
417-
return subst[0].expect_ty() == EarlyBinder(out_ty).subst(tcx, subst);
417+
return subst[0].expect_ty() == EarlyBinder::bind(out_ty).subst(tcx, subst);
418418
}
419419
false
420420
}

0 commit comments

Comments
 (0)