Skip to content

Commit 9b82bdd

Browse files
committed
Allow newly added non_local_definitions lint in tests
1 parent d6bac6e commit 9b82bdd

File tree

11 files changed

+16
-3
lines changed

11 files changed

+16
-3
lines changed

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

+2
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

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// run-pass
2+
#![allow(non_local_definitions)]
23
struct Example<const N: usize>;
34

45
macro_rules! external_macro {

tests/ui/consts/const_in_pattern/warn_corner_cases.rs

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
// rather than a commitment to a specific value.
1414

1515
#![warn(indirect_structural_match)]
16+
#![allow(non_local_definitions)]
1617

1718
#[derive(Copy, Clone, Debug)]
1819
struct NoDerive(#[allow(dead_code)] u32);

tests/ui/consts/const_in_pattern/warn_corner_cases.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
warning: to use a constant of type `NoDerive` in a pattern, the constant's initializer must be trivial or `NoDerive` must be annotated with `#[derive(PartialEq)]`
2-
--> $DIR/warn_corner_cases.rs:26:47
2+
--> $DIR/warn_corner_cases.rs:27:47
33
|
44
LL | match None { Some(_) => panic!("whoops"), INDEX => dbg!(INDEX), };
55
| ^^^^^
@@ -11,7 +11,7 @@ LL | match None { Some(_) => panic!("whoops"), INDEX => dbg!(INDEX), };
1111
= note: `#[warn(nontrivial_structural_match)]` on by default
1212

1313
warning: to use a constant of type `NoDerive` in a pattern, the constant's initializer must be trivial or `NoDerive` must be annotated with `#[derive(PartialEq)]`
14-
--> $DIR/warn_corner_cases.rs:32:47
14+
--> $DIR/warn_corner_cases.rs:33:47
1515
|
1616
LL | match None { Some(_) => panic!("whoops"), CALL => dbg!(CALL), };
1717
| ^^^^
@@ -22,7 +22,7 @@ LL | match None { Some(_) => panic!("whoops"), CALL => dbg!(CALL), };
2222
= note: see https://doc.rust-lang.org/stable/std/marker/trait.StructuralPartialEq.html for details
2323

2424
warning: to use a constant of type `NoDerive` in a pattern, the constant's initializer must be trivial or `NoDerive` must be annotated with `#[derive(PartialEq)]`
25-
--> $DIR/warn_corner_cases.rs:38:47
25+
--> $DIR/warn_corner_cases.rs:39:47
2626
|
2727
LL | match None { Some(_) => panic!("whoops"), METHOD_CALL => dbg!(METHOD_CALL), };
2828
| ^^^^^^^^^^^

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

+1
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

+1
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

+1
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

+1
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

+2
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/packed/issue-46152.rs

+1
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/rust-2018/uniform-paths/issue-55779.rs

+2
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)