about summary refs log tree commit diff
path: root/src/librustc
AgeCommit message (Collapse)AuthorLines
2013-09-25rustdoc: Linkify all reexports.Alex Crichton-0/+28
This way each component of a reexport path is click-able to the destination that it's referencing.
2013-09-25rustdoc: Change all code-blocks with a scriptAlex Crichton-1/+1
find src -name '*.rs' | xargs sed -i '' 's/~~~.*{\.rust}/```rust/g' find src -name '*.rs' | xargs sed -i '' 's/ ~~~$/ ```/g' find src -name '*.rs' | xargs sed -i '' 's/^~~~$/ ```/g'
2013-09-25auto merge of #9491 : thestinger/rust/noreturn, r=huonwbors-0/+6
Closes #9317
2013-09-25auto merge of #9492 : pnkfelix/rust/fsk-syntax-visit-refactor-remainder, r=huonwbors-259/+250
r? anyone Part of #7081. Removed many unnecessary context arguments, turning them into visitors. Removed some @allocation. If this lands, then I think the only thing left that is unaddressed are: * the various lint visitors, and * middle/privacy.rs, which has `impl<'self> Visitor<&'self method_map> for PrivacyVisitor`
2013-09-25Fold env into CheckItemRecursionVisitor.Felix S. Klock II-15/+17
2013-09-25Fold ErrorCheckVisitor into Liveness. Removed some @allocation.Felix S. Klock II-35/+31
2013-09-25Fold KindAnalysisVisitor into the Context. Removed unused current_item state.Felix S. Klock II-45/+38
2013-09-25Move unchanging portions of Context over to the Visitor.Felix S. Klock II-67/+70
2013-09-25Move unchanging portions of context over to the Visitor.Felix S. Klock II-37/+32
2013-09-25Fold context into CalleeTranslationVisitor.Felix S. Klock II-11/+12
2013-09-25Fold context into TransItemVisitor.Felix S. Klock II-12/+14
2013-09-25Fold type_use.rs Context into its Visitor.Felix S. Klock II-21/+18
2013-09-25Move the linearly-updated flag state into the Visitor.Felix S. Klock II-16/+18
2013-09-25add `noreturn` attribute to functions returning !Daniel Micay-0/+6
Closes #9317
2013-09-25auto merge of #9432 : alexcrichton/rust/correct-item-visibility, r=pcwaltonbors-84/+226
This fixes private statics and functions from being usable cross-crates, along with some bad privacy error messages. This is a reopening of #8365 with all the privacy checks in privacy.rs instead of resolve.rs (where they should be anyway). These maps of exported items will hopefully get used for generating documentation by rustdoc Closes #8592
2013-09-24auto merge of #9480 : brson/rust/noexit, r=thestingerbors-3/+4
This can cause unexpected errors in the runtime when done while scheduler threads are still initializing. Required some restructuring of the main_args functions in our libraries.
2013-09-24auto merge of #9470 : luqmana/rust/bba, r=brsonbors-3/+1
#8431 ~~@brson: do we need to bump up the cratemap version for this change?~~ Tis a no.
2013-09-24Remove the annihilate function from the crate map. Fixes #8431Luqman Aden-3/+1
2013-09-24Don't use libc::exit. #9473Brian Anderson-3/+4
This can cause unexpected errors in the runtime when done while scheduler threads are still initializing. Required some restructuring of the main_args functions in our libraries.
2013-09-24mark functions internal if not building a libraryDaniel Micay-18/+19
the entry point is wrapped with what should be the only public function
2013-09-24Correctly encode item visibility in metadataAlex Crichton-84/+226
This fixes private statics and functions from being usable cross-crates, along with some bad privacy error messages. This is a reopening of #8365 with all the privacy checks in privacy.rs instead of resolve.rs (where they should be anyway). These maps of exported items will hopefully get used for generating documentation by rustdoc Closes #8592
2013-09-24auto merge of #9463 : ↵bors-111/+101
pnkfelix/rust/fsk-syntax-visit-refactor-rest-of-typeck, r=huonw r? anyone Also got rid of a bit of `@mut` allocation. (Though not the monster that is `@mut FnCtxt`; that case is documented already on #7081; if we attack it, it will probably be its own ticket, not part of #7081.)
2013-09-24Part of #7081: Fold remainder of typeck's visit env into their visitor structs.Felix S. Klock II-111/+101
2013-09-24auto merge of #9453 : pnkfelix/rust/fsk-further-syntax-visit-refactors, ↵bors-144/+123
r=alexcrichton r? anyone. Part of #7081. More refactorings of the syntax::visit::Visitor implementations, folding so-called "environments" into the visitor impl when the latter was previously a trivial unit struct. As usual, this refactoring only applies when the environments are not actually carrying state that is meant to be pushed and popped as we traverse the expression. (For an example where the environment *isn't* just passed through, see the `visit_fn` in `liveness.rs`.) Got rid of a bit of @-allocation in borrowck. Both cases should be pure-refactorings.
2013-09-24visit::Visitor refactor: fold moves.rs VisitContext into ComputeModesVisitor.Felix S. Klock II-108/+90
2013-09-23librustc: Fix merge fallout.Patrick Walton-131/+199
2013-09-23test: Fix rustdoc and tests.Patrick Walton-4/+12
2013-09-23librustc: Remove `@fn` managed closures from the language.Patrick Walton-57/+35
2013-09-23librustc: Change the ID visitor to use traits instead of garbage-collected ↵Patrick Walton-23/+48
functions.
2013-09-23librustc: Remove the remaining direct uses of `@fn` from librustc.Patrick Walton-26/+40
2013-09-23librustc: Remove garbage-collected functions from util/common.Patrick Walton-12/+16
2013-09-23librustc: Don't use garbage-collected closures to store cleanups.Patrick Walton-24/+121
2013-09-23librustc: Make the fall-through case in match not use garbage collected ↵Patrick Walton-26/+76
functions
2013-09-23librustc: Port the pretty printer annotation infrastructure to use traits ↵Patrick Walton-80/+114
instead of garbage collected functions.
2013-09-23librustc: Remove garbage collected functions from front/{config,test} and ↵Patrick Walton-62/+59
metadata/{tydecode,tyencode}
2013-09-23librustc: Change fold to use traits instead of `@fn`.Patrick Walton-228/+282
2013-09-24visit::Visitor refactor: replace (&mut BorrowckVisitor, @BorrowckCtxt) with ↵Felix S. Klock II-36/+33
&mut BorrowckCtxt.
2013-09-23auto merge of #9301 : luqmana/rust/ncm, r=brsonbors-16/+38
Get rid of the crate_map arg! r? @brson
2013-09-23Find the cratemap at runtime on windows.Luqman Aden-1/+28
2013-09-21Update version numbers to 0.8Brian Anderson-3/+3
2013-09-20auto merge of #9350 : ↵bors-0/+15
pnkfelix/rust/fsk-issue-4691-catch-bad-fsu-during-compute-moves, r=nikomatsakis Resolves third bullet of #4691: if the functional-struct-update (FSU) expression `{ a: b, ..s }` causes `s` to move and `s` has a destructor, then the expression is illegal. r? @nikomatsakis
2013-09-20auto merge of #9332 : eugals/rust/master, r=alexcrichtonbors-31/+50
It is intended to optimize/beautify the code generated in a few trivial trait operations. Let's take the following code as an example: ``` trait Stuff { fn bar(&self); } fn callBar(s: &Stuff) { s.bar(); } struct Foo; impl Stuff for Foo { fn bar(&self) { } } pub fn main() { let o = Foo; callBar(&o as &Stuff); } ``` At present it is translated into something like: ``` define void @_ZN7callBar_UUID.0E({ i32, %tydesc*, i8*, i8*, i8 }*, { %tydesc*, i8* }*) #4 { "function top level": %__trait_callee = alloca { %tydesc*, i8* } %__auto_borrow_obj = alloca { %tydesc*, i8* } %2 = getelementptr inbounds { %tydesc*, i8* }* %1, i32 0, i32 0 %3 = load %tydesc** %2 %4 = getelementptr inbounds { %tydesc*, i8* }* %__auto_borrow_obj, i32 0, i32 0 store %tydesc* %3, %tydesc** %4 %5 = getelementptr inbounds { %tydesc*, i8* }* %1, i32 0, i32 1 %6 = load i8** %5 %7 = getelementptr inbounds { %tydesc*, i8* }* %__auto_borrow_obj, i32 0, i32 1 store i8* %6, i8** %7 %8 = bitcast { %tydesc*, i8* }* %__auto_borrow_obj to i8* %9 = bitcast { %tydesc*, i8* }* %__trait_callee to i8* call void @llvm.memcpy.p0i8.p0i8.i32(i8* %9, i8* %8, i32 8, i32 4, i1 false) %10 = getelementptr inbounds { %tydesc*, i8* }* %__trait_callee, i32 0, i32 1 %11 = load i8** %10 %12 = bitcast i8* %11 to { i32, %tydesc*, i8*, i8*, i8 }* %13 = getelementptr inbounds { %tydesc*, i8* }* %__trait_callee, i32 0, i32 0 %14 = bitcast %tydesc** %13 to [1 x i8*]** %15 = load [1 x i8*]** %14 %16 = getelementptr inbounds [1 x i8*]* %15, i32 0, i32 1 %17 = load i8** %16 %18 = bitcast i8* %17 to void ({ i32, %tydesc*, i8*, i8*, i8 }*)* call void %18({ i32, %tydesc*, i8*, i8*, i8 }* %12) ret void } ... define void @_ZN4main_UUID.0E({ i32, %tydesc*, i8*, i8*, i8 }*) #4 { "function top level": %o = alloca %struct.Foo %1 = alloca { %tydesc*, i8* } %__auto_borrow_obj = alloca { %tydesc*, i8* } %2 = getelementptr inbounds { %tydesc*, i8* }* %1, i32 0, i32 1 %3 = bitcast i8** %2 to %struct.Foo** store %struct.Foo* %o, %struct.Foo** %3 %4 = getelementptr inbounds { %tydesc*, i8* }* %1, i32 0, i32 0 %5 = bitcast %tydesc** %4 to { %tydesc*, void ({ i32, %tydesc*, i8*, i8*, i8 }*)* }** store { %tydesc*, void ({ i32, %tydesc*, i8*, i8*, i8 }*)* }* @vtable1081, { %tydesc*, void ({ i32, %tydesc*, i8*, i8*, i8 }*)* }** %5 %6 = getelementptr inbounds { %tydesc*, i8* }* %1, i32 0, i32 0 %7 = load %tydesc** %6 %8 = getelementptr inbounds { %tydesc*, i8* }* %__auto_borrow_obj, i32 0, i32 0 store %tydesc* %7, %tydesc** %8 %9 = getelementptr inbounds { %tydesc*, i8* }* %1, i32 0, i32 1 %10 = load i8** %9 %11 = getelementptr inbounds { %tydesc*, i8* }* %__auto_borrow_obj, i32 0, i32 1 store i8* %10, i8** %11 call void @_ZN7callBar_UUID.0E({ i32, %tydesc*, i8*, i8*, i8 }* undef, { %tydesc*, i8* }* %__auto_borrow_obj) ret void } ``` If you apply my patch, it would become way shorter and cleaner: ``` define void @_ZN7callBar_UUID.0E({ i32, %tydesc*, i8*, i8*, i8 }*, { %tydesc*, i8* }*) #4 { "function top level": %2 = getelementptr inbounds { %tydesc*, i8* }* %1, i32 0, i32 1 %3 = load i8** %2 %4 = bitcast i8* %3 to { i32, %tydesc*, i8*, i8*, i8 }* %5 = getelementptr inbounds { %tydesc*, i8* }* %1, i32 0, i32 0 %6 = bitcast %tydesc** %5 to [1 x i8*]** %7 = load [1 x i8*]** %6 %8 = getelementptr inbounds [1 x i8*]* %7, i32 0, i32 1 %9 = load i8** %8 %10 = bitcast i8* %9 to void ({ i32, %tydesc*, i8*, i8*, i8 }*)* call void %10({ i32, %tydesc*, i8*, i8*, i8 }* %4) ret void } ... define void @_ZN4main_UUID.0E({ i32, %tydesc*, i8*, i8*, i8 }*) #4 { "function top level": %o = alloca %struct.Foo %1 = alloca { %tydesc*, i8* } %2 = getelementptr inbounds { %tydesc*, i8* }* %1, i32 0, i32 1 %3 = bitcast i8** %2 to %struct.Foo** store %struct.Foo* %o, %struct.Foo** %3 %4 = getelementptr inbounds { %tydesc*, i8* }* %1, i32 0, i32 0 %5 = bitcast %tydesc** %4 to { %tydesc*, void ({ i32, %tydesc*, i8*, i8*, i8 }*)* }** store { %tydesc*, void ({ i32, %tydesc*, i8*, i8*, i8 }*)* }* @vtable1081, { %tydesc*, void ({ i32, %tydesc*, i8*, i8*, i8 }*)* }** %5 call void @_ZN7callBar_UUID.0E({ i32, %tydesc*, i8*, i8*, i8 }* undef, { %tydesc*, i8* }* %1) ret void } ``` Although this change doesn't increase the compilation speed much (I mentioned only about 1-2% boost on "rustc -O -Z time-passes syntax.rs"), but I still think it's a good thing to do as it greatly simplifies/clarifies LL generated in some cases which would definitely help in the future code generation investigations. I don't provide any new test cases in this patch as it is merely an optimization. Sorry guys, I somehow messed my previous PR and I don't see any better way to fix as to recreate it here.
2013-09-20auto merge of #9321 : chris-morgan/rust/lowercase-nan-methods, r=brsonbors-2/+2
This is for consistency in naming conventions. - ``std::num::Float::NaN()`` is changed to ``nan()``; - ``std::num::Float.is_NaN()`` is changed to ``is_nan()``; and - ``std::num::strconv::NumStrConv::NaN()`` is changed to ``nan()``. Fixes #9319.
2013-09-20auto merge of #9320 : ↵bors-5/+4
chris-morgan/rust/unreachable-macro-part-two-of-two-containing-the-destruction-of-the-unreachable-function, r=alexcrichton This is the second of two parts of #8991, now possible as a new snapshot has been made. (The first part implemented the unreachable!() macro; it was #8992, 6b7b8f2682.) ``std::util::unreachable()`` is removed summarily; any code which used it should now use the ``unreachable!()`` macro. Closes #9312. Closes #8991.
2013-09-20Resolves third bullet of #4691, and adds tests for it. Fix #4691.Felix S. Klock II-0/+15
2013-09-19auto merge of #9295 : alexcrichton/rust/fix-lang-items, r=thestingerbors-43/+42
Also add a test to help prevent this from getting out of sync again.
2013-09-19will not copy trait_callee on stack if it's source expr is a plain borrowed refU-NOV2010\eugals-6/+14
2013-09-19minor Type::opaque_trait code cleanupU-NOV2010\eugals-17/+6
2013-09-19optimized trans_to_datum::auto_borrow_obj code generation in case some ↵U-NOV2010\eugals-9/+31
trivial cases where simple copying can be applied
2013-09-19Rename the NaN and is_NaN methods to lowercase.Chris Morgan-2/+2
This is for consistency in naming conventions. - ``std::num::Float::NaN()`` is changed to ``nan()``; - ``std::num::Float.is_NaN()`` is changed to ``is_nan()``; and - ``std::num::strconv::NumStrConv::NaN()`` is changed to ``nan()``. Fixes #9319.