Skip to content

Commit

Permalink
Allow newly added non_local_definitions lint in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Urgau committed Feb 17, 2024
1 parent 6170394 commit 80c81c5
Show file tree
Hide file tree
Showing 14 changed files with 22 additions and 5 deletions.
2 changes: 2 additions & 0 deletions tests/ui/async-await/async-assoc-fn-anon-lifetimes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

//@ edition:2018

#![allow(non_local_definitions)]

struct A<'a, 'b>(&'a &'b i32);
struct B<'a>(&'a i32);

Expand Down
2 changes: 2 additions & 0 deletions tests/ui/const-generics/min_const_generics/macro.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
//@ run-pass
#![allow(non_local_definitions)]

struct Example<const N: usize>;

macro_rules! external_macro {
Expand Down
1 change: 1 addition & 0 deletions tests/ui/consts/const_in_pattern/accept_structural.rs
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions tests/ui/drop/dropck-eyepatch-reorder.rs
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions tests/ui/drop/dropck-eyepatch.rs
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions tests/ui/imports/local-modularized-tricky-pass-2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::*;
Expand Down
1 change: 1 addition & 0 deletions tests/ui/issues/issue-31776.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
2 changes: 2 additions & 0 deletions tests/ui/issues/issue-41053.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
//@ run-pass
//@ aux-build:issue-41053.rs

#![allow(non_local_definitions)]

pub trait Trait { fn foo(&self) {} }

pub struct Foo;
Expand Down
2 changes: 2 additions & 0 deletions tests/ui/macros/type-macros-simple.rs
Original file line number Diff line number Diff line change
@@ -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) }
}
Expand Down
1 change: 1 addition & 0 deletions tests/ui/packed/issue-46152.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
//@ run-pass
#![allow(dead_code)]
#![allow(unused_variables)]
#![allow(non_local_definitions)]
#![feature(unsize, coerce_unsized)]

#[repr(packed)]
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/privacy/associated-item-privacy-trait.rs
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
1 change: 1 addition & 0 deletions tests/ui/privacy/private-in-public-non-principal.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#![feature(auto_traits)]
#![feature(negative_impls)]
#![allow(non_local_definitions)]

pub trait PubPrincipal {}
auto trait PrivNonPrincipal {}
Expand Down
8 changes: 4 additions & 4 deletions tests/ui/privacy/private-in-public-non-principal.stderr
Original file line number Diff line number Diff line change
@@ -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)]
| ^^^^^^^^^^^^
Expand Down
2 changes: 2 additions & 0 deletions tests/ui/rust-2018/uniform-paths/issue-55779.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 80c81c5

Please sign in to comment.