Skip to content

Commit 5b5b60a

Browse files
committed
---
yaml --- r: 235956 b: refs/heads/stable c: ddc2829 h: refs/heads/master v: v3
1 parent 30d5c85 commit 5b5b60a

File tree

98 files changed

+1067
-7305
lines changed

Some content is hidden

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

98 files changed

+1067
-7305
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ refs/heads/tmp: afae2ff723393b3ab4ccffef6ac7c6d1809e2da0
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3030
refs/tags/homu-tmp: f859507de8c410b648d934d8f5ec1c52daac971d
3131
refs/tags/1.0.0-beta: 8cbb92b53468ee2b0c2d3eeb8567005953d40828
32-
refs/heads/stable: 3a12b4c4f805f66d223861d4be232112c2982a0e
32+
refs/heads/stable: ddc28298b9133e6a9cc39e276f9feff51d808949
3333
refs/tags/1.0.0: 55bd4f8ff2b323f317ae89e254ce87162d52a375
3434
refs/tags/1.1.0: bc3c16f09287e5545c1d3f76b7abd54f2eca868b
3535
refs/tags/1.2.0: f557861f822c34f07270347b94b5280de20a597e

branches/stable/.gitattributes

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,4 @@
66
*.rs rust
77
src/etc/pkg/rust-logo.ico binary
88
src/etc/pkg/rust-logo.png binary
9-
src/rt/msvc/* -whitespace
10-
src/rt/valgrind/* -whitespace
119
*.woff binary

branches/stable/src/doc/trpl/compiler-plugins.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ fn expand_rn(cx: &mut ExtCtxt, sp: Span, args: &[TokenTree])
6161
("I", 1)];
6262
6363
let text = match args {
64-
[TtToken(_, token::Ident(s, _))] => token::get_ident(s).to_string(),
64+
[TtToken(_, token::Ident(s, _))] => s.to_string(),
6565
_ => {
6666
cx.span_err(sp, "argument should be a single identifier");
6767
return DummyResult::any(sp);
@@ -186,8 +186,7 @@ impl LintPass for Pass {
186186
}
187187
188188
fn check_item(&mut self, cx: &Context, it: &ast::Item) {
189-
let name = token::get_ident(it.ident);
190-
if name.get() == "lintme" {
189+
if it.ident.name == "lintme" {
191190
cx.span_lint(TEST_LINT, it.span, "item is named 'lintme'");
192191
}
193192
}

branches/stable/src/libcore/slice.rs

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

301301
#[inline]
302302
fn split_at_mut(&mut self, mid: usize) -> (&mut [T], &mut [T]) {
303+
let len = self.len();
304+
let ptr = self.as_mut_ptr();
305+
assert!(mid <= len);
303306
unsafe {
304-
let self2: &mut [T] = mem::transmute_copy(&self);
305-
306-
(ops::IndexMut::index_mut(self, ops::RangeTo { end: mid } ),
307-
ops::IndexMut::index_mut(self2, ops::RangeFrom { start: mid } ))
307+
(from_raw_parts_mut(ptr, mid),
308+
from_raw_parts_mut(ptr.offset(mid as isize), len - mid))
308309
}
309310
}
310311

branches/stable/src/liblibc/lib.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1009,7 +1009,7 @@ pub mod types {
10091009
use types::os::arch::posix88::{uid_t};
10101010

10111011
pub type nlink_t = u16;
1012-
pub type blksize_t = i32;
1012+
pub type blksize_t = u32;
10131013
pub type blkcnt_t = i64;
10141014
pub type fflags_t = u32;
10151015
#[repr(C)]
@@ -1035,7 +1035,7 @@ pub mod types {
10351035
pub st_lspare: int32_t,
10361036
pub st_birthtime: time_t,
10371037
pub st_birthtime_nsec: c_long,
1038-
pub __unused: [uint8_t; 2],
1038+
pub __unused: [u8; 8],
10391039
}
10401040

10411041
#[repr(C)]
@@ -1103,7 +1103,7 @@ pub mod types {
11031103
use types::os::arch::posix88::{uid_t};
11041104

11051105
pub type nlink_t = u16;
1106-
pub type blksize_t = i64;
1106+
pub type blksize_t = u32;
11071107
pub type blkcnt_t = i64;
11081108
pub type fflags_t = u32;
11091109
#[repr(C)]
@@ -1129,7 +1129,6 @@ pub mod types {
11291129
pub st_lspare: int32_t,
11301130
pub st_birthtime: time_t,
11311131
pub st_birthtime_nsec: c_long,
1132-
pub __unused: [uint8_t; 2],
11331132
}
11341133

11351134
#[repr(C)]

branches/stable/src/librustc/ast_map/mod.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,7 @@ impl PathElem {
4747

4848
impl fmt::Display for PathElem {
4949
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
50-
let slot = token::get_name(self.name());
51-
write!(f, "{}", slot)
50+
write!(f, "{}", self.name())
5251
}
5352
}
5453

@@ -1073,18 +1072,18 @@ fn node_id_to_string(map: &Map, id: NodeId, include_id: bool) -> String {
10731072
match ii.node {
10741073
ConstImplItem(..) => {
10751074
format!("assoc const {} in {}{}",
1076-
token::get_ident(ii.ident),
1075+
ii.ident,
10771076
map.path_to_string(id),
10781077
id_str)
10791078
}
10801079
MethodImplItem(..) => {
10811080
format!("method {} in {}{}",
1082-
token::get_ident(ii.ident),
1081+
ii.ident,
10831082
map.path_to_string(id), id_str)
10841083
}
10851084
TypeImplItem(_) => {
10861085
format!("assoc type {} in {}{}",
1087-
token::get_ident(ii.ident),
1086+
ii.ident,
10881087
map.path_to_string(id),
10891088
id_str)
10901089
}
@@ -1103,13 +1102,13 @@ fn node_id_to_string(map: &Map, id: NodeId, include_id: bool) -> String {
11031102

11041103
format!("{} {} in {}{}",
11051104
kind,
1106-
token::get_ident(ti.ident),
1105+
ti.ident,
11071106
map.path_to_string(id),
11081107
id_str)
11091108
}
11101109
Some(NodeVariant(ref variant)) => {
11111110
format!("variant {} in {}{}",
1112-
token::get_ident(variant.node.name),
1111+
variant.node.name,
11131112
map.path_to_string(id), id_str)
11141113
}
11151114
Some(NodeExpr(ref expr)) => {

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

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ use lint::builtin;
3434
use util::nodemap::FnvHashMap;
3535

3636
use std::cell::RefCell;
37+
use std::cmp;
3738
use std::mem;
3839
use syntax::ast_util::IdVisitingOperation;
3940
use syntax::attr::AttrMetaMethods;
@@ -66,6 +67,9 @@ pub struct LintStore {
6667
/// Map of registered lint groups to what lints they expand to. The bool
6768
/// is true if the lint group was added by a plugin.
6869
lint_groups: FnvHashMap<&'static str, (Vec<LintId>, bool)>,
70+
71+
/// Maximum level a lint can be
72+
lint_cap: Option<Level>,
6973
}
7074

7175
/// The targed of the `by_name` map, which accounts for renaming/deprecation.
@@ -94,7 +98,10 @@ impl LintStore {
9498
}
9599
}
96100

97-
fn set_level(&mut self, lint: LintId, lvlsrc: LevelSource) {
101+
fn set_level(&mut self, lint: LintId, mut lvlsrc: LevelSource) {
102+
if let Some(cap) = self.lint_cap {
103+
lvlsrc.0 = cmp::min(lvlsrc.0, cap);
104+
}
98105
if lvlsrc.0 == Allow {
99106
self.levels.remove(&lint);
100107
} else {
@@ -109,6 +116,7 @@ impl LintStore {
109116
by_name: FnvHashMap(),
110117
levels: FnvHashMap(),
111118
lint_groups: FnvHashMap(),
119+
lint_cap: None,
112120
}
113121
}
114122

@@ -227,6 +235,13 @@ impl LintStore {
227235
}
228236
}
229237
}
238+
239+
self.lint_cap = sess.opts.lint_cap;
240+
if let Some(cap) = self.lint_cap {
241+
for level in self.levels.iter_mut().map(|p| &mut (p.1).0) {
242+
*level = cmp::min(*level, cap);
243+
}
244+
}
230245
}
231246
}
232247

branches/stable/src/librustc/metadata/creader.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ use syntax::attr::AttrMetaMethods;
3333
use syntax::codemap::{self, Span, mk_sp, Pos};
3434
use syntax::parse;
3535
use syntax::parse::token::InternedString;
36-
use syntax::parse::token;
3736
use syntax::visit;
3837
use log;
3938

@@ -181,19 +180,18 @@ impl<'a> CrateReader<'a> {
181180
fn extract_crate_info(&self, i: &ast::Item) -> Option<CrateInfo> {
182181
match i.node {
183182
ast::ItemExternCrate(ref path_opt) => {
184-
let ident = token::get_ident(i.ident);
185183
debug!("resolving extern crate stmt. ident: {} path_opt: {:?}",
186-
ident, path_opt);
184+
i.ident, path_opt);
187185
let name = match *path_opt {
188186
Some(name) => {
189-
validate_crate_name(Some(self.sess), name.as_str(),
187+
validate_crate_name(Some(self.sess), &name.as_str(),
190188
Some(i.span));
191-
name.as_str().to_string()
189+
name.to_string()
192190
}
193-
None => ident.to_string(),
191+
None => i.ident.to_string(),
194192
};
195193
Some(CrateInfo {
196-
ident: ident.to_string(),
194+
ident: i.ident.to_string(),
197195
name: name,
198196
id: i.id,
199197
should_link: should_link(i),

branches/stable/src/librustc/metadata/encoder.rs

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ use syntax::attr;
4040
use syntax::attr::AttrMetaMethods;
4141
use syntax::diagnostic::SpanHandler;
4242
use syntax::parse::token::special_idents;
43-
use syntax::parse::token;
4443
use syntax::print::pprust;
4544
use syntax::ptr::P;
4645
use syntax::visit::Visitor;
@@ -83,11 +82,11 @@ pub struct EncodeContext<'a, 'tcx: 'a> {
8382
}
8483

8584
fn encode_name(rbml_w: &mut Encoder, name: ast::Name) {
86-
rbml_w.wr_tagged_str(tag_paths_data_name, &token::get_name(name));
85+
rbml_w.wr_tagged_str(tag_paths_data_name, &name.as_str());
8786
}
8887

8988
fn encode_impl_type_basename(rbml_w: &mut Encoder, name: ast::Name) {
90-
rbml_w.wr_tagged_str(tag_item_impl_type_basename, &token::get_name(name));
89+
rbml_w.wr_tagged_str(tag_item_impl_type_basename, &name.as_str());
9190
}
9291

9392
fn encode_def_id(rbml_w: &mut Encoder, id: DefId) {
@@ -349,7 +348,7 @@ fn encode_path<PI: Iterator<Item=PathElem>>(rbml_w: &mut Encoder, path: PI) {
349348
ast_map::PathMod(_) => tag_path_elem_mod,
350349
ast_map::PathName(_) => tag_path_elem_name
351350
};
352-
rbml_w.wr_tagged_str(tag, &token::get_name(pe.name()));
351+
rbml_w.wr_tagged_str(tag, &pe.name().as_str());
353352
}
354353
rbml_w.end_tag();
355354
}
@@ -359,13 +358,13 @@ fn encode_reexported_static_method(rbml_w: &mut Encoder,
359358
method_def_id: DefId,
360359
method_name: ast::Name) {
361360
debug!("(encode reexported static method) {}::{}",
362-
exp.name, token::get_name(method_name));
361+
exp.name, method_name);
363362
rbml_w.start_tag(tag_items_data_item_reexport);
364363
rbml_w.wr_tagged_u64(tag_items_data_item_reexport_def_id,
365364
def_to_u64(method_def_id));
366365
rbml_w.wr_tagged_str(tag_items_data_item_reexport_name,
367366
&format!("{}::{}", exp.name,
368-
token::get_name(method_name)));
367+
method_name));
369368
rbml_w.end_tag();
370369
}
371370

@@ -499,15 +498,12 @@ fn encode_reexports(ecx: &EncodeContext,
499498
rbml_w.wr_tagged_u64(tag_items_data_item_reexport_def_id,
500499
def_to_u64(exp.def_id));
501500
rbml_w.wr_tagged_str(tag_items_data_item_reexport_name,
502-
exp.name.as_str());
501+
&exp.name.as_str());
503502
rbml_w.end_tag();
504503
encode_reexported_static_methods(ecx, rbml_w, path.clone(), exp);
505504
}
506-
}
507-
None => {
508-
debug!("(encoding info for module) found no reexports for {}",
509-
id);
510-
}
505+
},
506+
None => debug!("(encoding info for module) found no reexports for {}", id),
511507
}
512508
}
513509

@@ -539,7 +535,7 @@ fn encode_info_for_mod(ecx: &EncodeContext,
539535
if let ast::ItemImpl(..) = item.node {
540536
let (ident, did) = (item.ident, item.id);
541537
debug!("(encoding info for module) ... encoding impl {} ({}/{})",
542-
token::get_ident(ident),
538+
ident,
543539
did, ecx.tcx.map.node_to_string(did));
544540

545541
rbml_w.wr_tagged_u64(tag_mod_impl, def_to_u64(local_def(did)));
@@ -656,7 +652,7 @@ fn encode_info_for_struct(ecx: &EncodeContext,
656652
});
657653
rbml_w.start_tag(tag_items_data_item);
658654
debug!("encode_info_for_struct: doing {} {}",
659-
token::get_name(nm), id);
655+
nm, id);
660656
encode_struct_field_family(rbml_w, field.vis);
661657
encode_name(rbml_w, nm);
662658
encode_bounds_and_type_for_item(rbml_w, ecx, id);
@@ -816,7 +812,7 @@ fn encode_info_for_associated_const(ecx: &EncodeContext,
816812
impl_item_opt: Option<&ast::ImplItem>) {
817813
debug!("encode_info_for_associated_const({:?},{:?})",
818814
associated_const.def_id,
819-
token::get_name(associated_const.name));
815+
associated_const.name);
820816

821817
rbml_w.start_tag(tag_items_data_item);
822818

@@ -854,7 +850,7 @@ fn encode_info_for_method<'a, 'tcx>(ecx: &EncodeContext<'a, 'tcx>,
854850
impl_item_opt: Option<&ast::ImplItem>) {
855851

856852
debug!("encode_info_for_method: {:?} {:?}", m.def_id,
857-
token::get_name(m.name));
853+
m.name);
858854
rbml_w.start_tag(tag_items_data_item);
859855

860856
encode_method_ty_fields(ecx, rbml_w, m);
@@ -899,7 +895,7 @@ fn encode_info_for_associated_type<'a, 'tcx>(ecx: &EncodeContext<'a, 'tcx>,
899895
impl_item_opt: Option<&ast::ImplItem>) {
900896
debug!("encode_info_for_associated_type({:?},{:?})",
901897
associated_type.def_id,
902-
token::get_name(associated_type.name));
898+
associated_type.name);
903899

904900
rbml_w.start_tag(tag_items_data_item);
905901

@@ -937,7 +933,7 @@ fn encode_method_argument_names(rbml_w: &mut Encoder,
937933
for arg in &decl.inputs {
938934
let tag = tag_method_argument_name;
939935
if let ast::PatIdent(_, ref path1, _) = arg.pat.node {
940-
let name = token::get_name(path1.node.name);
936+
let name = path1.node.name.as_str();
941937
rbml_w.wr_tagged_bytes(tag, name.as_bytes());
942938
} else {
943939
rbml_w.wr_tagged_bytes(tag, &[]);
@@ -1562,7 +1558,7 @@ fn my_visit_foreign_item(ni: &ast::ForeignItem,
15621558
index: &mut Vec<entry<i64>>) {
15631559
debug!("writing foreign item {}::{}",
15641560
ecx.tcx.map.path_to_string(ni.id),
1565-
token::get_ident(ni.ident));
1561+
ni.ident);
15661562

15671563
let abi = ecx.tcx.map.get_foreign_abi(ni.id);
15681564
ecx.tcx.map.with_path(ni.id, |path| {
@@ -1748,7 +1744,7 @@ fn encode_defaulted(rbml_w: &mut Encoder, is_defaulted: bool) {
17481744
fn encode_associated_type_names(rbml_w: &mut Encoder, names: &[ast::Name]) {
17491745
rbml_w.start_tag(tag_associated_type_names);
17501746
for &name in names {
1751-
rbml_w.wr_tagged_str(tag_associated_type_name, &token::get_name(name));
1747+
rbml_w.wr_tagged_str(tag_associated_type_name, &name.as_str());
17521748
}
17531749
rbml_w.end_tag();
17541750
}

branches/stable/src/librustc/metadata/macro_import.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,7 @@ impl<'a> MacroLoader<'a> {
149149
let mut seen = HashSet::new();
150150

151151
for mut def in macros {
152-
let name = token::get_ident(def.ident);
153-
seen.insert(name.clone());
152+
let name = def.ident.name.as_str();
154153

155154
def.use_locally = match import.as_ref() {
156155
None => true,
@@ -161,18 +160,19 @@ impl<'a> MacroLoader<'a> {
161160
"allow_internal_unstable");
162161
debug!("load_macros: loaded: {:?}", def);
163162
self.macros.push(def);
163+
seen.insert(name);
164164
}
165165

166166
if let Some(sel) = import.as_ref() {
167167
for (name, span) in sel {
168-
if !seen.contains(name) {
168+
if !seen.contains(&name) {
169169
self.sess.span_err(*span, "imported macro not found");
170170
}
171171
}
172172
}
173173

174174
for (name, span) in &reexport {
175-
if !seen.contains(name) {
175+
if !seen.contains(&name) {
176176
self.sess.span_err(*span, "reexported macro not found");
177177
}
178178
}

0 commit comments

Comments
 (0)