We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 091b300 commit 1f64d63Copy full SHA for 1f64d63
compiler/rustc_builtin_macros/src/autodiff.rs
@@ -45,8 +45,7 @@ mod llvm_enzyme {
45
}
46
47
fn first_ident(x: &MetaItemInner) -> rustc_span::Ident {
48
- if x.lit().is_some() {
49
- let l = x.lit().unwrap();
+ if let Some(l) = x.lit() {
50
match l.kind {
51
ast::LitKind::Int(val, _) => {
52
// get an Ident from a lit
@@ -89,8 +88,8 @@ mod llvm_enzyme {
89
88
// If he doesn't specify an integer (=width), we default to scalar mode, thus width=1.
90
let mut first_activity = 2;
91
92
- let width = if meta_item.len() >= 3
93
- && let Some(x) = width(&meta_item[2])
+ let width = if let [_, _, x, ..] = &meta_item[..]
+ && let Some(x) = width(x)
94
{
95
first_activity = 3;
96
match x.try_into() {
0 commit comments