Skip to content

Rolling up PRs in the queue #17399

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 39 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
0147243
Improve the zsh completions.
scialex Sep 16, 2014
17674e0
Fix warning and make code follow the text better
pablobm Sep 17, 2014
9ce2c51
Document that CStrings live in the libc heap
Sep 17, 2014
ed476b0
support LTO against libraries built with codegen-units > 1
spernsteiner Sep 17, 2014
6a37692
Document that CStrings live in the libc heap
gamazeps Sep 18, 2014
07f4fda
syntax: use an index in CodeMap instead of Gc for ExpnInfo.
eddyb Sep 17, 2014
e35e47f
rustc: fix fallout from removing the use of Gc for ExpnInfo.
eddyb Sep 16, 2014
f1a8f53
Fix fallout in tests from removing the use of Gc in ExpnInfo.
eddyb Sep 18, 2014
1813b8c
rustc: remove DefArg and DefBinding in favor of DefLocal.
eddyb Sep 17, 2014
6543c5b
rustc: remove BindingMode from DefLocal.
eddyb Sep 17, 2014
6536a0c
rustc: add a closure depth to DefUpvar.
eddyb Sep 14, 2014
5c192ae
rustc: move type definitions from middle::freevars to middle::ty.
eddyb Sep 14, 2014
7c5df40
rustc: move freevar finding to resolve.
eddyb Sep 18, 2014
74b8868
rustc: remove Gc<Def> and depth from DefUpvar.
eddyb Sep 14, 2014
50d179d
Doc says to avoid mixing allocator instead of forbiding it
gamazeps Sep 18, 2014
0d70d57
std::rt::backtrace: Fix backtrace on Win64
klutzy Sep 18, 2014
360a29d
stop disabling ASLR in normal Windows builds
thestinger Sep 18, 2014
31a7e38
Implement slicing syntax.
nrc Sep 15, 2014
5aa264a
libsyntax: Disallow keywords followed by `::`.
pcwalton Sep 18, 2014
7c00d77
librustc: Implement the syntax in the RFC for unboxed closure sugar.
pcwalton Sep 6, 2014
cf9c586
reviewer changes
nrc Sep 17, 2014
ce0907e
Add enum variants to the type namespace
nrc Sep 11, 2014
0f6cbca
Move uses of enum to bitflags!.
ahmedcharles Sep 12, 2014
89b0944
Allow syntax extensions to return multiple items, closes #16723.
fhahn Sep 13, 2014
63cee1a
rollup merge of #17041 : pcwalton/right-unboxed-closure-sugar
alexcrichton Sep 19, 2014
1686353
rollup merge of #17236 : fhahn/issue-16723-multiple-items
alexcrichton Sep 19, 2014
0e5cb75
rollup merge of #17250 : ahmedcharles/bitflags
alexcrichton Sep 19, 2014
64b27e9
rollup merge of #17259 : eddyb/def-no-gc
alexcrichton Sep 19, 2014
129aff7
rollup merge of #17306 : scialex/fix-zsh
alexcrichton Sep 19, 2014
b94075c
rollup merge of #17314 : eddyb/span-no-gc
alexcrichton Sep 19, 2014
81ee358
rollup merge of #17318 : nick29581/slice
alexcrichton Sep 19, 2014
04f5fe5
rollup merge of #17338 : nick29581/variants-namespace
alexcrichton Sep 19, 2014
dbaa930
rollup merge of #17350 : pablobm/doc-fix
alexcrichton Sep 19, 2014
a116c72
rollup merge of #17355 : gamazeps/issue17210
alexcrichton Sep 19, 2014
6fe4467
rollup merge of #17358 : epdtry/pcg-lto
alexcrichton Sep 19, 2014
859407e
rollup merge of #17363 : thestinger/aslr
alexcrichton Sep 19, 2014
0e18c06
rollup merge of #17370 : klutzy/win64-backtrace
alexcrichton Sep 19, 2014
ebe9ec8
rollup merge of #17379 : pcwalton/keywords-followed-by-double-colon
alexcrichton Sep 19, 2014
f082416
Test fixes from the rollup
alexcrichton Sep 19, 2014
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/doc/guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -1575,8 +1575,6 @@ we haven't seen before. Here's a simple program that reads some input,
and then prints it back out:

