Skip to content

Commit 1a0c54c

Browse files
committed
---
yaml --- r: 274978 b: refs/heads/stable c: 4f86b8e h: refs/heads/master
1 parent ae64f38 commit 1a0c54c

File tree

33 files changed

+281
-70
lines changed

33 files changed

+281
-70
lines changed

[refs]

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

branches/stable/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Read ["Installing Rust"] from [The Book].
1717
1. Make sure you have installed the dependencies:
1818

1919
* `g++` 4.7 or `clang++` 3.x
20-
* `python` 2.7 or later (but not 3.x)
20+
* `python` 2.7 (but not 3.x)
2121
* GNU `make` 3.81 or later
2222
* `curl`
2323
* `git`

branches/stable/configure

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -729,12 +729,12 @@ step_msg "looking for build programs"
729729

730730
probe_need CFG_CURLORWGET curl wget
731731
if [ -z "$CFG_PYTHON_PROVIDED" ]; then
732-
probe_need CFG_PYTHON python2.7 python2.6 python2 python
732+
probe_need CFG_PYTHON python2.7 python2 python
733733
fi
734734

735735
python_version=$($CFG_PYTHON -V 2>&1)
736-
if [ $(echo $python_version | grep -c '^Python 2\.[4567]') -ne 1 ]; then
737-
err "Found $python_version, but LLVM requires Python 2.4-2.7"
736+
if [ $(echo $python_version | grep -c '^Python 2\.7') -ne 1 ]; then
737+
err "Found $python_version, but Python 2.7 is required"
738738
fi
739739

740740
# If we have no git directory then we are probably a tarball distribution

branches/stable/mk/crates.mk

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ RUSTC_CRATES := rustc rustc_typeck rustc_mir rustc_borrowck rustc_resolve rustc_
5959
rustc_data_structures rustc_front rustc_platform_intrinsics \
6060
rustc_plugin rustc_metadata rustc_passes
6161
HOST_CRATES := syntax syntax_ext $(RUSTC_CRATES) rustdoc fmt_macros
62-
TOOLS := compiletest rustdoc rustc rustbook error-index-generator
62+
TOOLS := compiletest rustdoc rustc rustbook error_index_generator
6363

6464
DEPS_core :=
6565
DEPS_alloc := core libc alloc_system
@@ -120,12 +120,12 @@ TOOL_DEPS_compiletest := test getopts
120120
TOOL_DEPS_rustdoc := rustdoc
121121
TOOL_DEPS_rustc := rustc_driver
122122
TOOL_DEPS_rustbook := std rustdoc
123-
TOOL_DEPS_error-index-generator := rustdoc syntax serialize
123+
TOOL_DEPS_error_index_generator := rustdoc syntax serialize
124124
TOOL_SOURCE_compiletest := $(S)src/compiletest/compiletest.rs
125125
TOOL_SOURCE_rustdoc := $(S)src/driver/driver.rs
126126
TOOL_SOURCE_rustc := $(S)src/driver/driver.rs
127127
TOOL_SOURCE_rustbook := $(S)src/rustbook/main.rs
128-
TOOL_SOURCE_error-index-generator := $(S)src/error-index-generator/main.rs
128+
TOOL_SOURCE_error_index_generator := $(S)src/error_index_generator/main.rs
129129

130130
ONLY_RLIB_core := 1
131131
ONLY_RLIB_libc := 1

branches/stable/mk/dist.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ PKG_FILES := \
5252
doc \
5353
driver \
5454
etc \
55-
error-index-generator \
55+
error_index_generator \
5656
$(foreach crate,$(CRATES),lib$(crate)) \
5757
libcollectionstest \
5858
libcoretest \

branches/stable/mk/docs.mk

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ RUSTBOOK_EXE = $(HBIN2_H_$(CFG_BUILD))/rustbook$(X_$(CFG_BUILD))
5959
# ./configure
6060
RUSTBOOK = $(RPATH_VAR2_T_$(CFG_BUILD)_H_$(CFG_BUILD)) $(RUSTBOOK_EXE)
6161

