summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2015-10-23add main fn to testNiko Matsakis-0/+2
2015-10-23fix bug in hir,identifiedNiko Matsakis-1/+1
2015-10-23improve Scope to print node-ids etcNiko Matsakis-1/+18
2015-10-23distinguish projections from the env/obj-types vs those fromNiko Matsakis-12/+93
trait definitions, and give prefence to the former. This is consistent with what we do for selection. It also works around a limitation that was leading to #28871.
2015-10-16check upvars in closures that are in staticsAriel Ben-Yehuda-1/+73
Fixes #27890 Fixes #28099 Fixes #28113
2015-10-16Warn on `pub extern crate`.Nick Cameron-5/+30
Temporary 'fix' for #26775
2015-10-16Make function pointers implement traits for up to 12 parametersManish Goregaokar-0/+7
(12 was chosen to be consistent with what we do for tuples) Fixes #28559
2015-10-16use the infcx tables to check if a closure is CopyAriel Ben-Yehuda-1/+33
Fixes #28550
2015-10-16don't crash when there are multiple conflicting implementations of DropAriel Ben-Yehuda-1/+23
Fixes #28568
2015-10-16remove the destructors tableAriel Ben-Yehuda-40/+28
Conflicts: src/librustc_lint/builtin.rs
2015-10-16show each object-safety violation onceAriel Ben-Yehuda-3/+45
different supertraits can suffer from the same object-safety violation, leading to duplication in the error message. Avoid it. Fixes #20692
2015-10-16deduplicate trait errors before they are displayedAriel Ben-Yehuda-40/+77
Because of type inference, duplicate obligations exist and cause duplicate errors. To avoid this, only display the first error for each (predicate,span). The inclusion of the span is somewhat bikesheddy, but *is* the more conservative option (it does not remove some instability, as duplicate obligations are ignored by `duplicate_set` under some inference conditions). Fixes #28098 cc #21528 (is it a dupe?)
2015-10-16rustc: Don't lint about isize/usize in FFIAlex Crichton-16/+10
This lint warning was originally intended to help against misuse of the old Rust `int` and `uint` types in FFI bindings where the Rust `int` was not equal to the C `int`. This confusion no longer exists (as Rust's types are now `isize` and `usize`), and as a result the need for this lint has become much less over time. Additionally, starting with [the RFC for libc][rfc] it's likely that `isize` and `usize` will be quite common in FFI bindings (e.g. they're the definition of `size_t` and `ssize_t` on many platforms). [rfc]: https://github.com/rust-lang/rfcs/pull/1291 This commit disables these lints to instead consider `isize` and `usize` valid types to have in FFI signatures.
2015-10-16Reject "+" and "-" when parsing floats.Robin Kruppe-1/+18
Fixes #29042
2015-10-01trans: Fix __imp_ creation for i686 MSVCAlex Crichton-3/+13
Turns out the symbol names are slightly different on 32-bit than on 64, so the prefix needs to be tweaked just a bit!
2015-10-01Removed unused parameter.Vadim Chugunov-5/+3
2015-10-01Converted test to rpass.Vadim Chugunov-10/+6
2015-10-01Fix dllimports of static data from rlibsVadim Chugunov-31/+105
2015-10-01VecDeque: Use power of two capacity even for zero sized typesUlrik Sverdrup-1/+40
VecDeque depends on using a power of two capacity. Use the largest possible power of two capacity for ZSTs.
2015-09-15Auto merge of #28263 - christopherdumas:add_help_E0118, r=nikomatsakisbors-1/+20
Contributing to the Rust error explanations. Should I also add a better error for it by default?
2015-09-15Auto merge of #28413 - arielb1:deduplication, r=eddybbors-286/+140
clean a few things discovered during my split_ty work r? @eddyb
2015-09-15Auto merge of #28407 - mmcco:master, r=alexcrichtonbors-1/+0
…e len is actually one more than the length of argv[0]. However, this is precarious and should probably be replaced with more robust logic.
2015-09-15Auto merge of #28406 - petrochenkov:primitive, r=eddybbors-2/+18
This was missing from https://github.com/rust-lang/rust/pull/27451 r? @eddyb
2015-09-15Auto merge of #28393 - arielb1:required-because-it-appears, r=nikomatsakisbors-41/+46
new error style: ``` path.rs:4:6: 4:7 error: the trait `core::marker::Sized` is not implemented for the type `[u8]` [E0277] path.rs:4 fn f(p: Path) {} ^ path.rs:4:6: 4:7 help: run `rustc --explain E0277` to see a detailed explanation path.rs:4:6: 4:7 note: `[u8]` does not have a constant size known at compile-time path.rs:4:6: 4:7 note: required because it appears within the type `std::sys::os_str::Slice` path.rs:4:6: 4:7 note: required because it appears within the type `std::ffi::os_str::OsStr` path.rs:4:6: 4:7 note: required because it appears within the type `std::path::Path` path.rs:4:6: 4:7 note: all local variables must have a statically known size path.rs:7:5: 7:36 error: the trait `core::marker::Send` is not implemented for the type `alloc::rc::Rc<()>` [E0277] path.rs:7 foo::<BTreeMap<Rc<()>, Rc<()>>>(); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ path.rs:7:5: 7:36 help: run `rustc --explain E0277` to see a detailed explanation path.rs:7:5: 7:36 note: `alloc::rc::Rc<()>` cannot be sent between threads safely path.rs:7:5: 7:36 note: required because it appears within the type `collections::btree::node::Node<alloc::rc::Rc<()>, alloc::rc::Rc<()>>` path.rs:7:5: 7:36 note: required because it appears within the type `collections::btree::map::BTreeMap<alloc::rc::Rc<()>, alloc::rc::Rc<()>>` path.rs:7:5: 7:36 note: required by `foo` error: aborting due to 2 previous errors ``` Fixes #21793 Fixes #23286 r? @nikomatsakis
2015-09-15Auto merge of #28268 - petrochenkov:fnptr, r=alexcrichtonbors-69/+71
Closes https://github.com/rust-lang/rust/issues/26082
2015-09-15Auto merge of #28395 - ebfull:fix-associated-item-resolution, r=arielb1bors-12/+94
Fixes #28344
2015-09-15Auto merge of #28351 - jonas-schievink:macro-bt, r=nrcbors-38/+56
The second commit in this PR will stop printing the macro definition site in backtraces, which cuts their length in half and increases readability (the definition site was only correct for local macros). The third commit will not print an invocation if the last one printed occurred at the same place (span). This will make backtraces caused by a self-recursive macro much shorter. (A possible alternative would be to capture the backtrace first, then limit it to a few frames at the start and end of the chain and print `...` inbetween. This would also work with multiple macros calling each other, which is not addressed by this PR - although the backtrace will still be halved) Example: ```rust macro_rules! m { ( 0 $($t:tt)* ) => ( m!($($t)*); ); () => ( fn main() {0} ); } m!(0 0 0 0 0 0 0 0 0 0 0 0 0 0 0); ``` On a semi-recent nightly, this yields: ``` test.rs:3:21: 3:22 error: mismatched types: expected `()`, found `_` (expected (), found integral variable) [E0308] test.rs:3 () => ( fn main() {0} ); ^ test.rs:1:1: 4:2 note: in expansion of m! test.rs:2:23: 2:34 note: expansion site test.rs:1:1: 4:2 note: in expansion of m! test.rs:2:23: 2:34 note: expansion site test.rs:1:1: 4:2 note: in expansion of m! test.rs:2:23: 2:34 note: expansion site test.rs:1:1: 4:2 note: in expansion of m! test.rs:2:23: 2:34 note: expansion site test.rs:1:1: 4:2 note: in expansion of m! test.rs:2:23: 2:34 note: expansion site test.rs:1:1: 4:2 note: in expansion of m! test.rs:2:23: 2:34 note: expansion site test.rs:1:1: 4:2 note: in expansion of m! test.rs:2:23: 2:34 note: expansion site test.rs:1:1: 4:2 note: in expansion of m! test.rs:2:23: 2:34 note: expansion site test.rs:1:1: 4:2 note: in expansion of m! test.rs:2:23: 2:34 note: expansion site test.rs:1:1: 4:2 note: in expansion of m! test.rs:2:23: 2:34 note: expansion site test.rs:1:1: 4:2 note: in expansion of m! test.rs:2:23: 2:34 note: expansion site test.rs:1:1: 4:2 note: in expansion of m! test.rs:2:23: 2:34 note: expansion site test.rs:1:1: 4:2 note: in expansion of m! test.rs:2:23: 2:34 note: expansion site test.rs:1:1: 4:2 note: in expansion of m! test.rs:2:23: 2:34 note: expansion site test.rs:1:1: 4:2 note: in expansion of m! test.rs:2:23: 2:34 note: expansion site test.rs:1:1: 4:2 note: in expansion of m! test.rs:6:1: 6:35 note: expansion site test.rs:3:21: 3:22 help: run `rustc --explain E0308` to see a detailed explanation error: aborting due to previous error ``` After this patch: ``` test.rs:3:21: 3:22 error: mismatched types: expected `()`, found `_` (expected (), found integral variable) [E0308] test.rs:3 () => ( fn main() {0} ); ^ test.rs:2:23: 2:34 note: in this expansion of m! test.rs:6:1: 6:35 note: in this expansion of m! test.rs:3:21: 3:22 help: run `rustc --explain E0308` to see a detailed explanation error: aborting due to previous error ```
2015-09-15Auto merge of #28274 - arielb1:split-ty, r=nikomatsakisbors-8432/+8697
That file got way too big for its own good. It could be split more - this is just a start. r? @nikomatsakis
2015-09-14Auto merge of #28256 - petrochenkov:conv, r=alexcrichtonbors-28/+101
This patch transforms functions of the form ``` fn f<Generic: AsRef<Concrete>>(arg: Generic) { let arg: &Concrete = arg.as_ref(); // Code using arg } ``` to the next form: ``` #[inline] fn f<Generic: AsRef<Concrete>>(arg: Generic) { fn f_inner(arg: &Concrete) { // Code using arg } f_inner(arg.as_ref()); } ``` Therefore, most of the code is concrete and not duplicated during monomorphisation (unless inlined) and only the tiny bit of conversion code is duplicated. This method was mentioned by @aturon in the Conversion Traits RFC (https://github.com/rust-lang/rfcs/blame/master/text/0529-conversion-traits.md#L249) and similar techniques are not uncommon in C++ template libraries. This patch goes to the extremes and applies the transformation even to smaller functions<sup>1</sup> for purity of the experiment. *Some of them can be rolled back* if considered too ridiculous. <sup>1</sup> However who knows how small are these functions are after inlining and everything. The functions in question are mostly `fs`/`os` functions and not used especially often with variety of argument types, so the code size reduction is rather small (but consistent). Here are the sizes of stage2 artifacts before and after the patch: https://gist.github.com/petrochenkov/e76a6b280f382da13c5d https://gist.github.com/petrochenkov/6cc28727d5256dbdfed0 Note: All the `inner` functions are concrete and unavailable for cross-crate inlining, some of them may need `#[inline]` annotations in the future. r? @aturon
2015-09-14Remove a needless memset(). It's okay that we don't append NUL because len ↵Michael McConville-1/+0
is actually one more than the length of argv[0]. However, this is precarious and should probably be replaced with more robust logic.
2015-09-15Prohibit renaming to primitive types' names in import listsVadim Petrochenkov-2/+18
2015-09-15deduplicate erase_regionsAriel Ben-Yehuda-269/+133
there is no need for 3 versions of the function
2015-09-14Auto merge of #28247 - christopherdumas:fix_28243, r=eddybbors-1/+17
as per #28243.
2015-09-14Auto merge of #28403 - sfackler:timeout-cap-removal, r=alexcrichtonbors-4/+0
Windows's scheduler apparently has "problems" unblocking calls in the asked for time period.
2015-09-14Drop upper bounds on net timeout testsSteven Fackler-4/+0
Windows's scheduler apparently has "problems" unblocking calls in the asked for time period.
2015-09-14Auto merge of #28248 - PeterReid:master, r=alexcrichtonbors-15/+27
Overflows in integer pow() computations would be missed if they preceded a 0 bit of the exponent being processed. This made calls such as 2i32.pow(1024) not trigger an overflow. Fixes #28012
2015-09-14Fix tuple float bug.christopherdumas-1/+17
2015-09-14Print the file in which a macro was definedJonas Schievink-5/+14
2015-09-14use RegionEscape instead of inherent has_escaping_regions fnsAriel Ben-Yehuda-17/+7
2015-09-14split ty::util and ty::adjustmentAriel Ben-Yehuda-1320/+1387
2015-09-14Auto merge of #28358 - dotdash:nounwind, r=alexcrichtonbors-11/+45
This allows to skip the codegen for all the unneeded landing pads, reducing code size across the board by about 2-5%, depending on the crate. Compile times seem to be pretty unaffected though :-/
2015-09-14move traits structural impls to traits::structural_implsAriel Ben-Yehuda-226/+238
2015-09-14Mark all extern functions as nounwindBjörn Steinbrink-0/+33
Unwinding across an FFI boundary is undefined behaviour, so we can mark all external function as nounwind. The obvious exception are those functions that actually perform the unwinding.
2015-09-14split ty.rs into smaller partsAriel Ben-Yehuda-4071/+4271
2015-09-14Auto merge of #28389 - aidanhs:aphs-update-musl-linking, r=steveklabnikbors-17/+14
In addition to instruction updates I - changed from wget to curl, because curl is a prerequisite of rust itself - removed `[...]` because they're missing from so many places it would just obscure the instructions if they were all put in r? @steveklabnik
2015-09-14Cleaner abstraction for type_substsSean Bowe-28/+43
2015-09-14move middle::ty and related modules to middle/ty/Ariel Ben-Yehuda-154/+140
2015-09-14Auto merge of #28396 - arielb1:misplaced-binding, r=eddybbors-33/+66
Technically a [breaking-change], but the broken code is useless, like `i32<Param=()>`. Fixes #24682 r? @eddyb
2015-09-14Auto merge of #28392 - arielb1:sort-bounds-list, r=eddybbors-11/+59
The sort key is a (DefId, Name), which is *not* stable between runs, so we must re-sort when loading. Fixes #24063 Fixes #25467 Fixes #27222 Fixes #28377 r? @eddyb
2015-09-13Added test for partially supplied type params in which remaining reference ↵Sean Bowe-0/+2
non-existant self