```{rust,ignore}
use std::io;

fn main() {
println!("Type something!");

Expand Down
199 changes: 131 additions & 68 deletions src/etc/zsh/_rust
Original file line number Diff line number Diff line change
Expand Up @@ -4,109 +4,166 @@ local -a _rustc_opts_switches _rustc_opts_lint _rustc_opts_debug

typeset -A opt_args

_rustc_debuginfo_levels=(
"0[no debug info]"
"1[line-tables only (for stacktraces and breakpoints)]"
"2[full debug info with variable and type information (same as -g)]"
)

_rustc_crate_types=(
'bin'
'lib'
'rlib'
'dylib'
'staticlib'
)

_rustc_emit_types=(
'asm'
'bc'
'ir'
'obj'
'link'
)
_rustc_pretty_types=(
'normal[un-annotated source]'
'expanded[crates expanded]'
'typed[crates expanded, with type annotations]'
'identified[fully parenthesized, AST nodes and blocks with IDs]'
'flowgraph=[graphviz formatted flowgraph for node]:NODEID:'
)
_rustc_color_types=(
'auto[colorize, if output goes to a tty (default)]'
'always[always colorize output]'
'never[never colorize output]'
)

_rustc_opts_vals=(
--crate-name='[Specify the name of the crate being built]'
--crate-type='[Comma separated list of types of crates for the compiler to emit]:TYPES:_values -s "," "Crate types" "$_rustc_crate_types[@]"'
--emit='[Comma separated list of types of output for the compiler to emit]:TYPES:_values -s "," "Emit Targets" "$_rustc_emit_types[@]"'
--debuginfo='[Emit DWARF debug info to the objects created]:LEVEL:_values "Debug Levels" "$_rustc_debuginfo_levels[@]"'
--dep-info='[Output dependency info to <filename> after compiling]::FILE:_files -/'
--sysroot='[Override the system root]:PATH:_files -/'
--cfg='[Configure the compilation environment]:SPEC:'
--out-dir='[Write output to compiler-chosen filename in <dir>. Ignored if -o is specified. (default the current directory)]:DIR:_files -/'
-o'[Write output to <filename>. Ignored if more than one --emit is specified.]:FILENAME:_files'
--opt-level='[Optimize with possible levels 0-3]:LEVEL:(0 1 2 3)'
--pretty='[Pretty-print the input instead of compiling]::TYPE:_values "TYPES" "$_rustc_pretty_types[@]"'
-L'[Add a directory to the library search path]:DIR:_files -/'
--target='[Target triple cpu-manufacturer-kernel\[-os\] to compile]:TRIPLE:'
--color='[Configure coloring of output]:CONF:_values "COLORS" "$_rustc_color_types[@]"'
{-v,--version}'[Print version info and exit]::VERBOSE:(verbose)'
--explain='[Provide a detailed explanation of an error message]:OPT:'
--extern'[Specify where an external rust library is located]:ARG:'
)

_rustc_opts_switches=(
--ar'[Program to use for managing archives instead of the default.]'
-c'[Compile and assemble, but do not link]'
--cfg'[Configure the compilation environment]'
--crate-id'[Output the crate id and exit]'
--crate-file-name'[deprecated in favor of --print-file-name]'
--crate-name'[Specify the name of the crate being built]'
--crate-type'[Specify the type of crate to crate]'
--debuginfo'[Emit DWARF debug info to the objects created: 0 = no debug info, 1 = line-tables only (for stacktraces and breakpoints), 2 = full debug info with variable and type information (same as -g)]'
--dep-info'[Output dependency info to <filename> after compiling]'
-g'[Equivalent to --debuginfo=2]'
{-h,--help}'[Display this message]'
-L'[Add a directory to the library search path]'
--linker'[Program to use for linking instead of the default.]'
--link-args'[FLAGS is a space-separated list of flags passed to the linker]'
--llvm-args'[A list of arguments to pass to llvm, comma separated]'
--ls'[List the symbols defined by a library crate]'
--no-analysis'[Parse and expand the output, but run no analysis or produce output]'
--no-rpath'[Disables setting the rpath in libs/exes]'
--no-trans'[Run all passes except translation; no output]'
-O'[Equivalent to --opt-level=2]'
-o'[Write output to <filename>]'
--opt-level'[Optimize with possible levels 0-3]'
--out-dir'[Write output to compiler-chosen filename in <dir>]'
--parse-only'[Parse only; do not compile, assemble, or link]'
--passes'[Comma or space separated list of pass names to use]'
--pretty'[Pretty-print the input instead of compiling]'
--print-crate-name'[Output the crate name and exit]'
--print-file-name'[Output the file(s) that would be written if compilation continued and exit]'
--save-temps'[Write intermediate files (.bc, .opt.bc, .o) in addition to normal output]'
--sysroot'[Override the system root]'
--test'[Build a test harness]'
--target'[Target triple cpu-manufacturer-kernel\[-os\] to compile]'
--target-cpu'[Select target processor (llc -mcpu=help for details)]'
--target-feature'[Target specific attributes (llc -mattr=help for details)]'
--relocation-model'[Relocation model (llc --help for details)]'
{-v,--version}'[Print version info and exit]'
)
_rustc_opts_codegen=(
'ar=[Path to the archive utility to use when assembling archives.]:BIN:_path_files'
'linker=[Path to the linker utility to use when linking libraries, executables, and objects.]:BIN:_path_files'
'link-args=[A space-separated list of extra arguments to pass to the linker when the linker is invoked.]:ARGS:'
'target-cpu=[Selects a target processor. If the value is "help", then a list of available CPUs is printed.]:CPU:'
'target-feature=[A space-separated list of features to enable or disable for the target. A preceding "+" enables a feature while a preceding "-" disables it. Available features can be discovered through target-cpu=help.]:FEATURE:'
'passes=[A space-separated list of extra LLVM passes to run. A value of "list" will cause rustc to print all known passes and exit. The passes specified are appended at the end of the normal pass manager.]:LIST:'
'llvm-args=[A space-separated list of arguments to pass through to LLVM.]:ARGS:'
'save-temps[If specified, the compiler will save more files (.bc, .o, .no-opt.bc) generated throughout compilation in the output directory.]'
'rpath[If specified, then the rpath value for dynamic libraries will be set in either dynamic library or executable outputs.]'
'no-prepopulate-passes[Suppresses pre-population of the LLVM pass manager that is run over the module.]'
'no-vectorize-loops[Suppresses running the loop vectorization LLVM pass, regardless of optimization level.]'
'no-vectorize-slp[Suppresses running the LLVM SLP vectorization pass, regardless of optimization level.]'
'soft-float[Generates software floating point library calls instead of hardware instructions.]'
'prefer-dynamic[Prefers dynamic linking to static linking.]'
"no-integrated-as[Force usage of an external assembler rather than LLVM's integrated one.]"
'no-redzone[disable the use of the redzone]'
'relocation-model=[The relocation model to use. (default: pic)]:MODEL:(pic static dynamic-no-pic)'
'code-model=[choose the code model to use (llc -code-model for details)]:MODEL:'
'metadata=[metadata to mangle symbol names with]:VAL:'
'extra-filenames=[extra data to put in each output filename]:VAL:'
'codegen-units=[divide crate into N units to optimize in parallel]:N:'
'help[Show all codegen options]'
)

_rustc_opts_lint=(
'attribute-usage[detects bad use of attributes]'
'ctypes[proper use of libc types in foreign modules]'
'dead-assignment[detect assignments that will never be read]'
'dead-code[detect piece of code that will never be used]'
'default-type-param-usage[prevents explicitly setting a type parameter with a default]'
'deprecated[detects use of #\[deprecated\] items]'
'help[Show a list of all lints]'
'experimental[detects use of #\[experimental\] items]'
'heap-memory[use of any (~ type or @ type) heap memory]'
'heap-memory[use of any (Box type or @ type) heap memory]'
'managed-heap-memory[use of managed (@ type) heap memory]'
'missing-doc[detects missing documentation for public members]'
'non-camel-case-types[types, variants and traits should have camel case names]'
'non-uppercase-pattern-statics[static constants in match patterns should be all caps]'
'non-uppercase-statics[static constants should have uppercase identifiers]'
'owned-heap-memory[use of owned (~ type) heap memory]'
'unnecessary-qualification[detects unnecessarily qualified names]'
'unsafe-block[usage of an `unsafe` block]'
'unstable[detects use of #\[unstable\] items (incl. items with no stability attribute)]'
'unused-result[unused result of an expression in a statement]'
'variant-size-difference[detects enums with widely varying variant sizes]'
'ctypes[proper use of libc types in foreign modules]'
'dead-assignment[detect assignments that will never be read]'
'dead-code[detect piece of code that will never be used]'
'deprecated[detects use of #\[deprecated\] items]'
'non-camel-case-types[types, variants and traits should have camel case names]'
'non-snake-case[methods, functions, lifetime parameters and modules should have snake case names]'
'path-statement[path statements with no effect]'
'raw-pointer-deriving[uses of #\[deriving\] with raw pointers are rarely correct]'
'type-limits[comparisons made useless by limits of the types involved]'
'type-overflow[literal out of range for its type]'
'unknown-crate-type[unknown crate type found in #\[crate_type\] directive]'
'unknown-features[unknown features found in crate-level #\[feature\] directives]'
'unnecessary-allocation[detects unnecessary allocations that can be eliminated]'
'unnecessary-parens[`if`, `match`, `while` and `return` do not need parentheses]'
'unnecessary-qualification[detects unnecessarily qualified names]'
'unnecessary-typecast[detects unnecessary type casts, that can be removed]'
'unreachable-code[detects unreachable code]'
'unrecognized-lint[unrecognized lint attribute]'
'unsafe-block[usage of an `unsafe` block]'
'unstable[detects use of #\[unstable\] items (incl. items with no stability attribute)]'
'unsigned-negate[using an unary minus operator on unsigned type]'
'unused-attribute[detects attributes that were not used by the compiler]'
'unused-imports[imports that are never used]'
'unused-must-use[unused result of a type flagged as #\[must_use\]]'
"unused-mut[detect mut variables which don't need to be mutable]"
'unused-result[unused result of an expression in a statement]'
'unused-unsafe[unnecessary use of an `unsafe` block]'
'unused-variable[detect variables which are not used in any way]'
'visible-private-types[detect use of private types in exported type signatures]'
'warnings[mass-change the level for lints which produce warnings]'
'while-true[suggest using `loop { }` instead of `while true { }`]'
'unknown-crate-type[unknown crate type found in #\[crate_type\] directive]'
'unknown-features[unknown features found in crate-level #\[feature\] directives]'
'bad-style[group of non_camel_case_types, non_snake_case, non_uppercase_statics]'
'unused[group of unused_imports, unused_variable, dead_assignment, dead_code, unused_mut, unreachable_code]'
)

_rustc_opts_debug=(
'verbose[in general, enable more debug printouts]'
'time-passes[measure time of each rustc pass]'
'count-llvm-insns[count where LLVM instrs originate]'
'time-llvm-passes[measure time of each LLVM pass]'
'trans-stats[gather trans statistics]'
'asm-comments[generate comments into the assembly (may change behavior)]'
'no-verify[skip LLVM verification]'
'borrowck-stats[gather borrowck statistics]'
'count-llvm-insns[count where LLVM instrs originate]'
'count-type-sizes[count the sizes of aggregate types]'
'debug-info[Produce debug info (experimental)]'
'no-landing-pads[omit landing pads for unwinding]'
'debug-llvm[enable debug output from LLVM]'
'extra-debug-info[Extra debugging info (experimental)]'
'gc[Garbage collect shared data (experimental)]'
'gen-crate-map[Force generation of a toplevel crate map]'
'lto[Perform LLVM link-time optimizations]'
'show-span[show spans for compiler debugging]'
'count-type-sizes[count the sizes of aggregate types]'
'meta-stats[gather metadata statistics]'
"no-integrated-as[Use external assembler rather than LLVM's integrated one]"
'no-landing-pads[omit landing pads for unwinding]'
'no-opt[do not optimize, even if -O is passed]'
"no-prepopulate-passes[Don't pre-populate the pass managers with a list of passes, only use the passes from --passes]"
"no-vectorize-loops[Don't run the loop vectorization optimization passes]"
"no-vectorize-slp[Don't run LLVM's SLP vectorization passes]"
'no-verify[skip LLVM verification]'
'prefer-dynamic[Prefer dynamic linking to static linking]'
'print-link-args[Print the arguments passed to the linker]'
'gc[Garbage collect shared data (experimental)]'
'print-llvm-passes[Prints the llvm optimization passes being run]'
'soft-float[Generate software floating point library calls]'
'time-llvm-passes[measure time of each LLVM pass]'
'time-passes[measure time of each rustc pass]'
'trans-stats[gather trans statistics]'
'verbose[in general, enable more debug printouts]'
'lto[Perform LLVM link-time optimizations]'
'ast-json[Print the AST as JSON and halt]'
'ast-json-noexpand[Print the pre-expansion AST as JSON and halt]'
'ls[List the symbols defined by a library crate]'
'save-analysis[Write syntax and type analysis information in addition to normal output]'
'flowgraph-print-loans[Include loan analysis data in --pretty flowgraph output]'
'flowgraph-print-moves[Include move analysis data in --pretty flowgraph output]'
'flowgraph-print-assigns[Include assignment analysis data in --pretty flowgraph output]'
'flowgraph-print-all[Include all dataflow analysis data in --pretty flowgraph output]'
)

_rustc_opts_fun_lint(){
Expand All @@ -115,14 +172,20 @@ _rustc_opts_fun_lint(){
}

_rustc_opts_fun_debug(){
_describe 'options' _rustc_opts_debug
_values 'options' "$_rustc_opts_debug[@]"
}

_rustc_opts_fun_codegen(){
_values 'options' "$_rustc_opts_codegen[@]"
}

_arguments -s : \
'(-W --warn)'{-W,--warn}'[Set lint warnings]:lint options:_rustc_opts_fun_lint' \
'(-A --allow)'{-A,--allow}'[Set lint allowed]:lint options:_rustc_opts_fun_lint' \
'(-D --deny)'{-D,--deny}'[Set lint denied]:lint options:_rustc_opts_fun_lint' \
'(-F --forbid)'{-F,--forbid}'[Set lint forbidden]:lint options:_rustc_opts_fun_lint' \
'(-W --warn)'{-W,--warn=}'[Set lint warnings]:lint options:_rustc_opts_fun_lint' \
'(-A --allow)'{-A,--allow=}'[Set lint allowed]:lint options:_rustc_opts_fun_lint' \
'(-D --deny)'{-D,--deny=}'[Set lint denied]:lint options:_rustc_opts_fun_lint' \
'(-F --forbid)'{-F,--forbid=}'[Set lint forbidden]:lint options:_rustc_opts_fun_lint' \
'*-Z[Set internal debugging options]:debug options:_rustc_opts_fun_debug' \
'*-C[Set internal Codegen options]:codegen options:_rustc_opts_fun_codegen' \
"$_rustc_opts_switches[@]" \
'*::files:_files -g "*.rs"'
"$_rustc_opts_vals[@]" \
'::files:_files -g "*.rs"'
2 changes: 1 addition & 1 deletion src/grammar/verify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ fn parse_antlr_token(s: &str, tokens: &HashMap<String, Token>) -> TokenAndSpan {
let sp = syntax::codemap::Span {
lo: syntax::codemap::BytePos(from_str::<u32>(start).unwrap() - offset),
hi: syntax::codemap::BytePos(from_str::<u32>(end).unwrap() + 1),
expn_info: None
expn_id: syntax::codemap::NO_EXPANSION
};

TokenAndSpan {
Expand Down
6 changes: 3 additions & 3 deletions src/libcollections/string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -872,7 +872,7 @@ mod tests {

use {Mutable, MutableSeq};
use str;
use str::{Str, StrSlice, Owned, Slice};
use str::{Str, StrSlice, Owned};
use super::String;
use vec::Vec;

Expand All @@ -898,10 +898,10 @@ mod tests {
#[test]
fn test_from_utf8_lossy() {
let xs = b"hello";
assert_eq!(String::from_utf8_lossy(xs), Slice("hello"));
assert_eq!(String::from_utf8_lossy(xs), str::Slice("hello"));

let xs = "ศไทย中华Việt Nam".as_bytes();
assert_eq!(String::from_utf8_lossy(xs), Slice("ศไทย中华Việt Nam"));
assert_eq!(String::from_utf8_lossy(xs), str::Slice("ศไทย中华Việt Nam"));

let xs = b"Hello\xC2 There\xFF Goodbye";
assert_eq!(String::from_utf8_lossy(xs),
Expand Down
80 changes: 80 additions & 0 deletions src/libcollections/vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ use core::default::Default;
use core::fmt;
use core::mem;
use core::num;
use core::ops;
use core::ptr;
use core::raw::Slice as RawSlice;
use core::uint;
Expand Down Expand Up @@ -464,6 +465,47 @@ impl<T> Index<uint,T> for Vec<T> {
}
}*/

impl<T> ops::Slice<uint, [T]> for Vec<T> {
#[inline]
fn as_slice_<'a>(&'a self) -> &'a [T] {
self.as_slice()
}

#[inline]
fn slice_from_<'a>(&'a self, start: &uint) -> &'a [T] {
self.as_slice().slice_from_(start)
}

#[inline]
fn slice_to_<'a>(&'a self, end: &uint) -> &'a [T] {
self.as_slice().slice_to_(end)
}
#[inline]
fn slice_<'a>(&'a self, start: &uint, end: &uint) -> &'a [T] {
self.as_slice().slice_(start, end)
}
}

impl<T> ops::SliceMut<uint, [T]> for Vec<T> {
#[inline]
fn as_mut_slice_<'a>(&'a mut self) -> &'a mut [T] {
self.as_mut_slice()
}

#[inline]
fn slice_from_mut_<'a>(&'a mut self, start: &uint) -> &'a mut [T] {
self.as_mut_slice().slice_from_mut_(start)
}

#[inline]
fn slice_to_mut_<'a>(&'a mut self, end: &uint) -> &'a mut [T] {
self.as_mut_slice().slice_to_mut_(end)
}
#[inline]
fn slice_mut_<'a>(&'a mut self, start: &uint, end: &uint) -> &'a mut [T] {
self.as_mut_slice().slice_mut_(start, end)
}
}
impl<T> FromIterator<T> for Vec<T> {
#[inline]
fn from_iter<I:Iterator<T>>(mut iterator: I) -> Vec<T> {
Expand Down Expand Up @@ -2327,6 +2369,44 @@ mod tests {
let _ = vec[3];
}

// NOTE uncomment after snapshot
/*
#[test]
#[should_fail]
fn test_slice_out_of_bounds_1() {
let x: Vec<int> = vec![1, 2, 3, 4, 5];
x[-1..];
}

#[test]
#[should_fail]
fn test_slice_out_of_bounds_2() {
let x: Vec<int> = vec![1, 2, 3, 4, 5];
x[..6];
}

#[test]
#[should_fail]
fn test_slice_out_of_bounds_3() {
let x: Vec<int> = vec![1, 2, 3, 4, 5];
x[-1..4];
}

#[test]
#[should_fail]
fn test_slice_out_of_bounds_4() {
let x: Vec<int> = vec![1, 2, 3, 4, 5];
x[1..6];
}

#[test]
#[should_fail]
fn test_slice_out_of_bounds_5() {
let x: Vec<int> = vec![1, 2, 3, 4, 5];
x[3..2];
}
*/

#[test]
fn test_swap_remove_empty() {
let mut vec: Vec<uint> = vec!();
Expand Down
Loading