Skip to content

Commit 61707d3

Browse files
committed
Bless tests.
1 parent ed27e35 commit 61707d3

File tree

7 files changed

+62
-116
lines changed

7 files changed

+62
-116
lines changed

src/tools/clippy/tests/ui/author/macro_in_closure.stdout

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -39,31 +39,8 @@ if let StmtKind::Let(local) = stmt.kind
3939
&& let ExprKind::Call(func3, args3) = trailing_expr1.kind
4040
&& func3.res(cx).is_diag_item(cx, sym::FmtTemplateNew)
4141
&& args3.len() == 1
42-
&& let ExprKind::AddrOf(BorrowKind::Ref, Mutability::Not, inner1) = args3[0].kind
43-
&& let ExprKind::Array(elements2) = inner1.kind
44-
&& elements2.len() == 4
45-
&& let ExprKind::Call(func4, args4) = elements2[0].kind
46-
&& paths::CORE_FMT_RT_PIECE_NUM.matches_path(cx, func4) // Add the path to `clippy_utils::paths` if needed
47-
&& args4.len() == 1
48-
&& let ExprKind::Lit(ref lit) = args4[0].kind
49-
&& let LitKind::Int(16140901201934811136, LitIntType::Unsigned(UintTy::Usize)) = lit.node
50-
&& let ExprKind::Call(func5, args5) = elements2[1].kind
51-
&& paths::CORE_FMT_RT_PIECE_NUM.matches_path(cx, func5) // Add the path to `clippy_utils::paths` if needed
52-
&& args5.len() == 1
53-
&& let ExprKind::Lit(ref lit1) = args5[0].kind
54-
&& let LitKind::Int(1, LitIntType::Unsigned(UintTy::Usize)) = lit1.node
55-
&& let ExprKind::Call(func6, args6) = elements2[2].kind
56-
&& paths::CORE_FMT_RT_PIECE_STR.matches_path(cx, func6) // Add the path to `clippy_utils::paths` if needed
57-
&& args6.len() == 1
58-
&& let ExprKind::Lit(ref lit2) = args6[0].kind
59-
&& let LitKind::Str(s, _) = lit2.node
60-
&& s.as_str() == "\n"
61-
&& let ExprKind::Call(func7, args7) = elements2[3].kind
62-
&& paths::CORE_FMT_RT_PIECE_NUM.matches_path(cx, func7) // Add the path to `clippy_utils::paths` if needed
63-
&& args7.len() == 1
64-
&& let ExprKind::Lit(ref lit3) = args7[0].kind
65-
&& let LitKind::Int(0, LitIntType::Unsigned(UintTy::Usize)) = lit3.node
66-
&& let ExprKind::AddrOf(BorrowKind::Ref, Mutability::Not, inner2) = args2[1].kind
42+
&& let ExprKind::ConstBlock(_) = args3[0].kind
43+
&& let ExprKind::AddrOf(BorrowKind::Ref, Mutability::Not, inner1) = args2[1].kind
6744
&& block.expr.is_none()
6845
&& let PatKind::Binding(BindingMode::NONE, _, name2, None) = local.pat.kind
6946
&& name2.as_str() == "print_text"

