Skip to content

Commit b9cf27e

Browse files
committed
---
yaml --- r: 276563 b: refs/heads/try c: 6ce63fb h: refs/heads/master i: 276561: 3b7f877 276559: 177681e
1 parent e7460fd commit b9cf27e

File tree

152 files changed

+1202
-2815
lines changed

Some content is hidden

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

152 files changed

+1202
-2815
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 6dbb0e86aec11050480beb76eade6fb805010ba7
33
refs/heads/snap-stage3: 235d77457d80b549dad3ac36d94f235208a1eafb
4-
refs/heads/try: dcfcbaa009799e6c74dbbe0f116105ea71cf22d5
4+
refs/heads/try: 6ce63fb3f1bf37004868f79beacb180283c0750e
55
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
66
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
77
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try/configure

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -969,11 +969,11 @@ then
969969
LLVM_VERSION=$($LLVM_CONFIG --version)
970970

971971
case $LLVM_VERSION in
972-
(3.[6-8]*)
972+
(3.[5-8]*)
973973
msg "found ok version of LLVM: $LLVM_VERSION"
974974
;;
975975
(*)
976-
err "bad LLVM version: $LLVM_VERSION, need >=3.6"
976+
err "bad LLVM version: $LLVM_VERSION, need >=3.5"
977977
;;
978978
esac
979979
fi

branches/try/mk/tests.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ $(3)/stage$(1)/test/$(4)test-$(2)$$(X_$(2)): \
383383
@$$(call E, rustc: $$@)
384384
$(Q)CFG_LLVM_LINKAGE_FILE=$$(LLVM_LINKAGE_PATH_$(2)) \
385385
$$(subst @,,$$(STAGE$(1)_T_$(2)_H_$(3))) -o $$@ $$< --test \
386-
-Cmetadata="test-crate" -L "$$(RT_OUTPUT_DIR_$(2))" \
386+
-L "$$(RT_OUTPUT_DIR_$(2))" \
387387
$$(LLVM_LIBDIR_RUSTFLAGS_$(2)) \
388388
$$(RUSTFLAGS_$(4))
389389

branches/try/src/compiletest/common.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,10 @@ impl fmt::Display for Mode {
6969
#[derive(Clone)]
7070
pub struct Config {
7171
// The library paths required for running the compiler
72-
pub compile_lib_path: PathBuf,
72+
pub compile_lib_path: String,
7373

7474
// The library paths required for running compiled programs
75-
pub run_lib_path: PathBuf,
75+
pub run_lib_path: String,
7676

7777
// The rustc executable
7878
pub rustc_path: PathBuf,

branches/try/src/compiletest/compiletest.rs

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -118,17 +118,9 @@ pub fn parse_config(args: Vec<String> ) -> Config {
118118
}
119119
}
120120

121-
fn make_absolute(path: PathBuf) -> PathBuf {
122-
if path.is_relative() {
123-
env::current_dir().unwrap().join(path)
124-
} else {
125-
path
126-
}
127-
}
128-
129121
Config {
130-
compile_lib_path: make_absolute(opt_path(matches, "compile-lib-path")),
131-
run_lib_path: make_absolute(opt_path(matches, "run-lib-path")),
122+
compile_lib_path: matches.opt_str("compile-lib-path").unwrap(),
123+
run_lib_path: matches.opt_str("run-lib-path").unwrap(),
132124
rustc_path: opt_path(matches, "rustc-path"),
133125
rustdoc_path: opt_path(matches, "rustdoc-path"),
134126
python: matches.opt_str("python").unwrap(),

branches/try/src/compiletest/runtest.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ fn run_pretty_test_revision(config: &Config,
316316
testpaths,
317317
pretty_type.to_owned()),
318318
props.exec_env.clone(),
319-
config.compile_lib_path.to_str().unwrap(),
319+
&config.compile_lib_path,
320320
Some(aux_dir.to_str().unwrap()),
321321
Some(src))
322322
}
@@ -635,7 +635,7 @@ fn run_debuginfo_gdb_test(config: &Config, props: &TestProps, testpaths: &TestPa
635635
testpaths,
636636
proc_args,
637637
environment,
638-
config.run_lib_path.to_str().unwrap(),
638+
&config.run_lib_path,
639639
None,
640640
None);
641641
}
@@ -1315,7 +1315,7 @@ fn exec_compiled_test(config: &Config, props: &TestProps,
13151315
testpaths,
13161316
make_run_args(config, props, testpaths),
13171317
env,
1318-
config.run_lib_path.to_str().unwrap(),
1318+
&config.run_lib_path,
13191319
Some(aux_dir.to_str().unwrap()),
13201320
None)
13211321
}
@@ -1387,7 +1387,7 @@ fn compose_and_run_compiler(config: &Config, props: &TestProps,
13871387
&aux_testpaths,
13881388
aux_args,
13891389
Vec::new(),
1390-
config.compile_lib_path.to_str().unwrap(),
1390+
&config.compile_lib_path,
13911391
Some(aux_dir.to_str().unwrap()),
13921392
None);
13931393
if !auxres.status.success() {
@@ -1410,7 +1410,7 @@ fn compose_and_run_compiler(config: &Config, props: &TestProps,
14101410
testpaths,
14111411
args,
14121412
props.rustc_env.clone(),
1413-
config.compile_lib_path.to_str().unwrap(),
1413+
&config.compile_lib_path,
14141414
Some(aux_dir.to_str().unwrap()),
14151415
input)
14161416
}

