about summary refs log tree commit diff
path: root/src/libsyntax
AgeCommit message (Collapse)AuthorLines
2015-02-03Remove the explicit closure kind syntax from the parser and AST;Niko Matsakis-60/+50
upgrade the inference based on expected type so that it is able to infer the fn kind in isolation even if the full signature is not available (and we could perhaps do better still in some cases, such as extracting just the types of the arguments but not the return value).
2015-02-04Compute widths properly when displaying spans in error messagesP1start-23/+58
Closes #8706.
2015-02-02rollup merge of #21845: Potpourri/import-syntaxAlex Crichton-3/+8
syntax like `use foo::bar::;` and `use foo:: as bar;` should be rejected, see issue #21629
2015-02-02rollup merge of #21842: alexcrichton/issue-21839Alex Crichton-2/+2
Now that associated types are fully implemented the iterator adaptors only need type parameters which are associated with actual storage. All other type parameters can either be derived from these (e.g. they are an associated type) or can be bare on the `impl` block itself. This is a breaking change due to the removal of type parameters on these iterator adaptors, but code can fairly easily migrate by just deleting the relevant type parameters for each adaptor. Other behavior should not be affected. Closes #21839 [breaking-change]
2015-02-02rollup merge of #21830: japaric/for-cleanupAlex Crichton-151/+149
Conflicts: src/librustc/metadata/filesearch.rs src/librustc_back/target/mod.rs src/libstd/os.rs src/libstd/sys/windows/os.rs src/libsyntax/ext/tt/macro_parser.rs src/libsyntax/print/pprust.rs src/test/compile-fail/issue-2149.rs
2015-02-02rollup merge of #21825: kmcallister/ttdelim-spanAlex Crichton-1/+24
2015-02-02rollup merge of #21817: edwardw/symmetric-binopAlex Crichton-0/+14
For "symmetric" binary operators, meaning the types of two sides must be equal, if the type of LHS doesn't know yet but RHS does, use that as an hint to infer LHS' type. Closes #21634
2015-02-02rollup merge of #21787: alexcrichton/std-envAlex Crichton-8/+8
Conflicts: src/libstd/sys/unix/backtrace.rs src/libstd/sys/unix/os.rs
2015-02-02rollup merge of #21754: semarie/openbsd-rebasedAlex Crichton-2/+4
Hi. Here a commit in order to add OpenBSD support to rust. - tests status: run-pass: test result: ok. 1879 passed; 0 failed; 24 ignored; 0 measured run-fail: test result: ok. 81 passed; 0 failed; 5 ignored; 0 measured compile-fail: test result: ok. 1634 passed; 0 failed; 22 ignored; 0 measured run-pass-fulldeps: test result: ok. 22 passed; 0 failed; 1 ignored; 0 measured compile-fail-fulldeps: test result: ok. 13 passed; 0 failed; 0 ignored; 0 measured - The current implementation of load_self function (src/libstd/sys/unix/os.rs) isn't optimal as under OpenBSD I haven't found a reliable method to get the filename of a running process. The current implementation is enought for bootstrapping purpose. - I have disable `run-pass/tcp-stress.rs` test under openbsd. When run manually, the test pass, but when run under `compiletest`, it timeout and echo continuoulsy `Too many open files`. - For building with jemalloc, a more recent version of jemalloc would be mandatory. See https://github.com/jemalloc/jemalloc/pull/188 for more details.
2015-02-02rollup merge of #21710: alfie/libsyntaxAlex Crichton-142/+142
Conflicts: src/libsyntax/parse/parser.rs
2015-02-02remove unused mut qualifiersJorge Aparicio-4/+2
2015-02-02`for x in xs.into_iter()` -> `for x in xs`Jorge Aparicio-6/+6
Also `for x in option.into_iter()` -> `if let Some(x) = option`
2015-02-02`for x in xs.iter_mut()` -> `for x in &mut xs`Jorge Aparicio-3/+3
Also `for x in option.iter_mut()` -> `if let Some(ref mut x) = option`
2015-02-02`for x in xs.iter()` -> `for x in &xs`Jorge Aparicio-138/+138
2015-02-02Omit integer suffix when unnecessaryAlfie John-142/+142
See PR # 21378 for context
2015-02-02Tweak some ‘expected…’ error messagesP1start-60/+68
Fixes #21153.
2015-02-01std: Remove extra type params on iter adaptorsAlex Crichton-2/+2
Now that associated types are fully implemented the iterator adaptors only need type parameters which are associated with actual storage. All other type parameters can either be derived from these (e.g. they are an associated type) or can be bare on the `impl` block itself. This is a breaking change due to the removal of type parameters on these iterator adaptors, but code can fairly easily migrate by just deleting the relevant type parameters for each adaptor. Other behavior should not be affected. Closes #21839 [breaking-change]
2015-02-01Reject syntax like `use foo::bar::;` and `use foo:: as bar;` and keywords in ↵Potpourri-3/+8
view path idents
2015-02-01std: Add a new `env` moduleAlex Crichton-8/+8
This is an implementation of [RFC 578][rfc] which adds a new `std::env` module to replace most of the functionality in the current `std::os` module. More details can be found in the RFC itself, but as a summary the following methods have all been deprecated: [rfc]: https://github.com/rust-lang/rfcs/pull/578 * `os::args_as_bytes` => `env::args` * `os::args` => `env::args` * `os::consts` => `env::consts` * `os::dll_filename` => no replacement, use `env::consts` directly * `os::page_size` => `env::page_size` * `os::make_absolute` => use `env::current_dir` + `join` instead * `os::getcwd` => `env::current_dir` * `os::change_dir` => `env::set_current_dir` * `os::homedir` => `env::home_dir` * `os::tmpdir` => `env::temp_dir` * `os::join_paths` => `env::join_paths` * `os::split_paths` => `env::split_paths` * `os::self_exe_name` => `env::current_exe` * `os::self_exe_path` => use `env::current_exe` + `pop` * `os::set_exit_status` => `env::set_exit_status` * `os::get_exit_status` => `env::get_exit_status` * `os::env` => `env::vars` * `os::env_as_bytes` => `env::vars` * `os::getenv` => `env::var` or `env::var_string` * `os::getenv_as_bytes` => `env::var` * `os::setenv` => `env::set_var` * `os::unsetenv` => `env::remove_var` Many function signatures have also been tweaked for various purposes, but the main changes were: * `Vec`-returning APIs now all return iterators instead * All APIs are now centered around `OsString` instead of `Vec<u8>` or `String`. There is currently on convenience API, `env::var_string`, which can be used to get the value of an environment variable as a unicode `String`. All old APIs are `#[deprecated]` in-place and will remain for some time to allow for migrations. The semantics of the APIs have been tweaked slightly with regard to dealing with invalid unicode (panic instead of replacement). The new `std::env` module is all contained within the `env` feature, so crates must add the following to access the new APIs: #![feature(env)] [breaking-change]
2015-02-01openbsd supportSébastien Marie-2/+4
2015-01-31Fix end of TtDelimited spanKeegan McAllister-1/+24
2015-02-01Make use of a binary operator's RHS type for LHS inferenceEdward Wang-0/+14
For "symmetric" binary operators, meaning the types of two side must be equal, if the type of LHS doesn't know yet but RHS does, use that as an hint to infer LHS' type. Closes #21634
2015-01-31Kill more `isize`sTobias Bucher-13/+13
2015-01-31Fix rebase issuesAdolfo Ochagavía-9/+15
2015-01-31Fix pretty printerAdolfo Ochagavía-0/+1
2015-01-31Replace uses of Decorator and ModifierAdolfo Ochagavía-31/+89
2015-01-31Deprecate SyntaxExtension::ModifierAdolfo Ochagavía-0/+1
Replaced by SyntaxExtension::MultiModifier [breaking-change]
2015-01-31Deprecate SyntaxExtension::DecoratorAdolfo Ochagavía-0/+1
It has been replaced by SyntaxExtension::MultiDecorator [breaking-change]
2015-01-31Add MultiDecorator variant to SyntaxExtension enumAdolfo Ochagavía-1/+27
2015-01-31Add MultiItemDecoratorAdolfo Ochagavía-0/+23
2015-01-31Deprecate ItemDecorator in favor of MultiItemDecoratorAdolfo Ochagavía-0/+1
[breaking-change]
2015-01-31Deprecate ItemModifier in favor of MultiItemModifierAdolfo Ochagavía-0/+3
[breaking-change]
2015-01-30Test fixes and rebase conflictsAlex Crichton-8/+7
Also some tidying up of a bunch of crate attributes
2015-01-30rollup merge of #21713: alexcrichton/second-pass-fmtAlex Crichton-75/+61
2015-01-30rollup merge of #21718: alexcrichton/stabilize-from-strAlex Crichton-12/+13
This commits adds an associated type to the `FromStr` trait representing an error payload for parses which do not succeed. The previous return value, `Option<Self>` did not allow for this form of payload. After the associated type was added, the following attributes were applied: * `FromStr` is now stable * `FromStr::Err` is now stable * `FromStr::from_str` is now stable * `StrExt::parse` is now stable * `FromStr for bool` is now stable * `FromStr for $float` is now stable * `FromStr for $integral` is now stable * Errors returned from stable `FromStr` implementations are stable * Errors implement `Display` and `Error` (both impl blocks being `#[stable]`) Closes #15138
2015-01-30rollup merge of #21704: FlaPer87/macro-reexportAlex Crichton-0/+7
Conflicts: src/libstd/lib.rs
2015-01-30std: Stabilize the std::fmt moduleAlex Crichton-75/+61
This commit performs a final stabilization pass over the std::fmt module, marking all necessary APIs as stable. One of the more interesting aspects of this module is that it exposes a good deal of its runtime representation to the outside world in order for `format_args!` to be able to construct the format strings. Instead of hacking the compiler to assume that these items are stable, this commit instead lays out a story for the stabilization and evolution of these APIs. There are three primary details used by the `format_args!` macro: 1. `Arguments` - an opaque package of a "compiled format string". This structure is passed around and the `write` function is the source of truth for transforming a compiled format string into a string at runtime. This must be able to be constructed in stable code. 2. `Argument` - an opaque structure representing an argument to a format string. This is *almost* a trait object as it's just a pointer/function pair, but due to the function originating from one of many traits, it's not actually a trait object. Like `Arguments`, this must be constructed from stable code. 3. `fmt::rt` - this module contains the runtime type definitions primarily for the `rt::Argument` structure. Whenever an argument is formatted with nonstandard flags, a corresponding `rt::Argument` is generated describing how the argument is being formatted. This can be used to construct an `Arguments`. The primary interface to `std::fmt` is the `Arguments` structure, and as such this type name is stabilize as-is today. It is expected for libraries to pass around an `Arguments` structure to represent a pending formatted computation. The remaining portions are largely "cruft" which would rather not be stabilized, but due to the stability checks they must be. As a result, almost all pieces have been renamed to represent that they are "version 1" of the formatting representation. The theory is that at a later date if we change the representation of these types we can add new definitions called "version 2" and corresponding constructors for `Arguments`. One of the other remaining large questions about the fmt module were how the pending I/O reform would affect the signatures of methods in the module. Due to [RFC 526][rfc], however, the writers of fmt are now incompatible with the writers of io, so this question has largely been solved. As a result the interfaces are largely stabilized as-is today. [rfc]: https://github.com/rust-lang/rfcs/blob/master/text/0526-fmt-text-writer.md Specifically, the following changes were made: * The contents of `fmt::rt` were all moved under `fmt::rt::v1` * `fmt::rt` is stable * `fmt::rt::v1` is stable * `Error` is stable * `Writer` is stable * `Writer::write_str` is stable * `Writer::write_fmt` is stable * `Formatter` is stable * `Argument` has been renamed to `ArgumentV1` and is stable * `ArgumentV1::new` is stable * `ArgumentV1::from_uint` is stable * `Arguments::new_v1` is stable (renamed from `new`) * `Arguments::new_v1_formatted` is stable (renamed from `with_placeholders`) * All formatting traits are now stable, as well as the `fmt` method. * `fmt::write` is stable * `fmt::format` is stable * `Formatter::pad_integral` is stable * `Formatter::pad` is stable * `Formatter::write_str` is stable * `Formatter::write_fmt` is stable * Some assorted top level items which were only used by `format_args!` were removed in favor of static functions on `ArgumentV1` as well. * The formatting-flag-accessing methods remain unstable Within the contents of the `fmt::rt::v1` module, the following actions were taken: * Reexports of all enum variants were removed * All prefixes on enum variants were removed * A few miscellaneous enum variants were renamed * Otherwise all structs, fields, and variants were marked stable. In addition to these actions in the `std::fmt` module, many implementations of `Show` and `String` were stabilized as well. In some other modules: * `ToString` is now stable * `ToString::to_string` is now stable * `Vec` no longer implements `fmt::Writer` (this has moved to `String`) This is a breaking change due to all of the changes to the `fmt::rt` module, but this likely will not have much impact on existing programs. Closes #20661 [breaking-change]
2015-01-30std: Stabilize FromStr and parseAlex Crichton-12/+13
This commits adds an associated type to the `FromStr` trait representing an error payload for parses which do not succeed. The previous return value, `Option<Self>` did not allow for this form of payload. After the associated type was added, the following attributes were applied: * `FromStr` is now stable * `FromStr::Err` is now stable * `FromStr::from_str` is now stable * `StrExt::parse` is now stable * `FromStr for bool` is now stable * `FromStr for $float` is now stable * `FromStr for $integral` is now stable * Errors returned from stable `FromStr` implementations are stable * Errors implement `Display` and `Error` (both impl blocks being `#[stable]`) Closes #15138
2015-01-30fixes after rebaseJorge Aparicio-1/+0
2015-01-30s/while let/for/g now that #21245 has been fixedJorge Aparicio-8/+4
2015-01-30custom message for refutable patterns in for loopsJorge Aparicio-2/+3
2015-01-30fix falloutJorge Aparicio-4/+11
2015-01-30implement for loop desugaringJorge Aparicio-3/+93
2015-01-30Change from core::ops::RangeFull to std::opsNick Cameron-1/+1
2015-01-30Rename FullRange to RangeFullNick Cameron-3/+3
2015-01-30Use absolute path to FullRange, rather than assuming it is in the preludeNick Cameron-53/+65
Closes #21263 [breaking-change] If you are using `core::ops::FullRange` you should change to using `core::ops::RangeFull`
2015-01-29Auto merge of #21677 - japaric:no-range, r=alexcrichtonbors-151/+156
Note: Do not merge until we get a newer snapshot that includes #21374 There was some type inference fallout (see 4th commit) because type inference with `a..b` is not as good as with `range(a, b)` (see #21672). r? @alexcrichton
2015-01-29bring back `#[derive(Show)]` with a deprecation warningJorge Aparicio-0/+8
2015-01-29s/Show/Debug/gJorge Aparicio-128/+128
2015-01-29register snaphotsJorge Aparicio-2/+0