Skip to content

Commit 927cfc8

Browse files
committed
---
yaml --- r: 187503 b: refs/heads/try c: 337a0a9 h: refs/heads/master i: 187501: 78d7c21 187499: 1e30eb2 187495: d810355 187487: 837502f v: v3
1 parent a9789a1 commit 927cfc8

File tree

6 files changed

+27
-25
lines changed

6 files changed

+27
-25
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: b4c965ee803a4521d8b4575f634e036f93e408f3
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 3a96d6a9818fe2affc98a187fb1065120458cee9
5-
refs/heads/try: 28362d542d2561c4cc16cb3229ce3fed7317dbd6
5+
refs/heads/try: 337a0a981eeb66bbb1c8ac115a60bb91c1b0ca48
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
88
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596

branches/try/src/libcore/fmt/mod.rs

Lines changed: 1 addition & 1 deletion
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
}

branches/try/src/libcore/iter.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ use num::{ToPrimitive, Int};
6868
use ops::{Add, Deref, FnMut};
6969
use option::Option;
7070
use option::Option::{Some, None};
71-
use marker::{Send, Sized, Sync};
71+
use marker::Sized;
7272
use usize;
7373

7474
/// An interface for dealing with "external iterators". These types of iterators
@@ -1783,10 +1783,6 @@ pub struct Peekable<I: Iterator> {
17831783
peeked: Option<I::Item>,
17841784
}
17851785

1786-
// FIXME: after #22828 being fixed, the following unsafe impl should be removed
1787-
unsafe impl<I: Iterator> Sync for Peekable<I> where I: Sync, I::Item: Sync {}
1788-
unsafe impl<I: Iterator> Send for Peekable<I> where I: Send, I::Item: Send {}
1789-
17901786
impl<I: Iterator + Clone> Clone for Peekable<I> where I::Item: Clone {
17911787
fn clone(&self) -> Peekable<I> {
17921788
Peekable {

branches/try/src/librustc_trans/trans/base.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -433,13 +433,13 @@ pub fn set_inline_hint(f: ValueRef) {
433433
}
434434

435435
pub fn set_llvm_fn_attrs(ccx: &CrateContext, attrs: &[ast::Attribute], llfn: ValueRef) {
436-
use syntax::attr::*;
436+
use syntax::attr::{find_inline_attr, InlineAttr};
437437
// Set the inline hint if there is one
438438
match find_inline_attr(Some(ccx.sess().diagnostic()), attrs) {
439-
InlineHint => set_inline_hint(llfn),
440-
InlineAlways => set_always_inline(llfn),
441-
InlineNever => set_no_inline(llfn),
442-
InlineNone => { /* fallthrough */ }
439+
InlineAttr::Hint => set_inline_hint(llfn),
440+
InlineAttr::Always => set_always_inline(llfn),
441+
InlineAttr::Never => set_no_inline(llfn),
442+
InlineAttr::None => { /* fallthrough */ }
443443
}
444444

445445
for attr in attrs {

branches/try/src/libsyntax/attr.rs

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
// Functions dealing with attributes and meta items
1212

13-
pub use self::InlineAttr::*;
1413
pub use self::StabilityLevel::*;
1514
pub use self::ReprAttr::*;
1615
pub use self::IntType::*;
@@ -285,33 +284,33 @@ pub fn find_crate_name(attrs: &[Attribute]) -> Option<InternedString> {
285284

286285
#[derive(Copy, PartialEq)]
287286
pub enum InlineAttr {
288-
InlineNone,
289-
InlineHint,
290-
InlineAlways,
291-
InlineNever,
287+
None,
288+
Hint,
289+
Always,
290+
Never,
292291
}
293292

294293
/// Determine what `#[inline]` attribute is present in `attrs`, if any.
295294
pub fn find_inline_attr(diagnostic: Option<&SpanHandler>, attrs: &[Attribute]) -> InlineAttr {
296295
// FIXME (#2809)---validate the usage of #[inline] and #[inline]
297-
attrs.iter().fold(InlineNone, |ia,attr| {
296+
attrs.iter().fold(InlineAttr::None, |ia,attr| {
298297
match attr.node.value.node {
299298
MetaWord(ref n) if *n == "inline" => {
300299
mark_used(attr);
301-
InlineHint
300+
InlineAttr::Hint
302301
}
303302
MetaList(ref n, ref items) if *n == "inline" => {
304303
mark_used(attr);
305304
if items.len() != 1 {
306305
diagnostic.map(|d|{ d.span_err(attr.span, "expected one argument"); });
307-
InlineNone
306+
InlineAttr::None
308307
} else if contains_name(&items[..], "always") {
309-
InlineAlways
308+
InlineAttr::Always
310309
} else if contains_name(&items[..], "never") {
311-
InlineNever
310+
InlineAttr::Never
312311
} else {
313312
diagnostic.map(|d|{ d.span_err((*items[0]).span, "invalid argument"); });
314-
InlineNone
313+
InlineAttr::None
315314
}
316315
}
317316
_ => ia
@@ -322,8 +321,8 @@ pub fn find_inline_attr(diagnostic: Option<&SpanHandler>, attrs: &[Attribute]) -
322321
/// True if `#[inline]` or `#[inline(always)]` is present in `attrs`.
323322
pub fn requests_inline(attrs: &[Attribute]) -> bool {
324323
match find_inline_attr(None, attrs) {
325-
InlineHint | InlineAlways => true,
326-
InlineNone | InlineNever => false,
324+
InlineAttr::Hint | InlineAttr::Always => true,
325+
InlineAttr::None | InlineAttr::Never => false,
327326
}
328327
}
329328

branches/try/src/test/run-pass/ifmt.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,13 @@ pub fn main() {
137137
t!(format!("{:+10.3e}", 1.2345e6f64), " +1.234e6");
138138
t!(format!("{:+10.3e}", -1.2345e6f64), " -1.234e6");
139139

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

0 commit comments

Comments
 (0)