branches/try/src/doc/book/strings.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ let s = "foo\
4444
assert_eq!("foobar", s);
4545
```
4646

47+
Note that you normally cannot access a `str` directly, but only through a `&str`
48+
reference. This is because `str` is an unsized type which requires additional
49+
runtime information to be usable. For more information see the chapter on
50+
[unsized types][ut].
51+
4752
Rust has more than only `&str`s though. A `String` is a heap-allocated string.
4853
This string is growable, and is also guaranteed to be UTF-8. `String`s are
4954
commonly created by converting from a string slice using the `to_string`
@@ -185,5 +190,6 @@ let hello_world = hello + &world;
185190
This is because `&String` can automatically coerce to a `&str`. This is a
186191
feature called ‘[`Deref` coercions][dc]’.
187192

193+
[ut]: unsized-types.html
188194
[dc]: deref-coercions.html
189195
[connect]: ../std/net/struct.TcpStream.html#method.connect

branches/try/src/doc/reference.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3911,9 +3911,6 @@ The _heap_ is a general term that describes boxes. The lifetime of an
39113911
allocation in the heap depends on the lifetime of the box values pointing to
39123912
it. Since box values may themselves be passed in and out of frames, or stored
39133913
in the heap, heap allocations may outlive the frame they are allocated within.
3914-
An allocation in the heap is guaranteed to reside at a single location in the
3915-
heap for the whole lifetime of the allocation - it will never be relocated as
3916-
a result of moving a box value.
39173914

39183915
### Memory ownership
39193916

branches/try/src/etc/CONFIGS.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,7 @@ These are some links to repos with configs which ease the use of rust.
1010
* [kate-config](https://github.com/rust-lang/kate-config)
1111
* [nano-config](https://github.com/rust-lang/nano-config)
1212
* [zsh-config](https://github.com/rust-lang/zsh-config)
13+
14+
## Community-maintained Configs
15+
16+
* [.editorconfig](https://gist.github.com/derhuerst/c9d1b9309e308d9851fa) ([what is this?](http://editorconfig.org/))

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1953,10 +1953,7 @@ impl StrExt for str {
19531953

19541954
#[inline]
19551955
fn is_char_boundary(&self, index: usize) -> bool {
1956-
// 0 and len are always ok.
1957-
// Test for 0 explicitly so that it can optimize out the check
1958-
// easily and skip reading string data for that case.
1959-
if index == 0 || index == self.len() { return true; }
1956+
if index == self.len() { return true; }
19601957
match self.as_bytes().get(index) {
19611958
None => false,
19621959
Some(&b) => b < 128 || b >= 192,
@@ -2029,7 +2026,6 @@ impl StrExt for str {
20292026
self.find(pat)
20302027
}
20312028

2032-
#[inline]
20332029
fn split_at(&self, mid: usize) -> (&str, &str) {
20342030
// is_char_boundary checks that the index is in [0, .len()]
20352031
if self.is_char_boundary(mid) {

branches/try/src/librbml/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,15 +166,15 @@ impl<'doc> Doc<'doc> {
166166
}
167167
}
168168

169-
pub fn get(&self, tag: usize) -> Doc<'doc> {
169+
pub fn get<'a>(&'a self, tag: usize) -> Doc<'a> {
170170
reader::get_doc(*self, tag)
171171
}
172172

173173
pub fn is_empty(&self) -> bool {
174174
self.start == self.end
175175
}
176176

177-
pub fn as_str_slice(&self) -> &'doc str {
177+
pub fn as_str_slice<'a>(&'a self) -> &'a str {
178178
str::from_utf8(&self.data[self.start..self.end]).unwrap()
179179
}
180180

branches/try/src/librustc/diagnostics.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1261,7 +1261,7 @@ compiled:
12611261
fn foo<T: Index<u8>>(x: T){}
12621262
12631263
#[rustc_on_unimplemented = "the type `{Self}` cannot be indexed by `{Idx}`"]
1264-
trait Index<Idx> { /* ... */ }
1264+
trait Index<Idx> { ... }
12651265
12661266
foo(true); // `bool` does not implement `Index<u8>`
12671267
```
@@ -1291,7 +1291,7 @@ compiled:
12911291
fn foo<T: Index<u8>>(x: T){}
12921292
12931293
#[rustc_on_unimplemented = "the type `{Self}` cannot be indexed by `{Idx}`"]
1294-
trait Index<Idx> { /* ... */ }
1294+
trait Index<Idx> { ... }
12951295
12961296
foo(true); // `bool` does not implement `Index<u8>`
12971297
```
@@ -1319,7 +1319,7 @@ compiled:
13191319
fn foo<T: Index<u8>>(x: T){}
13201320
13211321
#[rustc_on_unimplemented = "the type `{Self}` cannot be indexed by `{Idx}`"]
1322-
trait Index<Idx> { /* ... */ }
1322+
trait Index<Idx> { ... }
13231323
13241324
foo(true); // `bool` does not implement `Index<u8>`
13251325
```

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

