Skip to content

Commit

Permalink
Allow newly added non_local_definitions in std
Browse files Browse the repository at this point in the history
  • Loading branch information
Urgau committed Feb 17, 2024
1 parent 01bcc60 commit 1b73355
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions library/core/src/convert/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,7 @@ pub trait AsMut<T: ?Sized> {
/// For example, take this code:
///
/// ```
/// # #![cfg_attr(not(bootstrap), allow(non_local_definitions))]
/// struct Wrapper<T>(Vec<T>);
/// impl<T> From<Wrapper<T>> for Vec<T> {
/// fn from(w: Wrapper<T>) -> Vec<T> {
Expand Down
1 change: 1 addition & 0 deletions library/core/src/hash/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,7 @@ pub trait Hasher {
/// ```
/// #![feature(hasher_prefixfree_extras)]
/// # // Stubs to make the `impl` below pass the compiler
/// # #![cfg_attr(not(bootstrap), allow(non_local_definitions))]
/// # struct MyCollection<T>(Option<T>);
/// # impl<T> MyCollection<T> {
/// # fn len(&self) -> usize { todo!() }
Expand Down
1 change: 1 addition & 0 deletions library/core/tests/iter/adapters/step_by.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ fn test_iterator_step_by_nth() {
}

#[test]
#[cfg_attr(not(bootstrap), allow(non_local_definitions))]
fn test_iterator_step_by_nth_overflow() {
#[cfg(target_pointer_width = "16")]
type Bigger = u32;
Expand Down
2 changes: 2 additions & 0 deletions library/core/tests/result.rs
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ pub fn test_unwrap_or_default() {
}

#[test]
#[cfg_attr(not(bootstrap), allow(non_local_definitions))]
pub fn test_into_ok() {
fn infallible_op() -> Result<isize, !> {
Ok(666)
Expand All @@ -217,6 +218,7 @@ pub fn test_into_ok() {
}

#[test]
#[cfg_attr(not(bootstrap), allow(non_local_definitions))]
pub fn test_into_err() {
fn until_error_op() -> Result<!, isize> {
Err(666)
Expand Down

0 comments on commit 1b73355

Please sign in to comment.