Skip to content

Commit

Permalink
Address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
qinheping committed Nov 8, 2024
1 parent 745bbaf commit 7889a89
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
1 change: 1 addition & 0 deletions library/core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@
#![feature(unboxed_closures)]
#![feature(unsized_fn_params)]
#![feature(with_negative_coherence)]
// Required for Kani loop contracts, which are annotated as custom stmt attributes.
#![feature(proc_macro_hygiene)]
// tidy-alphabetical-end
//
Expand Down
5 changes: 2 additions & 3 deletions library/core/src/str/lossy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ impl<'a> Iterator for Utf8Chunks<'a> {
let mut valid_up_to = 0;
// TODO: remove `LEN` and use `self.source.len()` directly once
// fix the issue that Kani loop contracts doesn't support `self`.
// Tracked in https://github.com/model-checking/kani/issues/3700
#[cfg(kani)]
let LEN = self.source.len();
#[safety::loop_invariant(i <= LEN && valid_up_to == i)]
Expand Down Expand Up @@ -301,9 +302,7 @@ impl FusedIterator for Utf8Chunks<'_> {}
#[stable(feature = "utf8_chunks", since = "1.79.0")]
impl fmt::Debug for Utf8Chunks<'_> {
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
f.debug_struct("Utf8Chunks")
.field("source", &self.debug())
.finish()
f.debug_struct("Utf8Chunks").field("source", &self.debug()).finish()
}
}

Expand Down

0 comments on commit 7889a89

Please sign in to comment.