Lines changed: 12 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use super::MapEntry::*;
1414
use rustc_front::hir::*;
1515
use rustc_front::util;
1616
use rustc_front::intravisit::{self, Visitor};
17-
use middle::def_id::{CRATE_DEF_INDEX, DefId, DefIndex};
17+
use middle::def_id::{CRATE_DEF_INDEX, DefIndex};
1818
use std::iter::repeat;
1919
use syntax::ast::{NodeId, CRATE_NODE_ID, DUMMY_NODE_ID};
2020
use syntax::codemap::Span;
@@ -50,7 +50,6 @@ impl<'ast> NodeCollector<'ast> {
5050
parent: &'ast InlinedParent,
5151
parent_node: NodeId,
5252
parent_def_path: DefPath,
53-
parent_def_id: DefId,
5453
map: Vec<MapEntry<'ast>>,
5554
definitions: Definitions)
5655
-> NodeCollector<'ast> {
@@ -61,14 +60,8 @@ impl<'ast> NodeCollector<'ast> {
6160
definitions: definitions,
6261
};
6362

64-
assert_eq!(parent_def_path.krate, parent_def_id.krate);
65-
let root_path = Box::new(InlinedRootPath {
66-
data: parent_def_path.data,
67-
def_id: parent_def_id,
68-
});
69-
7063
collector.insert_entry(parent_node, RootInlinedParent(parent));
71-
collector.create_def(parent_node, DefPathData::InlinedRoot(root_path));
64+
collector.create_def(parent_node, DefPathData::InlinedRoot(parent_def_path));
7265

