- 14 9月, 2014 18 次提交
-
-
由 bors 提交于
Replaces Gc<T> in the AST with a custom owned smart pointer, P<T>. Fixes #7929. ## Benefits * **Identity** (affinity?): sharing AST nodes is bad for the various analysis passes (e.g. one could bypass borrowck with a shared `ExprAddrOf` node taking a mutable borrow), the only reason we haven't hit any serious issues with it is because of inefficient folding passes which will always deduplicate any such shared nodes. Even if we were to switch to an arena, this would still hold, i.e. we wouldn't just use `&'a T` in the AST, but rather an wrapper (`P<'a, T>`?). * **Immutability**: `P<T>` disallows mutating its inner `T` (unless that contains an `Unsafe` interior, which won't happen in the AST), unlike `~T`. * **Efficiency**: folding can reuse allocation space for `P<T>` and `Vec<T>`, the latter even when the input and output types differ (as it would be the case with arenas or an AST with type parameters to toggle macro support). Also, various algorithms have been changed from copying `Gc<T>` to using `&T` and iterators. * **Maintainability**: there is another reason I didn't just replace `Gc<T>` with `~T`: `P<T>` provides a fixed interface (`Deref`, `and_then` and `map`) which can remain fully functional even if the implementation changes (using a special thread-local heap, for example). Moreover, switching to, e.g. `P<'a, T>` (for a contextual arena) is easy and mostly automated.
-
由 Eduard Burtescu 提交于
-
由 Eduard Burtescu 提交于
-
由 Eduard Burtescu 提交于
-
由 Eduard Burtescu 提交于
-
由 Eduard Burtescu 提交于
-
由 Eduard Burtescu 提交于
-
由 Eduard Burtescu 提交于
-
由 Eduard Burtescu 提交于
-
由 bors 提交于
When checking for an existing crate, compare against the `crate_metadata::name` field, which is the crate name which was requested during resolution, rather than the result of the `crate_metadata::name()` method, which is the crate name within the crate metadata, as these may not match when using the --extern option to `rustc`. This fixes spurious "multiple crate version" warnings under the following scenario: - The crate `foo`, is referenced multiple times - `--extern foo=./path/to/libbar.rlib` is specified to rustc - The internal crate name of `libbar.rlib` is not `foo` The behavior surrounding `Context::should_match_name` and the comments in `loader.rs` both lead me to believe that this scenario is intended to work. Fixes #17186
-
由 Eduard Burtescu 提交于
-
由 Eduard Burtescu 提交于
-
由 Eduard Burtescu 提交于
-
由 Eduard Burtescu 提交于
-
由 Eduard Burtescu 提交于
-
由 Eduard Burtescu 提交于
-
由 bors 提交于
`Box<[T]>` is created by allocating `Box<[T, ..n]>` and coercing it so this code path is never used. It's also broken because it clamps the capacity of the memory allocations to 4 elements and that's incompatible with sized deallocation. This dates back to when `~[T]` was a growable vector type implemented as: *{ { tydesc, ref_count, prev, next }, { length, capacity, data[] } } Since even empty vectors had to allocate, it started off the capacity of all vectors at 4 as a heuristic. It's not possible to grow `Box<[T]>` and there is no need for a memory allocation when it's empty, so it would be a terrible heuristic today even if it worked.
-
由 bors 提交于
This PR fixes debuginfo tests on Windows.
-
- 13 9月, 2014 7 次提交
-
-
由 bors 提交于
Updates the callbacks section to refer to the right function name and fixes a couple of minor whitespace issues in the examples.
-
由 bors 提交于
Fixes #17120.
-
由 bors 提交于
This can break code like: fn call_rec(f: |uint| -> uint) -> uint { (|x| f(x))(call_rec(f)) } Change this code to use a temporary instead of violating the borrow rules: fn call_rec(f: |uint| -> uint) -> uint { let tmp = call_rec(|x| f(x)); f(tmp) } Closes #17144. [breaking-change] r? @huonw
-
由 bors 提交于
The other extension types already worked this way and it can be useful to track some state along with the extension. I also removed the `BasicMacroExpander` and `BasicIdentMacroExpander` since the span inside of them was never used. The expander function types now directly implement the relevant trait.
-
由 Brian Koropoff 提交于
-
由 bors 提交于
Fixing more suggestions from @dherman . I made them individual commits in case we want to discuss any of them further.
-
由 bors 提交于
This PR creates a new lint : ``unused_extern_crate``, which do pretty much the same thing as ``unused_import``, but for ``extern crate`` statements. It is related to feature request #10385. I adapted the code tracking used imports so that it tracks extern crates usage as well. This was mainly trial and error and while I believe all cases are covered, there might be some code I added that is useless (long compile times didn't give me the opportunity to check this in detail). Also, I removed some unused ``extern crate`` statements from the libs, that where spotted by this new lint.
-
- 12 9月, 2014 15 次提交
-
-
由 bors 提交于
Few visitors used the context passing feature and it can be easily emulated. The added lifetime threading allows a visitor to keep safe references to AST nodes it visits, making a non-owning ast_map design possible, for #13316.
-
由 Eduard Burtescu 提交于
-
由 Eduard Burtescu 提交于
-
由 bors 提交于
This switches win64 hosts to bootstrap from win64 snaps.
-
由 Victor Berger 提交于
-
由 Victor Berger 提交于
-
由 bors 提交于
-
由 Daniel Micay 提交于
`Box<[T]>` is created by allocating `Box<[T, ..n]>` and coercing it so this code path is never used. It's also broken because it clamps the capacity of the memory allocations to 4 elements and that's incompatible with sized deallocation. This dates back to when `~[T]` was a growable vector type implemented as: *{ { tydesc, ref_count, prev, next }, { length, capacity, data[] } } Since even empty vectors had to allocate, it started off the capacity of all vectors at 4 as a heuristic. It's not possible to grow `Box<[T]>` and there is no need for a memory allocation when it's empty, so it would be a terrible heuristic today even if it worked.
-
由 Damien Grassart 提交于
-
由 Brian Koropoff 提交于
When checking for an existing crate, compare against the `crate_metadata::name` field, which is the crate name which was requested during resolution, rather than the result of the `crate_metadata::name()` method, which is the crate name within the crate metadata, as these may not match when using the --extern option to `rustc`. This fixes spurious "multiple crate version" warnings under the following scenario: - The crate `foo`, is referenced multiple times - `--extern foo=./path/to/libbar.rlib` is specified to rustc - The internal crate name of `libbar.rlib` is not `foo` The behavior surrounding `Context::should_match_name` and the comments in `loader.rs` both lead me to believe that this scenario is intended to work. Fixes #17186
-
由 Brian Koropoff 提交于
-
由 bors 提交于
closes #16977 r? @nikomatsakis
-
由 Luqman Aden 提交于
-
由 bors 提交于
The Guide isn't 100% perfect, but it's basically complete. It's certainly better than the tutorial is. Time to start pointing more people its way. I also just made it consistent to call all things 'guides' rather than tutorials. Fixes #9874. This is the big one. And two bugs that just go away. Fixes #14503. Fixes #15009.
-