about summary refs log tree commit diff
path: root/src/test/run-make
AgeCommit message (Collapse)AuthorLines
2014-09-21Move -Z lto to -C lto.Colin Davidson-4/+4
Closes #12443
2014-09-12Add regression test for #17186Brian Koropoff-0/+35
2014-09-07Added test for link path orderinginrustwetrust-0/+45
2014-09-05don't leave unwanted temporary files with --emit=ir/asmStuart Pernsteiner-5/+34
2014-09-05add tests for separate compilationStuart Pernsteiner-0/+149
2014-09-03Fix spelling errors and capitalization.Joseph Crail-2/+2
2014-08-30auto merge of #16419 : huonw/rust/pretty-expanded-hygiene, r=pnkfelixbors-0/+58
Different Identifiers and Names can have identical textual representations, but different internal representations, due to the macro hygiene machinery (syntax contexts and gensyms). This provides a way to see these internals by compiling with `--pretty expanded,hygiene`. This is useful for debugging & hacking on macros (e.g. diagnosing https://github.com/rust-lang/rust/issues/15750/https://github.com/rust-lang/rust/issues/15962 likely would've been faster with this functionality). E.g. ```rust #![feature(macro_rules)] // minimal junk #![no_std] macro_rules! foo { ($x: ident) => { y + $x } } fn bar() { foo!(x) } ``` ```rust #![feature(macro_rules)] // minimal junk #![no_std] fn bar /* 61#0 */() { y /* 60#2 */ + x /* 58#3 */ } ```
2014-08-30rustc: implement a pretty mode to print ident/name's ctxt & gensyms.Huon Wilson-0/+58
`--pretty expanded,hygiene` is helpful with debugging macro issues, since two identifiers/names can be textually the same, but different internally (resulting in weird "undefined variable" errors).
2014-08-29auto merge of #16767 : SiegeLord/rust/reexported_methods, r=cmrbors-0/+79
Previously, this caused methods of re-exported types to not be inserted into the search index. This fix may introduce some false positives, but in my testing they appear as orphaned methods and end up not being inserted into the final search index at a later stage. Fixes issue #11943
2014-08-27Implement generalized object and type parameter bounds (Fixes #16462)Niko Matsakis-559/+829
2014-08-26Add a simple test for rustdoc search index contentsSiegeLord-0/+79
2014-08-26Rebasing changesNick Cameron-2/+2
2014-08-26DST coercions and DST structsNick Cameron-27/+27
[breaking-change] 1. The internal layout for traits has changed from (vtable, data) to (data, vtable). If you were relying on this in unsafe transmutes, you might get some very weird and apparently unrelated errors. You should not be doing this! Prefer not to do this at all, but if you must, you should use raw::TraitObject rather than hardcoding rustc's internal representation into your code. 2. The minimal type of reference-to-vec-literals (e.g., `&[1, 2, 3]`) is now a fixed size vec (e.g., `&[int, ..3]`) where it used to be an unsized vec (e.g., `&[int]`). If you want the unszied type, you must explicitly give the type (e.g., `let x: &[_] = &[1, 2, 3]`). Note in particular where multiple blocks must have the same type (e.g., if and else clauses, vec elements), the compiler will not coerce to the unsized type without a hint. E.g., `[&[1], &[1, 2]]` used to be a valid expression of type '[&[int]]'. It no longer type checks since the first element now has type `&[int, ..1]` and the second has type &[int, ..2]` which are incompatible. 3. The type of blocks (including functions) must be coercible to the expected type (used to be a subtype). Mostly this makes things more flexible and not less (in particular, in the case of coercing function bodies to the return type). However, in some rare cases, this is less flexible. TBH, I'm not exactly sure of the exact effects. I think the change causes us to resolve inferred type variables slightly earlier which might make us slightly more restrictive. Possibly it only affects blocks with unreachable code. E.g., `if ... { fail!(); "Hello" }` used to type check, it no longer does. The fix is to add a semicolon after the string.
2014-08-24Adjust the error messages to match the pattern "expected foo, found bar"Jonas Hietala-1/+1
Closes #8492
2014-08-20librustc: handle repr on structs, require it for ffi, unify with packedCorey Richardson-1/+1
As of RFC 18, struct layout is undefined. Opting into a C-compatible struct layout is now down with #[repr(C)]. For consistency, specifying a packed layout is now also down with #[repr(packed)]. Both can be specified. To fix errors caused by this, just add #[repr(C)] to the structs, and change #[packed] to #[repr(packed)] Closes #14309 [breaking-change]
2014-08-19Add fix for test on windows.Luqman Aden-0/+2
2014-08-18Add test for passing/getting packed structs with ffi.Luqman Aden-0/+46
2014-08-18Remove workaround of #13793/#10872klutzy-5/+0
LLVM assertion error has been fixed recently: http://llvm.org/bugs/show_bug.cgi?id=18993 Fixes #13793
2014-08-15Properly canonicalize crate paths specified via --externBjörn Steinbrink-0/+63
Crates that are resolved normally have their path canonicalized and all symlinks resolved. This does currently not happen for paths specified using the --extern option to rustc, which can lead to rustc thinking that it encountered two different versions of a crate, when it's actually the same version found through different paths. To fix this, we must store the canonical path for crates found via --extern and also use the canonical path when comparing paths. Fixes #16496
2014-08-13rustc lexer: regression tests for embedded Idents.Felix S. Klock II-0/+72
I chose to make two of them because I wanted something close to an "end-to-end" test (*), but at the same time I wanted a test that would run on Windows (**). (*) The run-make test serves as the end-to-end: It constructs an input that is trying to subvert the hack and we are going to check that it fails in the attempt). (**) The compile-fail-fulldeps test serves as a more narrow test that will be tested on all platforms. It also attempts to subvert the hack, testing that when you use `new_parser_from_tts`, the resulting parser does not support reading embedded Idents.
2014-08-12auto merge of #16434 : vadimcn/rust/many-crates-but-no-match, r=alexcrichtonbors-2/+2
2014-08-11Fix many-crates-but-no-match test. (Issue #16348)Vadim Chugunov-2/+2
2014-08-09Fix misspelled comments for tests.Joseph Crail-1/+1
2014-08-09auto merge of #16359 : epdtry/rust/mono-item-dedup-foreign, r=alexcrichtonbors-3/+12
Extend the changes from #16059 to the new generic foreign functions introduced by #15831.
2014-08-09auto merge of #16326 : pnkfelix/rust/fsk-add-path-suffix-lookup, r=huonwbors-0/+82
Extended `ast_map::Map` with an iterator over all node id's that match a path suffix. Extended pretty printer to let users choose particular items to pretty print, either by indicating an integer node-id, or by providing a path suffix. * Example 1: the suffix `typeck::check::check_struct` matches the item with the path `rustc::middle::typeck::check::check_struct` when compiling the `rustc` crate. * Example 2: the suffix `and` matches `core::option::Option::and` and `core::result::Result::and` when compiling the `core` crate. Refactored `pprust` slightly to support the pretty printer changes. (See individual commits for more description.)
2014-08-09pretty printer: Added some `run-make` tests of path-suffix lookup functionality.Felix S. Klock II-0/+82
2014-08-09auto merge of #15964 : huonw/rust/gensym-test, r=alexcrichtonbors-0/+26
This requires avoiding `quote_...!` for constructing the parts of the __test module, since that stringifies and reinterns the idents, losing the special gensym'd nature of them. (#15962.)
2014-08-09move a test into a run make, to check external affect rather thanHuon Wilson-0/+26
implementation details. (Mainly to avoid accessing the secret internal test module symbol name.)
2014-08-08don't translate items when monomorphizing foreign-ABI functionsStuart Pernsteiner-3/+12
2014-08-05Add new tests for extern and foreign fns and name mangling.Russell-0/+40
2014-08-05Allow generic foreign functions.Russell-0/+80
Generic extern functions written in Rust have their names mangled, as well as their internal clownshoe __rust_abi functions. This allows e.g. specific monomorphizations of these functions to be used as callbacks. Closes #12502.
2014-08-04rustc: Link entire archives of native librariesAlex Crichton-3/+82
As discovered in #15460, a particular #[link(kind = "static", ...)] line is not actually guaranteed to link the library at all. The reason for this is that if the external library doesn't have any referenced symbols in the object generated by rustc, the entire library is dropped by the linker. For dynamic native libraries, this is solved by passing -lfoo for all downstream compilations unconditionally. For static libraries in rlibs this is solved because the entire archive is bundled in the rlib. The only situation in which this was a problem was when a static native library was linked to a rust dynamic library. This commit brings the behavior of dylibs in line with rlibs by passing the --whole-archive flag to the linker when linking native libraries. On OSX, this uses the -force_load flag. This flag ensures that the entire archive is considered candidate for being linked into the final dynamic library. This is a breaking change because if any static library is included twice in the same compilation unit then the linker will start emitting errors about duplicate definitions now. The fix for this would involve only statically linking to a library once. Closes #15460 [breaking-change]
2014-08-04rustc: use Name numbers rather than the Show impl for constants.Huon Wilson-0/+35
Using the Show impl for Names created global symbols with names like `"str\"str\"(1027)"`. This adjusts strings, binaries and vtables to avoid using that impl. Fixes #15799.
2014-07-30avoid redundant translation of items during monomorphizationStuart Pernsteiner-0/+32
2014-07-29syntax: add support for quoting armsErick Tryzelaar-4/+4
2014-07-25librustc: Disallow mutation and assignment in pattern guards, and modifyPatrick Walton-29/+35
the CFG for match statements. There were two bugs in issue #14684. One was simply that the borrow check didn't know about the correct CFG for match statements: the pattern must be a predecessor of the guard. This disallows the bad behavior if there are bindings in the pattern. But it isn't enough to prevent the memory safety problem, because of wildcards; thus, this patch introduces a more restrictive rule, which disallows assignments and mutable borrows inside guards outright. I discussed this with Niko and we decided this was the best plan of action. This breaks code that performs mutable borrows in pattern guards. Most commonly, the code looks like this: impl Foo { fn f(&mut self, ...) {} fn g(&mut self, ...) { match bar { Baz if self.f(...) => { ... } _ => { ... } } } } Change this code to not use a guard. For example: impl Foo { fn f(&mut self, ...) {} fn g(&mut self, ...) { match bar { Baz => { if self.f(...) { ... } else { ... } } _ => { ... } } } } Sometimes this can result in code duplication, but often it illustrates a hidden memory safety problem. Closes #14684. [breaking-change]
2014-07-21rustc: Append platform exe suffix to output filesAlex Crichton-3/+4
Closes #15828
2014-07-18rustc: Mix extra-filename in temp outputsAlex Crichton-3/+18
When invoking the compiler in parallel, the intermediate output of the object files and bytecode can stomp over one another if two crates with the same name are being compiled. The output file is already being disambiguated with `-C extra-filename`, so this commit alters the naming of the temporary files to also mix in the extra filename to ensure that file names don't clash.
2014-07-15Deprecate `str::from_utf8_lossy`Adolfo Ochagavía-4/+4
Use `String::from_utf8_lossy` instead [breaking-change]
2014-07-11rustdoc: support tuple and struct patterns in function argumentsCorey Richardson-0/+4
2014-07-08auto merge of #15518 : alexcrichton/rust/fix-some-crate-names, r=sfacklerbors-0/+38
The output file was only being renamed based off #[crate_name], not #[crate_id] or --crate-name. Both of these behaviors have been restored now.
2014-07-08rustc: Fix naming output files with --crate-nameAlex Crichton-0/+38
The output file was only being renamed based off #[crate_name], not #[crate_id] or --crate-name. Both of these behaviors have been restored now.
2014-07-07Improve non-exhaustive pattern witnesses for structs with multiple fieldsJakub Wieczorek-2/+2
2014-07-05rustc: Default #[crate_name] on input, not outputAlex Crichton-6/+9
2014-07-05Test fixes and rebase conflictsAlex Crichton-2/+4
2014-07-05rustc: Repurpose the --crate-name CLI flagAlex Crichton-6/+22
In a cargo-driven world the primary location for the name of a crate will be in its manifest, not in the source file itself. The purpose of this flag is to reduce required duplication for new cargo projects. This is a breaking change because the existing --crate-name flag actually printed the crate name. This flag was renamed to --print-crate-name, and to maintain consistence, the --crate-file-name flag was renamed to --print-file-name. To maintain backwards compatibility, the --crate-file-name flag is still recognized, but it is deprecated. [breaking-change]
2014-07-05test: Fix tests for crate_id removalAlex Crichton-19/+172
This involved removing some tests whose functionality was removed such as many of the crateresolve tests
2014-07-05rustc: Add a flag for specifying dependenciesAlex Crichton-0/+102
This comit implements a new flag, --extern, which is used to specify where a crate is located. The purpose of this flag is to bypass the normal crate loading/matching of the compiler to point it directly at the right file. This flag takes the form `--extern foo=bar` where `foo` is the name of a crate and `bar` is the location at which to find the crate. Multiple `--extern` directives are allowed with the same crate name to specify the rlib/dylib pair for a crate. It is invalid to specify more than one rlib or more than one dylib, and it's required that the crates are valid rust crates. I have also added some extensive documentation to metadata::loader about how crate loading should work. RFC: 0035-remove-crate-id
2014-07-02Merge remote-tracking branch 'origin/master' into 0.11.0-releaseAlex Crichton-335/+335
Conflicts: src/libstd/lib.rs
2014-06-29librustc: Remove the fallback to `int` for integers and `f64` forPatrick Walton-333/+333
floating point numbers for real. This will break code that looks like: let mut x = 0; while ... { x += 1; } println!("{}", x); Change that code to: let mut x = 0i; while ... { x += 1; } println!("{}", x); Closes #15201. [breaking-change]