- 15 6月, 2014 1 次提交
-
-
由 Alex Crichton 提交于
-
- 14 6月, 2014 39 次提交
-
-
由 bors 提交于
-
由 bors 提交于
Closes #14794. If you're casting from an enum to a float, cast through an integer first. [breaking-change] r? @alexcrichton
-
由 bors 提交于
Implement the stronger guarantees for mutable borrows proposed in #12624.
-
由 bors 提交于
There was feedback gathered by @bjz which request for larger click targets in the rustdoc sidebar. Here's my attempt at that. My only concern with this patch is the removal of `<br>` between sidebar links. This may break formatting for text-only viewers of this documentation. If there is a large enough demographic of people that will be affected, perhaps we can try switching the structure of each sidebar block sidebar to an `<ol>` with each item as a `<li>`. * Change links to display:block for click larger targets * Remove linebreaks due to extra space * Adjust margins so that element spacing stays the same * Sidebar item hover background colour chosen from `<pre>` styling
-
由 Cameron Zwarich 提交于
Move analyze_restrictions_on_use and check_if_path_is_moved so that all of the code related to assignments is in a contiguous block at the end of the file.
-
由 Cameron Zwarich 提交于
-
由 Cameron Zwarich 提交于
Implement the stronger guarantees for mutable borrows from #12624. This removes the ability to read from a mutably borrowed path for the duration of the borrow, and enforces a unique access path for any mutable borrow, for both reads and writes. This makes mutable borrows work better with concurrent accesses from multiple threads, and it opens the door for allowing moves out of mutably borrowed values, as long as a new value is written before the mutable borrow ends. This also aligns Rust more closely with academic languages based on substructural types and separation logic. The most common situation triggering an error after this change is a call to a function mutably borrowing self with self.field as one of the arguments. The workaround is to bind self.field to a temporary, but the need for these temporaries will hopefully go away after #6268 is fixed. Another situation that triggers an error is using the head expression of a match in an arm that binds a variable with a mutable reference. The use of the head expression needs to be replaced with an expression that reconstructs it from match-bound variables. This fixes #12624. [breaking-change]
-
由 Cameron Zwarich 提交于
Fix all violations in the Rust source tree of the stronger guarantee of a unique access path for mutable borrows as described in #12624.
-
由 Cameron Zwarich 提交于
Also rename MoveError to UseError and MoveOk / MoveWhileBorrowed to UseOk / UseWhileBorrowed.
-
由 Cameron Zwarich 提交于
Currently analyze_move_out_from ignores the BorrowKind of loans, but the same logic is useful when restricted to loans of specific borrow kinds.
-
由 Cameron Zwarich 提交于
Currently analyze_move_out_from checks all restrictions on all base paths of the move path, but it only needs to check restrictions from loans of the base paths, and can disregard restrictions from loans of extensions of those base paths.
-
由 Cameron Zwarich 提交于
It doesn't actually need the Rc, and it reduces the net number of pointer manipulations.
-
由 Cameron Zwarich 提交于
It will be simpler to make some of the changes that I need to make to analyze_move_out if it uses a loop rather than recursion.
-
由 Huon Wilson 提交于
-
由 bors 提交于
-
由 Huon Wilson 提交于
This obsoletes the old `to_err_msg` method. Replace println!("Error: {}", failure.to_err_msg()) let string = failure.to_err_msg(); with println!("Error: {}", failure) let string = failure.to_str(); [breaking-change]
-
由 bors 提交于
This adds the missing `get_mut` method to the `MutableVector` trait, and implements it for `&'a mut [T]`.
-
由 Valentin Tsatskin 提交于
* Change links to display:block for click larger targets * Remove linebreaks due to extra space * Adjust margins so that element spacing stays the same * Sidebar item hover background colour chosen from <pre> styling
-
由 bors 提交于
-
由 Alex Crichton 提交于
Closes #14797 (librustc: Fix the issue with labels shadowing variable names by making) Closes #14823 (Improve error messages for io::fs) Closes #14827 (libsyntax: Allow `+` to separate trait bounds from objects.) Closes #14834 (configure: Don't sync unused submodules) Closes #14838 (Remove typo on collections::treemap::UnionItems) Closes #14839 (Fix the unused struct field lint for struct variants) Closes #14840 (Clarify `Any` docs) Closes #14846 (rustc: [T, ..N] and [T, ..N+1] are not the same) Closes #14847 (Audit usage of NativeMutex) Closes #14850 (remove unnecessary PaX detection) Closes #14856 (librustc: Take in account mutability when casting array to raw ptr.) Closes #14859 (librustc: Forbid `transmute` from being called on types whose size is) Closes #14860 (Fix `quote_pat!` & parse outer attributes in `quote_item!`)
-
由 Huon Wilson 提交于
Fixes #14857.
-
由 Huon Wilson 提交于
-
由 Patrick Walton 提交于
only known post-monomorphization, and report `transmute` errors before the code is generated for that `transmute`. This can break code that looked like: unsafe fn f<T>(x: T) { let y: int = transmute(x); } Change such code to take a type parameter that has the same size as the type being transmuted to. Closes #12898. [breaking-change]
-
由 Luqman Aden 提交于
-
由 Daniel Micay 提交于
Rust no longer has support for JIT compilation, so it doesn't currently require a PaX MPROTECT exception. The extended attributes are preferred over modifying the binaries so it's not actually going to work on most systems like this anyway. If JIT compilation ends up being supported again, it should handle this by *always* applying the exception via an extended attribute without performing auto-detection of PaX on the host. The `paxctl` tool is only necessary with the older method involving modifying the ELF binary.
-
由 Alex Crichton 提交于
Once a native mutex has been used once, it is never allowed to be moved again. This is because some pthreads implementations take pointers inside the mutex itself. This commit adds stern wording around the methods on native mutexes, and fixes one use case in the codebase. The Mutex type in libsync was susceptible to movement, so the inner static mutex is now boxed to ensure that the address of the native mutex is constant.
-
由 Alex Crichton 提交于
This commit fixes a bug in the calculation of the hash of a type which didn't factor in the length of a constant-sized vector. As a result of this, a type placed into an Any of a fixed length could be peeled out with any other fixed length in a safe manner.
-
由 P1start 提交于
The `Any` docs previously did not state that only `'static` types implement it.
-
由 Jakub Wieczorek 提交于
Fixes #14837.
-
The docstring stated it was a intersection iterator, when in fact it is the union iterator
-
由 Alex Crichton 提交于
If the compiler is built with --{llvm,jemalloc,libuv}-root, then the configure script can skip updating these submodules. Closes #14822
-
由 Patrick Walton 提交于
RFC #27. After a snapshot, the old syntax will be removed. This can break some code that looked like `foo as &Trait:Send`. Now you will need to write `foo as (&Trait+Send)`. Closes #12778. [breaking-change]
-
由 Alex Crichton 提交于
-
由 Yehuda Katz 提交于
-
由 Patrick Walton 提交于
the leading quote part of the identifier for the purposes of hygiene. This adopts @jbclements' solution to #14539. I'm not sure if this is a breaking change or not. Closes #12512. [breaking-change]
-
由 bors 提交于
The current setup is to have a single vector of type parameters in scope at any one time. We then have to concatenate the parameters from the impl/trait with those of the method. This makes a lot of things awkward, most notably associated fns ("static fns"). This branch restructures the substitutions into three distinct namespaces (type, self, fn). This makes most of the "type parameter management" trivial. This also sets us up to support UFCS (though I haven't made any particular changes in that direction in this patch). Along the way, this patch fixes a few miscellaneous bits of code cleanup: 1. Patch resolve to detect references to out-of-scope type parameters, rather than checking for "out of bound" indices during substitution (fixes #14603). 2. Move def out of libsyntax into librustc where it belongs. I should have moved DefId too, but didn't. 3. Permit homogeneous tuples like `(T, T, T)` to be used as fixed-length vectors like `[T, ..3]`. This is awfully handy, though public facing. I suppose it requires an RFC. 4. Add some missing tests. cc #5527 r? @pcwalton or @pnkfelix
-
由 Patrick Walton 提交于
Closes #14794. If you're casting from an enum to a float, cast through an integer first. [breaking-change]
-
由 Niko Matsakis 提交于
parameters This involves numerous substeps: 1. Treat Self same as any other parameter. 2. No longer compute offsets for method parameters. 3. Store all generic types (both trait/impl and method) with a method, eliminating odd discrepancies. 4. Stop doing unspeakable things to static methods and instead just use the natural types, now that we can easily add the type parameters from trait into the method's polytype. 5. No doubt some more. It was hard to separate these into distinct commits. Fixes #13564
-
由 Brendan Zabarauskas 提交于
-