about summary refs log tree commit diff
path: root/src/test/ui
AgeCommit message (Collapse)AuthorLines
2022-06-29Rollup merge of #97423 - m-ou-se:memory-ordering-intrinsics, r=tmiaskoDylan DPC-119/+119
Simplify memory ordering intrinsics This changes the names of the atomic intrinsics to always fully include their memory ordering arguments. ```diff - atomic_cxchg + atomic_cxchg_seqcst_seqcst - atomic_cxchg_acqrel + atomic_cxchg_acqrel_release - atomic_cxchg_acqrel_failrelaxed + atomic_cxchg_acqrel_relaxed // And so on. ``` - `seqcst` is no longer implied - The failure ordering on chxchg is no longer implied in some cases, but now always explicitly part of the name. - `release` is no longer shortened to just `rel`. That was especially confusing, since `relaxed` also starts with `rel`. - `acquire` is no longer shortened to just `acq`, such that the names now all match the `std::sync::atomic::Ordering` variants exactly. - This now allows for more combinations on the compare exchange operations, such as `atomic_cxchg_acquire_release`, which is necessary for #68464. - This PR only exposes the new possibilities through unstable intrinsics, but not yet through the stable API. That's for [a separate PR](https://github.com/rust-lang/rust/pull/98383) that requires an FCP. Suffixes for operations with a single memory order: | Order | Before | After | |---------|--------------|------------| | Relaxed | `_relaxed` | `_relaxed` | | Acquire | `_acq` | `_acquire` | | Release | `_rel` | `_release` | | AcqRel | `_acqrel` | `_acqrel` | | SeqCst | (none) | `_seqcst` | Suffixes for compare-and-exchange operations with two memory orderings: | Success | Failure | Before | After | |---------|---------|--------------------------|--------------------| | Relaxed | Relaxed | `_relaxed` | `_relaxed_relaxed` | | Relaxed | Acquire | :x: | `_relaxed_acquire` | | Relaxed | SeqCst | :x: | `_relaxed_seqcst` | | Acquire | Relaxed | `_acq_failrelaxed` | `_acquire_relaxed` | | Acquire | Acquire | `_acq` | `_acquire_acquire` | | Acquire | SeqCst | :x: | `_acquire_seqcst` | | Release | Relaxed | `_rel` | `_release_relaxed` | | Release | Acquire | :x: | `_release_acquire` | | Release | SeqCst | :x: | `_release_seqcst` | | AcqRel | Relaxed | `_acqrel_failrelaxed` | `_acqrel_relaxed` | | AcqRel | Acquire | `_acqrel` | `_acqrel_acquire` | | AcqRel | SeqCst | :x: | `_acqrel_seqcst` | | SeqCst | Relaxed | `_failrelaxed` | `_seqcst_relaxed` | | SeqCst | Acquire | `_failacq` | `_seqcst_acquire` | | SeqCst | SeqCst | (none) | `_seqcst_seqcst` |
2022-06-29Erase regions in new abstract constskadmin-0/+33
2022-06-28Don't point at another arg if we're already pointing at oneMichael Goulet-10/+47
2022-06-29Auto merge of #98376 - nnethercote:improve-derive-PartialEq, r=petrochenkovbors-0/+1163
Improve some deriving code and add a test The `.stdout` test is particularly useful. r? `@petrochenkov`
2022-06-28Migrate some rustc_borrowck diagnostics to SessionDiagnosticMichael Goulet-18/+18
2022-06-28Do not use a suggestion to change a binding's name to a typeMichael Goulet-17/+15
2022-06-28Remove redundant logic to suggest `as_ref`Michael Goulet-10/+95
2022-06-28Fix #98260, added the test caseYan Chen-0/+21
2022-06-28Note concrete type being coerced into objectMichael Goulet-49/+49
2022-06-28Fix trait object reborrow suggestionMichael Goulet-0/+35
2022-06-28Address code review commentsDominik Stolz-1/+1
2022-06-28Improve pretty printing of valtrees for referencesDominik Stolz-0/+48
2022-06-28Auto merge of #98632 - matthiaskrgr:rollup-peg868d, r=matthiaskrgrbors-0/+54
Rollup of 11 pull requests Successful merges: - #98548 (rustdoc-json: Allow Typedef to be different in sanity assert) - #98560 (Add regression test for #85907) - #98564 (Remove references to `./tmp` in-tree) - #98602 (Add regression test for #80074) - #98606 (:arrow_up: rust-analyzer) - #98609 (Fix ICE for associated constant generics) - #98611 (Fix glob import ICE in rustdoc JSON format) - #98617 (Remove feature `const_option` from std) - #98619 (Fix mir-opt wg name) - #98621 (llvm-wrapper: adapt for removal of the ASanGlobalsMetadataAnalysis LLVM API) - #98623 (fix typo in comment) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-06-28Rollup merge of #98609 - TaKO8Ki:fix-ice-for-associated-constant-generics, ↵Matthias Krüger-0/+23
r=lcnr Fix ICE for associated constant generics Fixes #98432
2022-06-28Rollup merge of #98602 - TaKO8Ki:add-regression-test-for-issue-80074, ↵Matthias Krüger-0/+14
r=Mark-Simulacrum Add regression test for #80074 closes #80074
2022-06-28Rollup merge of #98560 - TaKO8Ki:add-regression-test-for-85907, ↵Matthias Krüger-0/+17
r=Mark-Simulacrum Add regression test for #85907 closes #85907
2022-06-28Fix test for non-prefer-dynamic targetGary Guo-3/+2
2022-06-28Auto merge of #98188 - mystor:fast_group_punct, r=eddybbors-1/+1
proc_macro/bridge: stop using a remote object handle for proc_macro Punct and Group This is the third part of https://github.com/rust-lang/rust/pull/86822, split off as requested in https://github.com/rust-lang/rust/pull/86822#pullrequestreview-1008655452. This patch transforms the `Punct` and `Group` types into structs serialized over IPC rather than handles, making them more efficient to create and manipulate from within proc-macros.
2022-06-28Auto merge of #98612 - Dylan-DPC:rollup-7tasikc, r=Dylan-DPCbors-44/+197
Rollup of 9 pull requests Successful merges: - #97346 (Remove a back-compat hack on lazy TAIT) - #98261 (Remove `MAX_SUGGESTION_HIGHLIGHT_LINES`) - #98337 ([RFC 2011] Optimize non-consuming operators) - #98384 (Fix RSS reporting on macOS) - #98420 (translation: lint fix + more migration) - #98430 (Refactor iter adapters with less macros) - #98555 (Hermit: Fix initializing lazy locks) - #98595 (Implement `Send` and `Sync` for `ThinBox<T>`) - #98597 (Remove unstable CStr/CString change from 1.62 release note) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-06-28Rollup merge of #98337 - c410-f3r:assert-compiler, r=oli-obkDylan DPC-38/+179
[RFC 2011] Optimize non-consuming operators Tracking issue: https://github.com/rust-lang/rust/issues/44838 Fifth step of https://github.com/rust-lang/rust/pull/96496 The most non-invasive approach that will probably have very little to no performance impact. ## Current behaviour Captures are handled "on-the-fly", i.e., they are performed in the same place expressions are located. ```rust // `let a = 1; let b = 2; assert!(a > 1 && b < 100);` if !( { ***try capture `a` and then return `a`*** } > 1 && { ***try capture `b` and then return `b`*** } < 100 ) { panic!( ... ); } ``` As such, some overhead is likely to occur (Specially with very large chains of conditions). ## New behaviour for non-consuming operators When an operator is known to not take `self`, then it is possible to capture variables **AFTER** the condition. ```rust // `let a = 1; let b = 2; assert!(a > 1 && b < 100);` if !( a > 1 && b < 100 ) { { ***try capture `a`*** } { ***try capture `b`*** } panic!( ... ); } ``` So the possible impact on the runtime execution time will be diminished. r? ````@oli-obk````
2022-06-28Rollup merge of #97346 - JohnTitor:remove-back-compat-hacks, r=oli-obkDylan DPC-6/+18
Remove a back-compat hack on lazy TAIT This PR's motivation is here: https://github.com/rust-lang/rust/issues/72614#issuecomment-1134595446 ~~But removing a hack doesn't seem to reject the code on the issue, there're some more hacks?~~ r? ``@oli-obk``
2022-06-28Auto merge of #98396 - cjgillot:iwfchir, r=petrochenkovbors-19/+16
Do not access HIR to check impl wf. r? `@ghost`
2022-06-28fix `emit_inference_failure_err` ICElcnr-0/+100
2022-06-28fix ice for associated constant genericsTakayuki Maeda-0/+23
2022-06-28Remove `final_arg_types`, improve tuple wrapping suggestionMichael Goulet-7/+57
2022-06-28Rename/restructure memory ordering intrinsics.Mara Bos-119/+119
2022-06-27Use typed indices in argument mismatch algorithmMichael Goulet-48/+47
2022-06-28Auto merge of #98222 - cjgillot:single-wf, r=michaelwoeristerbors-265/+149
Only keep a single query for well-formed checking There are currently 3 queries to perform wf checks on different item-likes. This complexity is not required. This PR replaces the query by: - one query per item; - one query to invoke it for a whole module. This allows to remove HIR `ParItemLikeVisitor`.
2022-06-28add regression test for #80074Takayuki Maeda-0/+14
2022-06-27Rollup merge of #98506 - compiler-errors:object-safety-suggestions, r=oli-obkMatthias Krüger-3/+47
Fix span issues in object safety suggestions Fixes #98500
2022-06-27Remove a back-compat hack on lazy TAITYuki Okushi-6/+18
2022-06-27Rollup merge of #98530 - davidkna:known-bug-ref, r=Mark-SimulacrumMatthias Krüger-16/+16
compiletest: add issue number param to `known-bug` I was getting some errors while testing this, but I'm pretty sure that was unrelated to my changes. Closes #98436 > Basically, instead of `// known-bug`, do `// known-bug #00000` or maybe `// known-bug chalk#00`? > > From: https://rust-lang.zulipchat.com/#narrow/stream/326866-t-types.2Fnominated/topic/.2398095.3A.20NLL.3A.20unsound.20verification.20of.20higher.20ranked.20outlives.E2.80.A6/near/287258738 I also added an `unknown` escape-hatch because I didn't find corresponding issues for every `// known-bug`. The syntax also ended up being `// known-bug: `, because of `set_name_value_directive`.
2022-06-27Rollup merge of #97780 - compiler-errors:field-wfcheck-before-sized, r=jackh726Matthias Krüger-24/+40
Check ADT field is well-formed before checking it is sized Fixes #96810. There is one diagnostics regression, in [`src/test/ui/generic-associated-types/bugs/issue-80626.stderr`](https://github.com/rust-lang/rust/pull/97780/files#diff-53795946378e78a0af23a10277c628ff79091c18090fdc385801ee70c1ba6963). I am not super concerned about it, since it's GAT related. We _could_ fix it, possibly by using the `FieldSized` obligation cause code instead of `BuiltinDerivedObligation`. But that would require changing `Sized` trait confirmation and the `adt_sized_constraint` query.
2022-06-27Rollup merge of #97389 - m-ou-se:memory-ordering-diagnostics, r=estebankMatthias Krüger-228/+246
Improve memory ordering diagnostics Before: ![image](https://user-images.githubusercontent.com/783247/170234545-891cac30-eaa2-4186-847b-35cd51e00f2b.png) After: ![image](https://user-images.githubusercontent.com/783247/170239684-645f186f-5a02-4eb9-8651-2e5fe9591352.png) --- Before this change, the compiler suggests the failure ordering is too strong and suggests choosing a weaker ordering. After this change, it instead suggests the success ordering is not strong enough, and suggests chosing a stronger one. This is more likely to be correct. Also, before this change, the compiler suggested downgrading an invalid AcqRel failure ordering to Relaxed, without mentioning Acquire as an option.
2022-06-27Auto merge of #98221 - cjgillot:single-coh, r=lcnrbors-148/+138
Perform coherence checking per impl. r? `@ghost`
2022-06-26proc_macro: stop using a remote object handle for PunctNika Layzell-1/+1
This greatly reduces round-trips to fetch relevant extra information about the token in proc macro code, and avoids RPC messages to create Punct tokens.
2022-06-27add regression test for #85907Takayuki Maeda-0/+17
2022-06-27Improve derived discriminant testing.Nicholas Nethercote-11/+11
Currently the generated code for methods like `eq`, `ne`, and `partial_cmp` includes stuff like this: ``` let __self_vi = ::core::intrinsics::discriminant_value(&*self); let __arg_1_vi = ::core::intrinsics::discriminant_value(&*other); if true && __self_vi == __arg_1_vi { ... } ``` This commit removes the unnecessary `true &&`, and makes the generating code a little easier to read in the process. It also fixes some errors in comments.
2022-06-27Add a test checking the output of builtin derives.Nicholas Nethercote-0/+1163
2022-06-26compiletest: add issue number param to `known-bug`David Knaack-16/+16
2022-06-26Rollup merge of #98540 - TaKO8Ki:add-regression-test-for-87558, ↵Matthias Krüger-0/+33
r=Mark-Simulacrum Add regression test for #87558 Fixes #87558
2022-06-26Rollup merge of #98538 - TaKO8Ki:add-test-for-issue-91883, r=Mark-SimulacrumMatthias Krüger-0/+68
Add a ui test for issue #91883 closes #91883
2022-06-26Rollup merge of #97743 - RalfJung:const-err-future-breakage, r=estebankMatthias Krüger-0/+2838
make const_err show up in future breakage reports As tracked in https://github.com/rust-lang/rust/issues/71800, const_err should become a hard error Any Day Now (TM). I'd love to move forward with that sooner rather than later; it has been deny-by-default for many years and a future incompat lint since https://github.com/rust-lang/rust/pull/80394 (landed more than a year ago). Some CTFE errors are already hard errors since https://github.com/rust-lang/rust/pull/86194. But before we truly make it a hard error in all cases, we now have one more intermediate step we can take -- to make it show up in future breakage reports. Cc `````@rust-lang/wg-const-eval`````
2022-06-26Rollup merge of #97295 - c410-f3r:yet-another-let-chain, r=compiler-errorsMatthias Krüger-192/+436
[rustc_parse] Forbid `let`s in certain places Currently only forbids in locals to resolve https://github.com/rust-lang/rust/pull/94927#issuecomment-1099605024 but feel free to point any other places.
2022-06-26add a ui test for issue #91883Takayuki Maeda-0/+68
2022-06-26add regression test for #87558Takayuki Maeda-0/+33
2022-06-26Add regression test for #79224Yuki Okushi-0/+53
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2022-06-26Rollup merge of #98509 - rust-lang:notriddle/precise-pin-diag, r=compiler-errorsYuki Okushi-0/+24
diagnostics: consider parameter count when suggesting smart pointers Fixes #96834
2022-06-26Rollup merge of #98491 - antoyo:fix/ui-test-backtrace-panic-abort, r=Dylan-DPCYuki Okushi-0/+1
Fix backtrace UI test when panic=abort is used The function `contains_verbose_expected` is only used when the panic strategy is not abort, so it caused a warning when it was abort, which made the UI test failed on stderr comparison.
2022-06-26Rollup merge of #98371 - compiler-errors:better-opaque-printing, r=oli-obkYuki Okushi-1/+46
Fix printing `impl trait` under binders Before, we would render `impl for<'a> Trait<'a>` like `impl Trait<for<'a> 'a>`, lol.