about summary refs log tree commit diff
path: root/src/librustc/front
AgeCommit message (Collapse)AuthorLines
2014-04-23Support unsized types with the `type` keywordNick Cameron-2/+2
2014-04-20rustc: feature gates errors should use the new attribute syntaxErick Tryzelaar-2/+2
2014-04-20Allow inheritance between structs.Nick Cameron-1/+15
No subtyping, no interaction with traits. Partially addresses #9912.
2014-04-18Replace all ~"" with "".to_owned()Richo Healey-2/+2
2014-04-14Use new attribute syntax in python files in src/etc too (#13478)Manish Goregaokar-2/+2
2014-04-13auto merge of #13471 : Ryman/rust/feature_syntax_error, r=brsonbors-1/+1
The current error message is misleading, it asks users to add `#[feature(..)]` which ends up being treated as an outer attribute, which then has no error unless `attribute_usage` lint is enforced. The code will still fail and the user might not understand why.
2014-04-12auto merge of #13461 : eddyb/rust/cleanup-at-fn, r=luqmanabors-2/+1
2014-04-12librustc: Improve error message for missing feature attributes.Kevin Butler-1/+1
2014-04-11rustc: fix fallout from removing ast::Sigil and use ty::TraitStore in ↵Eduard Burtescu-2/+1
ty::ClosureTy.
2014-04-11libtest: rename `BenchHarness` to `Bencher`Liigo Zhuang-1/+1
Closes #12640
2014-04-10rustc: Disallow importing through use statementsAlex Crichton-6/+8
Resolve is currently erroneously allowing imports through private `use` statements in some circumstances, even across module boundaries. For example, this code compiles successfully today: use std::c_str; mod test { use c_str::CString; } This should not be allowed because it was explicitly decided that private `use` statements are purely bringing local names into scope, they are not participating further in name resolution. As a consequence of this patch, this code, while valid today, is now invalid: mod test { use std::c_str; unsafe fn foo() { ::test::c_str::CString::new(0 as *u8, false); } } While plausibly acceptable, I found it to be more consistent if private imports were only considered candidates to resolve the first component in a path, and no others. Closes #12612
2014-04-08Register new snapshotsAlex Crichton-1/+1
2014-04-04syntax: remove obsolete mutability from ExprVec and ExprRepeat.Eduard Burtescu-11/+7
2014-04-04auto merge of #13301 : erickt/rust/remove-refcell-get, r=huonwbors-2/+2
`RefCell::get` can be a bit surprising, because it actually clones the wrapped value. This removes `RefCell::get` and replaces all the users with `RefCell::borrow()` when it can, and `RefCell::borrow().clone()` when it can't. It removes `RefCell::set` for consistency. This closes #13182. It also fixes an infinite loop in a test when debugging is on.
2014-04-04auto merge of #13295 : huonw/rust/gate-concat-idents, r=alexcrichtonbors-0/+7
rustc: feature-gate `concat_idents!`. concat_idents! is not as useful as it could be, due to macros only being allowed in limited places, and hygiene, so lets feature gate it until we make a decision about it. cc #13294
2014-04-04rustc: feature-gate `concat_idents!`.Huon Wilson-0/+7
concat_idents! is not as useful as it could be, due to macros only being allowed in limited places, and hygiene, so lets feature gate it until we make a decision about it. cc #13294
2014-04-03std: Remove `RefCell::get()`Erick Tryzelaar-2/+2
It's surprising that `RefCell::get()` is implicitly doing a clone on a value. This patch removes it and replaces all users with either `.borrow()` when we can autoderef, or `.borrow().clone()` when we cannot.
2014-04-03auto merge of #13296 : brson/rust/0.11-pre, r=alexcrichtonbors-1/+1
This also changes some of the download links in the documentation to 'nightly'.
2014-04-03auto merge of #13290 : alexcrichton/rust/rollup, r=alexcrichtonbors-1/+1
Closes #13285 (rustc: Stop using LLVMGetSectionName) Closes #13280 (std: override clone_from for Vec.) Closes #13277 (serialize: add a few missing pubs to base64) Closes #13275 (Add and remove some ignore-win32 flags) Closes #13273 (Removed managed boxes from libarena.) Closes #13270 (Minor copy-editing for the tutorial) Closes #13267 (fix Option<~ZeroSizeType>) Closes #13265 (Update emacs mode to support new `#![inner(attribute)]` syntax.) Closes #13263 (syntax: Remove AbiSet, use one Abi)
2014-04-03Bump version to 0.11-preBrian Anderson-1/+1
This also changes some of the download links in the documentation to 'nightly'.
2014-04-03auto merge of #13286 : alexcrichton/rust/release, r=brsonbors-1/+1
Merging the 0.10 release into the master branch.
2014-04-03syntax: Remove AbiSet, use one AbiAlex Crichton-1/+1
This change removes the AbiSet from the AST, converting all usage to have just one Abi value. The current scheme selects a relevant ABI given a list of ABIs based on the target architecture and how relevant each ABI is to that architecture. Instead of this mildly complicated scheme, only one ABI will be allowed in abi strings, and pseudo-abis will be created for special cases as necessary. For example the "system" abi exists for stdcall on win32 and C on win64. Closes #10049
2014-03-31rustc: Switch field privacy as necessaryAlex Crichton-1/+1
2014-03-31Bump version to 0.10Alex Crichton-1/+1
2014-03-31vec: convert `append` and `append_one` to methodsDaniel Micay-3/+2
These were only free functions on `~[T]` because taking self by-value used to be broken.
2014-03-29Use new inner attribute syntax in test frameworkSteven Fackler-3/+3
2014-03-28Convert most code to new inner attribute syntax.Brian Anderson-2/+2
Closes #2569
2014-03-22rustc: Fix fallout of removing get()Alex Crichton-18/+6
2014-03-21auto merge of #13016 : huonw/rust/new-opt-vec, r=cmrbors-6/+6
Replace syntax::opt_vec with syntax::owned_slice The `owned_slice::OwnedSlice` is `(*T, uint)` (i.e. a direct equivalent to DSTs `~[T]`). This shaves two words off the old OptVec type; and also makes substituting in other implementations easy, by removing all the mutation methods. (And also everything that's very rarely/never used.)
2014-03-22Migrate all users of opt_vec to owned_slice, delete opt_vec.Huon Wilson-6/+6
syntax::opt_vec is now entirely unused, and so can go.
2014-03-21rustc: Switch defaults from libgreen to libnativeAlex Crichton-13/+5
The compiler will no longer inject libgreen as the default runtime for rust programs, this commit switches it over to libnative by default. Now that libnative has baked for some time, it is ready enough to start getting more serious usage as the default runtime for rustc generated binaries. We've found that there isn't really a correct decision in choosing a 1:1 or M:N runtime as a default for all applications, but it seems that a larger number of programs today would work more reasonable with a native default rather than a green default. With this commit come a number of bugfixes: * The main native task is now named "<main>" * The main native task has the stack bounds set up properly * #[no_uv] was renamed to #[no_start] * The core-run-destroy test was rewritten for both libnative and libgreen and one of the tests was modified to be more robust. * The process-detach test was locked to libgreen because it uses signal handling
2014-03-20Removing imports of std::vec_ng::VecAlex Crichton-3/+0
It's now in the prelude.
2014-03-20rename std::vec_ng -> std::vecDaniel Micay-8/+8
Closes #12771
2014-03-20rename std::vec -> std::sliceDaniel Micay-1/+1
Closes #12702
2014-03-18rustc: test: don't silently ignore bad benchesCorey Richardson-5/+10
This is adequate because when a function has a type that isn't caught here, that is, it has a single argument, but it *isn't* `&mut BenchHarness`, it errors later on with: error: mismatched types: expected `fn(&mut test::BenchHarness)` but found `fn(int)` (expected &-ptr but found int) which I consider acceptable. Closes #12997
2014-03-17De-@ ParseSess uses.Eduard Burtescu-1/+1
2014-03-17De-@ Session usage.Eduard Burtescu-29/+29
2014-03-15auto merge of #12791 : alexcrichton/rust/liblog, r=brsonbors-0/+1
The rationale and modifications can be found in the first commit message. This does make logging a bit more painful to use initially because it involves a feature gate and some `phase` attributes, but I think it may be reasonable to not require the `phase` attribute for loading `macro_rules!` macros because defining them will still be gated.
2014-03-15log: Introduce liblog, the old std::loggingAlex Crichton-0/+1
This commit moves all logging out of the standard library into an external crate. This crate is the new crate which is responsible for all logging macros and logging implementation. A few reasons for this change are: * The crate map has always been a bit of a code smell among rust programs. It has difficulty being loaded on almost all platforms, and it's used almost exclusively for logging and only logging. Removing the crate map is one of the end goals of this movement. * The compiler has a fair bit of special support for logging. It has the __log_level() expression as well as generating a global word per module specifying the log level. This is unfairly favoring the built-in logging system, and is much better done purely in libraries instead of the compiler itself. * Initialization of logging is much easier to do if there is no reliance on a magical crate map being available to set module log levels. * If the logging library can be written outside of the standard library, there's no reason that it shouldn't be. It's likely that we're not going to build the highest quality logging library of all time, so third-party libraries should be able to provide just as high-quality logging systems as the default one provided in the rust distribution. With a migration such as this, the change does not come for free. There are some subtle changes in the behavior of liblog vs the previous logging macros: * The core change of this migration is that there is no longer a physical log-level per module. This concept is still emulated (it is quite useful), but there is now only a global log level, not a local one. This global log level is a reflection of the maximum of all log levels specified. The previously generated logging code looked like: if specified_level <= __module_log_level() { println!(...) } The newly generated code looks like: if specified_level <= ::log::LOG_LEVEL { if ::log::module_enabled(module_path!()) { println!(...) } } Notably, the first layer of checking is still intended to be "super fast" in that it's just a load of a global word and a compare. The second layer of checking is executed to determine if the current module does indeed have logging turned on. This means that if any module has a debug log level turned on, all modules with debug log levels get a little bit slower (they all do more expensive dynamic checks to determine if they're turned on or not). Semantically, this migration brings no change in this respect, but runtime-wise, this will have a perf impact on some code. * A `RUST_LOG=::help` directive will no longer print out a list of all modules that can be logged. This is because the crate map will no longer specify the log levels of all modules, so the list of modules is not known. Additionally, warnings can no longer be provided if a malformed logging directive was supplied. The new "hello world" for logging looks like: #[phase(syntax, link)] extern crate log; fn main() { debug!("Hello, world!"); }
2014-03-15Squash test ~[] warningSteven Fackler-0/+1
The use of `std::os::args` creates a deprecated_owned_vector warning with a bogus span.
2014-03-12Changed lists of lifetimes in ast and ty to use Vec instead of OptVec.Felix S. Klock II-4/+4
There is a broader revision (that does this across the board) pending in #12675, but that is awaiting the arrival of more data (to decide whether to keep OptVec alive by using a non-Vec internally). For this code, the representation of lifetime lists needs to be the same in both ScopeChain and in the ast and ty structures. So it seemed cleanest to just use `vec_ng::Vec`, now that it has a cheaper empty representation than the current `vec` code.
2014-03-11rustc: Support various flavors of linkagesAlex Crichton-0/+14
It is often convenient to have forms of weak linkage or other various types of linkage. Sadly, just using these flavors of linkage are not compatible with Rust's typesystem and how it considers some pointers to be non-null. As a compromise, this commit adds support for weak linkage to external symbols, but it requires that this is only placed on extern statics of type `*T`. Codegen-wise, we get translations like: // rust code extern { #[linkage = "extern_weak"] static foo: *i32; } // generated IR @foo = extern_weak global i32 @_some_internal_symbol = internal global *i32 @foo All references to the rust value of `foo` then reference `_some_internal_symbol` instead of the symbol `_foo` itself. This allows us to guarantee that the address of `foo` will never be null while the value may sometimes be null. An example was implemented in `std::rt::thread` to determine if `__pthread_get_minstack()` is available at runtime, and a test is checked in to use it for a static value as well. Function pointers a little odd because you still need to transmute the pointer value to a function pointer, but it's thankfully better than not having this capability at all.
2014-03-08librustc: Fix up fallout from the automatic conversion.Felix S. Klock II-4/+6
2014-03-08librustc: Automatically change uses of `~[T]` to `Vec<T>` in rustc.Patrick Walton-12/+12
2014-03-07rename ast::ViewItemExternMod to ast::ViewItemExternCrate, and ↵Liigo Zhuang-5/+5
clean::ExternMod to clean::ExternCrate
2014-03-06syntax: Conditionally deriving(Hash) with WritersAlex Crichton-1/+6
If #[feature(default_type_parameters)] is enabled for a crate, then deriving(Hash) will expand with Hash<W: Writer> instead of Hash<SipState> so more hash algorithms can be used.
2014-03-03Register new snapshotsAlex Crichton-18/+0
This should fix the travis builds.
2014-03-01librustc: Fix errors arising from the automated `~[T]` conversionPatrick Walton-50/+72
2014-02-26Replace callee_id with information stored in method_map.Eduard Burtescu-1/+1
2014-02-24Gate default type parameter overrides.Eduard Burtescu-0/+17
Fixes #12423.