about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2022-06-29Remove needless FIXMENoah Lev-3/+0
In this case, it seems fine to have the field be the inverse of the flag, especially the `enable` vs `disable` terminology is clear.
2022-06-29Rollup merge of #98625 - RalfJung:retag, r=oli-obkDylan DPC-0/+2
emit Retag for compound types with reference fields I want to add an option to Miri to do retagging inside reference fields. But that means we first have to even emit `Retag` for types that *contain* references (rather than being of reference types). :) Stacked Borrows originally did that, but we stopped doing it when hitting bunch of issues in the standard library. However I have since realized that we actually do emit `noalias` for newtypes references, which means for soundness we should recurse into fields. Also it'd probably be bad news if newtypes lose out on optimizations (and they don't, for anything else). I want to add an option for that to Miri so that we can start experimenting with those semantics. r? ``@oli-obk``
2022-06-29Rollup merge of #98607 - compiler-errors:tuple-wrap-suggestion, r=oli-obkDylan DPC-17/+104
Clean up arg mismatch diagnostic, generalize tuple wrap suggestion This is based on top of #97542, so just look at the last commit which contains the relevant changes. 1. Remove `final_arg_types` which was one of the last places we were using raw (`usize`) indices instead of typed indices in the arg mismatch suggestion code. 2. Improve the tuple wrap suggestion, now we suggest things like `call(a, b, c, d)` -> `call(a, (b, c), d)` :smiley_cat: 3. Folded in fix #98645
2022-06-29Rollup merge of #98499 - JulianKnodt:erase_lifetime, r=lcnrDylan DPC-0/+33
Erase regions in New Abstract Consts When an abstract const is constructed, we previously included lifetimes in the set of substitutes, so it was not able to unify two abstract consts if their lifetimes did not match but the values did, despite the values not depending on the lifetimes. This caused code that should have compiled to not compile. Fixes #98452 r? ```@lcnr```
2022-06-29Rollup merge of #98415 - ↵Dylan DPC-18/+18
compiler-errors:rustc-borrowck-session-diagnostic-1, r=davidtwco Migrate some `rustc_borrowck` diagnostics to `SessionDiagnostic` Self-explanatory r? ```@davidtwco```
2022-06-29Auto merge of #98558 - nnethercote:smallvec-1.8.1, r=lqdbors-2/+2
Update `smallvec` to 1.8.1. This pulls in https://github.com/servo/rust-smallvec/pull/282, which gives some small wins for rustc. r? `@lqd`
2022-06-29Auto merge of #98656 - Dylan-DPC:rollup-hhytn0c, r=Dylan-DPCbors-254/+424
Rollup of 7 pull requests Successful merges: - #97423 (Simplify memory ordering intrinsics) - #97542 (Use typed indices in argument mismatch algorithm) - #97786 (Account for `-Z simulate-remapped-rust-src-base` when resolving remapped paths) - #98277 (Fix trait object reborrow suggestion) - #98525 (Add regression test for #79224) - #98549 (interpret: do not prune requires_caller_location stack frames quite so early) - #98603 (Some borrowck diagnostic fixes) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-06-29Rollup merge of #98603 - compiler-errors:minor-borrowck-diagnostic-fixes, ↵Dylan DPC-25/+108
r=davidtwco Some borrowck diagnostic fixes 1. Remove some redundant `.as_ref` suggestion logic from borrowck, this has the consequence of also not suggesting `.as_ref` after `Option` methods, but (correctly) before. 2. Fix a bug where we were replacing a binding's name with a type. Instead, make it a note. This is somewhat incomplete. See `src/test/ui/borrowck/suggest-as-ref-on-mut-closure.rs` for more improvements.
2022-06-29Rollup merge of #98525 - JohnTitor:issue-79224, r=compiler-errorsDylan DPC-0/+53
Add regression test for #79224 Closes #79224 r? `@compiler-errors` Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2022-06-29Rollup merge of #98277 - compiler-errors:issue-93596, r=estebankDylan DPC-48/+83
Fix trait object reborrow suggestion Fixes #93596 Slightly generalizes the logic we use to suggest fix first implemented in #95609, specifically when we have a `Sized` obligation that comes from a struct's unsized tail.
2022-06-29Rollup merge of #97542 - compiler-errors:arg-mismatch, r=jackh726Dylan DPC-48/+47
Use typed indices in argument mismatch algorithm I kinda went overboard with the renames, but in general, "arg" is renamed to "expected", and "input" is renamed to "provided", and we use new typed indices to make sure we're indexing into the right sized array. Other drive-by changes: 1. Factor this logic into a new function, so we don't need to `break 'label` to escape it. 1. Factored out dependence on `final_arg_types`, which is never populated for arguments greater than the number of expected args. Instead, we just grab the final coerced expression type from `in_progress_typeck_results`. 1. Adjust the criteria we use to print (provided) type names, before we didn't suggest anything that had infer vars, but now we suggest thing that have infer vars but aren't `_`. ~Also, sorry in advance, I kinda want to backport this but I know I have folded in a lot of unnecessary drive-by changes that might discourage that. I would be open to brainstorming how to get some of these changes on beta at least.~ edit: Minimized the ICE-fixing changes to #97557 cc `@jackh726` as author of #92364, and `@estebank` as reviewer of the PR. fixes #97484
2022-06-29Rollup merge of #97423 - m-ou-se:memory-ordering-intrinsics, r=tmiaskoDylan DPC-133/+133
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-29Auto merge of #98542 - jackh726:coinductive-wf, r=oli-obkbors-1/+1
Make empty bounds lower to `WellFormed` and make `WellFormed` coinductive r? rust-lang/types
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-28Note concrete type being coerced into objectMichael Goulet-49/+49
2022-06-28Fix trait object reborrow suggestionMichael Goulet-0/+35
2022-06-28Auto merge of #98475 - notriddle:notriddle/index-fn-signatures, r=GuillaumeGomezbors-146/+380
rustdoc: reference function signature types from the `p` array This reduces the size of the function signature index, because it's common to have many functions that operate on the same types. $ wc -c search-index-old.js search-index-new.js 5224374 search-index-old.js 3932314 search-index-new.js By my math, this reduces the uncompressed size of the search index by 32%. On compressed signatures, the wins are less drastic, a mere 8%: $ wc -c search-index-old.js.gz search-index-new.js.gz 404532 search-index-old.js.gz 371635 search-index-new.js.gz
2022-06-28Auto merge of #98632 - matthiaskrgr:rollup-peg868d, r=matthiaskrgrbors-14/+118
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 #98611 - GuillaumeGomez:rustdoc-json-glob-ice, r=notriddleMatthias Krüger-2/+35
Fix glob import ICE in rustdoc JSON format Fixes #98003. r? `@notriddle`
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 #98606 - lnicola:rust-analyzer-2022-06-28, r=lnicolaMatthias Krüger-7/+7
:arrow_up: rust-analyzer r? ``@ghost``
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 #98564 - jyn514:remove-tmp-dir, r=Mark-SimulacrumMatthias Krüger-5/+0
Remove references to `./tmp` in-tree These used to be used by codegen-units tests, but were switched from manually specifying directories to just using `// incremental` in https://github.com/rust-lang/rust/pull/89101. Remove the old references. Fixes https://github.com/rust-lang/rust/issues/34586.
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-28Rollup merge of #98548 - Enselic:allow-typedef-diff-for-rustdoc-json, ↵Matthias Krüger-0/+22
r=GuillaumeGomez rustdoc-json: Allow Typedef to be different in sanity assert Closes #98547 This fix is a natural extension of #98053. r? `@notriddle` (Since you reviewed the other PR.) CC `@GuillaumeGomez` `@rustbot` labels +A-rustdoc-json +T-rustdoc
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-28emit Retag for compound types with reference fieldsRalf Jung-0/+2
2022-06-28Auto merge of #98612 - Dylan-DPC:rollup-7tasikc, r=Dylan-DPCbors-225/+265
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 #98261 - ↵Dylan DPC-181/+68
WaffleLapkin:attempt_to_remove_max_suggestion_highlight_lines, r=flip1995 Remove `MAX_SUGGESTION_HIGHLIGHT_LINES` After #97798 the `MAX_SUGGESTION_HIGHLIGHT_LINES` constant doesn't really make sense since we always show full suggestions. This PR removes last usages of the constant and the constant itself. r? ``@flip1995`` (this mostly does changes in clippy)
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-28Add regression test for glob import ICE in rustdoc JSONGuillaume Gomez-0/+24
2022-06-28Fix glob import ICE in rustdoc JSON formatGuillaume Gomez-2/+11
2022-06-28fix ice for associated constant genericsTakayuki Maeda-0/+23
2022-06-28test/rustdoc-json/assoc_type.rs: Maximize chance of detecting future ICEsMartin Nordholts-0/+6
2022-06-28rustdoc-json: Add assoc type ICE regression testMartin Nordholts-0/+16
2022-06-28Remove `final_arg_types`, improve tuple wrapping suggestionMichael Goulet-7/+57
2022-06-28Rename/restructure memory ordering intrinsics.Mara Bos-133/+133
2022-06-28:arrow_up: rust-analyzerLaurențiu Nicola-7/+7
2022-06-27Use typed indices in argument mismatch algorithmMichael Goulet-48/+47
2022-06-28Make empty bounds lower to WellFormed and make WellFormed coinductiveJack Huey-1/+1
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-27Add comments, fixes for `0` sentinelMichael Howell-5/+36