summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2017-08-23Fix tests and falloutAlex Crichton-2/+2
2017-08-23Ensure that generic arguments don't end up in attribute paths.Jeffrey Seyfried-0/+22
2017-08-23std: Mark allocation functions as nounwindAlex Crichton-0/+32
This commit flags all allocation-related functions in liballoc as "this can't unwind" which should largely resolve the size-related issues found on #42808. The documentation on the trait was updated with such a restriction (they can't panic) as well as some other words about the relative instability about implementing a bullet-proof allocator. Closes #42808
2017-08-23register fn-ptr coercion obligations out of a snapshotAriel Ben-Yehuda-0/+19
Fixes #43923.
2017-08-23ast_validation: forbid "nonstandard" literal patternsAriel Ben-Yehuda-0/+23
Since #42886, macros can create "nonstandard" PatKind::Lit patterns, that contain path expressions instead of the usual literal expr. These can cause trouble, including ICEs. We *could* map these nonstandard patterns to PatKind::Path patterns during HIR lowering, but that would be much effort for little gain, and I think is too risky for beta. So let's just forbid them during AST validation. Fixes #43250.
2017-08-19Auto merge of #43922 - nrc:beta, r=alexcrichtonbors-0/+20
Uplift fix for include! in doc tests to beta Uplift https://github.com/rust-lang/rust/pull/43782 to beta. Fixes #43153. r? @alexcrichton (approved by @rust-lang/dev-tools )
2017-08-17Revert "Auto merge of #42840 - arielb1:poison-smoke-and-mirrors, r=nikomatsakis"Ariel Ben-Yehuda-60/+0
This reverts commit 9b85e1cfa5aa2aaa4b5df4359a023ad793983ffc, reversing changes made to 13157c4ebcca735a0842bd03c3dad1de7c429f9f.
2017-08-17Revert "save the subobligations as well"Ariel Ben-Yehuda-74/+0
This reverts commit 309ab478d31a699493fdb1593d9cb133705f51f0.
2017-08-17doc tests: use the filename from the source file for doc test programs, ↵Nick Cameron-0/+20
rather than a dummy name
2017-08-12Stabilize the `compile_error_macro` featureAlex Crichton-15/+0
Stabilizes: * `compile_error!` as a macro defined by rustc Closes #40872
2017-08-12std: Mark `Layout::repeat` as `#[inline]`Alex Crichton-0/+21
This fixes an optimization regression by allowing LLVM to see through more functions. Closes #43272
2017-08-12save the subobligations as wellNiko Matsakis-0/+74
2017-08-12Add a feature gateest31-0/+14
@alexcrichton figured out a way how to do it :)
2017-08-12Avoid calling the column!() macro in panicest31-0/+23
2017-07-17Auto merge of #42711 - Firstyear:san-on-dylib, r=alexcrichtonbors-9/+162
Add support for dylibs with Address Sanitizer Many applications use address sanitizer to assert correct behaviour of their programs. When using Rust with C, it's much more important to assert correct programs with tools like asan/lsan due to the unsafe nature of the access across an ffi boundary. However, previously only rust bin types could use asan. This posed a challenge for existing C applications that link or dlopen .so when the C application is compiled with asan. This PR enables asan to be linked to the dylib and cdylib crate type. We alter the test to check the proc-macro crate does not work with -Z sanitizer=address. Finally, we add a test that compiles a shared object in rust, then another rust program links it and demonstrates a crash through the call to the library. This PR is nearly complete, but I do require advice on the change to fix the -lasan that currently exists in the dylib test. This is required because the link statement is not being added correctly to the rustc build when -Z sanitizer=address is added (and I'm not 100% sure why) Thanks,
2017-07-17Auto merge of #43266 - feadoor:issue-43253-exclusive-range-warning, ↵bors-0/+71
r=nikomatsakis Fix `range_covered_by_constructor` for exclusive ranges. This resolves #43253
2017-07-17Move resolve diagnostic instability to compile-failOliver Schneider-37/+70
The produced paths aren't stable between builds, since reporting paths inside resolve, before resolve is finished might produce paths resolved to type aliases instead of the concrete type. Compile-fail tests can match just parts of messages, so they don't "suffer" from this issue. This is just a workaround, the instability should be fixed in the future.
2017-07-17Change some helps to suggestionsOliver Schneider-142/+105
2017-07-17Move some tests from compile-fail to uiOliver Schneider-29/+364
2017-07-16Fix `range_covered_by_constructor` for exclusive ranges.Sam Cappleman-Lynes-0/+71
This resolves #43253
2017-07-16Auto merge of #43237 - ↵bors-0/+8
zackmdavis:missing_sum_and_product_for_128_bit_integers, r=nagisa add u128/i128 to sum/product implementors Resolves #43235.
2017-07-15Auto merge of #43224 - jseyfried:fix_macro_idents_regression, r=nrcbors-0/+26
macros: fix regression involving identifiers in `macro_rules!` patterns. Fixes #42019. r? @nrc
2017-07-15Auto merge of #43179 - oli-obk:mark_all_the_expansions, r=jseyfriedbors-0/+49
Reintroduce expansion info for proc macros 1.1 r? @jseyfried
2017-07-15Auto merge of #43185 - durka:thread-local-pub-restricted, r=alexcrichtonbors-7/+15
support pub(restricted) in thread_local! (round 2) Resurrected #40984 now that the issue blocking it was fixed. Original description: `pub(restricted)` was stabilized in #40556 so let's go! Here is a [playground](https://play.rust-lang.org/?gist=f55f32f164a6ed18c219fec8f8293b98&version=nightly&backtrace=1). I changed the interface of `__thread_local_inner!`, which is supposedly unstable but this is not checked for macros (#34097 cc @petrochenkov @jseyfried), so this may be an issue.
2017-07-15Add support for dylibs with Address Sanitizer. This supports cdylibs and ↵William Brown-9/+162
staticlibs on gnu-linux targets.
2017-07-14add u128/i128 to sum/product implementorsZack M. Davis-0/+8
Resolves #43235.
2017-07-14Auto merge of #43026 - arielb1:llvm-next, r=alexcrichtonbors-0/+36
[LLVM] Avoid losing the !nonnull attribute in SROA Fixes #37945. r? @alexcrichton
2017-07-13Fix regression involving identifiers in `macro_rules!` patterns.Jeffrey Seyfried-0/+26
2017-07-13Rollup merge of #43125 - aochagavia:stable_drop, r=arielb1Steve Klabnik-0/+231
Add regression tests to ensure stable drop order Work towards #43034 I think this is all we need to do on the testing front regarding RFC 1857
2017-07-13Auto merge of #43158 - PlasmaPower:thread-local-try-with, r=alexcrichtonbors-0/+37
Thread local try with https://github.com/rust-lang/rfcs/pull/2030 was turned into this PR (the RFC was closed, but it looks like just a PR should be good). See also: state stabilization issue: #27716 `try_with` is used in two places in std: stdio and thread_info. In stdio, it would be better if the result was passed to the closure, but in thread_info, it's better as is where the result is returned from the function call. I'm not sure which is better, but I prefer the current way as it better represents the scope.
2017-07-12Add regression tests to ensure stable drop orderAdolfo Ochagavía-0/+231
2017-07-12Rollup merge of #43011 - qnighy:unsized-tuple-impls, r=aturonMark Simulacrum-0/+29
Implement Eq/Hash/Debug etc. for unsized tuples. As I mentioned in [the comment in #18469](https://github.com/rust-lang/rust/issues/18469#issuecomment-306767422), the implementations of `PartialEq`, `Eq`, `PartialOrd`, `Ord`, `Debug`, `Hash` can be generalized to unsized tuples. This is consistent with the `derive` behavior for unsized structs. ```rust #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Debug, Default, Hash)] struct MyTuple<X, Y, Z: ?Sized>(X, Y, Z); fn f(x: &MyTuple<i32, i32, [i32]>) { x == x; x < x; println!("{:?}", x); } ``` Questions: - Need an RFC? - Need a feature gate? I don't think it does because the unsized tuple coercion #42527 is feature-gated. - I changed `builder.field($name);` into `builder.field(&$name);` in the `Debug` implementation to pass compilation. This won't affect the behavior because `Debug for &'a T` is a mere redirection to `Debug for T`. However, I don't know if it affects code size / performance.
2017-07-12Rollup merge of #43000 - estebank:on-unimplemented-path, r=arielb1Mark Simulacrum-3/+140
`rustc_on_unimplemented` supports referring to trait Add support to `rustc_on_unimplemented` to reference the full path of the annotated trait. For the following code: ```rust pub mod Bar { #[rustc_on_unimplemented = "test error `{Self}` with `{Bar}` `{Baz}` `{Quux}` in `{Foo}`"] pub trait Foo<Bar, Baz, Quux> {} } ``` the error message will be: ``` test error `std::string::String` with `u8` `_` `u32` in `Bar::Foo` ```
2017-07-12Rollup merge of #42826 - Yorwba:type-mismatch-same-absolute-paths, r=arielb1Mark Simulacrum-0/+94
Note different versions of same crate when absolute paths of different types match. The current check to address #22750 only works when the paths of the mismatched types relative to the current crate are equal, but this does not always work if one of the types is only included through an indirect dependency. If reexports are involved, the indirectly included path can e.g. [contain private modules](https://github.com/rust-lang/rust/issues/22750#issuecomment-302755516). This PR takes care of these cases by also comparing the *absolute* path, which is equal if the type hasn't moved in the module hierarchy between versions. A more coarse check would be to compare only the crate names instead of full paths, but that might lead to too many false positives. Additionally, I believe it would be helpful to show where the differing crates came from, i.e. the information in `rustc::middle::cstore::CrateSource`, but I'm not sure yet how to nicely display all of that, so I'm leaving it to a future PR.
2017-07-12[LLVM] Avoid losing the !nonnull attribute in SROAAriel Ben-Yehuda-0/+36
This still does not work on 32-bit archs because of an LLVM limitation, but this is only an optimization, so let's push it on 64-bit only for now. Fixes #37945
2017-07-12Auto merge of #43107 - michaelwoerister:less-span-info-in-debug, r=nikomatsakisbors-0/+63
incr.comp.: Don't include span information in the ICH of type definitions This should improve some of the `regex` tests on perf.rlo. Not including spans into the ICH is harmless until we also cache warnings. To really solve the problem, we need to do more refactoring (see #43088). r? @nikomatsakis
2017-07-12Reintroduce expansion info for proc macros 1.1Oliver Schneider-0/+49
2017-07-11support pub(restricted) in thread_local!Alex Burka-7/+15
2017-07-11Fix @alexcrichton commentsLee Bousfield-0/+4
2017-07-11Merge ui/README.md into COMPILER_TESTS.md and describe how custom UI ↵kennytm-32/+72
normalization works.
2017-07-11compiletest: Support custom normalization rules.kennytm-74/+47
2017-07-11compiletest: Refactor: Move the `ignore-{}` logic into its own method.kennytm-6/+1
Prepare for `normalize-std???` which will share the same logic. Added `ignore-32bit` and `ignore-64bit`.
2017-07-11Auto merge of #42913 - kennytm:fix-40569-ident-without-backtrack, r=jseyfriedbors-2/+247
Only match a fragment specifier the if it starts with certain tokens. When trying to match a fragment specifier, we first predict whether the current token can be matched at all. If it cannot be matched, don't bother to push the Earley item to `bb_eis`. This can fix a lot of issues which otherwise requires full backtracking (#42838). In this PR the prediction treatment is not done for `:item`, `:stmt` and `:tt`, but it could be expanded in the future. Fixes #24189. Fixes #26444. Fixes #27832. Fixes #34030. Fixes #35650. Fixes #39964. Fixes the 4th comment in #40569. Fixes the issue blocking #40984.
2017-07-10Add LocalKey::try_with as an alternative to stateLee Bousfield-0/+33
2017-07-10Auto merge of #43028 - michaelwoerister:dedup-dep-nodes, r=nikomatsakisbors-23/+35
incr.comp.: Deduplicate some DepNodes and introduce anonymous DepNodes This is a parallel PR to the pending https://github.com/rust-lang/rust/pull/42769. It implements most of what is possible in terms of DepNode re-opening without having anonymous DepNodes yet (https://github.com/rust-lang/rust/issues/42298). r? @nikomatsakis
2017-07-10Auto merge of #43109 - pnkfelix:fix-link_args-gate, r=nikomatsakisbors-4/+14
Fix feature gate for `#[link_args(..)]` attribute Fix feature gate for `#[link_args(..)]` attribute so that it will fire regardless of context of attribute. See also #29596 and #43106
2017-07-10Fix feature gate for `#[link_args(..)]` attribute so that it will fireFelix S. Klock II-4/+14
regardless of context of attribute. Extend the gating test to include the attribute in "weird" places.
2017-07-10Split DepNode::ItemSignature into non-overlapping variants.Michael Woerister-23/+35
2017-07-10Store all generic arguments for method calls in ASTVadim Petrochenkov-1/+14
2017-07-08Auto merge of #43097 - PlasmaPower:large-align, r=eddybbors-1/+20
Raise alignment limit from 2^15 to 2^31 - 1 Fixes #42960