Skip to content

Rollup of 11 pull requests #44417

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 23 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
adfebed
Explicitly run perl for OpenSSL Configure
smaeul Aug 28, 2017
51a478c
rustc: Separately feature gate repr(i128)
alexcrichton Sep 2, 2017
4950756
Require rlibs for dependent crates when linking static executables
smaeul Sep 2, 2017
7e0b79d
Use rvalue promotion to 'static instead of static items.
eddyb Sep 4, 2017
cf318c3
bootstrap: use shasum(1) on NetBSD build hosts
jakllsch Aug 31, 2017
ab89870
bootstrap: use tar -z on extract
jakllsch Aug 31, 2017
502e707
Reduce false positives number in rustdoc html diff
GuillaumeGomez Sep 5, 2017
5b76b86
Use memalign instead of posix_memalign for Solaris
bgermann Sep 6, 2017
f633284
std: Fix a segfault on OSX with backtraces
alexcrichton Sep 7, 2017
0571523
Rotate Travis/AppVeyor S3 keys
alexcrichton Sep 7, 2017
fc44447
Update the libcompiler_builins submodule
est31 Sep 7, 2017
ddb072b
std::thread::LocalKey: Document limitation with initializers
joshlf Sep 7, 2017
43bc5ef
Rollup merge of #44131 - smaeul:openssl-perl, r=Mark-Simulacrum
GuillaumeGomez Sep 8, 2017
d455f27
Rollup merge of #44262 - alexcrichton:repr-128-gate, r=nikomatsakis
GuillaumeGomez Sep 8, 2017
73ca512
Rollup merge of #44279 - smaeul:crt_static-deps, r=alexcrichton
GuillaumeGomez Sep 8, 2017
51f6ff3
Rollup merge of #44312 - eddyb:static-by-any-other-name, r=alexcrichton
GuillaumeGomez Sep 8, 2017
b475b0a
Rollup merge of #44320 - jakllsch:jakllsch-caf2c3d2-c939-4c4d-8c68-1a…
GuillaumeGomez Sep 8, 2017
c4aadbd
Rollup merge of #44347 - GuillaumeGomez:rustdoc-false-positive, r=Qui…
GuillaumeGomez Sep 8, 2017
cb536ab
Rollup merge of #44372 - bgermann:master, r=alexcrichton
GuillaumeGomez Sep 8, 2017
c373dd7
Rollup merge of #44384 - alexcrichton:osx-segfault, r=estebank
GuillaumeGomez Sep 8, 2017
215ce2f
Rollup merge of #44385 - alexcrichton:new-sccache-keys, r=alexcrichton
GuillaumeGomez Sep 8, 2017
6f7c75e
Rollup merge of #44387 - est31:update_compiler_builtins, r=Mark-Simul…
GuillaumeGomez Sep 8, 2017
2dad4f3
Rollup merge of #44396 - joshlf:tls-comment, r=alexcrichton
GuillaumeGomez Sep 8, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,9 @@ matrix:
env:
global:
- SCCACHE_BUCKET=rust-lang-ci-sccache
- AWS_ACCESS_KEY_ID=AKIAIMX7VLAS3PZAVLUQ
- AWS_ACCESS_KEY_ID=AKIAJF6INZZRJHKQ3KZA
# AWS_SECRET_ACCESS_KEY=...
- secure: "Pixhh0hXDqGCdOyLtGFjli3J2AtDWIpyb2btIrLe956nCBDRutRoMm6rv5DI9sFZN07Mms7VzNNvhc9wCW1y63JAm414d2Co7Ob8kWMZlz9l9t7ACHuktUiis8yr+S4Quq1Vqd6pqi7pf2J++UxC8R/uLeqVrubzr6+X7AbmEFE="
- secure: "iz4GukJUJ9XVTivaTLMXS/5hab7d7C4aQi60Ef+0sw3DnOmntZ+/1SFFC++owccV8h0Ccw21cmmt0IGFHdlhROwq85AgLl3bXMnN/c9MISbaQvCZqRd2qnDxcYf/MF7+s1hqE7f6IxXebSbNI0hEDYHeyPY4g6wTF+yRWsD1qtc6JNLlOV979wxoCeqHL0gwKhH/5RI9lcmM7yohxSTQDS4XcAWDZFsrynocF8eialig5KAu4lqFCJIMTFpZsSLCUvosMVAolvmaiokEsRWwrhTmd/t/8hbm3OmnueNKbKuNpSHN9vDjO0vrLXFz6T4UOIPQSGr88rSHLUeKmpgbHfSfE5DiEGAoQ5aMhgnX1xo83TuvgyGHP3ifwgzXmsis3+HMluGd+6ek4rzHdxNevYbibl6jpHAeldu3borfiYQr9EHCrahMBSa22Z9YTarYStk5uo3kwalTkwMevFP3MlOLB0Q9s0LMLAJIZJ8pLh+2gzmwt2FRCR8S7fgR+9+44PKmtftA4AE3meey/gl1bes5KPPUhomeheVRVplx8PhU6boaAOCCar07s1d17AqEtouHgC3jd5TxMAQFq/MSUbkfOlefwVuDsfZvaOk0LnZbjZuwAN6ba2y8bK3AwhUfOftEAp/9f3RZjz3hjb1QKoZyQVin/XRte2UzgPjLRew="

