about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
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-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-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-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
2021-01-22Auto merge of #72160 - slo1:libstd-setgroups, r=KodrAusbors-0/+26
Add setgroups to std::os::unix::process::CommandExt Should fix #38527. I'm not sure groups is the greatest name though.
2021-01-22bless testsb-naber-1/+1
2021-01-22add and update testsb-naber-38/+141
2021-01-22Auto merge of #81271 - m-ou-se:rollup-xv7gq3w, r=m-ou-sebors-65/+338
Rollup of 10 pull requests Successful merges: - #80573 (Deny rustc::internal lints for rustdoc and clippy) - #81173 (Expand docs on Iterator::intersperse) - #81194 (Stabilize std::panic::panic_any.) - #81202 (Don't prefix 0x for each segments in `dbg!(Ipv6)`) - #81225 (Make 'docs' nullable in rustdoc-json output) - #81227 (Remove doctree::StructType) - #81233 (Document why not use concat! in dbg! macro) - #81236 (Gracefully handle loop labels missing leading `'` in different positions) - #81241 (Turn alloc's force_expr macro into a regular macro_rules.) - #81242 (Enforce statically that `MIN_NON_ZERO_CAP` is calculated at compile time) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-01-22Rollup merge of #81236 - estebank:everybody-loop-now, r=oli-obkMara Bos-65/+338
Gracefully handle loop labels missing leading `'` in different positions Fix #81192. * Account for labels when suggesting `loop` instead of `while true` * Suggest `'a` when given `a` only when appropriate * Add loop head span to hir * Tweak error for invalid `break expr` * Add more misspelled label tests * Avoid emitting redundant "unused label" lint * Parse loop labels missing a leading `'` Each commit can be reviewed in isolation.
2021-01-22Auto merge of #81101 - tmiasko:combine-now, r=nagisabors-70/+1
Combine instructions immediately
2021-01-22Auto merge of #80558 - lcnr:gat-variance, r=matthewjasperbors-0/+24
require gat substs to be invariant fixes #69184, fixes #80766 r? `@matthewjasper` probably
2021-01-22re-bless ui testsRalf Jung-53/+5
2021-01-22expand successful-promotion test a bitRalf Jung-16/+18
2021-01-22do promote array indexing if we know it is in-boundsRalf Jung-44/+47
2021-01-22avoid promoting division, modulo and indexing operations that could failRalf Jung-278/+278
2021-01-21Update src/test/ui/command/command-setgroups.rs to ignore windowsslo1-0/+1
2021-01-21Update src/test/ui/command/command-setgroups.rsslo1-0/+6
Co-authored-by: Ashley Mannix <kodraus@hey.com>
2021-01-21Add setgroups to std::os::unix::process::CommandExtslo1-0/+19
2021-01-22Auto merge of #81135 - jyn514:no-backticks, r=flip1995bors-22/+22
Fix formatting for removed lints - Don't add backticks for the reason a lint was removed. This is almost never a code block, and when it is the backticks should be in the reason itself. - Don't assume clippy is the only tool that needs to be checked for backwards compatibility I split this out of https://github.com/rust-lang/rust/pull/80527/ because it kept causing tests to fail, and it's a good change to have anyway. r? `@flip1995`
2021-01-21Do not suggest using a break label when one is already presentEsteban Küber-18/+6
2021-01-21Parse loop labels missing a leading `'`Esteban Küber-17/+22
When encountering the following typo: ```rust a: loop { break 'a; } ``` provide an appropriate suggestion.
2021-01-21Avoid emitting redundant "unused label" lintEsteban Küber-63/+17
2021-01-21Add more misspelled label testsEsteban Küber-15/+173
2021-01-21Tweak error for invalid `break expr`Esteban Küber-55/+119
Point at loop head on invalid `break expr`. Suggest removing `expr` or using label if available.
2021-01-21Suggest `'a` when given `a` only when appropriateEsteban Küber-21/+27
When encountering a name `a` that isn't resolved, but a label `'a` is found in the current ribs, only suggest `'a` if this name is the value expression of a `break` statement. Solve FIXME.
2021-01-21Account for labels when suggesting `loop` instead of `while true`Esteban Küber-9/+107
2021-01-22Auto merge of #81177 - Aaron1011:fix/force-capture-tokens, r=petrochenkovbors-0/+130
Force token collection to run when parsing nonterminals Fixes #81007 Previously, we would fail to collect tokens in the proper place when only builtin attributes were present. As a result, we would end up with attribute tokens in the collected `TokenStream`, leading to duplication when we attempted to prepend the attributes from the AST node. We now explicitly track when token collection must be performed due to nomterminal parsing.
2021-01-21Lower closure prototype after its body.Camille GILLOT-0/+68
2021-01-21mir: Improve size_of handling when arg is unsizedÖmer Sinan Ağacan-3/+31
2021-01-21require gat substs to be invariantBastian Kauschke-0/+24
2021-01-21Auto merge of #81240 - JohnTitor:rollup-ieaz82a, r=JohnTitorbors-4/+140
Rollup of 11 pull requests Successful merges: - #79655 (Add Vec visualization to understand capacity) - #80172 (Use consistent punctuation for 'Prelude contents' docs) - #80429 (Add regression test for mutual recursion in obligation forest) - #80601 (Improve grammar in documentation of format strings) - #81046 (Improve unknown external crate error) - #81178 (Visit only terminators when removing landing pads) - #81179 (Fix broken links with `--document-private-items` in the standard library) - #81184 (Remove unnecessary `after_run` function) - #81185 (Fix ICE in mir when evaluating SizeOf on unsized type) - #81187 (Fix typo in counters.rs) - #81219 (Document security implications of std::env::temp_dir) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-01-21Rollup merge of #81185 - osa1:fix_80742, r=oli-obkYuki Okushi-0/+75
Fix ICE in mir when evaluating SizeOf on unsized type Not quite ready yet. This tries to fix #80742 as discussed on [Zulip topic][1], by using `delay_span_bug`. I don't understand what `delay_span_bug` does. It seems like my error message is never used. With this patch, in this program: ```rust #![allow(incomplete_features)] #![feature(const_evaluatable_checked)] #![feature(const_generics)] use std::fmt::Debug; use std::marker::PhantomData; use std::mem::size_of; struct Inline<T> where [u8; size_of::<T>() + 1]: , { _phantom: PhantomData<T>, buf: [u8; size_of::<T>() + 1], } impl<T> Inline<T> where [u8; size_of::<T>() + 1]: , { pub fn new(val: T) -> Inline<T> { todo!() } } fn main() { let dst = Inline::<dyn Debug>::new(0); // line 27 } ``` these errors are printed, both for line 27 (annotated line above): - "no function or associated item named `new` found for struct `Inline<dyn Debug>` in the current scope" - "the size for values of type `dyn Debug` cannot be known at compilation time" Second error makes sense, but I'm not sure about the first one and why it's even printed. Finally, I'm not sure about the span passing in `const_eval`. [1]: https://rust-lang.zulipchat.com/#narrow/stream/269128-miri/topic/Help.20fixing.20.2380742
2021-01-21Rollup merge of #81046 - rylev:unknown-external-crate, r=estebankYuki Okushi-4/+34
Improve unknown external crate error This improves error messages when unknown items in the crate root are encountered. Fixes #63799 r? ```@estebank```