about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2021-01-30Account for unionHirochika Matsumoto-4/+42
2021-01-30Fix test to check help message as wellHirochika Matsumoto-21/+16
2021-01-29Add rust-fix testHirochika Matsumoto-3/+32
2021-01-29Add test for match expressionHirochika Matsumoto-1/+42
2021-01-29Suggest accessing field when code compiles with itHirochika Matsumoto-0/+34
2021-01-27Auto merge of #81335 - thomwiggers:no-panic-shrink-to, r=Mark-Simulacrumbors-8/+0
Trying to shrink_to greater than capacity should be no-op Per the discussion in https://github.com/rust-lang/rust/issues/56431, `shrink_to` shouldn't panic if you try to make a vector shrink to a capacity greater than its current capacity.
2021-01-27Auto merge of #80987 - GuillaumeGomez:remove-cache-key, r=jyn514bors-0/+75
Remove CACHE_KEY global We realized in https://github.com/rust-lang/rust/pull/80914 that the cache handling (through a global) needed to be updated to make it much easier to handle. r? `@jyn514`
2021-01-27Add search index test for primitive typesGuillaume Gomez-0/+75
2021-01-27Auto merge of #79591 - estebank:unexpected-generics, r=oli-obkbors-11/+20
Point only at generic arguments when they are unexpected
2021-01-26Point only at generic arguments when they are unexpectedEsteban Küber-11/+20
2021-01-27Rollup merge of #81407 - osa1:issue81098, r=estebankYuki Okushi-0/+36
Refine "remove semicolon" suggestion in trait selection Don't suggest it if the last statement doesn't have a semicolon Fixes #81098 See also #54771 for why this suggestion was added
2021-01-27Rollup merge of #81325 - osa1:issue81293, r=estebankYuki Okushi-0/+33
typeck: Don't suggest converting LHS exprs Converting LHS of an assignment does not work, so avoid suggesting that. Fixes #81293
2021-01-27Rollup merge of #81195 - estebank:suggest-bound-on-trait-with-params, r=oli-obkYuki Okushi-3/+133
Account for generics when suggesting bound Fix #81175.
2021-01-27Rollup merge of #80900 - camelid:readpointerasbytes-ice, r=oli-obkYuki Okushi-0/+43
Fix ICE with `ReadPointerAsBytes` validation error Fixes #79690. r? ``````@oli-obk``````
2021-01-26shrink_to shouldn't panic on len greater than capacityThom Wiggers-8/+0
2021-01-26Refine "remove semicolon" suggestion in trait selectionÖmer Sinan Ağacan-0/+36
Don't suggest it if the last statement doesn't have a semicolon Fixes #81098 See also #54771 for why this suggestion was added
2021-01-26typeck: Don't suggest converting LHS exprsÖmer Sinan Ağacan-0/+33
Converting LHS of an assignment does not work, so avoid suggesting that. Fixes #81293
2021-01-25Auto merge of #68828 - oli-obk:inline_cycle, r=wesleywiserbors-0/+194
Prevent query cycles in the MIR inliner r? `@eddyb` `@wesleywiser` cc `@rust-lang/wg-mir-opt` The general design is that we have a new query that is run on the `validated_mir` instead of on the `optimized_mir`. That query is forced before going into the optimization pipeline, so as to not try to read from a stolen MIR. The query should not be cached cross crate, as you should never call it for items from other crates. By its very design calls into other crates can never cause query cycles. This is a pessimistic approach to inlining, since we strictly have more calls in the `validated_mir` than we have in `optimized_mir`, but that's not a problem imo.
2021-01-25Ignore a test on wasm, because that changes landing padsoli-37/+39
2021-01-24Account for generics when suggesting boundEsteban Küber-3/+133
Fix #81175.
2021-01-24Ignore test on 32-bit architecturesCamelid-1/+4
2021-01-24Auto merge of #81355 - jonas-schievink:rollup-vpaadij, r=jonas-schievinkbors-209/+574
Rollup of 14 pull requests Successful merges: - #75180 (Implement Error for &(impl Error)) - #78578 (Permit mutable references in all const contexts) - #79174 (Make std::future a re-export of core::future) - #79884 (Replace magic numbers with existing constants) - #80855 (Expand assert!(expr, args..) to include $crate for hygiene on 2021.) - #80933 (Fix sysroot option not being honored across rustc) - #81259 (Replace version_check dependency with own version parsing code) - #81264 (Add unstable option to control doctest run directory) - #81279 (Small refactor in typeck) - #81297 (Don't provide backend_optimization_level query for extern crates) - #81302 (Fix rendering of stabilization version for trait implementors) - #81310 (Do not mark unit variants as used when in path pattern) - #81320 (Make bad shlex parsing a pretty error) - #81338 (Clean up `dominators_given_rpo`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-01-24Rollup merge of #81310 - tmiasko:in-pattern, r=petrochenkovJonas Schievink-1/+40
Do not mark unit variants as used when in path pattern Record that we are processing a pattern so that code responsible for handling path resolution can correctly decide whether to mark it as used or not. Closes #76788.
2021-01-24Rollup merge of #81302 - LeSeulArtichaut:80777-trait-render, r=jyn514Jonas Schievink-0/+19
Fix rendering of stabilization version for trait implementors Rustdoc compares an item's stabilization version with its parent's to not render it if they are the same. Here, the implementor was compared with itself, resulting in the stabilization version never getting shown. This probably needs a test. Fixes #80777. r? `@jyn514`
2021-01-24Rollup merge of #81264 - Swatinem:doctest-run-directory, r=jyn514Jonas Schievink-0/+35
Add unstable option to control doctest run directory This option will allow splitting the compile-time from the run-time directory of doctest invocations and is one step to solve https://github.com/rust-lang/cargo/issues/8993#issuecomment-760088944 r? `@jyn514`
2021-01-24Rollup merge of #81259 - est31:cfg_version, r=petrochenkovJonas Schievink-30/+110
Replace version_check dependency with own version parsing code This gives compiler maintainers a better degree of control over how the version gets parsed and is a good way to ensure that there are no changes of behaviour in the future. Also, issue a warning if the version is invalid instead of erroring so that we stay forwards compatible with possible future changes of the versioning scheme. Last, this improves the present test a little. Fixes #79436 r? `@petrochenkov`
2021-01-24Rollup merge of #80855 - m-ou-se:assert-2021, r=petrochenkovJonas Schievink-0/+9
Expand assert!(expr, args..) to include $crate for hygiene on 2021. This makes `assert!(expr, args..)` properly hygienic in Rust 2021. This is part of rust-lang/rfcs#3007, see #80162. Before edition 2021, this was a breaking change, as `std::panic` and `core::panic` are different. In edition 2021 they will be identical, making it possible to apply proper hygiene here.
2021-01-24Rollup merge of #78578 - oli-obk:const_mut_refs, r=RalfJungJonas Schievink-178/+361
Permit mutable references in all const contexts fixes #71212 cc `@rust-lang/wg-const-eval` `@christianpoveda`
2021-01-24parser: Collect tokens for values in key-value attributesVadim Petrochenkov-2/+14
2021-01-24Auto merge of #80838 - nagisa:nagisa/stack-probe-type, r=cuviperbors-0/+1
Target stack-probe support configurable finely This adds capability to configure the target's stack probe support in a more precise manner than just on/off. In particular now we allow choosing between always inline-asm, always call or either one of those depending on the LLVM version. Note that this removes the ability to turn off the generation of the stack-probe attribute. This is valid to replace it with inline-asm for all targets because `probe-stack="inline-asm"` will not generate any machine code on targets that do not currently support stack probes. This makes support for stack probes on targets that don't have any right now automatic with LLVM upgrades in the future. (This is valid to do based on the fact that clang unconditionally sets this attribute when `-fstack-clash-protection` is used, AFAICT) cc #77885 r? `@cuviper`
2021-01-24Auto merge of #80919 - cjgillot:defkey-span, r=oli-obkbors-8/+2
Generate metadata by iterating on DefId instead of traversing the HIR tree 1/N Sample from #80347.
2021-01-24Replace version_check dependency with own version parsing codeest31-30/+110
This gives compiler maintainers a better degree of control over how the version gets parsed and is a good way to ensure that there are no changes of behaviour in the future. Also, issue a warning if the version is invalid instead of erroring so that we stay forwards compatible with possible future changes of the versioning scheme. Last, this improves the present test a little.
2021-01-23Fix rendering of stabilization version for trait implementorsLeSeulArtichaut-0/+19
2021-01-23Rollup merge of #81288 - camelid:fix-trait-item-vis, r=jyn514Jonas Schievink-0/+32
rustdoc: Fix visibility of trait and impl items Fixes #81274. r? `@jyn514`
2021-01-23Rollup merge of #81249 - cjgillot:issue-79537, r=oli-obkJonas Schievink-0/+68
Lower closure prototype after its body. Fixes #79537. r? `@Mark-Simulacrum`
2021-01-23Rollup merge of #81243 - osa1:fix_80742_2, r=RalfJungJonas Schievink-3/+31
mir: Improve size_of handling when arg is unsized As discussed on Zulip with `@RalfJung.`
2021-01-23Add option to control doctest run directoryArpad Borsos-0/+35
This option will allow splitting the compile-time from the run-time directory of doctest invocations and is one step to solve https://github.com/rust-lang/cargo/issues/8993#issuecomment-760088944
2021-01-23Move test to mir-opt so we actually see that no inlining is happeningoli-4/+95
2021-01-23Make sure that const prop does not produce unsilenceable lints after inliningoli-0/+15
2021-01-23Prevent query cycles during inliningoli-0/+86
2021-01-23Auto merge of #80579 - RalfJung:no-fallible-promotion, r=oli-obkbors-281/+238
avoid promoting division, modulo and indexing operations that could fail For division, `x / y` will still be promoted if `y` is a non-zero integer literal; however, `1/(1+1)` will not be promoted any more. While at it, also see if we can reject promoting floating-point arithmetic (which are [complicated](https://github.com/rust-lang/unsafe-code-guidelines/issues/237) so maybe we should not promote them). This will need a crater run to see if there's code out there that relies on these things being promoted. If we can land this, promoteds in `fn`/`const fn` cannot fail to evaluate any more, which should let us do some simplifications in codegen/Miri! Cc https://github.com/rust-lang/rfcs/pull/3027 Fixes https://github.com/rust-lang/rust/issues/61821 r? `@oli-obk`
2021-01-23Iterate DefId to encode spans.Camille GILLOT-8/+2
2021-01-23Put dynamic check tests into their own fileoli-24/+64
2021-01-23Cover more cases in the test suiteoli-38/+99
2021-01-23Adjust wording of a diagnosticoli-17/+17
2021-01-23Fix a comment that only made sense in the context of a dataflow based ↵oli-3/+2
mutability check
2021-01-23Rename tests to what their code actually doesoli-0/+0
2021-01-23Permit mutable references in all const contextsoli-143/+226
2021-01-23Auto merge of #80065 - b-naber:parse-angle-arg-diagnostics, r=petrochenkovbors-38/+141
Improve diagnostics when parsing angle args https://github.com/rust-lang/rust/pull/79266 introduced parsing of generic arguments in associated type constraints, this however resulted in possibly very confusing error messages in cases in which closing angle brackets were missing such as in `Vec<(u32, _, _) = vec![]`, which outputs an incorrectly parsed equality constraint error, as noted by `@cynecx.` This PR tries to provide better error messages in such cases. r? `@petrochenkov`
2021-01-22rustdoc: Fix visibility of trait and impl itemsCamelid-0/+32