Skip to content

Commit 8edccef

Browse files
authored
Merge branch 'main' into metrics-tooling2
2 parents 217e220 + 30d156b commit 8edccef

File tree

215 files changed

+3514
-2571
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

215 files changed

+3514
-2571
lines changed

.github/workflows/kani.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ jobs:
122122
--exclude-pattern time::Duration::from_secs_f \
123123
--include-pattern unicode::unicode_data::conversions::to_ \
124124
--exclude-pattern ::precondition_check \
125-
--harness-timeout 5m \
125+
--harness-timeout 10m \
126126
--default-unwind 1000 \
127127
--jobs=3 --output-format=terse | tee autoharness-verification.log
128128
gzip autoharness-verification.log

.github/workflows/pr_approval.yml

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,21 @@ jobs:
7373
return;
7474
}
7575
76+
// Get the list of changed files
77+
const { data: changedFiles } = await github.rest.pulls.listFiles({
78+
owner,
79+
repo,
80+
pull_number,
81+
});
82+
83+
// Check if any files in doc/, library/ or verifast-proofs/ are modified
84+
const affectsDocs = changedFiles.some(file => file.filename.startsWith('doc/'));
85+
const affectsLibrary = changedFiles.some(file => file.filename.startsWith('library/'));
86+
const affectsVerifast = changedFiles.some(file => file.filename.startsWith('verifast-proofs/'));
87+
// Require two approvals iff one of the above folders are modified; otherwise, one is sufficient.
88+
const requiresTwoApprovals = affectsDocs || affectsLibrary || affectsVerifast;
89+
const requiredApprovals = requiresTwoApprovals ? 2 : 1;
90+
7691
// Get all reviews with pagination
7792
async function getAllReviews() {
7893
let allReviews = [];
@@ -113,23 +128,27 @@ jobs:
113128
.map(review => review.user.login)
114129
);
115130
116-
const requiredApprovals = 2;
117131
const committeeApprovers = Array.from(approvers)
118132
.filter(approver => requiredApprovers.includes(approver));
119133
const currentCountfromCommittee = committeeApprovers.length;
120134
121-
// Core logic that checks if the approvers are in the committee
122-
const conclusion = (currentCountfromCommittee >= 2) ? 'success' : 'failure';
135+
// Check if we have enough approvals
136+
const conclusion = (currentCountfromCommittee >= requiredApprovals) ? 'success' : 'failure';
123137
124138
console.log('PR Approval Status');
139+
console.log('Modified folders:');
140+
console.log(`- doc/: ${affectsDocs ? 'yes' : 'no'}`);
141+
console.log(`- library/: ${affectsLibrary ? 'yes' : 'no'}`);
142+
console.log(`- verifast-proofs/: ${affectsVerifast ? 'yes' : 'no'}`);
143+
console.log(`Required approvals from committee: ${requiredApprovals}`);
125144
console.log(`PR has ${approvers.size} total approvals and ${currentCountfromCommittee} required approvals from the committee.`);
126145
127146
console.log(`Committee Members: [${requiredApprovers.join(', ')}]`);
128147
console.log(`Committee Approvers: ${committeeApprovers.length === 0 ? 'NONE' : `[${committeeApprovers.join(', ')}]`}`);
129148
console.log(`All Approvers: ${approvers.size === 0 ? 'NONE' : `[${Array.from(approvers).join(', ')}]`}`);
130149
131150
if (conclusion === 'failure') {
132-
core.setFailed(`PR needs 2 approvals from committee members, but it has ${currentCountfromCommittee}`);
151+
core.setFailed(`PR needs ${requiredApprovals} approval${requiredApprovals > 1 ? 's' : ''} from committee members, but it has ${currentCountfromCommittee}`);
133152
} else {
134153
core.info('PR approval check passed successfully.');
135154
}

library/Cargo.lock

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

library/alloc/src/collections/btree/set.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ pub struct Iter<'a, T: 'a> {
139139
#[stable(feature = "collection_debug", since = "1.17.0")]
140140
impl<T: fmt::Debug> fmt::Debug for Iter<'_, T> {
141141
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
142-
f.debug_tuple("Iter").field(&self.iter.clone()).finish()
142+
f.debug_tuple("Iter").field(&self.iter).finish()
143143
}
144144
}
145145