7366
collector
7467
}
@@ -133,16 +126,11 @@ impl<'ast> Visitor<'ast> for NodeCollector<'ast> {
133126
// Pick the def data. This need not be unique, but the more
134127
// information we encapsulate into
135128
let def_data = match i.node {
136-
ItemDefaultImpl(..) | ItemImpl(..) =>
137-
DefPathData::Impl,
138-
ItemEnum(..) | ItemStruct(..) | ItemTrait(..) |
139-
ItemExternCrate(..) | ItemMod(..) | ItemForeignMod(..) |
140-
ItemTy(..) =>
141-
DefPathData::TypeNs(i.name),
142-
ItemStatic(..) | ItemConst(..) | ItemFn(..) =>
143-
DefPathData::ValueNs(i.name),
144-
ItemUse(..) =>
145-
DefPathData::Misc,
129+
ItemDefaultImpl(..) | ItemImpl(..) => DefPathData::Impl(i.name),
130+
ItemEnum(..) | ItemStruct(..) | ItemTrait(..) => DefPathData::Type(i.name),
131+
ItemExternCrate(..) | ItemMod(..) => DefPathData::Mod(i.name),
132+
ItemStatic(..) | ItemConst(..) | ItemFn(..) => DefPathData::Value(i.name),
133+
_ => DefPathData::Misc,
146134
};
147135

148136
self.insert_def(i.id, NodeItem(i), def_data);
@@ -207,7 +195,7 @@ impl<'ast> Visitor<'ast> for NodeCollector<'ast> {
207195
fn visit_foreign_item(&mut self, foreign_item: &'ast ForeignItem) {
208196
self.insert_def(foreign_item.id,
209197
NodeForeignItem(foreign_item),
210-
DefPathData::ValueNs(foreign_item.name));
198+
DefPathData::Value(foreign_item.name));
211199

212200
let parent_node = self.parent_node;
213201
self.parent_node = foreign_item.id;
@@ -227,8 +215,8 @@ impl<'ast> Visitor<'ast> for NodeCollector<'ast> {
227215

228216
fn visit_trait_item(&mut self, ti: &'ast TraitItem) {
229217
let def_data = match ti.node {
230-
MethodTraitItem(..) | ConstTraitItem(..) => DefPathData::ValueNs(ti.name),
231-
TypeTraitItem(..) => DefPathData::TypeNs(ti.name),
218+
MethodTraitItem(..) | ConstTraitItem(..) => DefPathData::Value(ti.name),
219+
TypeTraitItem(..) => DefPathData::Type(ti.name),
232220
};
233221

234222
self.insert(ti.id, NodeTraitItem(ti));
@@ -251,8 +239,8 @@ impl<'ast> Visitor<'ast> for NodeCollector<'ast> {
251239

252240
fn visit_impl_item(&mut self, ii: &'ast ImplItem) {
253241
let def_data = match ii.node {
254-
ImplItemKind::Method(..) | ImplItemKind::Const(..) => DefPathData::ValueNs(ii.name),
255-
ImplItemKind::Type(..) => DefPathData::TypeNs(ii.name),
242+
ImplItemKind::Method(..) | ImplItemKind::Const(..) => DefPathData::Value(ii.name),
243+
ImplItemKind::Type(..) => DefPathData::Type(ii.name),
256244
};
257245

258246
self.insert_def(ii.id, NodeImplItem(ii), def_data);

0 commit comments

Comments
 (0)