Skip to content

Commit 773e074

Browse files
author
Dave Huseby
committed
---
yaml --- r: 187854 b: refs/heads/tmp c: 804c071 h: refs/heads/master v: v3
1 parent be4404a commit 773e074

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+101
-849
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,5 @@ refs/heads/building: 126db549b038c84269a1e4fe46f051b2c15d6970
3434
refs/heads/beta: 522d09dfecbeca1595f25ac58c6d0178bbd21d7d
3535
refs/heads/windistfix: 7608dbad651f02e837ed05eef3d74a6662a6e928
3636
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
37-
refs/heads/tmp: d9704bdfdb3057ed2a28fcf0dd5c9165ed45189b
37+
refs/heads/tmp: 804c071d8b9cfe4d40df9565558db8a9d87d7775
3838
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f

branches/tmp/src/etc/htmldocck.py

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,6 @@
9696
highlights for example. If you want to simply check the presence of
9797
given node or attribute, use an empty string (`""`) as a `PATTERN`.
9898
99-
* `@count PATH XPATH COUNT' checks for the occurrence of given XPath
100-
in the given file. The number of occurrences must match the given count.
101-
10299
All conditions can be negated with `!`. `@!has foo/type.NoSuch.html`
103100
checks if the given file does not exist, for example.
104101
@@ -336,11 +333,6 @@ def check_tree_text(tree, path, pat, regexp):
336333
return ret
337334

338335

339-
def check_tree_count(tree, path, count):
340-
path = normalize_xpath(path)
341-
return len(tree.findall(path)) == count
342-
343-
344336
def check(target, commands):
345337
cache = CachedFiles(target)
346338
for c in commands:
@@ -368,13 +360,6 @@ def check(target, commands):
368360
raise RuntimeError('Invalid number of @{} arguments \
369361
at line {}'.format(c.cmd, c.lineno))
370362

371-
elif c.cmd == 'count': # count test
372-
if len(c.args) == 3: # @count <path> <pat> <count> = count test
373-
ret = check_tree_count(cache.get_tree(c.args[0]), c.args[1], int(c.args[2]))
374-
else:
375-
raise RuntimeError('Invalid number of @{} arguments \
376-
at line {}'.format(c.cmd, c.lineno))
377-
378363
elif c.cmd == 'valid-html':
379364
raise RuntimeError('Unimplemented @valid-html at line {}'.format(c.lineno))
380365

branches/tmp/src/liballoc/arc.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -139,13 +139,6 @@ pub struct Weak<T> {
139139
unsafe impl<T: Sync + Send> Send for Weak<T> { }
140140
unsafe impl<T: Sync + Send> Sync for Weak<T> { }
141141

142-
#[stable(feature = "rust1", since = "1.0.0")]
143-
impl<T: fmt::Debug> fmt::Debug for Weak<T> {
144-
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
145-
write!(f, "(Weak)")
146-
}
147-
}
148-
149142
struct ArcInner<T> {
150143
strong: atomic::AtomicUsize,
151144
weak: atomic::AtomicUsize,

branches/tmp/src/liballoc/heap.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ mod imp {
300300
libc::realloc(ptr as *mut libc::c_void, size as libc::size_t) as *mut u8
301301
} else {
302302
let new_ptr = allocate(size, align);
303-
ptr::copy(new_ptr, ptr, cmp::min(size, old_size));
303+
ptr::copy_memory(new_ptr, ptr, cmp::min(size, old_size));
304304
deallocate(ptr, old_size, align);
305305
new_ptr
306306
}

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,10 @@ pub trait Write {
110110
/// traits.
111111
#[stable(feature = "rust1", since = "1.0.0")]
112112
pub struct Formatter<'a> {
113+
#[cfg(not(stage0))]
113114
flags: u32,
115+
#[cfg(stage0)]
116+
flags: usize,
114117
fill: char,
115118
align: rt::v1::Alignment,
116119
width: Option<usize>,
@@ -156,6 +159,13 @@ impl<'a> ArgumentV1<'a> {
156159
}
157160
}
158161

162+
#[cfg(stage0)]
163+
#[doc(hidden)]
164+
#[stable(feature = "rust1", since = "1.0.0")]
165+
pub fn from_uint(x: &uint) -> ArgumentV1 {
166+
ArgumentV1::new(x, ArgumentV1::show_usize)
167+
}
168+
#[cfg(not(stage0))]
159169
#[doc(hidden)]
160170
#[stable(feature = "rust1", since = "1.0.0")]
161171
pub fn from_usize(x: &usize) -> ArgumentV1 {
@@ -595,9 +605,14 @@ impl<'a> Formatter<'a> {
595605
write(self.buf, fmt)
596606
}
597607

608+
#[cfg(not(stage0))]
598609
/// Flags for formatting (packed version of rt::Flag)
599610
#[stable(feature = "rust1", since = "1.0.0")]
600611
pub fn flags(&self) -> u32 { self.flags }
612+
#[cfg(stage0)]
613+
/// Flags for formatting (packed version of rt::Flag)
614+
#[stable(feature = "rust1", since = "1.0.0")]
615+
pub fn flags(&self) -> usize { self.flags }
601616

602617
/// Character used as 'fill' whenever there is alignment
603618
#[unstable(feature = "core", reason = "method was just created")]

branches/tmp/src/libcore/fmt/rt/v1.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ pub struct FormatSpec {
3232
pub fill: char,
3333
#[stable(feature = "rust1", since = "1.0.0")]
3434
pub align: Alignment,
35+
#[cfg(stage0)]
36+
#[stable(feature = "rust1", since = "1.0.0")]
37+
pub flags: usize,
38+
#[cfg(not(stage0))]
3539
#[stable(feature = "rust1", since = "1.0.0")]
3640
pub flags: u32,
3741
#[stable(feature = "rust1", since = "1.0.0")]

branches/tmp/src/libcore/intrinsics.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -241,12 +241,7 @@ extern "rust-intrinsic" {
241241
/// will trigger a compiler error.
242242
pub fn return_address() -> *const u8;
243243

244-
/// Returns `true` if the actual type given as `T` requires drop
245-
/// glue; returns `false` if the actual type provided for `T`
246-
/// implements `Copy`.
247-
///
248-
/// If the actual type neither requires drop glue nor implements
249-
/// `Copy`, then may return `true` or `false`.
244+
/// Returns `true` if a type requires drop glue.
250245
pub fn needs_drop<T>() -> bool;
251246

252247
/// Returns `true` if a type is managed (will be allocated on the local heap)

branches/tmp/src/libcore/macros.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ macro_rules! panic {
1515
panic!("explicit panic")
1616
);
1717
($msg:expr) => ({
18+
#[cfg(stage0)]
19+
static _MSG_FILE_LINE: (&'static str, &'static str, usize) = ($msg, file!(), line!());
20+
#[cfg(not(stage0))]
1821
static _MSG_FILE_LINE: (&'static str, &'static str, u32) = ($msg, file!(), line!());
1922
::core::panicking::panic(&_MSG_FILE_LINE)
2023
});
@@ -23,6 +26,9 @@ macro_rules! panic {
2326
// used inside a dead function. Just `#[allow(dead_code)]` is
2427
// insufficient, since the user may have
2528
// `#[forbid(dead_code)]` and which cannot be overridden.
29+
#[cfg(stage0)]
30+
static _FILE_LINE: (&'static str, usize) = (file!(), line!());
31+
#[cfg(not(stage0))]
2632
static _FILE_LINE: (&'static str, u32) = (file!(), line!());
2733
::core::panicking::panic_fmt(format_args!($fmt, $($arg)*), &_FILE_LINE)
2834
});