62-
# The error-index-generator executable...
63-
ERR_IDX_GEN_EXE = $(HBIN2_H_$(CFG_BUILD))/error-index-generator$(X_$(CFG_BUILD))
62+
# The error_index_generator executable...
63+
ERR_IDX_GEN_EXE = $(HBIN2_H_$(CFG_BUILD))/error_index_generator$(X_$(CFG_BUILD))
6464
ERR_IDX_GEN = $(RPATH_VAR2_T_$(CFG_BUILD)_H_$(CFG_BUILD)) $(ERR_IDX_GEN_EXE)
6565
ERR_IDX_GEN_MD = $(RPATH_VAR2_T_$(CFG_BUILD)_H_$(CFG_BUILD)) $(ERR_IDX_GEN_EXE) markdown
6666

@@ -221,9 +221,9 @@ error-index: doc/error-index.html
221221
# Metadata used to generate the index is created as a side effect of
222222
# the build so this depends on every crate being up to date.
223223
doc/error-index.html: $(ERR_IDX_GEN_EXE) $(CSREQ$(2)_T_$(CFG_BUILD)_H_$(CFG_BUILD)) | doc/
224-
$(Q)$(call E, error-index-generator: $@)
224+
$(Q)$(call E, error_index_generator: $@)
225225
$(Q)$(ERR_IDX_GEN)
226226

227227
doc/error-index.md: $(ERR_IDX_GEN_EXE) $(CSREQ$(2)_T_$(CFG_BUILD)_H_$(CFG_BUILD)) | doc/
228-
$(Q)$(call E, error-index-generator: $@)
228+
$(Q)$(call E, error_index_generator: $@)
229229
$(Q)$(ERR_IDX_GEN_MD)

branches/stable/mk/prepare.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ define PREPARE_MAN
8282

8383
endef
8484

85-
PREPARE_TOOLS = $(filter-out compiletest rustbook error-index-generator, $(TOOLS))
85+
PREPARE_TOOLS = $(filter-out compiletest rustbook error_index_generator, $(TOOLS))
8686

8787

8888
# $(1) is tool

branches/stable/mk/tests.mk

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1072,7 +1072,8 @@ $(3)/test/run-make/%-$(1)-T-$(2)-H-$(3).ok: \
10721072
$(3) \
10731073
"$$(LLVM_LIBDIR_RUSTFLAGS_$(3))" \
10741074
"$$(LLVM_ALL_COMPONENTS_$(3))" \
1075-
"$$(LLVM_CXXFLAGS_$(3))"
1075+
"$$(LLVM_CXXFLAGS_$(3))" \
1076+
'$$(CXX_$(3))'
10761077
@touch -r $$@.start_time $$@ && rm $$@.start_time
10771078
else
10781079
# FIXME #11094 - The above rule doesn't work right for multiple targets

