Skip to content

Commit 0905c8a

Browse files
committed
Auto merge of #22909 - Manishearth:rollup, r=Manishearth
r? @Manishearth
2 parents 341a9ca + 60f7732 commit 0905c8a

File tree

8 files changed

+38
-7
lines changed

8 files changed

+38
-7
lines changed

configure

+1-1
Original file line numberDiff line numberDiff line change
@@ -875,7 +875,7 @@ then
875875
| cut -d ' ' -f 2)
876876

877877
case $CFG_CLANG_VERSION in
878-
(3.0svn | 3.0 | 3.1* | 3.2* | 3.3* | 3.4* | 3.5* | 3.6*)
878+
(3.2* | 3.3* | 3.4* | 3.5* | 3.6*)
879879
step_msg "found ok version of CLANG: $CFG_CLANG_VERSION"
880880
if [ -z "$CC" ]
881881
then

src/libcollections/str.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1455,9 +1455,9 @@ pub trait StrExt: Index<RangeFull, Output = str> {
14551455
///
14561456
/// `is_cjk` determines behavior for characters in the Ambiguous category: if `is_cjk` is
14571457
/// `true`, these are 2 columns wide; otherwise, they are 1. In CJK locales, `is_cjk` should be
1458-
/// `true`, else it should be `false`. [Unicode Standard Annex
1459-
/// #11](http://www.unicode.org/reports/tr11/) recommends that these characters be treated as 1
1460-
/// column (i.e., `is_cjk` = `false`) if the locale is unknown.
1458+
/// `true`, else it should be `false`.
1459+
/// [Unicode Standard Annex #11](http://www.unicode.org/reports/tr11/) recommends that these
1460+
/// characters be treated as 1 column (i.e., `is_cjk = false`) if the locale is unknown.
14611461
#[unstable(feature = "collections",
14621462
reason = "this functionality may only be provided by libunicode")]
14631463
fn width(&self, is_cjk: bool) -> usize {

src/libcore/fmt/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -700,7 +700,7 @@ impl Display for char {
700700
impl<T> Pointer for *const T {
701701
fn fmt(&self, f: &mut Formatter) -> Result {
702702
f.flags |= 1 << (FlagV1::Alternate as u32);
703-
let ret = LowerHex::fmt(&(*self as u32), f);
703+
let ret = LowerHex::fmt(&(*self as usize), f);
704704
f.flags &= !(1 << (FlagV1::Alternate as u32));
705705
ret
706706
}

src/librustc_trans/back/write.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -851,7 +851,9 @@ pub fn run_passes(sess: &Session,
851851

852852
// FIXME: time_llvm_passes support - does this use a global context or
853853
// something?
854-
//if sess.time_llvm_passes() { llvm::LLVMRustPrintPassTimings(); }
854+
if sess.opts.cg.codegen_units == 1 && sess.time_llvm_passes() {
855+
unsafe { llvm::LLVMRustPrintPassTimings(); }
856+
}
855857
}
856858

857859
struct WorkItem {

src/librustc_trans/trans/base.rs

+5
Original file line numberDiff line numberDiff line change
@@ -2332,6 +2332,11 @@ pub fn trans_item(ccx: &CrateContext, item: &ast::Item) {
23322332
// Do static_assert checking. It can't really be done much earlier
23332333
// because we need to get the value of the bool out of LLVM
23342334
if attr::contains_name(&item.attrs, "static_assert") {
2335+
if !ty::type_is_bool(ty::expr_ty(ccx.tcx(), expr)) {
2336+
ccx.sess().span_fatal(expr.span,
2337+
"can only have static_assert on a static \
2338+
with type `bool`");
2339+
}
23352340
if m == ast::MutMutable {
23362341
ccx.sess().span_fatal(expr.span,
23372342
"cannot have static_assert on a mutable \

src/libstd/sys/unix/thread.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ pub mod guard {
164164

165165
if pthread_main_np() == 1 {
166166
// main thread
167-
current_stack.ss_sp as uint - current_stack.ss_size as uint + 3 * PAGE_SIZE as uint
167+
current_stack.ss_sp as uint - current_stack.ss_size as uint + PAGE_SIZE as uint
168168

169169
} else {
170170
// new thread
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Copyright 2015 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+
#![allow(dead_code)]
12+
13+
#[static_assert]
14+
static E: i32 = 1; //~ ERROR can only have static_assert on a static with type `bool`
15+
16+
fn main() {}

src/test/run-pass/ifmt.rs

+8
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#![feature(box_syntax)]
1818

1919
use std::fmt;
20+
use std::usize;
2021

2122
struct A;
2223
struct B;
@@ -137,6 +138,13 @@ pub fn main() {
137138
t!(format!("{:+10.3e}", 1.2345e6f64), " +1.234e6");
138139
t!(format!("{:+10.3e}", -1.2345e6f64), " -1.234e6");
139140

141+
// Test that pointers don't get truncated.
142+
{
143+
let val = usize::MAX;
144+
let exp = format!("{:#x}", val);
145+
t!(format!("{:p}", val as *const isize), exp);
146+
}
147+
140148
// Escaping
141149
t!(format!("{{"), "{");
142150
t!(format!("}}"), "}");

0 commit comments

Comments
 (0)