Allow newly added non_local_definitions in std

This commit is contained in:
Urgau 2024-01-27 17:37:53 +01:00
parent 01bcc60ecd
commit 1b733558bf
4 changed files with 5 additions and 0 deletions

View File

@ -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> {

View File

@ -454,6 +454,7 @@ fn write_isize(&mut self, i: isize) {
/// ```
/// #![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!() }

View File

@ -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;

View File

@ -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)
@ -217,6 +218,7 @@ fn infallible_op2() -> Result<isize, MyNeverToken> {
}
#[test]
#[cfg_attr(not(bootstrap), allow(non_local_definitions))]
pub fn test_into_err() {
fn until_error_op() -> Result<!, isize> {
Err(666)