Skip to content

Commit bd54ba1

Browse files
committed
---
yaml --- r: 272730 b: refs/heads/beta c: 675723e h: refs/heads/master
1 parent 351a674 commit bd54ba1

File tree

62 files changed

+702
-634
lines changed

Some content is hidden

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

62 files changed

+702
-634
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ refs/tags/0.9: 36870b185fc5f5486636d4515f0e22677493f225
2323
refs/tags/0.10: ac33f2b15782272ae348dbd7b14b8257b2148b5a
2424
refs/tags/0.11.0: e1247cb1d0d681be034adb4b558b5a0c0d5720f9
2525
refs/tags/0.12.0: f0c419429ef30723ceaf6b42f9b5a2aeb5d2e2d1
26-
refs/heads/beta: cf01fb68368ec985ffd3bf00e8e885780576da25
26+
refs/heads/beta: 675723e24376527afd36173bab2954154c474e27
2727
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
2828
refs/heads/tmp: e06d2ad9fcd5027bcaac5b08fc9aa39a49d0ecd3
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f

branches/beta/src/libcollectionstest/str.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1508,6 +1508,19 @@ generate_iterator_test! {
15081508
with str::rsplitn;
15091509
}
15101510

1511+
#[test]
1512+
fn different_str_pattern_forwarding_lifetimes() {
1513+
use std::str::pattern::Pattern;
1514+
1515+
fn foo<'a, P>(p: P) where for<'b> &'b P: Pattern<'a> {
1516+
for _ in 0..3 {
1517+
"asdf".find(&p);
1518+
}
1519+
}
1520+
1521+
foo::<&str>("x");
1522+
}
1523+
15111524
mod bench {
15121525
use test::{Bencher, black_box};
15131526

branches/beta/src/libcore/cell.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,9 @@ impl<T:Copy> Cell<T> {
241241
#[stable(feature = "rust1", since = "1.0.0")]
242242
unsafe impl<T> Send for Cell<T> where T: Send {}
243243

244+
#[stable(feature = "rust1", since = "1.0.0")]
245+
impl<T> !Sync for Cell<T> {}
246+
244247
#[stable(feature = "rust1", since = "1.0.0")]
245248
impl<T:Copy> Clone for Cell<T> {
246249
#[inline]
@@ -461,6 +464,9 @@ impl<T: ?Sized> RefCell<T> {
461464
#[stable(feature = "rust1", since = "1.0.0")]
462465
unsafe impl<T: ?Sized> Send for RefCell<T> where T: Send {}
463466

467+
#[stable(feature = "rust1", since = "1.0.0")]
468+
impl<T: ?Sized> !Sync for RefCell<T> {}
469+
464470
#[stable(feature = "rust1", since = "1.0.0")]
465471
impl<T: Clone> Clone for RefCell<T> {
466472
#[inline]

branches/beta/src/libcore/slice.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -285,12 +285,12 @@ impl<T> SliceExt for [T] {
285285

286286
#[inline]
287287
unsafe fn get_unchecked(&self, index: usize) -> &T {
288-
&*(self.repr().data.offset(index as isize))
288+
&*(self.as_ptr().offset(index as isize))
289289
}
290290

291291
#[inline]
292292
fn as_ptr(&self) -> *const T {
293-
self.repr().data
293+
self as *const [T] as *const T
294294
}
295295

296296
fn binary_search_by<F>(&self, mut f: F) -> Result<usize, usize> where
@@ -448,12 +448,12 @@ impl<T> SliceExt for [T] {
448448

449449
#[inline]
450450
unsafe fn get_unchecked_mut(&mut self, index: usize) -> &mut T {
451-
&mut *(self.repr().data as *mut T).offset(index as isize)
451+
&mut *self.as_mut_ptr().offset(index as isize)
452452
}
453453

454454
#[inline]
455455
fn as_mut_ptr(&mut self) -> *mut T {
456-
self.repr().data as *mut T
456+
self as *mut [T] as *mut T
457457
}
458458

459459
#[inline]

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1894,7 +1894,7 @@ impl StrExt for str {
18941894

18951895
#[inline]
18961896
fn as_ptr(&self) -> *const u8 {
1897-
self.repr().data
1897+
self as *const str as *const u8
18981898
}
18991899

19001900
#[inline]

branches/beta/src/libcore/str/pattern.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,7 @@ impl<'a, F> Pattern<'a> for F where F: FnMut(char) -> bool {
492492
/////////////////////////////////////////////////////////////////////////////
493493

494494
/// Delegates to the `&str` impl.
495-
impl<'a, 'b> Pattern<'a> for &'b &'b str {
495+
impl<'a, 'b, 'c> Pattern<'a> for &'c &'b str {
496496
pattern_methods!(StrSearcher<'a, 'b>, |&s| s, |s| s);
497497
}
498498

branches/beta/src/librustc/dep_graph/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,8 @@ pub fn visit_all_items_in_krate<'tcx,V,F>(tcx: &ty::ctxt<'tcx>,
198198
fn visit_item(&mut self, i: &'tcx hir::Item) {
199199
let item_def_id = self.tcx.map.local_def_id(i.id);
200200
let task_id = (self.dep_node_fn)(item_def_id);
201-
debug!("About to start task {:?}", task_id);
202201
let _task = self.tcx.dep_graph.in_task(task_id);
202+
debug!("Started task {:?}", task_id);
203203
self.tcx.dep_graph.read(DepNode::Hir(item_def_id));
204204
self.visitor.visit_item(i)
205205
}

branches/beta/src/librustc/front/map/collector.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,8 @@ impl<'ast> Visitor<'ast> for NodeCollector<'ast> {
150150
for field in v.node.data.fields() {
151151
self.create_def_with_parent(
152152
Some(variant_def_index),
153-
field.node.id,
154-
DefPathData::Field(field.node.kind));
153+
field.id,
154+
DefPathData::Field(field.name));
155155
}
156156
}
157157
}
@@ -166,7 +166,7 @@ impl<'ast> Visitor<'ast> for NodeCollector<'ast> {
166166
}
167167

168168
for field in struct_def.fields() {
169-
self.create_def(field.node.id, DefPathData::Field(field.node.kind));
169+
self.create_def(field.id, DefPathData::Field(field.name));
170170
}
171171
}
172172
ItemTrait(_, _, ref bounds, _) => {

branches/beta/src/librustc/front/map/definitions.rs

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
use middle::cstore::LOCAL_CRATE;
1212
use middle::def_id::{DefId, DefIndex};
1313
use rustc_data_structures::fnv::FnvHashMap;
14-
use rustc_front::hir;
1514
use syntax::ast;
1615
use syntax::parse::token::InternedString;
1716
use util::nodemap::NodeMap;
@@ -84,8 +83,7 @@ pub enum DefPathData {
8483
TypeParam(ast::Name),
8584
LifetimeDef(ast::Name),
8685
EnumVariant(ast::Name),
87-
PositionalField,
88-
Field(hir::StructFieldKind),
86+
Field(ast::Name),
8987
StructCtor, // implicit ctor for a tuple-like struct
9088
Initializer, // initializer for a const
9189
Binding(ast::Name), // pattern binding
@@ -186,19 +184,11 @@ impl DefPathData {
186184
LifetimeDef(name) |
187185
EnumVariant(name) |
188186
DetachedCrate(name) |
189-
Binding(name) => {
187+
Binding(name) |
188+
Field(name) => {
190189
name.as_str()
191190
}
192191

193-
Field(hir::StructFieldKind::NamedField(name, _)) => {
194-
name.as_str()
195-
}
196-
197-
PositionalField |
198-
Field(hir::StructFieldKind::UnnamedField(_)) => {
199-
InternedString::new("{{field}}")
200-
}
201-
202192
// note that this does not show up in user printouts
203193
CrateRoot => {
204194
InternedString::new("{{root}}")

branches/beta/src/librustc/lint/context.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -811,7 +811,7 @@ impl<'a, 'tcx, 'v> hir_visit::Visitor<'v> for LateContext<'a, 'tcx> {
811811
}
812812

813813
fn visit_struct_field(&mut self, s: &hir::StructField) {
814-
self.with_lint_attrs(&s.node.attrs, |cx| {
814+
self.with_lint_attrs(&s.attrs, |cx| {
815815
run_lints!(cx, check_struct_field, late_passes, s);
816816
hir_visit::walk_struct_field(cx, s);
817817
})

0 commit comments

Comments
 (0)