library/alloc/src/ffi/c_str.rs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -351,9 +351,14 @@ impl CString {
351351
/// # Safety
352352
///
353353
/// This should only ever be called with a pointer that was earlier
354-
/// obtained by calling [`CString::into_raw`]. Other usage (e.g., trying to take
355-
/// ownership of a string that was allocated by foreign code) is likely to lead
356-
/// to undefined behavior or allocator corruption.
354+
/// obtained by calling [`CString::into_raw`], and the memory it points to must not be accessed
355+
/// through any other pointer during the lifetime of reconstructed `CString`.
356+
/// Other usage (e.g., trying to take ownership of a string that was allocated by foreign code)
357+
/// is likely to lead to undefined behavior or allocator corruption.
358+
///
359+
/// This function does not validate ownership of the raw pointer's memory.
360+
/// A double-free may occur if the function is called twice on the same raw pointer.
361+
/// Additionally, the caller must ensure the pointer is not dangling.
357362
///
358363
/// It should be noted that the length isn't just "recomputed," but that
359364
/// the recomputed length must match the original length from the
@@ -818,6 +823,7 @@ impl From<Vec<NonZero<u8>>> for CString {
818823
}
819824
}
820825

826+
#[stable(feature = "c_string_from_str", since = "1.85.0")]
821827
impl FromStr for CString {
822828
type Err = NulError;
823829

@@ -830,6 +836,7 @@ impl FromStr for CString {
830836
}
831837
}
832838

839+
#[stable(feature = "c_string_from_str", since = "1.85.0")]
833840
impl TryFrom<CString> for String {
834841
type Error = IntoStringError;
835842

library/alloc/src/ffi/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,5 +87,5 @@ pub use self::c_str::CString;
8787
#[stable(feature = "alloc_c_string", since = "1.64.0")]
8888
pub use self::c_str::{FromVecWithNulError, IntoStringError, NulError};
8989

90-
#[unstable(feature = "c_str_module", issue = "112134")]
90+
#[stable(feature = "c_str_module", since = "CURRENT_RUSTC_VERSION")]
9191
pub mod c_str;

library/alloc/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@
123123
#![feature(fmt_internals)]
124124
#![feature(fn_traits)]
125125
#![feature(formatting_options)]
126+
#![feature(generic_atomic)]
126127
#![feature(hasher_prefixfree_extras)]
127128
#![feature(inplace_iteration)]
128129
#![feature(iter_advance_by)]

library/alloc/src/macros.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,7 @@ macro_rules! vec {
105105
macro_rules! format {
106106
($($arg:tt)*) => {
107107
$crate::__export::must_use({
108-
let res = $crate::fmt::format($crate::__export::format_args!($($arg)*));
109-
res
108+
$crate::fmt::format($crate::__export::format_args!($($arg)*))
110109
})
111110
}
112111
}

library/alloc/src/str.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -603,6 +603,10 @@ impl str {
603603
/// Converts a boxed slice of bytes to a boxed string slice without checking
604604
/// that the string contains valid UTF-8.
605605
///
606+
/// # Safety
607+
///
608+
/// * The provided bytes must contain a valid UTF-8 sequence.
609+
///
606610
/// # Examples
607611
///
608612
/// ```

library/alloc/src/string.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1832,6 +1832,7 @@ impl String {
18321832
#[stable(feature = "rust1", since = "1.0.0")]
18331833
#[rustc_const_stable(feature = "const_vec_string_slice", since = "1.87.0")]
18341834
#[rustc_confusables("length", "size")]
1835+
#[cfg_attr(not(bootstrap), rustc_no_implicit_autorefs)]
18351836
pub const fn len(&self) -> usize {
18361837
self.vec.len()
18371838
}
@@ -1851,6 +1852,7 @@ impl String {
18511852
#[must_use]
18521853
#[stable(feature = "rust1", since = "1.0.0")]
18531854
#[rustc_const_stable(feature = "const_vec_string_slice", since = "1.87.0")]
1855+
#[cfg_attr(not(bootstrap), rustc_no_implicit_autorefs)]
18541856
pub const fn is_empty(&self) -> bool {
18551857
self.len() == 0
18561858
}

0 commit comments

Comments
 (0)