branches/stable/src/doc/book/vectors.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,21 @@ let v = vec![1, 2, 3, 4, 5]; // v: Vec<i32>
1111
```
1212

1313
(Notice that unlike the `println!` macro we’ve used in the past, we use square
14-
brackets `[]` with `vec!` macro. Rust allows you to use either in either situation,
15-
this is just convention.)
14+
brackets `[]` with `vec!` macro. Rust allows you to use either in either
15+
situation, this is just convention.)
1616

1717
There’s an alternate form of `vec!` for repeating an initial value:
1818

1919
```rust
2020
let v = vec![0; 10]; // ten zeroes
2121
```
2222

23+
Vectors store their contents as contiguous arrays of `T` on the heap. This means
24+
that they must be able to know the size of `T` at compile time (that is, how
25+
many bytes are needed to store a `T`?). The size of some things can't be known
26+
at compile time. For these you'll have to store a pointer to that thing:
27+
thankfully, the [`Box`][box] type works perfectly for this.
28+
2329
## Accessing elements
2430

2531
To get the value at a particular index in the vector, we use `[]`s:
@@ -113,6 +119,7 @@ Vectors have many more useful methods, which you can read about in [their
113119
API documentation][vec].
114120

115121
[vec]: ../std/vec/index.html
122+
[box]: ../std/boxed/index.html
116123
[generic]: generics.html
117124
[panic]: concurrency.html#panics
118125
[get]: http://doc.rust-lang.org/std/vec/struct.Vec.html#method.get

branches/stable/src/etc/maketest.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ def convert_path_spec(name, value):
5757
putenv('RUSTFLAGS', sys.argv[15])
5858
putenv('LLVM_COMPONENTS', sys.argv[16])
5959
putenv('LLVM_CXXFLAGS', sys.argv[17])
60+
putenv('CXX', sys.argv[18])
6061
putenv('PYTHON', sys.executable)
6162
os.putenv('TARGET', target_triple)
6263

branches/stable/src/etc/tidy.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,15 @@
2424

2525
interesting_files = ['.rs', '.py', '.js', '.sh', '.c', '.h']
2626
uninteresting_files = ['miniz.c', 'jquery', 'rust_android_dummy']
27+
stable_whitelist = {
28+
'src/bootstrap',
29+
'src/build_helper',
30+
'src/libcollectionstest',
31+
'src/libcore',
32+
'src/libstd',
33+
'src/rustc/std_shim',
34+
'src/test'
35+
}
2736

2837

2938
def report_error_name_no(name, no, s):
@@ -93,6 +102,7 @@ def interesting_file(f):
93102
file_counts = {ext: 0 for ext in interesting_files}
94103

95104
all_paths = set()
105+
needs_unstable_attr = set()
96106

97107
try:
98108
for (dirpath, dirnames, filenames) in os.walk(src_dir):
@@ -149,6 +159,9 @@ def interesting_file(f):
149159
else:
150160
if "SNAP " in line:
151161
report_warn("unmatched SNAP line: " + line)
162+
search = re.search(r'^#!\[unstable', line)
163+
if search:
164+
needs_unstable_attr.discard(filename)
152165

153166
if cr_flag in line:
154167
check_cr = False
@@ -181,6 +194,9 @@ def interesting_file(f):
181194
check_cr = True
182195
check_tab = True
183196
check_linelength = True
197+
if all(f not in filename for f in stable_whitelist) and \
198+
re.search(r'src/.*/lib\.rs', filename):
199+
needs_unstable_attr.add(filename)
184200

185201
# Put a reasonable limit on the amount of header data we use for
186202
# the licenseck
@@ -195,6 +211,8 @@ def interesting_file(f):
195211
update_counts(current_name)
196212
assert len(current_contents) > 0
197213
do_license_check(current_name, current_contents)
214+
for f in needs_unstable_attr:
215+
report_error_name_no(f, 1, "requires unstable attribute")
198216

199217
except UnicodeDecodeError as e:
200218
report_err("UTF-8 decoding error " + str(e))

branches/stable/src/libcollections/vec.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
//! A growable list type with heap-allocated contents, written `Vec<T>` but
12-
//! pronounced 'vector.'
11+
//! A contiguous growable array type with heap-allocated contents, written
12+
//! `Vec<T>` but pronounced 'vector.'
1313
//!
1414
//! Vectors have `O(1)` indexing, amortized `O(1)` push (to the end) and
1515
//! `O(1)` pop (from the end).
@@ -78,7 +78,7 @@ use borrow::{Cow, IntoCow};
7878

7979
use super::range::RangeArgument;
8080

81-
/// A growable list type, written `Vec<T>` but pronounced 'vector.'
81+
/// A contiguous growable array type, written `Vec<T>` but pronounced 'vector.'
8282
///
8383
/// # Examples
8484
///

branches/stable/src/libcore/num/u16.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@
1414
1515
#![stable(feature = "rust1", since = "1.0.0")]
1616

17-
uint_module! { u16, i16, 16 }
17+
uint_module! { u16, 16 }

branches/stable/src/libcore/num/u32.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@
1414
1515
#![stable(feature = "rust1", since = "1.0.0")]
1616

17-
uint_module! { u32, i32, 32 }
17+
uint_module! { u32, 32 }

branches/stable/src/libcore/num/u64.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@
1414
1515
#![stable(feature = "rust1", since = "1.0.0")]
1616

17-
uint_module! { u64, i64, 64 }
17+
uint_module! { u64, 64 }

branches/stable/src/libcore/num/u8.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@
1414
1515
#![stable(feature = "rust1", since = "1.0.0")]
1616

17-
uint_module! { u8, i8, 8 }
17+
uint_module! { u8, 8 }

branches/stable/src/libcore/num/uint_macros.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
#![doc(hidden)]
1212

13-
macro_rules! uint_module { ($T:ty, $T_SIGNED:ty, $bits:expr) => (
13+
macro_rules! uint_module { ($T:ty, $bits:expr) => (
1414

1515
#[unstable(feature = "num_bits_bytes",
1616
reason = "may want to be an associated function",

branches/stable/src/libcore/num/usize.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@
1515
#![stable(feature = "rust1", since = "1.0.0")]
1616

1717
#[cfg(target_pointer_width = "32")]
18-
uint_module! { usize, isize, 32 }
18+
uint_module! { usize, 32 }
1919
#[cfg(target_pointer_width = "64")]
20-
uint_module! { usize, isize, 64 }
20+
uint_module! { usize, 64 }

branches/stable/src/librustc/session/config.rs

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ use syntax::attr;
2828
use syntax::attr::AttrMetaMethods;
2929
use syntax::errors::{ColorConfig, Handler};
3030
use syntax::parse;
31+
use syntax::parse::lexer::Reader;
3132
use syntax::parse::token::InternedString;
3233
use syntax::feature_gate::UnstableFeatures;
3334

@@ -509,7 +510,7 @@ options! {CodegenOptions, CodegenSetter, basic_codegen_options,
509510
link_args: Option<Vec<String>> = (None, parse_opt_list,
510511
"extra arguments to pass to the linker (space separated)"),
511512
link_dead_code: bool = (false, parse_bool,
512-
"let the linker strip dead coded (turning it on can be used for code coverage)"),
513+
"don't let linker strip dead code (turning it on can be used for code coverage)"),
513514
lto: bool = (false, parse_bool,
514515
"perform LLVM link-time optimizations"),
515516
target_cpu: Option<String> = (None, parse_opt_string,
@@ -906,10 +907,19 @@ pub fn rustc_optgroups() -> Vec<RustcOptGroup> {
906907
// Convert strings provided as --cfg [cfgspec] into a crate_cfg
907908
pub fn parse_cfgspecs(cfgspecs: Vec<String> ) -> ast::CrateConfig {
908909
cfgspecs.into_iter().map(|s| {
909-
parse::parse_meta_from_source_str("cfgspec".to_string(),
910-
s.to_string(),
911-
Vec::new(),
912-
&parse::ParseSess::new())
910+
let sess = parse::ParseSess::new();
911+
let mut parser = parse::new_parser_from_source_str(&sess,
912+
Vec::new(),
913+
"cfgspec".to_string(),
914+
s.to_string());
915+
let meta_item = panictry!(parser.parse_meta_item());
916+
917+
if !parser.reader.is_eof() {
918+
early_error(ErrorOutputType::default(), &format!("invalid --cfg argument: {}",
919+
s))
920+
}
921+
922+
meta_item
913923
}).collect::<ast::CrateConfig>()
914924
}
915925

0 commit comments

Comments
 (0)