about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2019-06-20rustdoc: generate implementors for all auto traitsSimonas Kazlauskas-3/+15
Previously we would only generate a list of synthetic implementations for two well known traits – Send and Sync. With this patch all the auto traits known to rustc are considered. This includes such traits like Unpin and user’s own traits. Sadly the implementation still iterates through the list of crate items and checks them against the traits, which for non-std crates containing their own auto-traits will still not include types defined in std/core. It is an improvement nontheless.
2019-06-20Rollup merge of #61782 - Electron-libre:suggest_tuple_struct_syntax, r=estebankMazdak Farrokhzad-4/+12
suggest tuple struct syntax refs #57242
2019-06-20Auto merge of #60341 - mtak-:macos-tlv-workaround, r=alexcrichtonbors-14/+12
macos tlv workaround fixes: #60141 Includes: * remove dead code: `requires_move_before_drop`. This hasn't been needed for a while now (oops I should have removed it in #57655) * redox had a copy of `fast::Key` (not sure why?). That has been removed. * Perform a `read_volatile` on OSX to reduce `tlv_get_addr` calls per `__getit` from (4-2 depending on context) to 1. `tlv_get_addr` is relatively expensive (~1.5ns on my machine). Previously, in contexts where `__getit` was inlined, 4 calls to `tlv_get_addr` were performed per lookup. For some reason when `__getit` is not inlined this is reduced to 2x - and performance improves to match. After this PR, I have only ever seen 1x call to `tlv_get_addr` per `__getit`, and macos now benefits from situations where `__getit` is inlined. I'm not sure if the `read_volatile(&&__KEY)` trick is working around an LLVM bug, or a rustc bug, or neither. r? @alexcrichton
2019-06-19Auto merge of #61947 - estebank:ice-ice-revolution, r=matthewjasperbors-0/+33
Fix ICE involving mut references Fix #61623, fix #61944, fix #61751.
2019-06-19fix compile-fail test for targets without thread localstyler-4/+3
2019-06-19fix indentationCedric-2/+2
2019-06-19Rollup merge of #61547 - petrochenkov:cfgen, r=CentrilMazdak Farrokhzad-87/+104
Support `cfg` and `cfg_attr` on generic parameters `cfg` attributes are supported in all other positions where attributes are accepted at all. They were previously prohibited in https://github.com/rust-lang/rust/pull/51283 because they weren't implemented correctly before that and were simply ignored.
2019-06-19Auto merge of #61172 - matthewjasper:cleanup-implied-bounds-lint, r=varkorbors-421/+3202
Improve the explicit_outlives_requirements lint * Don't use Strings to compare parameters * Extend the lint to lifetime bounds * Extend the lint to enums and unions * Use the correct span for where clauses in tuple structs * Try to early-out where possible * Remove unnecessary bounds in rustc crates
2019-06-19Auto merge of #58351 - oli-obk:double_check_const_eval, r=RalfJungbors-0/+187
Refactor interning to properly mark memory as mutable or immutable r? @RalfJung This implementation is incomplete out of multiple reasons * [ ] add `-Zunleash_the_miri_inside_of_you` tests * [ ] report an error if there's an `UnsafeCell` behind a reference in a constant * [ ] make validity checks actually test whether the mutability of their allocations match what they see in the type
2019-06-19provide variant definition on tuple struct unknow field errorCedric-2/+8
2019-06-19adt hint pointing to adt spanCedric-8/+6
2019-06-19Support `cfg` and `cfg_attr` on generic parametersVadim Petrochenkov-87/+104
2019-06-19Update ui test outputOliver Scherer-1/+1
2019-06-19Add and update more testsOliver Scherer-1/+28
2019-06-19Make interning explicitly care about types and the mutability of memoryOliver Scherer-0/+160
2019-06-19Auto merge of #61945 - Centril:rollup-xdqo2mn, r=Centrilbors-89/+116
Rollup of 11 pull requests Successful merges: - #61505 (Only show methods that appear in `impl` blocks in the Implementors sections of trait doc pages) - #61701 (move stray run-pass const tests into const/ folder) - #61748 (Tweak transparent enums and unions diagnostic spans) - #61802 (Make MaybeUninit #[repr(transparent)]) - #61839 (ci: Add a script for generating CPU usage graphs) - #61842 (Remove unnecessary lift calls) - #61843 (Turn down the myriad-closures test) - #61896 (rustc_typeck: correctly compute `Substs` for `Res::SelfCtor`.) - #61898 (syntax: Factor out common fields from `SyntaxExtension` variants) - #61938 (create an issue for miri even in status test-fail) - #61941 (Preserve generator and yield source for error messages) Failed merges: r? @ghost
2019-06-18Fix ICE involving mut referencesEsteban Küber-0/+33
2019-06-19Rollup merge of #61941 - cramertj:no-more-yield-errors, r=centrilMazdak Farrokhzad-4/+4
Preserve generator and yield source for error messages Previously, error messages after HIR lowering all referred to generators and yield, regardless of whether the original source was a generator or an async/await body. This change tracks the kind of each generator and yield source in order to provide appropriately tailored error messages. Fixes #60615.
2019-06-19Rollup merge of #61898 - petrochenkov:sekind, r=eddybMazdak Farrokhzad-13/+5
syntax: Factor out common fields from `SyntaxExtension` variants And some other related cleanups. Continuation of https://github.com/rust-lang/rust/pull/61606. This will also help to unblock https://github.com/rust-lang/rust/pull/61877.
2019-06-19Rollup merge of #61896 - eddyb:correct-self-ctor, r=petrochenkovMazdak Farrokhzad-0/+66
rustc_typeck: correctly compute `Substs` for `Res::SelfCtor`. Fixes #61882. r? @petrochenkov cc @varkor
2019-06-19Rollup merge of #61843 - alexcrichton:disable-myriad-closures, r=pietroalbiniMazdak Farrokhzad-3/+3
Turn down the myriad-closures test This tests takes nearly 5 minutes to compile on CI where the CPUs we have aren't exactly the fastest. This test does actually require all closures to exist to exhibit the original bug, but it seems a little excessive to test a single bug on CI on all platforms which simply pegs a single CPU for 5 minutes with no parallelism opportunities, so this turns down the test to still exercise it somewhat at least.
2019-06-19Rollup merge of #61748 - estebank:transparent-span, r=CentrilMazdak Farrokhzad-69/+38
Tweak transparent enums and unions diagnostic spans
2019-06-19Rollup merge of #61701 - RalfJung:const-tests, r=cramertjMazdak Farrokhzad-0/+0
move stray run-pass const tests into const/ folder r? @oli-obk
2019-06-18Preserve generator and yield source for error messagesTaylor Cramer-4/+4
Previously, error messages after HIR lowering all referred to generators and yield, regardless of whether the original source was a generator or an async/await body. This change tracks the kind of each generator and yield source in order to provide appropriately tailored error messages.
2019-06-18Improve the explicit_outlives_requirements lintMatthew Jasper-413/+3194
* Don't use Strings to compare parameters * Extend the lint to lifetime bounds * Extend the lint to enums and unions * Use the correct span for where clauses in tuple structs * Try to early-out where possible
2019-06-18Remove the HirId/NodeId from where clausesMatthew Jasper-8/+8
Also give them a span in the HIR
2019-06-18Auto merge of #59625 - immunant:copy_variadics_typealias, r=eddybbors-72/+192
Refactor C FFI variadics to more closely match their C counterparts, and add Clone implementation We had to make some changes to expose `va_copy` and `va_end` directly to users (mainly for C2Rust, but not exclusively): - redefine the Rust variadic structures to more closely correspond to C: `VaList` now matches `va_list`, and `VaListImpl` matches `__va_list_tag` - add `Clone` for `VaListImpl` - add explicit `as_va_list()` conversion function from `VaListImpl` to `VaList` - add deref coercion from `VaList` to `VaListImpl` - add support for the `asmjs` target All these changes were needed for use cases like: ```Rust let mut ap2 = va_copy(ap); vprintf(fmt, ap2); va_end(&mut ap2); ```
2019-06-18test: normalize away the line/column info in ui/pattern/const-pat-ice.Eduard-Mihai Burtescu-1/+2
2019-06-18rustc_typeck: correctly compute `Substs` for `Res::SelfCtor`.Eduard-Mihai Burtescu-0/+66
2019-06-18Auto merge of #61822 - JohnTitor:add-long-e0592, r=GuillaumeGomez,Centrilbors-1/+12
Add explanation for E0592 This is a part of #61137 r? @GuillaumeGomez
2019-06-18syntax: Factor out common fields from `SyntaxExtension` variantsVadim Petrochenkov-13/+5
2019-06-18Auto merge of #61864 - lzutao:ptr-null, r=sfacklerbors-32/+34
Make use of `ptr::null(_mut)` instead of casting zero There are few places that I don't replace the zero casting pointer with `ptr::null` or `ptr::null_mut`: ```bash % git grep -E '[ ([{]0 as \*' src/libcore/ptr/mod.rs:216:pub const fn null<T>() -> *const T { 0 as *const T } src/libcore/ptr/mod.rs:231:pub const fn null_mut<T>() -> *mut T { 0 as *mut T } src/test/run-pass/consts/const-cast-ptr-int.rs:12:static a: TestStruct = TestStruct{x: 0 as *const u8}; src/test/ui/issues/issue-45730.rs:5: let x: *const _ = 0 as *const _; //~ ERROR cannot cast src/test/ui/issues/issue-45730.rs:8: let x = 0 as *const i32 as *const _ as *mut _; //~ ERROR cannot cast src/test/ui/issues/issue-45730.stderr:14:LL | let x: *const _ = 0 as *const _; src/test/ui/issues/issue-45730.stderr:24:LL | let x = 0 as *const i32 as *const _ as *mut _; src/test/ui/lint/lint-forbid-internal-unsafe.rs:15: println!("{}", evil!(*(0 as *const u8))); src/test/ui/order-dependent-cast-inference.rs:5: let mut y = 0 as *const _; src/test/ui/order-dependent-cast-inference.stderr:4:LL | let mut y = 0 as *const _; ``` r? @sfackler
2019-06-17Expose `VaListImpl` as the Rust equivalent of `__va_list_tag` and implement ↵Andrei Homescu-72/+192
Clone for it.
2019-06-17Rollup merge of #61885 - scottmcm:slice-iter-len-opt, r=rkruppe,RalfJungMazdak Farrokhzad-0/+14
Help LLVM better optimize slice::Iter(Mut)::len r? @RalfJung I've included a codegen test that fails without this change as a demonstration of usefulness.
2019-06-17Rollup merge of #61836 - ljedrz:i_still_hate_node_ids, r=ljedrzMazdak Farrokhzad-1/+1
Replace some uses of NodeId with HirId We are still using `NodeId` in some spots where we could use `HirId` instead; this PR targets some of these spots and removes some of the associated `hir::map` functions.
2019-06-17Rollup merge of #61702 - RalfJung:const-enum-cast, r=oli-obkMazdak Farrokhzad-2/+11
test more variants of enum-int-casting As I learned in https://github.com/rust-lang/rust/pull/61673#issuecomment-500213506, there is a code path we are not testing yet. Looks like enum-int-casting with and without an intermediate let-binding is totally different. EDIT: The reason for this is to get rid of the cycle in definitions such as: ```rust enum Foo { A = 0, B = Foo::A as isize + 2, } ``` This has historically been supported, so a hack adding special treatment to `Enum::Variant as _` was added to keep supporting it.
2019-06-17suggest tuple struct syntaxCedric-4/+8
2019-06-17remove _by_hir_id if there is no NodeId counterpartljedrz-1/+1
2019-06-17Make use of `ptr::null(_mut)` instead of casting zeroLzu Tao-32/+34
2019-06-16Auto merge of #61892 - rijenkii:master, r=Centrilbors-0/+9
weird-exprs: if if if if The `if` keyword can be chained as long as there are enough `{...} else {...}` following, and they all return a `bool` (not required for the last one). `if` expression can be also put inside a `match` arm guard, thus making the whole thing a little bit more confusing. Discovered this clusterfunk while reading the reference because I have nothing better to do.
2019-06-16Auto merge of #61347 - Centril:stabilize-underscore_const_names, r=petrochenkovbors-67/+128
Stabilize underscore_const_names in 1.37.0 You are now permitted to write: ```rust const _: $type_expression = $term_expression; ``` That is, we change the [grammar of items](https://github.com/rust-lang-nursery/wg-grammar/blob/9d1984d7ae8d6576f943566539a31a5800644c57/grammar/item.lyg#L3-L42), as written in [the *`.lyg`* notation](https://github.com/rust-lang/gll/tree/263bf161dad903e67aa65fc591ced3cab18afa2a#grammar), from: ```java Item = attrs:OuterAttr* vis:Vis? kind:ItemKind; ItemKind = | ... | Const:{ "const" name:IDENT ":" ty:Type "=" value:Expr ";" } | ... ; ``` into: ```java Item = attrs:OuterAttr* vis:Vis? kind:ItemKind; ItemKind = | ... | Const:{ "const" name:IdentOrUnderscore ":" ty:Type "=" value:Expr ";" } | ... ; IdentOrUnderscore = | Named:IDENT | NoName:"_" ; ``` r? @petrochenkov
2019-06-16if if if ifRijenkii-0/+9
2019-06-16Auto merge of #60730 - matthewjasper:optimize-false-edges, r=pnkfelixbors-326/+326
Optimize matches Attempt to fix or improve #60571 This is breaking some diagnostics because the MIR for match arms isn't in source order any more. cc @centril
2019-06-15Help LLVM better optimize slice::Iter(Mut)::lenScott McMurray-0/+14
2019-06-15Auto merge of #61868 - Centril:rollup-gglsecp, r=Centrilbors-0/+41
Rollup of 6 pull requests Successful merges: - #61785 (note some safety concerns of raw-ptr-to-ref casts) - #61805 (typeck: Fix ICE for blocks in repeat expr count.) - #61813 (Remove some unnecessary symbol interner ops) - #61824 (in which we decline to lint single-use lifetimes in `derive`d impls) - #61844 (Change `...` to `..=` where applicable) - #61854 (Minor cosmetic improvements to accompany PR 61825) Failed merges: r? @ghost
2019-06-15Rollup merge of #61824 - rust-lang:single_derive, r=eddybMazdak Farrokhzad-0/+7
in which we decline to lint single-use lifetimes in `derive`d impls Resolves #53738. r? @eddyb
2019-06-15Rollup merge of #61805 - ↵Mazdak Farrokhzad-0/+34
davidtwco:ice-const-generic-repeat-expr-count-sequel, r=varkor typeck: Fix ICE for blocks in repeat expr count. Fixes #61336 (again). This PR fixes an ICE that occured when a block expression resolving to a const generic was used for the count of an array repeat expression. r? @varkor
2019-06-15Auto merge of #61143 - estebank:issue-61106, r=eddybbors-0/+21
When suggesting borrow, remove useless clones Fix #61106.
2019-06-15Auto merge of #59752 - Zoxc:dylib-fix, r=alexcrichtonbors-0/+9
Limit dylib symbols This makes `windows-gnu` match the behavior of `windows-msvc`. It probably doesn't make sense to export these symbols on other platforms either.
2019-06-15Auto merge of #61825 - Centril:tauv-infer-fix, r=petrochenkovbors-0/+30
type_alias_enum_variants: fix #61801; allow a path pattern to infer Fix #61801. Given a type-relative path pattern referring to an enum variant through a type alias, allow inferring the generic argument applied in the expectation set by the scrutinee of a `match` expression. Similar issues may exist for `let` statements but I don't know how to test for that since `PhantomData<T>` is necessary...) The gist of the problem here was that `resolve_ty_and_res_ufcs` was called twice which is apparently no good... It is possible that this PR is papering over some deeper problem, but that is beyond my knowledge of the compiler. r? @petrochenkov cc @eddyb @alexreg cc https://github.com/rust-lang/rust/pull/61682 cc https://github.com/rust-lang/rust/issues/49683