branches/tmp/src/libcore/panicking.rs

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,20 +34,49 @@ use fmt;
3434

3535
#[cold] #[inline(never)] // this is the slow path, always
3636
#[lang="panic"]
37+
#[cfg(stage0)]
38+
pub fn panic(expr_file_line: &(&'static str, &'static str, usize)) -> ! {
39+
let (expr, file, line) = *expr_file_line;
40+
panic_fmt(format_args!("{}", expr), &(file, line))
41+
}
42+
#[cold] #[inline(never)] // this is the slow path, always
43+
#[lang="panic"]
44+
#[cfg(not(stage0))]
3745
pub fn panic(expr_file_line: &(&'static str, &'static str, u32)) -> ! {
3846
let (expr, file, line) = *expr_file_line;
3947
panic_fmt(format_args!("{}", expr), &(file, line))
4048
}
4149

4250
#[cold] #[inline(never)]
4351
#[lang="panic_bounds_check"]
52+
#[cfg(stage0)]
53+
fn panic_bounds_check(file_line: &(&'static str, usize),
54+
index: usize, len: usize) -> ! {
55+
panic_fmt(format_args!("index out of bounds: the len is {} but the index is {}",
56+
len, index), file_line)
57+
}
58+
#[cold] #[inline(never)]
59+
#[lang="panic_bounds_check"]
60+
#[cfg(not(stage0))]
4461
fn panic_bounds_check(file_line: &(&'static str, u32),
4562
index: usize, len: usize) -> ! {
4663
panic_fmt(format_args!("index out of bounds: the len is {} but the index is {}",
4764
len, index), file_line)
4865
}
4966

5067
#[cold] #[inline(never)]
68+
#[cfg(stage0)]
69+
pub fn panic_fmt(fmt: fmt::Arguments, file_line: &(&'static str, usize)) -> ! {
70+
#[allow(improper_ctypes)]
71+
extern {
72+
#[lang = "panic_fmt"]
73+
fn panic_impl(fmt: fmt::Arguments, file: &'static str, line: uint) -> !;
74+
}
75+
let (file, line) = *file_line;
76+
unsafe { panic_impl(fmt, file, line as uint) }
77+
}
78+
#[cold] #[inline(never)]
79+
#[cfg(not(stage0))]
5180
pub fn panic_fmt(fmt: fmt::Arguments, file_line: &(&'static str, u32)) -> ! {
5281
#[allow(improper_ctypes)]
5382
extern {

branches/tmp/src/libcore/str/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -939,7 +939,6 @@ impl<'a, P: Pattern<'a>> Iterator for SplitStr<'a, P> {
939939
type Item = &'a str;
940940

941941
#[inline]
942-
#[allow(deprecated)]
943942
fn next(&mut self) -> Option<&'a str> {
944943
Iterator::next(&mut self.0)
945944
}

branches/tmp/src/liblog/macros.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,13 @@
5050
#[macro_export]
5151
macro_rules! log {
5252
($lvl:expr, $($arg:tt)+) => ({
53+
#[cfg(stage0)]
54+
static LOC: ::log::LogLocation = ::log::LogLocation {
55+
line: line!() as u32,
56+
file: file!(),
57+
module_path: module_path!(),
58+
};
59+
#[cfg(not(stage0))]
5360
static LOC: ::log::LogLocation = ::log::LogLocation {
5461
line: line!(),
5562
file: file!(),

branches/tmp/src/librustc/lint/builtin.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1771,11 +1771,6 @@ impl LintPass for Stability {
17711771
stability::check_path(cx.tcx, path, id,
17721772
&mut |id, sp, stab| self.lint(cx, id, sp, stab));
17731773
}
1774-
1775-
fn check_pat(&mut self, cx: &Context, pat: &ast::Pat) {
1776-
stability::check_pat(cx.tcx, pat,
1777-
&mut |id, sp, stab| self.lint(cx, id, sp, stab))
1778-
}
17791774
}
17801775

17811776
declare_lint! {

branches/tmp/src/librustc/middle/stability.rs

Lines changed: 0 additions & 121 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,8 @@ impl<'a> Annotator<'a> {
5858
attrs: &Vec<Attribute>, item_sp: Span, f: F, required: bool) where
5959
F: FnOnce(&mut Annotator),
6060
{
61-
debug!("annotate(id = {:?}, attrs = {:?})", id, attrs);
6261
match attr::find_stability(self.sess.diagnostic(), attrs, item_sp) {
6362
Some(stab) => {
64-
debug!("annotate: found {:?}", stab);
6563
self.index.local.insert(id, stab.clone());
6664

6765
// Don't inherit #[stable(feature = "rust1", since = "1.0.0")]
@@ -74,8 +72,6 @@ impl<'a> Annotator<'a> {
7472
}
7573
}
7674
None => {
77-
debug!("annotate: not found, use_parent = {:?}, parent = {:?}",
78-
use_parent, self.parent);
7975
if use_parent {
8076
if let Some(stab) = self.parent.clone() {
8177
self.index.local.insert(id, stab);
@@ -303,12 +299,6 @@ impl<'a, 'v, 'tcx> Visitor<'v> for Checker<'a, 'tcx> {
303299
&mut |id, sp, stab| self.check(id, sp, stab));
304300
visit::walk_path(self, path)
305301
}
306-
307-
fn visit_pat(&mut self, pat: &ast::Pat) {
308-
check_pat(self.tcx, pat,
309-
&mut |id, sp, stab| self.check(id, sp, stab));
310-
visit::walk_pat(self, pat)
311-
}
312302
}
313303

314304
/// Helper for discovering nodes to check for stability
@@ -395,76 +385,6 @@ pub fn check_expr(tcx: &ty::ctxt, e: &ast::Expr,
395385
None => return
396386
}
397387
}
398-
ast::ExprField(ref base_e, ref field) => {
399-
span = field.span;
400-
match ty::expr_ty_adjusted(tcx, base_e).sty {
401-
ty::ty_struct(did, _) => {
402-
ty::lookup_struct_fields(tcx, did)
403-
.iter()
404-
.find(|f| f.name == field.node.name)
405-
.unwrap_or_else(|| {
406-
tcx.sess.span_bug(field.span,
407-
"stability::check_expr: unknown named field access")
408-
})
409-
.id
410-
}
411-
_ => tcx.sess.span_bug(e.span,
412-
"stability::check_expr: named field access on non-struct")
413-
}
414-
}
415-
ast::ExprTupField(ref base_e, ref field) => {
416-
span = field.span;
417-
match ty::expr_ty_adjusted(tcx, base_e).sty {
418-
ty::ty_struct(did, _) => {
419-
ty::lookup_struct_fields(tcx, did)
420-
.get(field.node)
421-
.unwrap_or_else(|| {
422-
tcx.sess.span_bug(field.span,
423-
"stability::check_expr: unknown unnamed field access")
424-
})
425-
.id
426-
}
427-
ty::ty_tup(..) => return,
428-
_ => tcx.sess.span_bug(e.span,
429-
"stability::check_expr: unnamed field access on \
430-
something other than a tuple or struct")
431-
}
432-
}
433-
ast::ExprStruct(_, ref expr_fields, _) => {
434-
let type_ = ty::expr_ty(tcx, e);
435-
match type_.sty {
436-
ty::ty_struct(did, _) => {
437-
let struct_fields = ty::lookup_struct_fields(tcx, did);
438-
// check the stability of each field that appears
439-
// in the construction expression.
440-
for field in expr_fields {
441-
let did = struct_fields
442-
.iter()
443-
.find(|f| f.name == field.ident.node.name)
444-
.unwrap_or_else(|| {
445-
tcx.sess.span_bug(field.span,
446-
"stability::check_expr: unknown named \
447-
field access")
448-
})
449-
.id;
450-
maybe_do_stability_check(tcx, did, field.span, cb);
451-
}
452-
453-
// we're done.
454-
return
455-
}
456-
// we don't look at stability attributes on
457-
// struct-like enums (yet...), but it's definitely not
458-
// a bug to have construct one.
459-
ty::ty_enum(..) => return,
460-
_ => {
461-
tcx.sess.span_bug(e.span,
462-
&format!("stability::check_expr: struct construction \
463-
of non-struct, type {:?}",
464-
type_.repr(tcx)));
465-
}
466-
}
467-
}
468388
_ => return
469389
};
470390

@@ -483,47 +403,6 @@ pub fn check_path(tcx: &ty::ctxt, path: &ast::Path, id: ast::NodeId,
483403

484404
}
485405

486-
pub fn check_pat(tcx: &ty::ctxt, pat: &ast::Pat,
487-
cb: &mut FnMut(ast::DefId, Span, &Option<Stability>)) {
488-
debug!("check_pat(pat = {:?})", pat);
489-
if is_internal(tcx, pat.span) { return; }
490-
491-
let did = match ty::pat_ty_opt(tcx, pat) {
492-
Some(&ty::TyS { sty: ty::ty_struct(did, _), .. }) => did,
493-
Some(_) | None => return,
494-
};
495-
let struct_fields = ty::lookup_struct_fields(tcx, did);
496-
match pat.node {
497-
// Foo(a, b, c)
498-
ast::PatEnum(_, Some(ref pat_fields)) => {
499-
for (field, struct_field) in pat_fields.iter().zip(struct_fields.iter()) {
500-
// a .. pattern is fine, but anything positional is
501-
// not.
502-
if let ast::PatWild(ast::PatWildMulti) = field.node {
503-
continue
504-
}
505-
maybe_do_stability_check(tcx, struct_field.id, field.span, cb)
506-
}
507-
}
508-
// Foo { a, b, c }
509-
ast::PatStruct(_, ref pat_fields, _) => {
510-
for field in pat_fields {
511-
let did = struct_fields
512-
.iter()
513-
.find(|f| f.name == field.node.ident.name)
514-
.unwrap_or_else(|| {
515-
tcx.sess.span_bug(field.span,
516-
"stability::check_pat: unknown named field access")
517-
})
518-
.id;
519-
maybe_do_stability_check(tcx, did, field.span, cb);
520-
}
521-
}
522-
// everything else is fine.
523-
_ => {}
524-
}
525-
}
526-
527406
fn maybe_do_stability_check(tcx: &ty::ctxt, id: ast::DefId, span: Span,
528407
cb: &mut FnMut(ast::DefId, Span, &Option<Stability>)) {
529408
if !is_staged_api(tcx, id) { return }

0 commit comments

Comments
 (0)