1
Fork 0

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 //@ edition:2018
#![allow(non_local_definitions)]
struct A<'a, 'b>(&'a &'b i32); struct A<'a, 'b>(&'a &'b i32);
struct B<'a>(&'a i32); struct B<'a>(&'a i32);

View file

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

View file

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

View file

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

View file

@ -1,5 +1,6 @@
//@ run-pass //@ run-pass
#![feature(dropck_eyepatch)] #![feature(dropck_eyepatch)]
#![allow(non_local_definitions)]
// The point of this test is to illustrate that the `#[may_dangle]` // The point of this test is to illustrate that the `#[may_dangle]`
// attribute specifically allows, in the context of a type // 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. // into the root module soon enough to act as usual items and shadow globs and preludes.
#![feature(decl_macro)] #![feature(decl_macro)]
#![allow(non_local_definitions)]
// `macro_export` shadows globs // `macro_export` shadows globs
use inner1::*; use inner1::*;

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,24 +1,24 @@
warning: trait `PrivNonPrincipal` is more private than the item `leak_dyn_nonprincipal` 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 {} } LL | pub fn leak_dyn_nonprincipal() -> Box<dyn PubPrincipal + PrivNonPrincipal> { loop {} }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function `leak_dyn_nonprincipal` is reachable at visibility `pub` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function `leak_dyn_nonprincipal` is reachable at visibility `pub`
| |
note: but trait `PrivNonPrincipal` is only usable at visibility `pub(crate)` 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 {} LL | auto trait PrivNonPrincipal {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: `#[warn(private_interfaces)]` on by default = note: `#[warn(private_interfaces)]` on by default
error: missing documentation for an associated function 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() {} LL | pub fn check_doc_lint() {}
| ^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^
| |
note: the lint level is defined here 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)] LL | #[deny(missing_docs)]
| ^^^^^^^^^^^^ | ^^^^^^^^^^^^

View file

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