@@ -78,7 +78,73 @@ LL | let _: Option<Opcode> = (op2.foo[0] > 0 && op2.foo[0] < 10).then(|| uns
7878 | ~~~~ ++
7979
8080error: this transmute is always evaluated eagerly, even if the condition is false
81- --> $DIR/eager_transmute.rs:48:24
81+ --> $DIR/eager_transmute.rs:47:70
82+ |
83+ LL | let _: Option<Opcode> = (1..=3).contains(&op).then_some(unsafe { std::mem::transmute(op) });
84+ | ^^^^^^^^^^^^^^^^^^^^^^^
85+ |
86+ help: consider using `bool::then` to only transmute if the condition holds
87+ |
88+ LL | let _: Option<Opcode> = (1..=3).contains(&op).then(|| unsafe { std::mem::transmute(op) });
89+ | ~~~~ ++
90+
91+ error: this transmute is always evaluated eagerly, even if the condition is false
92+ --> $DIR/eager_transmute.rs:48:83
93+ |
94+ LL | let _: Option<Opcode> = ((1..=3).contains(&op) || op == 4).then_some(unsafe { std::mem::transmute(op) });
95+ | ^^^^^^^^^^^^^^^^^^^^^^^
96+ |
97+ help: consider using `bool::then` to only transmute if the condition holds
98+ |
99+ LL | let _: Option<Opcode> = ((1..=3).contains(&op) || op == 4).then(|| unsafe { std::mem::transmute(op) });
100+ | ~~~~ ++
101+
102+ error: this transmute is always evaluated eagerly, even if the condition is false
103+ --> $DIR/eager_transmute.rs:49:69
104+ |
105+ LL | let _: Option<Opcode> = (1..3).contains(&op).then_some(unsafe { std::mem::transmute(op) });
106+ | ^^^^^^^^^^^^^^^^^^^^^^^
107+ |
108+ help: consider using `bool::then` to only transmute if the condition holds
109+ |
110+ LL | let _: Option<Opcode> = (1..3).contains(&op).then(|| unsafe { std::mem::transmute(op) });
111+ | ~~~~ ++
112+
113+ error: this transmute is always evaluated eagerly, even if the condition is false
114+ --> $DIR/eager_transmute.rs:50:68
115+ |
116+ LL | let _: Option<Opcode> = (1..).contains(&op).then_some(unsafe { std::mem::transmute(op) });
117+ | ^^^^^^^^^^^^^^^^^^^^^^^
118+ |
119+ help: consider using `bool::then` to only transmute if the condition holds
120+ |
121+ LL | let _: Option<Opcode> = (1..).contains(&op).then(|| unsafe { std::mem::transmute(op) });
122+ | ~~~~ ++
123+
124+ error: this transmute is always evaluated eagerly, even if the condition is false
125+ --> $DIR/eager_transmute.rs:51:68
126+ |
127+ LL | let _: Option<Opcode> = (..3).contains(&op).then_some(unsafe { std::mem::transmute(op) });
128+ | ^^^^^^^^^^^^^^^^^^^^^^^
129+ |
130+ help: consider using `bool::then` to only transmute if the condition holds
131+ |
132+ LL | let _: Option<Opcode> = (..3).contains(&op).then(|| unsafe { std::mem::transmute(op) });
133+ | ~~~~ ++
134+
135+ error: this transmute is always evaluated eagerly, even if the condition is false
136+ --> $DIR/eager_transmute.rs:52:69
137+ |
138+ LL | let _: Option<Opcode> = (..=3).contains(&op).then_some(unsafe { std::mem::transmute(op) });
139+ | ^^^^^^^^^^^^^^^^^^^^^^^
140+ |
141+ help: consider using `bool::then` to only transmute if the condition holds
142+ |
143+ LL | let _: Option<Opcode> = (..=3).contains(&op).then(|| unsafe { std::mem::transmute(op) });
144+ | ~~~~ ++
145+
146+ error: this transmute is always evaluated eagerly, even if the condition is false
147+ --> $DIR/eager_transmute.rs:61:24
82148 |
83149LL | (op < 4).then_some(std::mem::transmute::<_, Opcode>(op));
84150 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -89,7 +155,7 @@ LL | (op < 4).then(|| std::mem::transmute::<_, Opcode>(op));
89155 | ~~~~ ++
90156
91157error: this transmute is always evaluated eagerly, even if the condition is false
92- --> $DIR/eager_transmute.rs:77 :60
158+ --> $DIR/eager_transmute.rs:90 :60
93159 |
94160LL | let _: Option<NonZeroU8> = (v1 > 0).then_some(unsafe { std::mem::transmute(v1) });
95161 | ^^^^^^^^^^^^^^^^^^^^^^^
@@ -100,7 +166,7 @@ LL | let _: Option<NonZeroU8> = (v1 > 0).then(|| unsafe { std::mem::transmut
100166 | ~~~~ ++
101167
102168error: this transmute is always evaluated eagerly, even if the condition is false
103- --> $DIR/eager_transmute.rs:83 :86
169+ --> $DIR/eager_transmute.rs:96 :86
104170 |
105171LL | let _: Option<NonMaxU8> = (v2 < NonZeroU8::new(255).unwrap()).then_some(unsafe { std::mem::transmute(v2) });
106172 | ^^^^^^^^^^^^^^^^^^^^^^^
@@ -111,7 +177,7 @@ LL | let _: Option<NonMaxU8> = (v2 < NonZeroU8::new(255).unwrap()).then(|| u
111177 | ~~~~ ++
112178
113179error: this transmute is always evaluated eagerly, even if the condition is false
114- --> $DIR/eager_transmute.rs:89 :93
180+ --> $DIR/eager_transmute.rs:102 :93
115181 |
116182LL | let _: Option<NonZeroNonMaxU8> = (v2 < NonZeroU8::new(255).unwrap()).then_some(unsafe { std::mem::transmute(v2) });
117183 | ^^^^^^^^^^^^^^^^^^^^^^^
@@ -121,5 +187,5 @@ help: consider using `bool::then` to only transmute if the condition holds
121187LL | let _: Option<NonZeroNonMaxU8> = (v2 < NonZeroU8::new(255).unwrap()).then(|| unsafe { std::mem::transmute(v2) });
122188 | ~~~~ ++
123189
124- error: aborting due to 11 previous errors
190+ error: aborting due to 17 previous errors
125191
0 commit comments