about summary refs log tree commit diff
path: root/src/librustc/metadata
AgeCommit message (Collapse)AuthorLines
2015-02-24rustc: load DefAssociatedTy from cross-crate metadata. Fixes #20542.Eduard Burtescu-17/+25
2015-02-24rustc: remove unused ForeignType item family.Eduard Burtescu-3/+1
2015-02-24syntax: don't use TraitRef in QPath.Eduard Burtescu-3/+2
2015-02-24syntax: don't store a secondary NodeId for TyPath.Eduard Burtescu-1/+1
2015-02-24Revert bogus rename from DefTrait to DefaultImpl.Eduard Burtescu-1/+1
2015-02-24Remove ty_open and treat Unsized lvalues as *Unsized.Eduard Burtescu-3/+0
2015-02-24Auto merge of #21689 - FlaPer87:oibit-send-and-friends, r=nikomatsakisbors-4/+31
This is one more step towards completing #13231 This series of commits add support for default trait implementations. The changes in this PR don't break existing code and they are expected to preserve the existing behavior in the compiler as far as built-in bounds checks go. The PR adds negative implementations of `Send`/`Sync` for some types and it removes the special cases for `Send`/`Sync` during the trait obligations checks. That is, it now fully relies on the traits check rather than lang items. Once this patch lands and a new snapshot is created, it'll be possible to add default impls for `Send` and `Sync` and remove entirely the use of `BuiltinBound::{BoundSend,BoundSync}` for positive implementations as well. This PR also removes the restriction on negative implementations. That is, it is now possible to add negative implementations for traits other than `Send`/`Sync`
2015-02-23Rollup merge of #22490 - nagisa:inline-args, r=alexcrichtonManish Goregaokar-10/+2
2015-02-23Rollup merge of #22664 - lfairy:just-say-no, r=alexcrichtonManish Goregaokar-0/+2
Leading hyphens already don't work (#22661), so no code should break from this change. Closes #22661.
2015-02-22Auto merge of #22466 - Kimundi:str_pattern_ai_safe, r=aturonbors-1/+1
This is not a complete implementation of the RFC: - only existing methods got updated, no new ones added - doc comments are not extensive enough yet - optimizations got lost and need to be reimplemented See https://github.com/rust-lang/rfcs/pull/528 Technically a [breaking-change]
2015-02-22Validate inline attribute argumentsSimonas Kazlauskas-10/+2
2015-02-22Disallow crate names with leading hyphensChris Wong-1/+3
Leading hyphens already don't work (#22661), so no code should break from this change. Closes #22661.
2015-02-22Rename DefTrait to DefaultImplFlavio Percoco-8/+8
2015-02-22look for default trait candidatesFlavio Percoco-0/+13
2015-02-22Fix fallout from libsyntax implementationFlavio Percoco-3/+17
2015-02-22Rollup merge of #22584 - alexcrichton:snapshots, r=GankroManish Goregaokar-42/+0
2015-02-20Register new snapshotsAlex Crichton-42/+0
2015-02-20Remove remaining uses of `[]`. This time I tried to use deref coercions ↵Niko Matsakis-73/+73
where possible.
2015-02-20Addressed PR commentsMarvin Löbel-1/+1
2015-02-18rollup merge of #22502: nikomatsakis/deprecate-bracket-bracketAlex Crichton-18/+18
Conflicts: src/libcollections/slice.rs src/libcollections/str.rs src/librustc/middle/lang_items.rs src/librustc_back/rpath.rs src/librustc_typeck/check/regionck.rs src/libstd/ffi/os_str.rs src/libsyntax/diagnostic.rs src/libsyntax/parse/parser.rs src/libsyntax/util/interner.rs src/test/run-pass/regions-refcell.rs
2015-02-18Replace all uses of `&foo[]` with `&foo[..]` en masse.Niko Matsakis-18/+18
2015-02-18rollup merge of #22482: alexcrichton/cstr-changesAlex Crichton-1/+1
This commit is an implementation of [RFC 592][r592] and [RFC 840][r840]. These two RFCs tweak the behavior of `CString` and add a new `CStr` unsized slice type to the module. [r592]: https://github.com/rust-lang/rfcs/blob/master/text/0592-c-str-deref.md [r840]: https://github.com/rust-lang/rfcs/blob/master/text/0840-no-panic-in-c-string.md The new `CStr` type is only constructable via two methods: 1. By `deref`'ing from a `CString` 2. Unsafely via `CStr::from_ptr` The purpose of `CStr` is to be an unsized type which is a thin pointer to a `libc::c_char` (currently it is a fat pointer slice due to implementation limitations). Strings from C can be safely represented with a `CStr` and an appropriate lifetime as well. Consumers of `&CString` should now consume `&CStr` instead to allow producers to pass in C-originating strings instead of just Rust-allocated strings. A new constructor was added to `CString`, `new`, which takes `T: IntoBytes` instead of separate `from_slice` and `from_vec` methods (both have been deprecated in favor of `new`). The `new` method returns a `Result` instead of panicking. The error variant contains the relevant information about where the error happened and bytes (if present). Conversions are provided to the `io::Error` and `old_io::IoError` types via the `FromError` trait which translate to `InvalidInput`. This is a breaking change due to the modification of existing `#[unstable]` APIs and new deprecation, and more detailed information can be found in the two RFCs. Notable breakage includes: * All construction of `CString` now needs to use `new` and handle the outgoing `Result`. * Usage of `CString` as a byte slice now explicitly needs a `.as_bytes()` call. * The `as_slice*` methods have been removed in favor of just having the `as_bytes*` methods. Closes #22469 Closes #22470 [breaking-change]
2015-02-18rollup merge of #22480: alexcrichton/hashv3Alex Crichton-0/+42
This commit is an implementation of [RFC 823][rfc] which is another pass over the `std::hash` module for stabilization. The contents of the module were not entirely marked stable, but some portions which remained quite similar to the previous incarnation are now marked `#[stable]`. Specifically: [rfc]: https://github.com/rust-lang/rfcs/blob/master/text/0823-hash-simplification.md * `std::hash` is now stable (the name) * `Hash` is now stable * `Hash::hash` is now stable * `Hasher` is now stable * `SipHasher` is now stable * `SipHasher::new` and `new_with_keys` are now stable * `Hasher for SipHasher` is now stable * Many `Hash` implementations are now stable All other portions of the `hash` module remain `#[unstable]` as they are less commonly used and were recently redesigned. This commit is a breaking change due to the modifications to the `std::hash` API and more details can be found on the [RFC][rfc]. Closes #22467 [breaking-change]
2015-02-18std: Implement CString-related RFCsAlex Crichton-1/+1
This commit is an implementation of [RFC 592][r592] and [RFC 840][r840]. These two RFCs tweak the behavior of `CString` and add a new `CStr` unsized slice type to the module. [r592]: https://github.com/rust-lang/rfcs/blob/master/text/0592-c-str-deref.md [r840]: https://github.com/rust-lang/rfcs/blob/master/text/0840-no-panic-in-c-string.md The new `CStr` type is only constructable via two methods: 1. By `deref`'ing from a `CString` 2. Unsafely via `CStr::from_ptr` The purpose of `CStr` is to be an unsized type which is a thin pointer to a `libc::c_char` (currently it is a fat pointer slice due to implementation limitations). Strings from C can be safely represented with a `CStr` and an appropriate lifetime as well. Consumers of `&CString` should now consume `&CStr` instead to allow producers to pass in C-originating strings instead of just Rust-allocated strings. A new constructor was added to `CString`, `new`, which takes `T: IntoBytes` instead of separate `from_slice` and `from_vec` methods (both have been deprecated in favor of `new`). The `new` method returns a `Result` instead of panicking. The error variant contains the relevant information about where the error happened and bytes (if present). Conversions are provided to the `io::Error` and `old_io::IoError` types via the `FromError` trait which translate to `InvalidInput`. This is a breaking change due to the modification of existing `#[unstable]` APIs and new deprecation, and more detailed information can be found in the two RFCs. Notable breakage includes: * All construction of `CString` now needs to use `new` and handle the outgoing `Result`. * Usage of `CString` as a byte slice now explicitly needs a `.as_bytes()` call. * The `as_slice*` methods have been removed in favor of just having the `as_bytes*` methods. Closes #22469 Closes #22470 [breaking-change]
2015-02-18std: Stabilize the `hash` moduleAlex Crichton-0/+42
This commit is an implementation of [RFC 823][rfc] which is another pass over the `std::hash` module for stabilization. The contents of the module were not entirely marked stable, but some portions which remained quite similar to the previous incarnation are now marked `#[stable]`. Specifically: [rfc]: https://github.com/rust-lang/rfcs/blob/master/text/0823-hash-simplification.md * `std::hash` is now stable (the name) * `Hash` is now stable * `Hash::hash` is now stable * `Hasher` is now stable * `SipHasher` is now stable * `SipHasher::new` and `new_with_keys` are now stable * `Hasher for SipHasher` is now stable * Many `Hash` implementations are now stable All other portions of the `hash` module remain `#[unstable]` as they are less commonly used and were recently redesigned. This commit is a breaking change due to the modifications to the `std::hash` API and more details can be found on the [RFC][rfc]. Closes #22467 [breaking-change]
2015-02-18Opt for .cloned() over .map(|x| x.clone()) etc.Kevin Butler-3/+2
2015-02-17Rollup merge of #22241 - kmcallister:macro-plugin-cleanup, r=sfacklerManish Goregaokar-47/+216
2015-02-16Auto merge of #22230 - nikomatsakis:object-lifetime-defaults-2, r=pnkfelixbors-1/+34
Implement rules described in rust-lang/rfcs#599. Fixes https://github.com/rust-lang/rust/issues/22211. ~~Based atop PR https://github.com/rust-lang/rust/pull/22182, so the first few commits (up to and including "Pacify the mercilous nrc") have already been reviewed.~~
2015-02-16Detect and store object-lifetime-defaults.Niko Matsakis-1/+34
2015-02-16rustc: qualify expressions in check_const for potential promotion.Eduard Burtescu-0/+1
2015-02-16rustc: use FromPrimitive for decoding astencode_tag.Eduard Burtescu-13/+1
2015-02-12Separate macro and plugin loadingKeegan McAllister-0/+187
Now they just share a bit of code internal to creader. Resolves #22198 to my satisfaction.
2015-02-12creader: Clean up macro/plugin APIKeegan McAllister-47/+29
Step towards #22198.
2015-02-12Pacify the merciless nrc.Niko Matsakis-4/+4
2015-02-12Update metadata to reflect that predicates/schemes/trait-defs are now severedNiko Matsakis-44/+73
2015-02-11rollup merge of #22197: alexcrichton/do-not-link-pluginsAlex Crichton-1/+1
2015-02-11rustc: Do not link to pluginsAlex Crichton-1/+1
This flag seems to have erroneously been set to `true`.
2015-02-11rollup merge of #22188: alexcrichton/envv2Alex Crichton-1/+1
This commit tweaks the interface of the `std::env` module to make it more ergonomic for common usage: * `env::var` was renamed to `env::var_os` * `env::var_string` was renamed to `env::var` * `env::args` was renamed to `env::args_os` * `env::args` was re-added as a panicking iterator over string values * `env::vars` was renamed to `env::vars_os` * `env::vars` was re-added as a panicking iterator over string values. This should make common usage (e.g. unicode values everywhere) more ergonomic as well as "the default". This is also a breaking change due to the differences of what's yielded from each of these functions, but migration should be fairly easy as the defaults operate over `String` which is a common type to use. [breaking-change]
2015-02-11std: Tweak the std::env OsString/String interfaceAlex Crichton-1/+1
This commit tweaks the interface of the `std::env` module to make it more ergonomic for common usage: * `env::var` was renamed to `env::var_os` * `env::var_string` was renamed to `env::var` * `env::args` was renamed to `env::args_os` * `env::args` was re-added as a panicking iterator over string values * `env::vars` was renamed to `env::vars_os` * `env::vars` was re-added as a panicking iterator over string values. This should make common usage (e.g. unicode values everywhere) more ergonomic as well as "the default". This is also a breaking change due to the differences of what's yielded from each of these functions, but migration should be fairly easy as the defaults operate over `String` which is a common type to use. [breaking-change]
2015-02-11Added DestructionScope variant to CodeExtent, representing the areaFelix S. Klock II-2/+17
immediately surrounding a node that is a terminating_scope (e.g. statements, looping forms) during which the destructors run (the destructors for temporaries from the execution of that node, that is). Introduced DestructionScopeData newtype wrapper around ast::NodeId, to preserve invariant that FreeRegion and ScopeChain::BlockScope carry destruction scopes (rather than arbitrary CodeExtents). Insert DestructionScope and block Remainder into enclosing CodeExtents hierarchy. Add more doc for DestructionScope, complete with ASCII art. Switch to constructing DestructionScope rather than Misc in a number of places, mostly related to `ty::ReFree` creation, and use destruction-scopes of node-ids at various calls to liberate_late_bound_regions. middle::resolve_lifetime: Map BlockScope to DestructionScope in `fn resolve_free_lifetime`. Add the InnermostDeclaringBlock and InnermostEnclosingExpr enums that are my attempt to clarify the region::Context structure, and that later commmts build upon. Improve the debug output for `CodeExtent` attached to `ty::Region::ReScope`. Loosened an assertion in `rustc_trans::trans::cleanup` to account for `DestructionScope`. (Perhaps this should just be switched entirely over to `DestructionScope`, rather than allowing for either `Misc` or `DestructionScope`.) ---- Even though the DestructionScope is new, this particular commit should not actually change the semantics of any current code.
2015-02-09Use a crate attribute to load pluginsKeegan McAllister-4/+4
#[plugin] #[no_link] extern crate bleh; becomes a crate attribute #![plugin(bleh)] The feature gate is still required. It's almost never correct to link a plugin into the resulting library / executable, because it will bring all of libsyntax and librustc with it. However if you really want this behavior, you can get it with a separate `extern crate` item in addition to the `plugin` attribute. Fixes #21043. Fixes #20769. [breaking-change]
2015-02-08Auto merge of #21999 - tomjakubowski:rustdoc-fixes, r=alexcrichtonbors-1/+2
r? @alexcrichton
2015-02-07Auto merge of #22023 - alexcrichton:oops-picked-the-wrong-plugin, r=nikomatsakisbors-9/+3
The compiler would previously fall back to using `-L` and normal lookup paths if a `--extern` path was specified but it did not match (wrong architecture, for example). This commit removes this behavior and forces the hand of the crate loader to *always* use the `--extern` path if specified, no matter whether it is correct or not. This fixes a bug today where the compiler's own libraries are favored in cross compilation by accident. For example when a crate using the crates.io version of `log` was cross compiled, Cargo would compile `log` for the target architecture. When loading the macros, however, the compiler currently favors using the *host* architecture (for plugins), and because the `--extern log=...` pointed at an rlib for the target architecture, that lookup failed. The crate loader then fell back on `-L` paths to find the compiler-used `log` crate (the wrong one!) and then a compile failure happened because the logging macros are slightly different.
2015-02-07Auto merge of #21978 - Potpourri:error-extern-crate-staticlib, r=alexcrichtonbors-5/+30
Add special error for this case and help message `please recompile this crate using --crate-type lib`, also list found candidates. See issue #14416 r? @alexcrichton
2015-02-07Auto merge of #21505 - GuillaumeGomez:interned_string, r=alexcrichtonbors-16/+16
It's in order to make the code more homogeneous.
2015-02-06rustc: Don't fall back to -L if using --externAlex Crichton-9/+3
The compiler would previously fall back to using `-L` and normal lookup paths if a `--extern` path was specified but it did not match (wrong architecture, for example). This commit removes this behavior and forces the hand of the crate loader to *always* use the `--extern` path if specified, no matter whether it is correct or not. This fixes a bug today where the compiler's own libraries are favored in cross compilation by accident. For example when a crate using the crates.io version of `log` was cross compiled, Cargo would compile `log` for the target architecture. When loading the macros, however, the compiler currently favors using the *host* architecture (for plugins), and because the `--extern log=...` pointed at an rlib for the target architecture, that lookup failed. The crate loader then fell back on `-L` paths to find the compiler-used `log` crate (the wrong one!) and then a compile failure happened because the logging macros are slightly different.
2015-02-06Auto merge of #21926 - mzabaluev:raw-lifetime, r=alexcrichtonbors-4/+4
New functions, `slice::from_raw_parts` and `slice::from_raw_parts_mut`, are added to implement the lifetime convention as agreed in rust-lang/rfcs#556. The functions `slice::from_raw_buf` and `slice::from_raw_mut_buf` are left deprecated for the time being. Holding back on changing the signature of `std::ffi::c_str_to_bytes` as consensus in rust-lang/rfcs#592 is building to replace it with a composition of other functions. Contribution to #21923.
2015-02-06Encode foreign function argument namesTom Jakubowski-1/+2
Fix #21917
2015-02-06Update to last version, remove "[]" as much as possibleGuillaumeGomez-5/+5
2015-02-06librustc has been updatedGuillaumeGomez-16/+16