before_install:
# If we are building a pull request, do the build if $ALLOW_PR == 1
Expand Down Expand Up @@ -262,9 +262,9 @@ deploy:
upload_dir: rustc-builds
acl: public_read
region: us-east-1
access_key_id: AKIAIPQVNYF2T3DTYIWQ
access_key_id: AKIAJN7ZQ3AGSFJQSDFQ
secret_access_key:
secure: "FBqDqOTeIPMu6v/WYPf4CFSlh9rLRZGKVtpLa5KkyuOhXRTrnEzBduEtS8/FMIxdQImvurhSvxWvqRybMOi4qoVfjMqqpHAI7uBbidbrvAcJoHNsx6BgUNVCIoH6a0UsAjTUtm6/YPIpzbHoLZXPL0GrHPMk6Mu04qVSmcYNWn4="
secure: "VDTtsQfBrgMgQ4mwrZqVPlHqnJYnnCJpyaHMwJuuZCzD1nBamw78Sv7zk2PnoTb8aMsvgaRzYeskmaWTXsAnw9saizTKUs2AdAHaTgfPgGCL7040uymc9Zb8fCVaKWw/aBDfgOuLwCfttifOYnGc5IzdagtIb3nIvbvvd8kFVMxOSpQCJJP9k8AvAzvlTMfH1Ol5YwUdeHiw7ABZuzlfF3kJyHSLKu9Tmvlx0LepUKSyvnGM3va3OPiIXuERiXP4ltRpZmujNHMFt3o/sqr2aAYUGHWGJwqOHh/co6eNgNheVllhF2hS+S56O3F9mGSTJejBJzESRhTYGkQvLRgRzpuwVjjGyCleUXXt5MhCclagM7+1lkNmafDuSbYrJJyLwg/izglxwtbxCMF/U85egEsP5zjVVrCSGLhQYO4K3X12MyE+COR5TLNgMd8lWl2/wGoF1TWCqO6pG/BrfWuBPCYnBQ2pfAS/UbQhFB/c4+WzIl37jVtKFTgLWIcOW6iDuaRePS4r5gXBI7jCPp7CkrFPPzhmrxnV55v+kVu3ts9GEC8jJWK7bmReZ5OShneqzXtWVGVhtArwpYx5E/VJtA9izakkSIXo88LVJr/l1ALAJCqngILC2ccgDJ7HAE/8qxcya6lkqlEowCQaHBv8+YiNKckCnBgx7MVK4ky4/f0="
on:
branch: auto
condition: $DEPLOY = 1
Expand All @@ -276,9 +276,9 @@ deploy:
upload_dir: rustc-builds-try
acl: public_read
region: us-east-1
access_key_id: AKIAIPQVNYF2T3DTYIWQ
access_key_id: AKIAJN7ZQ3AGSFJQSDFQ
secret_access_key:
secure: "FBqDqOTeIPMu6v/WYPf4CFSlh9rLRZGKVtpLa5KkyuOhXRTrnEzBduEtS8/FMIxdQImvurhSvxWvqRybMOi4qoVfjMqqpHAI7uBbidbrvAcJoHNsx6BgUNVCIoH6a0UsAjTUtm6/YPIpzbHoLZXPL0GrHPMk6Mu04qVSmcYNWn4="
secure: "VDTtsQfBrgMgQ4mwrZqVPlHqnJYnnCJpyaHMwJuuZCzD1nBamw78Sv7zk2PnoTb8aMsvgaRzYeskmaWTXsAnw9saizTKUs2AdAHaTgfPgGCL7040uymc9Zb8fCVaKWw/aBDfgOuLwCfttifOYnGc5IzdagtIb3nIvbvvd8kFVMxOSpQCJJP9k8AvAzvlTMfH1Ol5YwUdeHiw7ABZuzlfF3kJyHSLKu9Tmvlx0LepUKSyvnGM3va3OPiIXuERiXP4ltRpZmujNHMFt3o/sqr2aAYUGHWGJwqOHh/co6eNgNheVllhF2hS+S56O3F9mGSTJejBJzESRhTYGkQvLRgRzpuwVjjGyCleUXXt5MhCclagM7+1lkNmafDuSbYrJJyLwg/izglxwtbxCMF/U85egEsP5zjVVrCSGLhQYO4K3X12MyE+COR5TLNgMd8lWl2/wGoF1TWCqO6pG/BrfWuBPCYnBQ2pfAS/UbQhFB/c4+WzIl37jVtKFTgLWIcOW6iDuaRePS4r5gXBI7jCPp7CkrFPPzhmrxnV55v+kVu3ts9GEC8jJWK7bmReZ5OShneqzXtWVGVhtArwpYx5E/VJtA9izakkSIXo88LVJr/l1ALAJCqngILC2ccgDJ7HAE/8qxcya6lkqlEowCQaHBv8+YiNKckCnBgx7MVK4ky4/f0="
on:
branch: try
condition: $DEPLOY = 1 && $ALLOW_TRY = 1
Expand All @@ -292,9 +292,9 @@ deploy:
upload_dir: rustc-builds-alt
acl: public_read
region: us-east-1
access_key_id: AKIAIPQVNYF2T3DTYIWQ
access_key_id: AKIAJN7ZQ3AGSFJQSDFQ
secret_access_key:
secure: "FBqDqOTeIPMu6v/WYPf4CFSlh9rLRZGKVtpLa5KkyuOhXRTrnEzBduEtS8/FMIxdQImvurhSvxWvqRybMOi4qoVfjMqqpHAI7uBbidbrvAcJoHNsx6BgUNVCIoH6a0UsAjTUtm6/YPIpzbHoLZXPL0GrHPMk6Mu04qVSmcYNWn4="
secure: "VDTtsQfBrgMgQ4mwrZqVPlHqnJYnnCJpyaHMwJuuZCzD1nBamw78Sv7zk2PnoTb8aMsvgaRzYeskmaWTXsAnw9saizTKUs2AdAHaTgfPgGCL7040uymc9Zb8fCVaKWw/aBDfgOuLwCfttifOYnGc5IzdagtIb3nIvbvvd8kFVMxOSpQCJJP9k8AvAzvlTMfH1Ol5YwUdeHiw7ABZuzlfF3kJyHSLKu9Tmvlx0LepUKSyvnGM3va3OPiIXuERiXP4ltRpZmujNHMFt3o/sqr2aAYUGHWGJwqOHh/co6eNgNheVllhF2hS+S56O3F9mGSTJejBJzESRhTYGkQvLRgRzpuwVjjGyCleUXXt5MhCclagM7+1lkNmafDuSbYrJJyLwg/izglxwtbxCMF/U85egEsP5zjVVrCSGLhQYO4K3X12MyE+COR5TLNgMd8lWl2/wGoF1TWCqO6pG/BrfWuBPCYnBQ2pfAS/UbQhFB/c4+WzIl37jVtKFTgLWIcOW6iDuaRePS4r5gXBI7jCPp7CkrFPPzhmrxnV55v+kVu3ts9GEC8jJWK7bmReZ5OShneqzXtWVGVhtArwpYx5E/VJtA9izakkSIXo88LVJr/l1ALAJCqngILC2ccgDJ7HAE/8qxcya6lkqlEowCQaHBv8+YiNKckCnBgx7MVK4ky4/f0="
on:
branch: auto
condition: $DEPLOY_ALT = 1
12 changes: 6 additions & 6 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
environment:
SCCACHE_BUCKET: rust-lang-ci-sccache
AWS_ACCESS_KEY_ID: AKIAIMX7VLAS3PZAVLUQ
AWS_ACCESS_KEY_ID: AKIAJF6INZZRJHKQ3KZA
AWS_SECRET_ACCESS_KEY:
secure: 1UkmbiDd15tWtYbMm5O2Uqm0b0Ur8v1MoSlydxl4ojcroPeerRMlUges0l57py8c
secure: 55JOuLG3N+q12QH88ZYLfSXV1ocEi6At1leBKHwRsESgQ4mWCNse49J/x+9WUJFP
SCCACHE_DIGEST: f808afabb4a4eb1d7112bcb3fa6be03b61e93412890c88e177c667eb37f46353d7ec294e559b16f9f4b5e894f2185fe7670a0df15fd064889ecbd80f0c34166c

