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 2c408c8Copy full SHA for 2c408c8
humility-hiffy/src/lib.rs
@@ -184,8 +184,16 @@ 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 linker included a symbol for
190
+ // an otherwise-unused variable marked as `#[used]`; this changed in
191
+ // rust-lang/rust#140872
192
+ //
193
+ // See hubris#2169 for more details
194
let goff = hubris
195
.lookup_definition(name)
196
+ .or_else(|_| hubris.lookup_variable(name).map(|v| &v.goff))
197
.context("expected hiffy definition not found")?;
198
199
Ok(*goff)
0 commit comments