Skip to content

Commit 80c81c5

Browse files
committed
Allow newly added non_local_definitions lint in tests
1 parent 6170394 commit 80c81c5

14 files changed

+22
-5
lines changed

tests/ui/async-await/async-assoc-fn-anon-lifetimes.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55

66
//@ edition:2018
77

8+
#![allow(non_local_definitions)]
9+
810
struct A<'a, 'b>(&'a &'b i32);
911
struct B<'a>(&'a i32);
1012

tests/ui/const-generics/min_const_generics/macro.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
//@ run-pass
2+
#![allow(non_local_definitions)]
3+
24
struct Example<const N: usize>;
35

46
macro_rules! external_macro {

tests/ui/consts/const_in_pattern/accept_structural.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
//@ run-pass
22

3+
#![allow(non_local_definitions)]
34
#![warn(indirect_structural_match)]
45

56
// This test is checking our logic for structural match checking by enumerating

tests/ui/drop/dropck-eyepatch-reorder.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
//@ run-pass
22
#![feature(dropck_eyepatch)]
3+
#![allow(non_local_definitions)]
34

45
// The point of this test is to test uses of `#[may_dangle]` attribute
56
// where the formal declaration order (in the impl generics) does not

tests/ui/drop/dropck-eyepatch.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
//@ run-pass
22
#![feature(dropck_eyepatch)]
3+
#![allow(non_local_definitions)]
34

45
// The point of this test is to illustrate that the `#[may_dangle]`
56
// attribute specifically allows, in the context of a type

tests/ui/imports/local-modularized-tricky-pass-2.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
// into the root module soon enough to act as usual items and shadow globs and preludes.
55

66
#![feature(decl_macro)]
7+
#![allow(non_local_definitions)]
78

89
// `macro_export` shadows globs
910
use inner1::*;

tests/ui/issues/issue-31776.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
//@ run-pass
22
#![allow(dead_code)]
33
#![allow(unused_variables)]
4+
#![allow(non_local_definitions)]
45
// Various scenarios in which `pub` is required in blocks
56

67
struct S;

tests/ui/issues/issue-41053.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
//@ run-pass
22
//@ aux-build:issue-41053.rs
33

4+
#![allow(non_local_definitions)]
5+
46
pub trait Trait { fn foo(&self) {} }
57

68
pub struct Foo;

tests/ui/macros/type-macros-simple.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
//@ run-pass
22
#![allow(dead_code)]
33
#![allow(unused_variables)]
4+
#![allow(non_local_definitions)]
5+
46
macro_rules! Tuple {
57
{ $A:ty,$B:ty } => { ($A, $B) }
68
}

tests/ui/packed/issue-46152.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
//@ run-pass
22
#![allow(dead_code)]
33
#![allow(unused_variables)]
4+
#![allow(non_local_definitions)]
45
#![feature(unsize, coerce_unsized)]
56

67
#[repr(packed)]

tests/ui/privacy/associated-item-privacy-trait.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#![feature(decl_macro, associated_type_defaults)]
2-
#![allow(private_interfaces, private_bounds)]
2+
#![allow(private_interfaces, private_bounds, non_local_definitions)]
33

44
mod priv_trait {
55
trait PrivTr {

tests/ui/privacy/private-in-public-non-principal.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#![feature(auto_traits)]
22
#![feature(negative_impls)]
3+
#![allow(non_local_definitions)]
34

45
pub trait PubPrincipal {}
56
auto trait PrivNonPrincipal {}

tests/ui/privacy/private-in-public-non-principal.stderr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
warning: trait `PrivNonPrincipal` is more private than the item `leak_dyn_nonprincipal`
2-
--> $DIR/private-in-public-non-principal.rs:7:1
2+
--> $DIR/private-in-public-non-principal.rs:8:1
33
|
44
LL | pub fn leak_dyn_nonprincipal() -> Box<dyn PubPrincipal + PrivNonPrincipal> { loop {} }
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function `leak_dyn_nonprincipal` is reachable at visibility `pub`
66
|
77
note: but trait `PrivNonPrincipal` is only usable at visibility `pub(crate)`
8-
--> $DIR/private-in-public-non-principal.rs:5:1
8+
--> $DIR/private-in-public-non-principal.rs:6:1
99
|
1010
LL | auto trait PrivNonPrincipal {}
1111
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
1212
= note: `#[warn(private_interfaces)]` on by default
1313

1414
error: missing documentation for an associated function
15-
--> $DIR/private-in-public-non-principal.rs:13:9
15+
--> $DIR/private-in-public-non-principal.rs:14:9
1616
|
1717
LL | pub fn check_doc_lint() {}
1818
| ^^^^^^^^^^^^^^^^^^^^^^^
1919
|
2020
note: the lint level is defined here
21-
--> $DIR/private-in-public-non-principal.rs:10:8
21+
--> $DIR/private-in-public-non-principal.rs:11:8
2222
|
2323
LL | #[deny(missing_docs)]
2424
| ^^^^^^^^^^^^

tests/ui/rust-2018/uniform-paths/issue-55779.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
//@ edition:2018
33
//@ aux-crate:issue_55779_extern_trait=issue-55779-extern-trait.rs
44

5+
#![allow(non_local_definitions)]
6+
57
use issue_55779_extern_trait::Trait;
68

79
struct Local;

0 commit comments

Comments
 (0)