mirror of
https://github.com/rust-lang/rust.git
synced 2024-10-30 05:51:58 +00:00
Allow newly added non_local_definitions lint in tests
This commit is contained in:
parent
6170394313
commit
80c81c53ac
@ -5,6 +5,8 @@
|
||||
|
||||
//@ edition:2018
|
||||
|
||||
#![allow(non_local_definitions)]
|
||||
|
||||
struct A<'a, 'b>(&'a &'b i32);
|
||||
struct B<'a>(&'a i32);
|
||||
|
||||
|
@ -1,4 +1,6 @@
|
||||
//@ run-pass
|
||||
#![allow(non_local_definitions)]
|
||||
|
||||
struct Example<const N: usize>;
|
||||
|
||||
macro_rules! external_macro {
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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::*;
|
||||
|
@ -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;
|
||||
|
@ -1,6 +1,8 @@
|
||||
//@ run-pass
|
||||
//@ aux-build:issue-41053.rs
|
||||
|
||||
#![allow(non_local_definitions)]
|
||||
|
||||
pub trait Trait { fn foo(&self) {} }
|
||||
|
||||
pub struct Foo;
|
||||
|
@ -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) }
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
//@ run-pass
|
||||
#![allow(dead_code)]
|
||||
#![allow(unused_variables)]
|
||||
#![allow(non_local_definitions)]
|
||||
#![feature(unsize, coerce_unsized)]
|
||||
|
||||
#[repr(packed)]
|
||||
|
@ -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 {
|
||||
|
@ -1,5 +1,6 @@
|
||||
#![feature(auto_traits)]
|
||||
#![feature(negative_impls)]
|
||||
#![allow(non_local_definitions)]
|
||||
|
||||
pub trait PubPrincipal {}
|
||||
auto trait PrivNonPrincipal {}
|
||||
|
@ -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)]
|
||||
| ^^^^^^^^^^^^
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user