Switch back non_local_definitions lint to allow-by-default · rust-lang/rust@0c0dfb8 (original) (raw)

1

1

`` warning: non-local impl definition, impl blocks should be written at the same level as their item

``

2

``

`-

--> $DIR/consts.rs:13:5

`

``

2

`+

--> $DIR/consts.rs:15:5

`

3

3

` |

`

4

4

`LL | const Z: () = {

`

5

5

` | -----------

`

`@@ -17,10 +17,14 @@ LL | impl Uto for &Test {}

`

17

17

`` = note: an impl is never scoped, even when it is nested inside an item, as it may impact type checking outside of that item, which can be the case if neither the trait or the self type are at the same nesting level as the impl

``

18

18

`` = note: items in an anonymous const item (const _: () = { ... }) are treated as in the same scope as the anonymous const's declaration for the purpose of this lint

``

19

19

` = note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue https://github.com/rust-lang/rust/issues/120363

`

20

``

`` -

= note: #[warn(non_local_definitions)] on by default

``

``

20

`+

note: the lint level is defined here

`

``

21

`+

--> $DIR/consts.rs:5:9

`

``

22

`+

|

`

``

23

`+

LL | #![warn(non_local_definitions)]

`

``

24

`+

| ^^^^^^^^^^^^^^^^^^^^^

`

21

25

``

22

26

`` warning: non-local impl definition, impl blocks should be written at the same level as their item

``

23

``

`-

--> $DIR/consts.rs:24:5

`

``

27

`+

--> $DIR/consts.rs:26:5

`

24

28

` |

`

25

29

`LL | static A: u32 = {

`

26

30

`` | ------------- move the impl block outside of this static A

``

`@@ -36,7 +40,7 @@ LL | impl Uto2 for Test {}

`

36

40

` = note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue https://github.com/rust-lang/rust/issues/120363

`

37

41

``

38

42

`` warning: non-local impl definition, impl blocks should be written at the same level as their item

``

39

``

`-

--> $DIR/consts.rs:32:5

`

``

43

`+

--> $DIR/consts.rs:34:5

`

40

44

` |

`

41

45

`LL | const B: u32 = {

`

42

46

`` | ------------ move the impl block outside of this constant B

``

`@@ -52,7 +56,7 @@ LL | impl Uto3 for Test {}

`

52

56

` = note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue https://github.com/rust-lang/rust/issues/120363

`

53

57

``

54

58

`` warning: non-local impl definition, impl blocks should be written at the same level as their item

``

55

``

`-

--> $DIR/consts.rs:43:5

`

``

59

`+

--> $DIR/consts.rs:45:5

`

56

60

` |

`

57

61

`LL | fn main() {

`

58

62

`` | --------- move the impl block outside of this function main

``

`@@ -65,7 +69,7 @@ LL | impl Test {

`

65

69

` = note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue https://github.com/rust-lang/rust/issues/120363

`

66

70

``

67

71

`` warning: non-local impl definition, impl blocks should be written at the same level as their item

``

68

``

`-

--> $DIR/consts.rs:50:9

`

``

72

`+

--> $DIR/consts.rs:52:9

`

69

73

` |

`

70

74

`LL | const {

`

71

75

` | ___________-

`

`@@ -84,7 +88,7 @@ LL | | };

`

84

88

` = note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue https://github.com/rust-lang/rust/issues/120363

`

85

89

``

86

90

`` warning: non-local impl definition, impl blocks should be written at the same level as their item

``

87

``

`-

--> $DIR/consts.rs:59:9

`

``

91

`+

--> $DIR/consts.rs:61:9

`

88

92

` |

`

89

93

`LL | const _: u32 = {

`

90

94

`` | ------------ move the impl block outside of this constant _ and up 2 bodies

``

`@@ -98,7 +102,7 @@ LL | impl Test {

`

98

102

` = note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue https://github.com/rust-lang/rust/issues/120363

`

99

103

``

100

104

`` warning: non-local impl definition, impl blocks should be written at the same level as their item

``

101

``

`-

--> $DIR/consts.rs:72:9

`

``

105

`+

--> $DIR/consts.rs:74:9

`

102

106

` |

`

103

107

`LL | let _a = || {

`

104

108

`` | -- move the impl block outside of this closure <unnameable> and up 2 bodies

``

`@@ -113,7 +117,7 @@ LL | impl Uto9 for Test {}

`

113

117

` = note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue https://github.com/rust-lang/rust/issues/120363

`

114

118

``

115

119

`` warning: non-local impl definition, impl blocks should be written at the same level as their item

``

116

``

`-

--> $DIR/consts.rs:79:9

`

``

120

`+

--> $DIR/consts.rs:81:9

`

117

121

` |

`

118

122

`LL | type A = [u32; {

`

119

123

` | ____________________-

`