- 20 11月, 2014 26 次提交
-
-
由 Aaron Turon 提交于
This commit relaxes constraints on generics and traits within the `core::ops` module and for the `Equiv` trait.
-
由 Aaron Turon 提交于
This commit changes `AsSlice` to work on unsized types, and changes the `impl` for `&[T]` to `[T]`. Aside from making the trait more general, this also helps some ongoing work with method resolution changes. This is a breaking change: code that uses generics bounded by `AsSlice` will have to change. In particular, such code previously often took arguments of type `V` where `V: AsSlice<T>` by value. These should now be taken by reference: ```rust fn foo<Sized? V: AsSlice<T>>(v: &V) { .. } ``` A few std lib functions have been changed accordingly. [breaking-change]
-
由 bors 提交于
This commit adds stability markers for the APIs that have recently been aligned with [numerics reform](https://github.com/rust-lang/rfcs/pull/369). For APIs that were changed as part of that reform, `#[unstable]` is used to reflect the recency, but the APIs will become `#[stable]` in a follow-up pass. In addition, a few aspects of the APIs not explicitly covered by the RFC are marked here -- in particular, constants for floats. This commit does not mark the `uint` or `int` modules as `#[stable]`, given the ongoing debate out the names and roles of these types. Due to some deprecation (see the RFC for details), this is a: [breaking-change] r? @alexcrichton cc @bjz
-
由 bors 提交于
-
由 Jakub Bukaj 提交于
-
由 bors 提交于
This fixes the gap in the language definition causing #18726 by defining a clear bound on the maximum size for libraries to enforce. Closes #18069
-
由 Jakub Bukaj 提交于
I don't know enough about the free functions to give them better docs right now.
-
由 Jakub Bukaj 提交于
-
由 Jakub Bukaj 提交于
Futureproof Rust for fancier suffixed literals. The Rust compiler tokenises a literal followed immediately (no whitespace) by an identifier as a single token: (for example) the text sequences `"foo"bar`, `1baz` and `1u1024` are now a single token rather than the pairs `"foo"` `bar`, `1` `baz` and `1u` `1024` respectively. The compiler rejects all such suffixes in the parser, except for the 12 numeric suffixes we have now. I'm fairly sure this will affect very few programs, since it's not currently legal to have `<literal><identifier>` in a Rust program, except in a macro invocation. Any macro invocation relying on this behaviour can simply separate the two tokens with whitespace: `foo!("bar"baz)` becomes `foo!("bar" baz)`. This implements [RFC 463](https://github.com/rust-lang/rfcs/blob/master/text/0463-future-proof-literal-suffixes.md), and so closes https://github.com/rust-lang/rust/issues/19088.
-
由 Jakub Bukaj 提交于
-
由 Jakub Bukaj 提交于
Besides being more helpful, this gives us the flexibility to later define a meaning for something like ```rust #[deriving(...)] mod bar { ... } ```
-
由 Jakub Bukaj 提交于
Fixes #19086. Whilst the code that this PR renders invalid was never meant to be valid, this is still a... [breaking-change]
-
由 Jakub Bukaj 提交于
-
由 Jakub Bukaj 提交于
Fixes #19069. These were never intended not to be feature-gated but this PR is nonetheless a... [breaking-change]
-
由 Jakub Bukaj 提交于
-
由 Jakub Bukaj 提交于
This commit applies the stabilization of std::fmt as outlined in [RFC 380][rfc]. There are a number of breaking changes as a part of this commit which will need to be handled to migrated old code: * A number of formatting traits have been removed: String, Bool, Char, Unsigned, Signed, and Float. It is recommended to instead use Show wherever possible or to use adaptor structs to implement other methods of formatting. * The format specifier for Boolean has changed from `t` to `b`. * The enum `FormatError` has been renamed to `Error` as well as becoming a unit struct instead of an enum. The `WriteError` variant no longer exists. * The `format_args_method!` macro has been removed with no replacement. Alter code to use the `format_args!` macro instead. * The public fields of a `Formatter` have become read-only with no replacement. Use a new formatting string to alter the formatting flags in combination with the `write!` macro. The fields can be accessed through accessor methods on the `Formatter` structure. Other than these breaking changes, the contents of std::fmt should now also all contain stability markers. Most of them are still #[unstable] or #[experimental] [rfc]: https://github.com/rust-lang/rfcs/blob/master/text/0380-stabilize-std-fmt.md [breaking-change] Closes #18904
-
由 Jakub Bukaj 提交于
As-is, there's no indication that the code examples pop out into a window that runs on `play.rust-lang.org` until you mouse over them. I managed to get to section 4 of the guide before realizing you could do this since it didn't occur to me to mouse over the example text. cc @rose since we went through the tutorial together and I think it wasn't obvious to her either.
-
由 Jakub Bukaj 提交于
-
由 Jakub Bukaj 提交于
Ensure that the type parameters passed to methods outlive the call expression. Fixes #18899. This is yet another case of forgotten to consistently enforce the constraints in every instance where they apply. Might be nice to try and refactor to make this whole thing more DRY, but for now here's a targeted fix. r? @pcwalton
-
由 Jakub Bukaj 提交于
Now that we've done `fail` -> `panic`, I feel bringing back the error handling guide is a good idea. We had one long ago, but it was removed when conditions were removed. This doesn't cover the new FromError stuff, but I feel like it's already useful in this state, so I'm sending this PR now.
-
由 Jakub Bukaj 提交于
This fixes #17388. Note that we don't check type parameters in trait-references and so on, so we accept some nonsense (I opened https://github.com/rust-lang/rust/issues/18865). (It may be easier to just add support for `T::Foo` and deprecate the qpath code until we can implement it more robustly using the trait lookup infrastructure, not sure.)
-
由 Jakub Bukaj 提交于
This fixes the gap in the language definition causing #18726 by defining a clear bound on the maximum size for libraries to enforce. Closes #18069
-
由 Jakub Bukaj 提交于
-
由 bors 提交于
-
由 Steve Klabnik 提交于
I don't know enough about the free functions to give them better docs right now.
-
由 bors 提交于
Pass the unadjusted type into the unsize_info function, which seems to be what it expects. Fixes #17322. r? @nick29581 Full disclosure: still running make check locally ;)
-
- 19 11月, 2014 14 次提交
-
-
由 Niko Matsakis 提交于
Pass the unadjusted type into the unsize_info function, which seems to be what it expects. Fixes #17322.
-
由 Daniel Hofstetter 提交于
-
由 Huon Wilson 提交于
This changes the stated grammar of literals to move all suffixes into the generic literal production.
-
由 Huon Wilson 提交于
This makes the formal lexical grammar (more closely) reflect the one implemented by the compiler.
-
由 Huon Wilson 提交于
This moves errors and all handling of numeric suffixes into the parser rather than the lexer.
-
由 Huon Wilson 提交于
This adds an optional suffix at the end of a literal token: `"foo"bar`. An actual use of a suffix in a expression (or other literal that the compiler reads) is rejected in the parser. This doesn't switch the handling of numbers to this system, and doesn't outlaw illegal suffixes for them yet.
-
由 Niko Matsakis 提交于
Update libcollections tests to pass the new type rules. They used to return a pointer to the value they were modifying, but this should not have been legal, since that pointer would have to outlive the closure, and the closure continues to modify the value during the execution. This return value was just passed to `black_box` so as to convince llvm that the value was live, so rather than returning a pointer, modify to just call `black_box` directly inside the fn.
-
由 Niko Matsakis 提交于
-
由 Niko Matsakis 提交于
-
由 Daniel Micay 提交于
This fixes the gap in the language definition causing #18726 by defining a clear bound on the maximum size for libraries to enforce. Closes #18069
-
由 Valerii Hiora 提交于
-
由 bors 提交于
After more than a month of sitting on this patch, rebasing and tracking down some nasty bugs (there's might be still one out there, but it only manifested in `middle::trans::reflect` which is now gone), I'd like to merge it as it is. This changeset makes middle::ty safe, linking the lifetime of a type to the type context it was created in. It's a prerequisite for introducing function-local type contexts to localize types with inference variables, in order to (potentially) free hundreds of MBs from rustc's memory usage peak.
-
由 Alex Crichton 提交于
This commit applies the stabilization of std::fmt as outlined in [RFC 380][rfc]. There are a number of breaking changes as a part of this commit which will need to be handled to migrated old code: * A number of formatting traits have been removed: String, Bool, Char, Unsigned, Signed, and Float. It is recommended to instead use Show wherever possible or to use adaptor structs to implement other methods of formatting. * The format specifier for Boolean has changed from `t` to `b`. * The enum `FormatError` has been renamed to `Error` as well as becoming a unit struct instead of an enum. The `WriteError` variant no longer exists. * The `format_args_method!` macro has been removed with no replacement. Alter code to use the `format_args!` macro instead. * The public fields of a `Formatter` have become read-only with no replacement. Use a new formatting string to alter the formatting flags in combination with the `write!` macro. The fields can be accessed through accessor methods on the `Formatter` structure. Other than these breaking changes, the contents of std::fmt should now also all contain stability markers. Most of them are still #[unstable] or #[experimental] [rfc]: https://github.com/rust-lang/rfcs/blob/master/text/0380-stabilize-std-fmt.md [breaking-change] Closes #18904
-
由 Eduard Burtescu 提交于
-