src/tools/clippy/tests/ui/author/macro_in_loop.stdout

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -50,31 +50,8 @@ if let Some(higher::ForLoop { pat: pat, arg: arg, body: body, .. }) = higher::Fo
5050
&& let ExprKind::Call(func3, args3) = trailing_expr1.kind
5151
&& func3.res(cx).is_diag_item(cx, sym::FmtTemplateNew)
5252
&& args3.len() == 1
53-
&& let ExprKind::AddrOf(BorrowKind::Ref, Mutability::Not, inner1) = args3[0].kind
54-
&& let ExprKind::Array(elements2) = inner1.kind
55-
&& elements2.len() == 4
56-
&& let ExprKind::Call(func4, args4) = elements2[0].kind
57-
&& paths::CORE_FMT_RT_PIECE_NUM.matches_path(cx, func4) // Add the path to `clippy_utils::paths` if needed
58-
&& args4.len() == 1
59-
&& let ExprKind::Lit(ref lit2) = args4[0].kind
60-
&& let LitKind::Int(16140901201934811136, LitIntType::Unsigned(UintTy::Usize)) = lit2.node
61-
&& let ExprKind::Call(func5, args5) = elements2[1].kind
62-
&& paths::CORE_FMT_RT_PIECE_NUM.matches_path(cx, func5) // Add the path to `clippy_utils::paths` if needed
63-
&& args5.len() == 1
64-
&& let ExprKind::Lit(ref lit3) = args5[0].kind
65-
&& let LitKind::Int(1, LitIntType::Unsigned(UintTy::Usize)) = lit3.node
66-
&& let ExprKind::Call(func6, args6) = elements2[2].kind
67-
&& paths::CORE_FMT_RT_PIECE_STR.matches_path(cx, func6) // Add the path to `clippy_utils::paths` if needed
68-
&& args6.len() == 1
69-
&& let ExprKind::Lit(ref lit4) = args6[0].kind
70-
&& let LitKind::Str(s, _) = lit4.node
71-
&& s.as_str() == "\n"
72-
&& let ExprKind::Call(func7, args7) = elements2[3].kind
73-
&& paths::CORE_FMT_RT_PIECE_NUM.matches_path(cx, func7) // Add the path to `clippy_utils::paths` if needed
74-
&& args7.len() == 1
75-
&& let ExprKind::Lit(ref lit5) = args7[0].kind
76-
&& let LitKind::Int(0, LitIntType::Unsigned(UintTy::Usize)) = lit5.node
77-
&& let ExprKind::AddrOf(BorrowKind::Ref, Mutability::Not, inner2) = args2[1].kind
53+
&& let ExprKind::ConstBlock(_) = args3[0].kind
54+
&& let ExprKind::AddrOf(BorrowKind::Ref, Mutability::Not, inner1) = args2[1].kind
7855
&& block1.expr.is_none()
7956
&& block.expr.is_none()
8057
{

tests/codegen-units/item-collection/opaque-return-impls.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,4 +86,4 @@ pub fn foo3() -> Box<dyn Iterator<Item = usize>> {
8686
//~ MONO_ITEM fn foo3
8787
//~ MONO_ITEM fn std::boxed::Box::<Counter>::new
8888
//~ MONO_ITEM fn Counter::new
89-
//~ MONO_ITEM fn core::fmt::rt::<impl std::fmt::Arguments<'_>>::new_const::<1>
89+
//~ MONO_ITEM fn core::fmt::rt::<impl std::fmt::Arguments<'_>>::from_str

tests/mir-opt/sroa/lifetimes.foo.ScalarReplacementOfAggregates.diff

Lines changed: 49 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -20,28 +20,20 @@
2020
let mut _20: core::fmt::rt::Template<'_>;
2121
let mut _21: &[core::fmt::rt::Piece; 7];
2222
let _22: &[core::fmt::rt::Piece; 7];
23-
let _23: [core::fmt::rt::Piece; 7];
24-
let mut _24: core::fmt::rt::Piece;
25-
let mut _25: core::fmt::rt::Piece;
26-
let mut _26: core::fmt::rt::Piece;
27-
let mut _27: core::fmt::rt::Piece;
28-
let mut _28: core::fmt::rt::Piece;
29-
let mut _29: core::fmt::rt::Piece;
30-
let mut _30: core::fmt::rt::Piece;
31-
let mut _31: &[core::fmt::rt::Argument<'_>; 2];
32-
let _32: &[core::fmt::rt::Argument<'_>; 2];
33-
let mut _34: &std::boxed::Box<dyn std::fmt::Display>;
34-
let mut _35: &u32;
35-
let mut _36: bool;
36-
let mut _37: isize;
37-
let mut _38: isize;
38-
let mut _39: isize;
39-
+ let _40: std::result::Result<std::boxed::Box<dyn std::fmt::Display>, <T as Err>::Err>;
40-
+ let _41: u32;
23+
let mut _23: &[core::fmt::rt::Argument<'_>; 2];
24+
let _24: &[core::fmt::rt::Argument<'_>; 2];
25+
let mut _25: &std::boxed::Box<dyn std::fmt::Display>;
26+
let mut _26: &u32;
27+
let mut _27: bool;
28+
let mut _28: isize;
29+
let mut _29: isize;
30+
let mut _30: isize;
31+
+ let _31: std::result::Result<std::boxed::Box<dyn std::fmt::Display>, <T as Err>::Err>;
32+
+ let _32: u32;
4133
scope 1 {
4234
- debug foo => _1;
43-
+ debug ((foo: Foo<T>).0: std::result::Result<std::boxed::Box<dyn std::fmt::Display>, <T as Err>::Err>) => _40;
44-
+ debug ((foo: Foo<T>).1: u32) => _41;
35+
+ debug ((foo: Foo<T>).0: std::result::Result<std::boxed::Box<dyn std::fmt::Display>, <T as Err>::Err>) => _31;
36+
+ debug ((foo: Foo<T>).1: u32) => _32;
4537
let _5: std::result::Result<std::boxed::Box<dyn std::fmt::Display>, <T as Err>::Err>;
4638
scope 2 {
4739
debug x => _5;
@@ -52,16 +44,15 @@
5244
debug x => _8;
5345
let _8: std::boxed::Box<dyn std::fmt::Display>;
5446
let _12: (&std::boxed::Box<dyn std::fmt::Display>, &u32);
55-
+ let _42: &std::boxed::Box<dyn std::fmt::Display>;
56-
+ let _43: &u32;
47+
+ let _33: &std::boxed::Box<dyn std::fmt::Display>;
48+
+ let _34: &u32;
5749
scope 5 {
5850
- debug args => _12;
59-
+ debug ((args: (&Box<dyn std::fmt::Display>, &u32)).0: &std::boxed::Box<dyn std::fmt::Display>) => _42;
60-
+ debug ((args: (&Box<dyn std::fmt::Display>, &u32)).1: &u32) => _43;
51+
+ debug ((args: (&Box<dyn std::fmt::Display>, &u32)).0: &std::boxed::Box<dyn std::fmt::Display>) => _33;
52+
+ debug ((args: (&Box<dyn std::fmt::Display>, &u32)).1: &u32) => _34;
6153
let _15: [core::fmt::rt::Argument<'_>; 2];
6254
scope 6 {
6355
debug args => _15;
64-
let mut _33: &[core::fmt::rt::Piece; 7];
6556
}
6657
}
6758
}
@@ -70,10 +61,10 @@
7061
}
7162

7263
bb0: {
73-
_36 = const false;
64+
_27 = const false;
7465
- StorageLive(_1);
75-
+ StorageLive(_40);
76-
+ StorageLive(_41);
66+
+ StorageLive(_31);
67+
+ StorageLive(_32);
7768
+ nop;
7869
StorageLive(_2);
7970
StorageLive(_3);
@@ -87,17 +78,17 @@
8778
_2 = Result::<Box<dyn std::fmt::Display>, <T as Err>::Err>::Ok(move _3);
8879
StorageDead(_3);
8980
- _1 = Foo::<T> { x: move _2, y: const 7_u32 };
90-
+ _40 = move _2;
91-
+ _41 = const 7_u32;
81+
+ _31 = move _2;
82+
+ _32 = const 7_u32;
9283
+ nop;
9384
StorageDead(_2);
9485
StorageLive(_5);
95-
_36 = const true;
86+
_27 = const true;
9687
- _5 = move (_1.0: std::result::Result<std::boxed::Box<dyn std::fmt::Display>, <T as Err>::Err>);
97-
+ _5 = move _40;
88+
+ _5 = move _31;
9889
StorageLive(_6);
9990
- _6 = copy (_1.1: u32);
100-
+ _6 = copy _41;
91+
+ _6 = copy _32;
10192
_7 = discriminant(_5);
10293
switchInt(move _7) -> [0: bb2, otherwise: bb8];
10394
}
@@ -109,35 +100,35 @@
109100
StorageLive(_10);
110101
StorageLive(_11);
111102
- StorageLive(_12);
112-
+ StorageLive(_42);
113-
+ StorageLive(_43);
103+
+ StorageLive(_33);
104+
+ StorageLive(_34);
114105
+ nop;
115106
StorageLive(_13);
116107
_13 = &_8;
117108
StorageLive(_14);
118109
_14 = &_6;
119110
- _12 = (move _13, move _14);
120-
+ _42 = move _13;
121-
+ _43 = move _14;
111+
+ _33 = move _13;
112+
+ _34 = move _14;
122113
+ nop;
123114
StorageDead(_14);
124115
StorageDead(_13);
125116
StorageLive(_15);
126117
StorageLive(_16);
127118
StorageLive(_17);
128-
- _34 = copy (_12.0: &std::boxed::Box<dyn std::fmt::Display>);
129-
+ _34 = copy _42;
130-
_17 = &(*_34);
119+
- _25 = copy (_12.0: &std::boxed::Box<dyn std::fmt::Display>);
120+
+ _25 = copy _33;
121+
_17 = &(*_25);
131122
_16 = core::fmt::rt::Argument::<'_>::new_display::<Box<dyn std::fmt::Display>>(move _17) -> [return: bb3, unwind unreachable];
132123
}
133124

134125
bb3: {
135126
StorageDead(_17);
136127
StorageLive(_18);
137128
StorageLive(_19);
138-
- _35 = copy (_12.1: &u32);
139-
+ _35 = copy _43;
140-
_19 = &(*_35);
129+
- _26 = copy (_12.1: &u32);
130+
+ _26 = copy _34;
131+
_19 = &(*_26);
141132
_18 = core::fmt::rt::Argument::<'_>::new_display::<u32>(move _19) -> [return: bb4, unwind unreachable];
142133
}
143134

@@ -149,25 +140,24 @@
149140
StorageLive(_20);
150141
StorageLive(_21);
151142
StorageLive(_22);
152-
_33 = const foo::<T>::promoted[0];
153-
_22 = &(*_33);
143+
_22 = const foo::<T>::{constant#0}::<&[core::fmt::rt::Piece; 7]>;
154144
_21 = &(*_22);
155145
_20 = core::fmt::rt::Template::<'_>::new::<7>(move _21) -> [return: bb5, unwind unreachable];
156146
}
157147

158148
bb5: {
159149
StorageDead(_22);
160150
StorageDead(_21);
161-
StorageLive(_31);
162-
StorageLive(_32);
163-
_32 = &_15;
164-
_31 = &(*_32);
165-
_11 = core::fmt::rt::<impl Arguments<'_>>::new::<2>(move _20, move _31) -> [return: bb6, unwind unreachable];
151+
StorageLive(_23);
152+
StorageLive(_24);
153+
_24 = &_15;
154+
_23 = &(*_24);
155+
_11 = core::fmt::rt::<impl Arguments<'_>>::new::<2>(move _20, move _23) -> [return: bb6, unwind unreachable];
166156
}
167157

168158
bb6: {
169-
StorageDead(_32);
170-
StorageDead(_31);
159+
StorageDead(_24);
160+
StorageDead(_23);
171161
StorageDead(_20);
172162
_10 = _eprint(move _11) -> [return: bb7, unwind unreachable];
173163
}
@@ -176,8 +166,8 @@
176166
StorageDead(_11);
177167
StorageDead(_15);
178168
- StorageDead(_12);
179-
+ StorageDead(_42);
180-
+ StorageDead(_43);
169+
+ StorageDead(_33);
170+
+ StorageDead(_34);
181171
+ nop;
182172
StorageDead(_10);
183173
_9 = const ();
@@ -198,16 +188,16 @@
198188

199189
bb10: {
200190
StorageDead(_6);
201-
_37 = discriminant(_5);
202-
switchInt(move _37) -> [0: bb11, otherwise: bb12];
191+
_28 = discriminant(_5);
192+
switchInt(move _28) -> [0: bb11, otherwise: bb12];
203193
}
204194

205195
bb11: {
206-
_36 = const false;
196+
_27 = const false;
207197
StorageDead(_5);
208198
- StorageDead(_1);
209-
+ StorageDead(_40);
210-
+ StorageDead(_41);
199+
+ StorageDead(_31);
200+
+ StorageDead(_32);
211201
+ nop;
212202
return;
213203
}

tests/ui/consts/recursive-const-in-impl.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ LL | println!("{}", Thing::<i32>::X);
55
| ^^^^^^^^^^^^^^^
66
|
77
= help: consider increasing the recursion limit by adding a `#![recursion_limit = "14"]` attribute to your crate (`recursive_const_in_impl`)
8-
= note: query depth increased by 9 when simplifying constant for the type system `main::promoted[1]`
8+
= note: query depth increased by 9 when simplifying constant for the type system `main::promoted[0]`
99
= note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
1010

1111
error: aborting due to 1 previous error

tests/ui/unpretty/exhaustive.hir.stdout

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -395,8 +395,9 @@ mod expressions {
395395
super let args = (&expr,);
396396
super let args = [format_argument::new_display(args.0)];
397397
format_arguments::new(unsafe {
398-
format_template::new(&[format_piece::num(16140901201934811136usize),
399-
format_piece::num(0usize)])
398+
format_template::new(const
399+
&[format_piece::num(16140901201934811136usize),
400+
format_piece::num(0usize)])
400401
}, &args)
401402
};
402403
}

tests/ui/unpretty/flattened-format-args.stdout

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@ fn main() {
1414
super let args = (&x,);
1515
super let args = [format_argument::new_display(args.0)];
1616
format_arguments::new(unsafe {
17-
format_template::new(&[format_piece::num(8usize),
18-
format_piece::str("a 123 b "), format_piece::num(5usize),
19-
format_piece::str(" xyz\n"), format_piece::num(0usize)])
17+
format_template::new(const
18+
&[format_piece::num(8usize), format_piece::str("a 123 b "),
19+
format_piece::num(5usize), format_piece::str(" xyz\n"),
20+
format_piece::num(0usize)])
2021
}, &args)
2122
});
2223
};

0 commit comments

Comments
 (0)