Skip to content

Commit 4f7db2c

Browse files
committed
Linux fixes
1 parent 4df5929 commit 4f7db2c

File tree

5 files changed

+21
-8
lines changed

5 files changed

+21
-8
lines changed

src/libstd/sys/unix/backtrace/printing/dladdr.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ pub fn resolve_symname<F>(frame: Frame,
2626
info.dli_sname.is_null() {
2727
None
2828
} else {
29-
CStr::from_ptr(info.dli_sname).to_str().ok().map(|s| (s, nfo.dli_saddr as usize))
29+
CStr::from_ptr(info.dli_sname).to_str().ok().map(|s| (s, info.dli_saddr as usize))
3030
};
31-
callback(syminfo);
31+
callback(syminfo)
3232
}
3333
}
3434

src/libstd/sys/unix/backtrace/printing/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ where
3434
F: FnOnce(Option<(&str, usize)>) -> io::Result<()>
3535
{
3636
::sys_common::gnu::libbacktrace::resolve_symname(frame, |syminfo| {
37-
if symname.is_some() {
37+
if syminfo.is_some() {
3838
callback(syminfo)
3939
} else {
4040
dladdr::resolve_symname(frame, callback, bc)

src/libstd/sys_common/gnu/libbacktrace.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ pub fn resolve_symname<F>(frame: Frame,
7373
"failed to allocate libbacktrace state")
7474
)
7575
}
76-
let mut data = (ptr::null(), usize);
76+
let mut data = (ptr::null(), 0);
7777
let data_addr = &mut data as *mut _;
7878
let ret = unsafe {
7979
backtrace_syminfo(state,
@@ -86,7 +86,7 @@ pub fn resolve_symname<F>(frame: Frame,
8686
None
8787
} else {
8888
unsafe {
89-
(CStr::from_ptr(data).to_str().ok(), data.1)
89+
CStr::from_ptr(data.0).to_str().ok().map(|s| (s, data.1))
9090
}
9191
}
9292
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
macro_rules! m { ($v:str) => {} }
12+
//~^ ERROR :str fragment specifier is experimental and subject to change
13+
14+
fn main() {
15+
m!(pub);
16+
}

src/test/compile-fail/feature-gate-macro-vis-matcher.rs

-3
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// Test that the MSP430 interrupt ABI cannot be used when msp430_interrupt
12-
// feature gate is not used.
13-
1411
macro_rules! m { ($v:vis) => {} }
1512
//~^ ERROR :vis fragment specifier is experimental and subject to change
1613

0 commit comments

Comments
 (0)