# By default schannel checks revocation of certificates unlike some other SSL
Expand Down Expand Up @@ -185,9 +185,9 @@ before_deploy:
deploy:
- provider: S3
skip_cleanup: true
access_key_id: AKIAIPQVNYF2T3DTYIWQ
access_key_id: AKIAJN7ZQ3AGSFJQSDFQ
secret_access_key:
secure: +11jsUNFTQ9dq5Ad1i2+PeUJaXluFJ0zIJAXESE1dFT3Kdjku4/eDdgyjgsB6GnV
secure: rEWqEEumXgn/lvc+2vhUjUHXQYU2p7ayT0BVtzsb2oX1cUpmn5TiQOK+v2yQsQzm
bucket: rust-lang-ci
set_public: true
region: us-east-1
Expand All @@ -202,9 +202,9 @@ deploy:
# different upload directory and a slightly different trigger
- provider: S3
skip_cleanup: true
access_key_id: AKIAIPQVNYF2T3DTYIWQ
access_key_id: AKIAJN7ZQ3AGSFJQSDFQ
secret_access_key:
secure: +11jsUNFTQ9dq5Ad1i2+PeUJaXluFJ0zIJAXESE1dFT3Kdjku4/eDdgyjgsB6GnV
secure: rEWqEEumXgn/lvc+2vhUjUHXQYU2p7ayT0BVtzsb2oX1cUpmn5TiQOK+v2yQsQzm
bucket: rust-lang-ci
set_public: true
region: us-east-1
Expand Down
7 changes: 4 additions & 3 deletions src/bootstrap/native.rs
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ impl Step for Openssl {
if !ok {
panic!("failed to download openssl source")
}
let mut shasum = if target.contains("apple") {
let mut shasum = if target.contains("apple") || build.build.contains("netbsd") {
let mut cmd = Command::new("shasum");
cmd.arg("-a").arg("256");
cmd
Expand All @@ -387,9 +387,10 @@ impl Step for Openssl {
let dst = build.openssl_install_dir(target).unwrap();
drop(fs::remove_dir_all(&obj));
drop(fs::remove_dir_all(&dst));
build.run(Command::new("tar").arg("xf").arg(&tarball).current_dir(&out));
build.run(Command::new("tar").arg("zxf").arg(&tarball).current_dir(&out));

let mut configure = Command::new(obj.join("Configure"));
let mut configure = Command::new("perl");
configure.arg(obj.join("Configure"));
configure.arg(format!("--prefix={}", dst.display()));
configure.arg("no-dso");
configure.arg("no-ssl2");
Expand Down
4 changes: 2 additions & 2 deletions src/liballoc_system/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ mod platform {
}
}

#[cfg(any(target_os = "android", target_os = "redox"))]
#[cfg(any(target_os = "android", target_os = "redox", target_os = "solaris"))]
#[inline]
unsafe fn aligned_malloc(layout: &Layout) -> *mut u8 {
// On android we currently target API level 9 which unfortunately
Expand All @@ -244,7 +244,7 @@ mod platform {
libc::memalign(layout.align(), layout.size()) as *mut u8
}

#[cfg(not(any(target_os = "android", target_os = "redox")))]
#[cfg(not(any(target_os = "android", target_os = "redox", target_os = "solaris")))]
#[inline]
unsafe fn aligned_malloc(layout: &Layout) -> *mut u8 {
let mut out = ptr::null_mut();
Expand Down
2 changes: 1 addition & 1 deletion src/libcompiler_builtins
13 changes: 3 additions & 10 deletions src/libcore/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,11 @@ macro_rules! panic {
panic!("explicit panic")
);
($msg:expr) => ({
static _MSG_FILE_LINE_COL: (&'static str, &'static str, u32, u32) =
($msg, file!(), line!(), __rust_unstable_column!());
$crate::panicking::panic(&_MSG_FILE_LINE_COL)
$crate::panicking::panic(&($msg, file!(), line!(), __rust_unstable_column!()))
});
($fmt:expr, $($arg:tt)*) => ({
// The leading _'s are to avoid dead code warnings if this is
// used inside a dead function. Just `#[allow(dead_code)]` is
// insufficient, since the user may have
// `#[forbid(dead_code)]` and which cannot be overridden.
static _MSG_FILE_LINE_COL: (&'static str, u32, u32) =
(file!(), line!(), __rust_unstable_column!());
$crate::panicking::panic_fmt(format_args!($fmt, $($arg)*), &_MSG_FILE_LINE_COL)
$crate::panicking::panic_fmt(format_args!($fmt, $($arg)*),
&(file!(), line!(), __rust_unstable_column!()))
});
}

Expand Down
76 changes: 42 additions & 34 deletions src/librustc/middle/dependency_format.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,26 +112,51 @@ fn calculate_type<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
return Vec::new();
}

match ty {
// If the global prefer_dynamic switch is turned off, first attempt
// static linkage (this can fail).
config::CrateTypeExecutable if !sess.opts.cg.prefer_dynamic => {
if let Some(v) = attempt_static(tcx) {
return v;
}
}
let preferred_linkage = match ty {
// cdylibs must have all static dependencies.
config::CrateTypeCdylib => Linkage::Static,

// Generating a dylib without `-C prefer-dynamic` means that we're going
// to try to eagerly statically link all dependencies. This is normally
// done for end-product dylibs, not intermediate products.
config::CrateTypeDylib if !sess.opts.cg.prefer_dynamic => Linkage::Static,
config::CrateTypeDylib => Linkage::Dynamic,

// If the global prefer_dynamic switch is turned off, or the final
// executable will be statically linked, prefer static crate linkage.
config::CrateTypeExecutable if !sess.opts.cg.prefer_dynamic ||
sess.crt_static() => Linkage::Static,
config::CrateTypeExecutable => Linkage::Dynamic,

// proc-macro crates are required to be dylibs, and they're currently
// required to link to libsyntax as well.
config::CrateTypeProcMacro => Linkage::Dynamic,

// No linkage happens with rlibs, we just needed the metadata (which we
// got long ago), so don't bother with anything.
config::CrateTypeRlib => return Vec::new(),

// Staticlibs and cdylibs must have all static dependencies. If any fail
// to be found, we generate some nice pretty errors.
config::CrateTypeStaticlib |
config::CrateTypeCdylib => {
if let Some(v) = attempt_static(tcx) {
return v;
}
config::CrateTypeRlib => Linkage::NotLinked,

// staticlibs must have all static dependencies.
config::CrateTypeStaticlib => Linkage::Static,
};

if preferred_linkage == Linkage::NotLinked {
// If the crate is not linked, there are no link-time dependencies.
return Vec::new();
}

if preferred_linkage == Linkage::Static {
// Attempt static linkage first. For dylibs and executables, we may be
// able to retry below with dynamic linkage.
if let Some(v) = attempt_static(tcx) {
return v;
}

// Staticlibs, cdylibs, and static executables must have all static
// dependencies. If any are not found, generate some nice pretty errors.
if ty == config::CrateTypeCdylib || ty == config::CrateTypeStaticlib ||
(ty == config::CrateTypeExecutable && sess.crt_static() &&
!sess.target.target.options.crt_static_allows_dylibs) {
for cnum in sess.cstore.crates() {
if sess.cstore.dep_kind(cnum).macros_only() { continue }
let src = sess.cstore.used_crate_source(cnum);
Expand All @@ -141,23 +166,6 @@ fn calculate_type<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
}
return Vec::new();
}

// Generating a dylib without `-C prefer-dynamic` means that we're going
// to try to eagerly statically link all dependencies. This is normally
// done for end-product dylibs, not intermediate products.
config::CrateTypeDylib if !sess.opts.cg.prefer_dynamic => {
if let Some(v) = attempt_static(tcx) {
return v;
}
}

// Everything else falls through below. This will happen either with the
// `-C prefer-dynamic` or because we're a proc-macro crate. Note that
// proc-macro crates are required to be dylibs, and they're currently
// required to link to libsyntax as well.
config::CrateTypeExecutable |
config::CrateTypeDylib |
config::CrateTypeProcMacro => {},
}

let mut formats = FxHashMap();
Expand Down
1 change: 0 additions & 1 deletion src/librustc_mir/transform/elaborate_drops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ use syntax::ast;
use syntax_pos::Span;

use std::fmt;
use std::u32;

pub struct ElaborateDrops;

Expand Down
7 changes: 5 additions & 2 deletions src/librustc_typeck/check/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1554,9 +1554,12 @@ pub fn check_enum<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,

let repr_type_ty = def.repr.discr_type().to_ty(tcx);
if repr_type_ty == tcx.types.i128 || repr_type_ty == tcx.types.u128 {
if !tcx.sess.features.borrow().i128_type {
if !tcx.sess.features.borrow().repr128 {
emit_feature_err(&tcx.sess.parse_sess,
"i128_type", sp, GateIssue::Language, "128-bit type is unstable");
"repr128",
sp,
GateIssue::Language,
"repr with 128-bit type is unstable");
}
}

Expand Down
10 changes: 7 additions & 3 deletions src/librustdoc/html/render.rs
Original file line number Diff line number Diff line change
Expand Up @@ -660,9 +660,13 @@ fn render_difference(diff: &html_diff::Difference) {
elem.path, elem.element_name, elem_attributes, opposite_elem_attributes);
}
html_diff::Difference::NodeText { ref elem, ref elem_text, ref opposite_elem_text, .. } => {
let (s1, s2) = concise_compared_strs(elem_text, opposite_elem_text);
println!(" {} Text differs:\n expected: `{}`\n found: `{}`",
elem.path, s1, s2);
if elem_text.split("\n")
.zip(opposite_elem_text.split("\n"))
.any(|(a, b)| a.trim() != b.trim()) {
let (s1, s2) = concise_compared_strs(elem_text, opposite_elem_text);
println!(" {} Text differs:\n expected: `{}`\n found: `{}`",
elem.path, s1, s2);
}
}
html_diff::Difference::NotPresent { ref elem, ref opposite_elem } => {
if let Some(ref elem) = *elem {
Expand Down
2 changes: 1 addition & 1 deletion src/libstd/ffi/c_str.rs
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ impl fmt::Debug for CStr {
#[stable(feature = "cstr_default", since = "1.10.0")]
impl<'a> Default for &'a CStr {
fn default() -> &'a CStr {
static SLICE: &'static [c_char] = &[0];
const SLICE: &'static [c_char] = &[0];
unsafe { CStr::from_ptr(SLICE.as_ptr()) }
}
}
Expand Down
18 changes: 3 additions & 15 deletions src/libstd/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,23 +66,11 @@ macro_rules! panic {
panic!("explicit panic")
});
($msg:expr) => ({
$crate::rt::begin_panic($msg, {
// static requires less code at runtime, more constant data
static _FILE_LINE_COL: (&'static str, u32, u32) = (file!(), line!(),
__rust_unstable_column!());
&_FILE_LINE_COL
})
$crate::rt::begin_panic($msg, &(file!(), line!(), __rust_unstable_column!()))
});
($fmt:expr, $($arg:tt)+) => ({
$crate::rt::begin_panic_fmt(&format_args!($fmt, $($arg)+), {
// The leading _'s are to avoid dead code warnings if this is
// used inside a dead function. Just `#[allow(dead_code)]` is
// insufficient, since the user may have
// `#[forbid(dead_code)]` and which cannot be overridden.
static _FILE_LINE_COL: (&'static str, u32, u32) = (file!(), line!(),
__rust_unstable_column!());
&_FILE_LINE_COL
})
$crate::rt::begin_panic_fmt(&format_args!($fmt, $($arg)+),
&(file!(), line!(), __rust_unstable_column!()))
});
}

Expand Down
3 changes: 2 additions & 1 deletion src/libstd/sys/unix/backtrace/printing/dladdr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ pub fn resolve_symname<F>(frame: Frame,
{
unsafe {
let mut info: Dl_info = intrinsics::init();
let symname = if dladdr(frame.exact_position, &mut info) == 0 {
let symname = if dladdr(frame.exact_position, &mut info) == 0 ||
info.dli_sname.is_null() {
None
} else {
CStr::from_ptr(info.dli_sname).to_str().ok()
Expand Down
4 changes: 4 additions & 0 deletions src/libstd/thread/local.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ use mem;
/// within a thread, and values that implement [`Drop`] get destructed when a
/// thread exits. Some caveats apply, which are explained below.
///
/// A `LocalKey`'s initializer cannot recursively depend on itself, and using
/// a `LocalKey` in this way will cause the initializer to infinitely recurse
/// on the first call to `with`.
///
/// # Examples
///
/// ```
Expand Down
3 changes: 3 additions & 0 deletions src/libsyntax/feature_gate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,9 @@ declare_features! (
// The `i128` type
(active, i128_type, "1.16.0", Some(35118)),

// The `repr(i128)` annotation for enums
(active, repr128, "1.16.0", Some(35118)),

// The `unadjusted` ABI. Perma unstable.
(active, abi_unadjusted, "1.16.0", None),

Expand Down
Loading