about summary refs log tree commit diff
path: root/src/librustc/metadata
AgeCommit message (Collapse)AuthorLines
2014-12-17rollup merge of #19849: alexcrichton/second-pass-optionAlex Crichton-5/+5
This commit takes a second pass through the `std::option` module to fully stabilize any lingering methods inside of it. These items were made stable as-is * Some * None * as_mut * expect * unwrap * unwrap_or * unwrap_or_else * map * map_or * map_or_else * and_then * or_else * unwrap_or_default * Default implementation * FromIterator implementation * Copy implementation These items were made stable with modifications * iter - now returns a struct called Iter * iter_mut - now returns a struct called IterMut * into_iter - now returns a struct called IntoIter, Clone is never implemented This is a breaking change due to the modifications to the names of the iterator types returned. Code referencing the old names should updated to referencing the newer names instead. This is also a breaking change due to the fact that `IntoIter` no longer implements the `Clone` trait. These items were explicitly not stabilized * as_slice - waiting on indexing conventions * as_mut_slice - waiting on conventions with as_slice as well * cloned - the API was still just recently added * ok_or - API remains experimental * ok_or_else - API remains experimental [breaking-change]
2014-12-17auto merge of #19799 : alexcrichton/rust/stop-panicking, r=huonwbors-6/+10
Fix a panic where the compiler was looking at stale or old metadata. See #19798, #19772, #19757, #19744, #19718, #19691.
2014-12-15rollup merge of #19793: tomjakubowski/metadata-const-attrsBrian Anderson-0/+1
Fix #19773 Together with #19774 (which this is rebased on): Fix #18156, fix #19722, fix #19185 r? @alexcrichton (since this was your suggestion!)
2014-12-14std: Fully stabilize Option<T>Alex Crichton-5/+5
This commit takes a second pass through the `std::option` module to fully stabilize any lingering methods inside of it. These items were made stable as-is * Some * None * as_mut * expect * unwrap * unwrap_or * unwrap_or_else * map * map_or * map_or_else * and_then * or_else * unwrap_or_default * Default implementation * FromIterator implementation * Copy implementation These items were made stable with modifications * iter - now returns a struct called Iter * iter_mut - now returns a struct called IterMut * into_iter - now returns a struct called IntoIter, Clone is never implemented This is a breaking change due to the modifications to the names of the iterator types returned. Code referencing the old names should updated to referencing the newer names instead. This is also a breaking change due to the fact that `IntoIter` no longer implements the `Clone` trait. These items were explicitly not stabilized * as_slice - waiting on indexing conventions * as_mut_slice - waiting on conventions with as_slice as well * cloned - the API was still just recently added * ok_or - API remains experimental * ok_or_else - API remains experimental [breaking-change]
2014-12-14Parse `unsafe impl` but don't do anything particularly interesting with the ↵Niko Matsakis-15/+22
results.
2014-12-14Parse `unsafe trait` but do not do anything with it beyond parsing and ↵Niko Matsakis-1/+17
integrating into rustdoc etc.
2014-12-14Rename FnStyle trait to Unsafety.Niko Matsakis-13/+13
2014-12-13librustc: use tuple indexingJorge Aparicio-3/+3
2014-12-13librustc: use unboxed closuresJorge Aparicio-76/+118
2014-12-13librustc: fix falloutJorge Aparicio-1/+3
2014-12-12rustc: Don't panic on corrupt metadataAlex Crichton-6/+10
Fix a panic where the compiler was looking at stale or old metadata. See #19798, #19772, #19757, #19744, #19718, #19691.
2014-12-12Switch to using predicates to drive checking. Correct various tests --Niko Matsakis-3/+85
in most cases, just the error message changed, but in some cases we are reporting new errors that OUGHT to have been reported before but we're overlooked (mostly involving the `'static` bound on `Send`).
2014-12-12Introduce predicates but don't use them.Niko Matsakis-1/+3
2014-12-12Start restructuring to support generalized where clauses etc.Niko Matsakis-4/+2
2014-12-12metadata: Encode attributes for const itemsTom Jakubowski-0/+1
Fix #19773 Together with #19774 (which this is rebased on): Fix #18156, fix #19722, fix #19185
2014-12-12auto merge of #19391 : nick29581/rust/assoc-eq, r=nikomatsakisbors-1/+1
r? @nikomatsakis cc @aturon (I think you were interested in this for some library stuff) closes #18432
2014-12-12auto merge of #19568 : barosl/rust/enum-struct-variants-ice, r=alexcrichtonbors-7/+15
This pull request tries to fix #19340, which states two ICE cases related to enum struct variants. It is my first attempt to fix the compiler. I found this solution by trial and error, so the method used to fix the issue looks very hacky. Please review it, and direct me to find a better solution. I'm also to add test cases. Where should I put them? Maybe `src/test/run-pass/issue-19340.rs`?
2014-12-12Mostly non-behaviour-changing changes (style, etc.)Nick Cameron-1/+1
2014-12-12Fix ICE when a struct variant enum is imported from an external crateBarosl Lee-7/+15
Fixes the first case of #19340.
2014-12-10rustc: Fix `make install`Alex Crichton-3/+3
Move a few docblocks from 'ignore' to something that's not rust (e.g. 'text'). Closes #19678
2014-12-09auto merge of #19563 : alexcrichton/rust/issue-19501, r=pnkfelixbors-2/+36
One of the causes of #19501 was that the metadata on OSX was getting corrupted. For any one particular invocation of the compiler the metadata file inside of an rlib archive would have extra bytes appended to the end of it. These extra bytes end up confusing rbml and have it run off the end of the array (resulting in the out of bounds detected). This commit prepends the length of metadata to the start of the metadata to ensure that we always slice the precise amount that we want, and it also un-ignores the test from #19502. Closes #19501
2014-12-09rollup merge of #19614: steveklabnik/gh19599Alex Crichton-3/+3
Fixes #19599
2014-12-08rustc: Prepend a length to all metadataAlex Crichton-2/+36
One of the causes of #19501 was that the metadata on OSX was getting corrupted. For any one particular invocation of the compiler the metadata file inside of an rlib archive would have extra bytes appended to the end of it. These extra bytes end up confusing rbml and have it run off the end of the array (resulting in the out of bounds detected). This commit prepends the length of metadata to the start of the metadata to ensure that we always slice the precise amount that we want, and it also un-ignores the test from #19502. Closes #19501
2014-12-08librustc: Make `Copy` opt-in.Niko Matsakis-14/+33
This change makes the compiler no longer infer whether types (structures and enumerations) implement the `Copy` trait (and thus are implicitly copyable). Rather, you must implement `Copy` yourself via `impl Copy for MyType {}`. A new warning has been added, `missing_copy_implementations`, to warn you if a non-generic public type has been added that could have implemented `Copy` but didn't. For convenience, you may *temporarily* opt out of this behavior by using `#![feature(opt_out_copy)]`. Note though that this feature gate will never be accepted and will be removed by the time that 1.0 is released, so you should transition your code away from using it. This breaks code like: #[deriving(Show)] struct Point2D { x: int, y: int, } fn main() { let mypoint = Point2D { x: 1, y: 1, }; let otherpoint = mypoint; println!("{}{}", mypoint, otherpoint); } Change this code to: #[deriving(Show)] struct Point2D { x: int, y: int, } impl Copy for Point2D {} fn main() { let mypoint = Point2D { x: 1, y: 1, }; let otherpoint = mypoint; println!("{}{}", mypoint, otherpoint); } This is the backwards-incompatible part of #13231. Part of RFC #3. [breaking-change]
2014-12-07remove usage of notrust from the docsSteve Klabnik-3/+3
Fixes #19599
2014-12-06librustc: remove unnecessary `as_mut_slice` callsJorge Aparicio-1/+1
2014-12-06librustc: remove unnecessary `as_slice()` callsJorge Aparicio-9/+8
2014-12-04Move various data structures out of typeck and into ty.Niko Matsakis-4/+2
2014-12-03Replace `equiv` method calls with `==` operator sugarJorge Aparicio-9/+9
2014-11-30fix missed switch pointed out in review plus a few othersjfager-15/+9
2014-11-29Replace some verbose match statements with their `if let` equivalent.jfager-129/+95
No semantic changes, no enabling `if let` where it wasn't already enabled.
2014-11-26rollup merge of #19317: sfackler/xcrate-namespaceAlex Crichton-10/+0
The chunk of code in encoder.rs was at one point deleted, but must have come back in a rebase or something :( Closes #19293
2014-11-26Rote changes due to the fact that ast paths no longer carry this extraneous ↵Niko Matsakis-2/+1
bounds.
2014-11-25Fix xcrate enum namespacingSteven Fackler-10/+0
Closes #19293
2014-11-23auto merge of #19152 : alexcrichton/rust/issue-17863, r=aturonbors-20/+8
This commit is an implementation of [RFC 240][rfc] when applied to the standard library. It primarily deprecates the entirety of `string::raw`, `vec::raw`, `slice::raw`, and `str::raw` in favor of associated functions, methods, and other free functions. The detailed renaming is: * slice::raw::buf_as_slice => slice::from_raw_buf * slice::raw::mut_buf_as_slice => slice::from_raw_mut_buf * slice::shift_ptr => deprecated with no replacement * slice::pop_ptr => deprecated with no replacement * str::raw::from_utf8 => str::from_utf8_unchecked * str::raw::c_str_to_static_slice => str::from_c_str * str::raw::slice_bytes => deprecated for slice_unchecked (slight semantic diff) * str::raw::slice_unchecked => str.slice_unchecked * string::raw::from_parts => String::from_raw_parts * string::raw::from_buf_len => String::from_raw_buf_len * string::raw::from_buf => String::from_raw_buf * string::raw::from_utf8 => String::from_utf8_unchecked * vec::raw::from_buf => Vec::from_raw_buf All previous functions exist in their `#[deprecated]` form, and the deprecation messages indicate how to migrate to the newer variants. [rfc]: https://github.com/rust-lang/rfcs/blob/master/text/0240-unsafe-api-location.md [breaking-change] Closes #17863
2014-11-22std: Align `raw` modules with unsafe conventionsAlex Crichton-20/+8
This commit is an implementation of [RFC 240][rfc] when applied to the standard library. It primarily deprecates the entirety of `string::raw`, `vec::raw`, `slice::raw`, and `str::raw` in favor of associated functions, methods, and other free functions. The detailed renaming is: * slice::raw::buf_as_slice => slice::with_raw_buf * slice::raw::mut_buf_as_slice => slice::with_raw_mut_buf * slice::shift_ptr => deprecated with no replacement * slice::pop_ptr => deprecated with no replacement * str::raw::from_utf8 => str::from_utf8_unchecked * str::raw::c_str_to_static_slice => str::from_c_str * str::raw::slice_bytes => deprecated for slice_unchecked (slight semantic diff) * str::raw::slice_unchecked => str.slice_unchecked * string::raw::from_parts => String::from_raw_parts * string::raw::from_buf_len => String::from_raw_buf_len * string::raw::from_buf => String::from_raw_buf * string::raw::from_utf8 => String::from_utf8_unchecked * vec::raw::from_buf => Vec::from_raw_buf All previous functions exist in their `#[deprecated]` form, and the deprecation messages indicate how to migrate to the newer variants. [rfc]: https://github.com/rust-lang/rfcs/blob/master/text/0240-unsafe-api-location.md [breaking-change] Closes #17863
2014-11-21auto merge of #16552 : jauhien/rust/fix-libdir, r=alexcrichtonbors-5/+10
Fixies #11671 This commit changes default relative libdir 'lib' to a relative libdir calculated using LIBDIR provided by --libdir configuration option. In case if no option was provided behavior does not change.
2014-11-20Refactored new CodeExtent type for improved abstraction.Felix S. Klock II-7/+29
(Previously, statically identifiable scopes/regions were solely identified with NodeId's; this refactoring prepares for a future where that 1:1 correspondence does not hold.)
2014-11-19rustc: middle: remove obsolete ty::get.Eduard Burtescu-2/+2
2014-11-19rustc: fix fallout of adding the `'tcx` lifetime to `Ty`.Eduard Burtescu-150/+177
2014-11-19rustc: middle: rename `ty::t` to `Ty` and use it unqualified everywhere.Eduard Burtescu-14/+14
2014-11-19rustc: avoid `use`-ing `syntax::ast::*`.Eduard Burtescu-102/+101
2014-11-18auto merge of #18870 : barosl/rust/os-ioresult, r=alexcrichtonbors-1/+1
Make old-fashioned functions in the `std::os` module utilize `IoResult`. I'm still investigating the possibility to include more functions in this pull request. Currently, it covers `getcwd()`, `make_absolute()`, and `change_dir()`. The issues covered by this PR are #16946 and #16315. A few concerns: - Should we provide `OsError` in distinction from `IoError`? I'm saying this because in Python, those two are distinguished. One advantage that we keep using `IoError` is that we can make the error cascade down other functions whose return type also includes `IoError`. An example of such functions is `std::io::TempDir::new_in()`, which uses `os::make_absolute()` as well as returns `IoResult<TempDir>`. - `os::getcwd()` uses an internal buffer whose size is 2048 bytes, which is passed to `getcwd(3)`. There is no upper limitation of file paths in the POSIX standard, but typically it is set to 4096 bytes such as in Linux. Should we increase the buffer size? One thing that makes me nervous is that the size of 2048 bytes already seems a bit excessive, thinking that in normal cases, there would be no filenames that even exceeds 512 bytes. Fixes #16946. Fixes #16315. Any ideas are welcomed. Thanks!
2014-11-19Make os::getcwd() return IoResult<Path>Barosl Lee-1/+1
os::getcwd() panics if the current directory is not available. According to getcwd(3), there are three cases: - EACCES: Permission denied. - ENOENT: The current working directory has been removed. - ERANGE: The buffer size is less than the actual absolute path. This commit makes os::getcwd() return IoResult<Path>, not just Path, preventing it from panicking. As os::make_absolute() depends on os::getcwd(), it is also modified to return IoResult<Path>. Fixes #16946. [breaking-change]
2014-11-18Switch the code to use De Bruijn indices rather than binder-ids.Niko Matsakis-7/+4
2014-11-18Move trans, back, driver, and back into a new crate, rustc_trans. Reduces ↵Niko Matsakis-7/+6
memory usage significantly and opens opportunities for more parallel compilation.
2014-11-18rollup merge of #19000: IvanUkhov/doc-link-dylibJakub Bukaj-0/+2
Hello, `dylib` [seems][1] to be no longer an option for the `kind` key of the `link` attribute. UPDATE: It should be the other way around: It [seems][1] `dylib` has been lost as a possible variant of the `kind` key of the `link` attribute. See the comment below. Regards, Ivan [1]: https://github.com/rust-lang/rust/blob/8f8753878644b0bfb38d24781edb9ef2028730f2/src/librustc/metadata/creader.rs#L237
2014-11-17Fallout from deprecationAaron Turon-7/+6
This commit handles the fallout from deprecating `_with` and `_equiv` methods.
2014-11-17Bring back the dylib kind of the link attributeIvan Ukhov-0/+2
2014-11-17Switch to purely namespaced enumsSteven Fackler-0/+21
This breaks code that referred to variant names in the same namespace as their enum. Reexport the variants in the old location or alter code to refer to the new locations: ``` pub enum Foo { A, B } fn main() { let a = A; } ``` => ``` pub use self::Foo::{A, B}; pub enum Foo { A, B } fn main() { let a = A; } ``` or ``` pub enum Foo { A, B } fn main() { let a = Foo::A; } ``` [breaking-change]