Allow newly added non_local_definitions lint in tests

This commit is contained in:
Urgau 2024-01-26 17:14:38 +01:00
parent 6170394313
commit 80c81c53ac
14 changed files with 22 additions and 5 deletions

View File

@ -5,6 +5,8 @@
//@ edition:2018
#![allow(non_local_definitions)]
struct A<'a, 'b>(&'a &'b i32);
struct B<'a>(&'a i32);

View File

@ -1,4 +1,6 @@
//@ run-pass
#![allow(non_local_definitions)]
struct Example<const N: usize>;
macro_rules! external_macro {

View File

@ -1,5 +1,6 @@
//@ run-pass
#![allow(non_local_definitions)]
#![warn(indirect_structural_match)]
// This test is checking our logic for structural match checking by enumerating

View File

@ -1,5 +1,6 @@
//@ run-pass
#![feature(dropck_eyepatch)]
#![allow(non_local_definitions)]
// The point of this test is to test uses of `#[may_dangle]` attribute
// where the formal declaration order (in the impl generics) does not

View File

@ -1,5 +1,6 @@
//@ run-pass
#![feature(dropck_eyepatch)]
#![allow(non_local_definitions)]
// The point of this test is to illustrate that the `#[may_dangle]`
// attribute specifically allows, in the context of a type

View File

@ -4,6 +4,7 @@
// into the root module soon enough to act as usual items and shadow globs and preludes.
#![feature(decl_macro)]
#![allow(non_local_definitions)]
// `macro_export` shadows globs
use inner1::*;

View File

@ -1,6 +1,7 @@
//@ run-pass
#![allow(dead_code)]
#![allow(unused_variables)]
#![allow(non_local_definitions)]
// Various scenarios in which `pub` is required in blocks
struct S;

View File

@ -1,6 +1,8 @@
//@ run-pass
//@ aux-build:issue-41053.rs
#![allow(non_local_definitions)]
pub trait Trait { fn foo(&self) {} }
pub struct Foo;

View File

@ -1,6 +1,8 @@
//@ run-pass
#![allow(dead_code)]
#![allow(unused_variables)]
#![allow(non_local_definitions)]
macro_rules! Tuple {
{ $A:ty,$B:ty } => { ($A, $B) }
}

View File

@ -1,6 +1,7 @@
//@ run-pass
#![allow(dead_code)]
#![allow(unused_variables)]
#![allow(non_local_definitions)]
#![feature(unsize, coerce_unsized)]
#[repr(packed)]

View File

@ -1,5 +1,5 @@
#![feature(decl_macro, associated_type_defaults)]
#![allow(private_interfaces, private_bounds)]
#![allow(private_interfaces, private_bounds, non_local_definitions)]
mod priv_trait {
trait PrivTr {

View File

@ -1,5 +1,6 @@
#![feature(auto_traits)]
#![feature(negative_impls)]
#![allow(non_local_definitions)]
pub trait PubPrincipal {}
auto trait PrivNonPrincipal {}

View File

@ -1,24 +1,24 @@
warning: trait `PrivNonPrincipal` is more private than the item `leak_dyn_nonprincipal`
--> $DIR/private-in-public-non-principal.rs:7:1
--> $DIR/private-in-public-non-principal.rs:8:1
|
LL | pub fn leak_dyn_nonprincipal() -> Box<dyn PubPrincipal + PrivNonPrincipal> { loop {} }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function `leak_dyn_nonprincipal` is reachable at visibility `pub`
|
note: but trait `PrivNonPrincipal` is only usable at visibility `pub(crate)`
--> $DIR/private-in-public-non-principal.rs:5:1
--> $DIR/private-in-public-non-principal.rs:6:1
|
LL | auto trait PrivNonPrincipal {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: `#[warn(private_interfaces)]` on by default
error: missing documentation for an associated function
--> $DIR/private-in-public-non-principal.rs:13:9
--> $DIR/private-in-public-non-principal.rs:14:9
|
LL | pub fn check_doc_lint() {}
| ^^^^^^^^^^^^^^^^^^^^^^^
|
note: the lint level is defined here
--> $DIR/private-in-public-non-principal.rs:10:8
--> $DIR/private-in-public-non-principal.rs:11:8
|
LL | #[deny(missing_docs)]
| ^^^^^^^^^^^^

View File

@ -2,6 +2,8 @@
//@ edition:2018
//@ aux-crate:issue_55779_extern_trait=issue-55779-extern-trait.rs
#![allow(non_local_definitions)]
use issue_55779_extern_trait::Trait;
struct Local;