about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2015-07-17Rollup merge of #25993 - nham:fix_23969, r=nikomatsakisManish Goregaokar-0/+78
Adds two error codes, one for duplicate associated constants and one for types. I'm not certain these should each have their own code, but E0201 is already solely for duplicate associated functions so at least it kinda matches. This will lead to somewhat redundant error explanations, but that's nothing new! Fixes #23969.
2015-07-16Fixup testManish Goregaokar-1/+1
2015-07-16Rollup merge of #27018 - arielb1:enum-update, r=eddybManish Goregaokar-0/+16
Fixes #26948. r? @eddyb
2015-07-16Rollup merge of #26988 - frewsxcv:regression-tests, r=alexcrichtonManish Goregaokar-0/+111
"body": null,
2015-07-16Rollup merge of #26819 - P1start:ref-suggestion, r=nikomatsakisManish Goregaokar-0/+33
The error now looks like this: ``` <anon>:4:9: 4:10 error: use of moved value: `x` [E0382] <anon>:4 foo(x); ^ <anon>:3:9: 3:10 note: `x` moved here because it has type `Box<i32>`, which is moved by default <anon>:3 let y = x; ^ <anon>:3:9: 3:10 help: use `ref` to take a reference instead: <anon>: let ref y = x; ```
2015-07-15Remove reference to gdb-pretty-struct-and-enums.rsTamir Duberstein-4/+0
It was removed in bba934f19ab26d5afc4f0be923ea699010883906. Fixes #27059.
2015-07-15Better detection of duplicate associated items.Nick Hamann-0/+78
Expands E0201 to be used for any duplicate associated items, not just duplicate methods/functions. It also correctly detects when two different kinds of items (like a constant and a method) have the same name. Fixes #23969.
2015-07-14don't ICE when FRU is used on an enum variantAriel Ben-Yehuda-0/+16
Fixes #26948.
2015-07-14Add regression test for #21140Corey Farwell-1/+18
Closes #21140
2015-07-13Auto merge of #26241 - SimonSapin:derefmut-for-string, r=alexcrichtonbors-18/+3
See https://github.com/rust-lang/rfcs/issues/1157
2015-07-13Fix tests for changes in #26241.Simon Sapin-18/+3
2015-07-13Auto merge of #27000 - alexcrichton:semi-after-type, r=cmrbors-0/+17
This commit expands the follow set of the `ty` and `path` macro fragments to include the semicolon token as well. A semicolon is already allowed after these tokens, so it's currently a little too restrictive to not have a semicolon allowed. For example: extern { fn foo() -> i32; // semicolon after type } fn main() { struct Foo; Foo; // semicolon after path }
2015-07-13Add regression tests for #23595Corey Farwell-0/+40
Closes #23595
2015-07-13Add regression test for #20544Corey Farwell-0/+27
Closes #20544
2015-07-13Add regression test for #22312Corey Farwell-0/+27
Closes #22312
2015-07-13Correctly detect reassignments to the interior of matched structs/tuplesBjörn Steinbrink-0/+19
If we match a whole struct or tuple, the "field" for the reassignment checker will be "None" which means that mutating any field should count as a reassignment. Fixes #26996.
2015-07-13Auto merge of #26910 - nrc:ice-lang-item, r=@huonwbors-0/+26
2015-07-13Auto merge of #26947 - nagisa:unicode-escape-error, r=nrcbors-3/+5
Inspired by the now-mysteriously-closed https://github.com/rust-lang/rust/pull/26782. This PR introduces better error messages when unicode escapes have invalid format (e.g. `\uFFFF`). It also makes rustc always tell the user that escape may not be used in byte-strings and bytes and fixes some spans to not include unecessary characters and include escape backslash in some others.
2015-07-13Don't ICE when missing owned_box lang itemNick Cameron-0/+26
Closes #20549
2015-07-12Auto merge of #26958 - alexcrichton:down-with-thread-dtors, r=brsonbors-0/+38
TLS tests have been deadlocking on the OSX bots for quite some time now and this commit is the result of the investigation into what's going on. It turns out that a value in TLS which is being destroyed (e.g. the destructor is run) can be reset back to the initial state **while the destructor is running** if TLS is re-accessed. To fix this we stop calling drop_in_place on OSX and instead move the data to a temporary location on the stack.
2015-07-13Tell unicode escapes can’t be used as bytes earlier/moreSimonas Kazlauskas-3/+5
2015-07-12syntax: Allow semi tokens after macro ty/pathAlex Crichton-0/+17
This commit expands the follow set of the `ty` and `path` macro fragments to include the semicolon token as well. A semicolon is already allowed after these tokens, so it's currently a little too restrictive to not have a semicolon allowed. For example: extern { fn foo() -> i32; // semicolon after type } fn main() { struct Foo; Foo; // semicolon after path }
2015-07-12std: Fix a TLS destructor bug on OSXAlex Crichton-0/+38
TLS tests have been deadlocking on the OSX bots for quite some time now and this commit is the result of the investigation into what's going on. It turns out that a value in TLS which is being destroyed (e.g. the destructor is run) can be reset back to the initial state **while the destructor is running** if TLS is re-accessed. To fix this we stop calling drop_in_place on OSX and instead move the data to a temporary location on the stack.
2015-07-11Suggest using `ref` inline in an errorP1start-0/+33
2015-07-10Change some instances of .connect() to .join()Wesley Wiser-3/+3
2015-07-10Improve incomplete unicode escape reportingSimonas Kazlauskas-1/+1
This improves diagnostic messages when \u escape is used incorrectly and { is missing. Instead of saying “unknown character escape: u”, it will now report that unicode escape sequence is incomplete and suggest what the correct syntax is.
2015-07-10Auto merge of #26907 - nrc:save-fns, r=brsonbors-0/+15
r? @huonw
2015-07-09Auto merge of #26904 - bluss:no-repeat, r=alexcrichtonbors-22/+12
In a followup to PR #26849, improve one more location for I/O where we can use `Vec::resize` to ensure better performance when zeroing buffers. Use the `vec![elt; n]` macro everywhere we can in the tree. It replaces `repeat(elt).take(n).collect()` which is more verbose, requires type hints, and right now produces worse code. `vec![]` is preferable for vector initialization. The `vec![]` replacement touches upon one I/O path too, Stdin::read for windows, and that should be a small improvement. r? @alexcrichton
2015-07-09Use vec![elt; n] where possibleUlrik Sverdrup-22/+12
The common pattern `iter::repeat(elt).take(n).collect::<Vec<_>>()` is exactly equivalent to `vec![elt; n]`, do this replacement in the whole tree. (Actually, vec![] is smart enough to only call clone n - 1 times, while the former solution would call clone n times, and this fact is virtually irrelevant in practice.)
2015-07-09Auto merge of #26515 - quantheory:check_enum_recursion, r=nrcbors-0/+24
Fixes #23302. Note that there's an odd situation regarding the following, most likely due to some inadequacy in `const_eval`: ```rust enum Y { A = 1usize, B, } ``` In this case, `Y::B as usize` might be considered a constant expression in some cases, but not others. (See #23513, for a related problem where there is only one variant, with no discriminant, and it doesn't behave nicely as a constant expression either.) Most of the complexity in this PR is basically future-proofing, to ensure that when `Y::B as usize` is fully made to be a constant expression, it can't be used to set `Y::A`, and thus indirectly itself.
2015-07-08Add comments about the checks for recursive variant definition, as requested ↵Sean Patrick Santos-0/+4
by @nrc.
2015-07-09Fix a span bug for qualified pathsNick Cameron-0/+15
2015-07-08Auto merge of #26869 - alexcrichton:fix-msvc-sepcomp, r=nrcbors-3/+103
This commit alters the implementation of multiple codegen units slightly to be compatible with the MSVC linker. Currently the implementation will take the N object files created by each codegen unit and will run `ld -r` to create a new object file which is then passed along. The MSVC linker, however, is not able to do this operation. The compiler will now no longer attempt to assemble object files together but will instead just pass through all the object files as usual. This implies that rlibs may not contain more than one object file (if the library is compiled with more than one codegen unit) and the output of `-C save-temps` will have changed slightly as object files with the extension `0.o` will not be renamed to `o` unless requested otherwise.
2015-07-08trans: Link rlibs to dylibs with --whole-archiveAlex Crichton-2/+102
This commit starts passing the `--whole-archive` flag (`-force_load` on OSX) to the linker when linking rlibs into dylibs. The primary purpose of this commit is to ensure that the linker doesn't strip out objects from an archive when creating a dynamic library. Information on how this can go wrong can be found in issues #14344 and #25185. The unfortunate part about passing this flag to the linker is that we have to preprocess the rlib to remove the metadata and compressed bytecode found within. This means that creating a dylib will now take longer to link as we've got to copy around the input rlibs to a temporary location, modify them, and then invoke the linker. This isn't done for executables, however, so the "hello world" compile time is not affected. This fix was instigated because of the previous commit where rlibs may not contain multiple object files instead of one due to codegen units being greater than one. That change prevented the main distribution from being compiled with more than one codegen-unit and this commit fixes that. Closes #14344 Closes #25185
2015-07-08this fixes the test failures on freebsdDave Huseby-0/+6
2015-07-08Auto merge of #26859 - arielb1:const-deref-again, r=eddybbors-0/+23
Fixes #25901 r? @eddyb
2015-07-07msvc: Get codegen-units workingAlex Crichton-1/+1
This commit alters the implementation of multiple codegen units slightly to be compatible with the MSVC linker. Currently the implementation will take the N object files created by each codegen unit and will run `ld -r` to create a new object file which is then passed along. The MSVC linker, however, is not able to do this operation. The compiler will now no longer attempt to assemble object files together but will instead just pass through all the object files as usual. This implies that rlibs may not contain more than one object file (if the library is compiled with more than one codegen unit) and the output of `-C save-temps` will have changed slightly as object files with the extension `0.o` will not be renamed to `o` unless requested otherwise.
2015-07-07Auto merge of #26747 - huonw:stability-issue, r=alexcrichtonbors-0/+41
This takes an issue number and points people to it in the printed error message. This commit does not make it an error to have no `issue` field.
2015-07-07mark user-defined derefs as non-constantAriel Ben-Yehuda-0/+23
Fixes #25901
2015-07-07Auto merge of #26699 - eddyb:unstable-prelude_import, r=huonwbors-1/+15
Closes #26690.
2015-07-06Rollup merge of #26807 - eddyb:trans-normalize, r=cmrSteve Klabnik-0/+15
Fixes #26805. f? @jroesch.
2015-07-06Auto merge of #26741 - alexcrichton:noinline-destructors, r=brsonbors-1/+2
This PR was originally going to be a "let's start running tests on MSVC" PR, but it didn't quite get to that point. It instead gets us ~80% of the way there! The steps taken in this PR are: * Landing pads are turned on by default for 64-bit MSVC. The LLVM support is "good enough" with the caveat the destructor glue is now marked noinline. This was recommended [on the associated bug](https://llvm.org/bugs/show_bug.cgi?id=23884) as a stopgap until LLVM has a better representation for exception handling in MSVC. The consequence of this is that MSVC will have a bit of a perf hit, but there are possible routes we can take if this workaround sticks around for too long. * The linker (`link.exe`) is now looked up in the Windows Registry if it's not otherwise available in the environment. This improves using the compiler outside of a VS shell (e.g. in a MSYS shell or in a vanilla cmd.exe shell). This also makes cross compiles via Cargo "just work" when crossing between 32 and 64 bit! * TLS destructors were fixed to start running on MSVC (they previously weren't running at all) * A few assorted `run-pass` tests were fixed. * The dependency on the `rust_builtin` library was removed entirely for MSVC to try to prevent any `cl.exe` compiled objects get into the standard library. This should help us later remove any dependence on the CRT by the standard library. * I re-added `rust_try_msvc_32.ll` for 32-bit MSVC and ensured that landing pads were turned off by default there as well. Despite landing pads being enabled, there are still *many* failing tests on MSVC. The two major classes I've identified so far are: * Spurious aborts. It appears that when optimizations are enabled that landing pads aren't always lined up properly, and sometimes an exception being thrown can't find the catch block down the stack, causing the program to abort. I've been working to reduce this test case but haven't been met with great success just yet. * Parallel codegen does not work on MSVC. Our current strategy is to take the N object files emitted by the N codegen threads and use `ld -r` to assemble them into *one* object file. The MSVC linker, however, does not have this ability, and this will need to be rearchitected to work on MSVC. I will fix parallel codegen in a future PR, and I'll also be watching LLVM closely to see if the aborts... disappear!
2015-07-06rustc: implement `unstable(issue = "nnn")`.Huon Wilson-0/+41
This takes an issue number and points people to it in the printed error message. This commit does not make it an error to have no `issue` field.
2015-07-06don't use type_parameter_def during astconvAriel Ben-Yehuda-0/+12
astconv is called when converting the type-parameter, which leads to a crash. Fixes #26812.
2015-07-05Auto merge of #26464 - Gankro:send, r=alexcrichtonbors-1/+0
Vec contains `Unique<T>` and some usizes, this is already derived.
2015-07-05Auto merge of #26473 - Eljay:missing_docs, r=alexcrichtonbors-0/+21
Fixes #24249 I've tagged all items that were missing docs to allow them to compile for now, the ones in core/num should probably be documented at least. This is also a breaking change for any crates using `#[deny(missing_docs)]` that have undocumented constants, not sure there is any way to avoid this without making it a separate lint?
2015-07-05rustc_trans: always use normalizing_infer_ctxt.Eduard Burtescu-0/+15
2015-07-05Feature-gate #[prelude_import].Eduard Burtescu-1/+15
2015-07-04Auto merge of #26694 - eddyb:method-nan, r=arielb1bors-0/+40
`MethodCallee` now has no information about the method, other than its `DefId`. The previous bits of information can be recovered as follows: ```rust let method_item = tcx.impl_or_trait_item(callee.def_id); let container = method_item.container(); ``` The method is inherent if `container` is a `ty::ImplContainer`: * the `impl` the method comes from is `container.id()` The method is a trait method if `container` is a `ty::TraitContainer: * the `trait` the method is part of is `container.id()` * a `ty::TraitRef` can be constructed by putting together: * `container.id()` as the `trait` ID * `callee.substs.clone().method_to_trait()` as the `trait` substs (including `Self`) * the above `trait_ref` is a valid `T: Trait<A, B, C>` predicate * selecting `trait_ref` could result in one of the following: * `traits::VtableImpl(data)`: static dispatch to `data.impl_def_id` * `traits::VtableObject(data)`: dynamic dispatch, with the vtable index: `traits::get_vtable_index_of_object_method(tcx, data, callee.def_id)` * other variants of `traits::Vtable`: various other `impl` sources
2015-07-04rustc: compute the vtable base of a supertrait during selection. Fixes #26339.Eduard Burtescu-0/+40