about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2022-11-05Auto merge of #103991 - matthiaskrgr:rollup-tj53nte, r=matthiaskrgrbors-7/+9
Rollup of 7 pull requests Successful merges: - #103868 (Use `TraitEngine` (by itself) less) - #103878 (Fix artifact version/channel detection for stable) - #103946 (Cleanup bind_pattern args) - #103956 (Make mir opt unused file check blessable) - #103977 (LLVM 16: Switch to using MemoryEffects) - #103980 (rustdoc: simplify search results CSS and DOM) - #103984 (Refactor tcx mk_const parameters.) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-11-05Specify that `break` cannot be used outside of loop *or* labeled blockclubby789-27/+27
2022-11-05Rollup merge of #103980 - notriddle:notriddle/search-results, r=GuillaumeGomezMatthias Krüger-5/+5
rustdoc: simplify search results CSS and DOM Preview: http://notriddle.com/notriddle-rustdoc-demos/search-results/std/index.html?search=vec There is a layout change caused by this commit, but it's subtle. You won't notice it unless you're looking for it. ## Before ![image](https://user-images.githubusercontent.com/1593513/200060877-05ae4135-db8d-4d24-8dfa-4c06b8ef671c.png) ## After ![image](https://user-images.githubusercontent.com/1593513/200061474-b0ea9e8d-72c3-401f-9106-072307d9e2ff.png)
2022-11-05Rollup merge of #103977 - TimNN:memory-effects, r=nikicMatthias Krüger-2/+4
LLVM 16: Switch to using MemoryEffects This adapts the compiler to the changes required by https://github.com/llvm/llvm-project/commit/304f1d59ca41872c094def3aee0a8689df6aa398. AFAICT, `WriteOnly` isn't used by the compiler, all `ReadNone` uses were migrated and the remaining use of `ReadOnly` is only for function parameters. To simplify the FFI, this PR uses an enum to represent `MemoryEffects` across the FFI boundary, which then gets mapped to the matching static factory method when constructing the attribute. Fixes #103961. `@rustbot` label +llvm-main r? `@nikic`
2022-11-04Auto merge of #103298 - ferrocene:pa-compile-flags-last, r=jyn514bors-0/+9
Ensure that compile-flags arguments are the last in UI tests Before this PR, compiletest would add `-L path/to/aux` at the end of the rustc flags, even after the custom ones set with the compile-flags header comment. This made it impossible to check how rustc would behave when a flag requiring an argument was passed without the argument, because the argument would become `-L`. This PR fixes that by adding the `-L path/to/aux` before the arguments defined in compile-flags, at least for UI tests. Other test suites might either be fixed as well by this change, or still present the old behavior (`-L` is now always passed before, but other tests suites might add additional flags after the custom ones).
2022-11-04Don't silently eat label before block in block-like exprMichael Goulet-0/+219
2022-11-04rustdoc: get rid of CSS/DOM `div.desc span`, which isn't really neededMichael Howell-4/+4
2022-11-04rustdoc: simplify search results CSS and DOMMichael Howell-1/+1
There is a layout change caused by this commit, but it's subtle. You won't notice it unless you're looking for it.
2022-11-04rustdoc: add test for cross-crate trait-object typesLeón Orell Valerian Liehr-0/+49
as well as some FIXMEs
2022-11-04rustdoc: move cross-crate lifetime/outlives bounds on GAT params from ↵León Orell Valerian Liehr-1/+5
where-clause to param declaration site I've overlooked this in #103190.
2022-11-04rustdoc: render unnamed arguments as underscores in cross-crate functions & ↵León Orell Valerian Liehr-2/+2
function pointers for consistency with the way we display local definitions (cleaned from HIR, not from rustc_middle).
2022-11-04rustdoc: render late-bound lifetimes in generic parameter list of ↵León Orell Valerian Liehr-1/+1
cross-crate functions and methods
2022-11-04LLVM 16: Switch to using MemoryEffectsTim Neumann-2/+4
2022-11-04Rollup merge of #103964 - clubby789:lint-enclosing-unsafe, r=compiler-errorsMatthias Krüger-0/+50
Give a specific lint for unsafety not being inherited In cases like ```rs static mut FOO: u64 = 0; fn main() { unsafe {static BAR: u64 = FOO;} } ``` and ```rs fn foo() { unsafe { fn bar() { unsafe_call(); } } } ``` Specifically inform the user that the unsafety is not inherited for the seperate enclosing items Fixes #94077 r? compiler-errors `@rustbot` label +A-diagnostics
2022-11-04Rollup merge of #103897 - Amanieu:llvm-58384, r=davidtwcoMatthias Krüger-0/+16
asm: Work around LLVM bug on AArch64 Upstream issue: https://github.com/llvm/llvm-project/issues/58384 LLVM gets confused if we assign a 32-bit value to a 64-bit register, so pass the 32-bit register name to LLVM in that case.
2022-11-04Rollup merge of #103681 - RalfJung:libtest-thread, r=thomccMatthias Krüger-5/+5
libtest: run all tests in their own thread, if supported by the host This reverts the threading changes of https://github.com/rust-lang/rust/pull/56243, which made it so that with `-j1`, the test harness does not spawn any threads. Those changes were done to enable Miri to run the test harness, but Miri supports threads nowadays, so this is no longer needed. Using a thread for each test is useful because the thread's name can be set to the test's name which makes panic messages consistent between `-j1` and `-j2` runs and also a bit more readable. I did not revert the HashMap changes of https://github.com/rust-lang/rust/pull/56243; using a deterministic map seems fine for the test harness and the more deterministic testing is the better. Fixes https://github.com/rust-lang/rust/issues/59122 Fixes https://github.com/rust-lang/rust/issues/70492
2022-11-04Rollup merge of #103397 - crlf0710:port_dead_code_lint, r=davidtwcoMatthias Krüger-6/+6
Port `dead_code` lints to be translatable. This adds an additional comma to lists with three or more items, to be consistent with list formatters like `icu4x`. r? `@davidtwco`
2022-11-04Formatting changes + add UI testclubby789-0/+50
2022-11-04fake a base to suppress later extra error messageyukang-24/+21
2022-11-04Rollup merge of #103950 - nbdd0121:master, r=tmiaskoMatthias Krüger-0/+12
Fix ICE when negative impl is collected during eager mono ```rust trait Foo { fn foo() {} } impl !Foo for () {} ``` This code will currently cause an ICE when mono collection mode is "eager" (with `-C link-dead-code=y` or `-Z print-mono-items=eager`.
2022-11-04Rollup merge of #103780 - compiler-errors:bound-closure-lifetimes, r=jackh726Matthias Krüger-0/+63
Fix late-bound lifetime closure ICEs in HIR typeck and MIR borrowck During HIR typeck, we need to teach astconv to treat late-bound regions within a closure body as free, fixing escaping bound vars ICEs in both of the issues below. However, this then gets us to MIR borrowck, which itself needs to be taught how to instantiate free region vids for late-bound regions that come from items that _aren't_ the typeck root (for now, just closures). Fixes #103771 Fixes #103736
2022-11-04Rollup merge of #103938 - notriddle:notriddle/search-results-border-bottom, ↵Matthias Krüger-0/+18
r=GuillaumeGomez rustdoc: clean up hardcoded CSS border color on search results Hardcoded colors in rustdoc.css should usually be avoided. Preview: http://notriddle.com/notriddle-rustdoc-demos/border-bottom-search/test_dingus/?search=test
2022-11-04Rollup merge of #103930 - fee1-dead-contrib:mv-from-root, r=jyn514Matthias Krüger-7/+7
Move some tests from `src/test/ui` to more reasonable places
2022-11-04Rollup merge of #103892 - compiler-errors:afit-rustdoc, r=GuillaumeGomezMatthias Krüger-0/+14
Properly render asyncness for trait fns without default body We weren't properly desugaring async fns in traits unless they had default bodies (in which case rustdoc treats them much like they came from an impl). cc ```@yoshuawuyts``` should help with https://rust-lang.zulipchat.com/#narrow/stream/330606-wg-async.2Fasync-fn-in-trait-impl/topic/type.20inside.20.60async.20fn.60.20body.20must.20be.20known.20in.20this.20context/near/306894869
2022-11-04Make non-ASCII errors more consistent.Nicholas Nethercote-45/+45
There are three kinds of "byte" literals: byte literals, byte string literals, and raw byte string literals. None are allowed to have non-ASCII chars in them. Two `EscapeError` variants exist for when that constraint is violated. - `NonAsciiCharInByte`: used for byte literals and byte string literals. - `NonAsciiCharInByteString`: used for raw byte string literals. As a result, the messages for raw byte string literals use different wording, without good reason. Also, byte string literals are incorrectly described as "byte constants" in some error messages. This commit eliminates `NonAsciiCharInByteString` so the three cases are handled similarly, and described correctly. The `mode` is enough to distinguish them. Note: Some existing error messages mention "byte constants" and some mention "byte literals". I went with the latter here, because it's a more correct name, as used by the Reference.
2022-11-04Fix ICE when negative impl is collected during eager monoGary Guo-0/+12
2022-11-04fix #102806, suggest use .. to fill in the rest of the fields of Structyukang-0/+73
2022-11-03rustdoc: clean up hardcoded CSS border color on search resultsMichael Howell-0/+18
Hardcoded colors in rustdoc.css should usually be avoided.
2022-11-03Move some tests from `src/test/ui` to more reasonable placesDeadbeef-7/+7
2022-11-03Elaborate supertrait obligations when deducing closure signatureMichael Goulet-28/+30
2022-11-03Fix Access Violation when using lld & ThinLTO on windows-msvcWesley Wiser-1/+1
Users report an AV at runtime of the compiled binary when using lld and ThinLTO on windows-msvc. The AV occurs when accessing a static value which is defined in one crate but used in another. Based on the disassembly of the cross-crate use, it appears that the use is not correctly linked with the definition and is instead assigned a garbage pointer value. If we look at the symbol tables for each crates' obj file, we can see what is happening: *lib.obj*: ``` COFF SYMBOL TABLE ... 00E 00000000 SECT2 notype External | _ZN10reproducer7memrchr2FN17h612b61ca0e168901E ... ``` *bin.obj*: ``` COFF SYMBOL TABLE ... 010 00000000 UNDEF notype External | __imp__ZN10reproducer7memrchr2FN17h612b61ca0e168901E ... ``` The use of the symbol has the "import" style symbol name but the declaration doesn't generate any symbol with the same name. As a result, linking the files generates a warning from lld: > rust-lld: warning: bin.obj: locally defined symbol imported: reproducer::memrchr::FN::h612b61ca0e168901 (defined in lib.obj) [LNK4217] and the symbol reference remains undefined at runtime leading to the AV. To fix this, we just need to detect that we are performing ThinLTO (and thus, static linking) and omit the `dllimport` attribute on the extern item in LLVM IR.
2022-11-03Add test caseWesley Wiser-0/+28
2022-11-03roll another resolution logic in rustdocDeadbeef-19/+1
2022-11-03Correctly resolve Inherent Associated TypesDeadbeef-52/+49
2022-11-03move compiletest's own ui tests into a subdirectoryPietro Albini-0/+0
2022-11-03check for pattern in compiletest-compile-flags-lastPietro Albini-0/+1
2022-11-03Auto merge of #103904 - JakobDegen:mir-opt-dash, r=oli-obkbors-3259/+3259
Ban dashes in miropt test file names Dashes in miropt test file names are annoying - specifically, they cause the test files to not be sorted next to their outputs, which makes it very difficult to tell what goes with what. This PR changes all files to use underscores and adds a blessable tidy check that enforces this. r? `@jyn514` This PR is obviously going to bitrot very quickly. Because of this, I'm going to wait at least 48 hours and until review comes back to allow people from `@rust-lang/wg-mir-opt` or elsewhere to lodge complaints if there are any. If not, I'll rebase the branch on Friday afternoon PST and ask that it be `r+`'d with `p=1` at that time.
2022-11-03Stabilize default_alloc_error_handlerAmanieu d'Antras-31/+0
Closes #66741
2022-11-02Ban dashes in miropt test file namesJakob Degen-3259/+3259
2022-11-02Rollup merge of #103886 - GuillaumeGomez:local-reexport-doc, r=notriddleMatthias Krüger-0/+16
rustdoc: Fix merge of attributes for reexports of local items Fixes https://github.com/rust-lang/rust/issues/84619. The problem was that we didn't merge attributes between the the reexport and the item. r? `@notriddle`
2022-11-02Rollup merge of #103870 - TaKO8Ki:fix-103790, r=fee1-deadMatthias Krüger-0/+75
Fix `inferred_kind` ICE Fixes #103790
2022-11-02Rollup merge of #99801 - ↵Matthias Krüger-0/+33
Neo-Zhixing:fix/generic_const_exprs_parent_opaque_predicates, r=oli-obk fix(generic_const_exprs): Fix predicate inheritance for children of opaque types Fixes #99705 We currently have a special case to perform predicate inheritance when the const item is in the generics. I think we're also going to need this for opaque return types. When evaluating the predicates applied to the associated item, it'll inherit from its parent, the opaque type, which will never have predicates applied. This PR bypass the opaque typed parent and inherit predicates directly from the function itself.
2022-11-02asm: Work around LLVM bug on AArch64Amanieu d'Antras-0/+16
Upstream issue: https://github.com/llvm/llvm-project/issues/58384 LLVM gets confused if we assign a 32-bit value to a 64-bit register, so pass the 32-bit register name to LLVM in that case.
2022-11-02Properly render asyncness for traits without default bodyMichael Goulet-0/+14
2022-11-02Rollup merge of #103774 - compiler-errors:dyn-trait-in-type-name, r=eholkDylan DPC-4/+1
Format `dyn Trait` better in `type_name` intrinsic Noticed this in #103764 (though not related to that PR at all!) ```rust trait Foo { type Bar; } fn main() { println!( "`dyn Fn(i32, i32) -> i32` => `{}`", std::any::type_name::<dyn Fn(i32, i32) -> i32>() ); println!( "`dyn Foo<Bar = i32> + Send + Sync` => `{}`", std::any::type_name::<dyn Foo<Bar = i32> + Send + Sync>() ); } ``` ``` `dyn Fn(i32, i32) -> i32` => `dyn core::ops::function::Fn<(i32, i32)>+Output = i32` `dyn Foo<Bar = i32> + Send + Sync` => `dyn playground::Foo+Bar = i32+core::marker::Sync+core::marker::Send` ``` Just reuse `pretty_print_dyn_existential` which already makes an attempt to make its output stable.
2022-11-02Remove has_errors from FnCtxtMichael Goulet-5/+19
2022-11-02Add regression test for doc of reexport of local itemsGuillaume Gomez-0/+16
2022-11-02Auto merge of #103649 - petrochenkov:docnotrait, r=GuillaumeGomezbors-0/+12
rustdoc: Do not add external traits to the crate in `register_res` It's not clear why it was done, and apparently it's no longer necessary now. Such additions are unpredictable for early doc link resolution and would force us to collect all doc links from all external traits. Fixes https://github.com/rust-lang/rust/issues/103463
2022-11-02return const_error when ty has errorsTakayuki Maeda-0/+75
2022-11-01Rollup merge of #103839 - Nilstrieb:print-list, r=compiler-errorsManish Goregaokar-0/+6
Print valid `--print` requests if request is invalid When someone makes a typo, it can be useful to see the valid options. This is also useful if someone wants to find out about all the options.