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.
variables
definitions
1 parent 5cb6122 commit ea0f1caCopy full SHA for ea0f1ca
humility-hiffy/src/lib.rs
@@ -184,8 +184,14 @@ impl<'a> HiffyContext<'a> {
184
}
185
186
fn definition(hubris: &'a HubrisArchive, name: &str) -> Result<HubrisGoff> {
187
+ // Depending on compiler version, definitions may be in either
188
+ // `self.definitions` or `self.variables`, so we'll check in both
189
+ // places. Behavior depends on whether the compiler included DWARF /
190
+ // ELF debug info for the type of an otherwise-unused variable marked as
191
+ // `#[used]`; this changed in rust-lang/rust#140872
192
let goff = hubris
193
.lookup_definition(name)
194
+ .or_else(|_| hubris.lookup_variable(name).map(|v| &v.goff))
195
.context("expected hiffy definition not found")?;
196
197
Ok(*goff)
0 commit comments