about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2022-11-25Refine instruction_set inline rulesLokathor-21/+56
Previously an exact match of the `instruction_set` attribute was required for an MIR inline to be considered. This change checks for an exact match *only* if the callee sets an `instruction_set` in the first place. When the callee does not declare an instruction set then it is considered to be platform agnostic code and it's allowed to be inline'd into the caller.
2022-11-26add start_stmt to handle postfix incrementyukang-8/+177
2022-11-25Rollup merge of #104896 - notriddle:notriddle/tooltip, r=GuillaumeGomezMatthias Krüger-1/+1
rustdoc: fix broken tooltip CSS text `#ffffff` on background `#fdffd3` fails the [WCAG color contrast checker], and seems like a mistake in https://github.com/rust-lang/rust/commit/16b55903ee16503e7026677c169727d1907704c2. Making the cursor a pointer is misleading, since clicking it doesn't do anything. [WCAG color contrast checker]: https://accessibleweb.com/color-contrast-checker/
2022-11-25Rollup merge of #104879 - aDotInTheVoid:jsondoclint-typedef, r=GuillaumeGomezMatthias Krüger-0/+10
jsondoclint: Recognise Typedef as valid kind for Type::ResolvedPath Closes #104851 r? ``@GuillaumeGomez`` ``@rustbot`` modify labels: +A-testsuite
2022-11-25rustdoc: revert tooltip background color on light theme to readableMichael Howell-1/+1
text #fff on background #fdffd3 fails the [WCAG color contrast checker], and seems like a mistake in 16b55903ee16503e7026677c169727d1907704c2. [WCAG color contrast checker]: https://accessibleweb.com/color-contrast-checker/
2022-11-25jsondoclint: Recognise Typedef as valid kind for Type::ResolvedPathNixon Enraght-Moony-0/+10
Closes #104851
2022-11-25Rollup merge of #104849 - GuillaumeGomez:source-code-sidebar-css-migration, ↵Matthias Krüger-8/+36
r=notriddle Migrate source code elements style to CSS variables r? ``@notriddle``
2022-11-25`super_relate_consts` do not spurriously fail on assoc constsBoxy-0/+20
2022-11-25fmtBoxy-1/+1
2022-11-25handle assoc consts in fulfill `ConstEquate`Boxy-151/+61
2022-11-25handle nested obligations in `satisfied_from_param_env`Boxy-8/+79
2022-11-25Add expand_abstract_constkadmin-21/+1
Adds the ability to directly expand a const to an expr without having to deal with intermediate steps.
2022-11-25Add empty ConstKind::Abstractkadmin-35/+163
Initial pass at expr/abstract const/s Address comments Switch to using a list instead of &[ty::Const], rm `AbstractConst` Remove try_unify_abstract_consts Update comments Add edits Recurse more More edits Prevent equating associated consts Move failing test to ui Changes this test from incremental to ui, and mark it as failing and a known bug. Does not cause the compiler to ICE, so should be ok.
2022-11-25fix #104867, Properly handle postfix inc/dec in standalone and subexpr scenariosyukang-22/+163
2022-11-25Use "must be init" instead of "must not be uninit" everywhereOli Scherer-11/+11
2022-11-25Add a `because` to errors derived from fieldsOli Scherer-12/+12
2022-11-25Add a test for OOB rangesOli Scherer-0/+21
2022-11-25Don't show fields from other cratesOli Scherer-34/+4
2022-11-25Reinstate the previous compact form of "in this field" errorsOli Scherer-42/+21
2022-11-25Add a test for scalar pair layout validationOli Scherer-3/+32
2022-11-25Compute layout instead of manually procesisng the layout restriction attributesOli Scherer-0/+63
2022-11-25Print a trace through types to show how to get to the problematic typeOli Scherer-13/+46
2022-11-25Auto merge of #104602 - petrochenkov:effvisperf5, r=oli-obkbors-6/+50
privacy: Fix more (potential) issues with effective visibilities Continuation of https://github.com/rust-lang/rust/pull/103965. See individual commits for more detailed description of the changes. The shortcuts removed in https://github.com/rust-lang/rust/pull/104602/commits/4eb63f618e601efee657d24cd4e8833fb03fac4c and https://github.com/rust-lang/rust/pull/104602/commits/c7c7d1672739e38c8d39ae861b284486aefd5b48 could actually be correct (or correct after some tweaks), but they used global reasoning like "we can skip this update because if the code compiles then some other update should do the same thing eventually". I have some expertise in this area, but I still have doubt whether such global reasoning was correct or not, especially in presence of all possible exotic cases with imports. After this PR all table changes should be "locally correct" after every update, even if it may be overcautious. If similar optimizations are introduced again they will need detailed comments explaining why it's legal to do what they do and providing proofs. Fixes https://github.com/rust-lang/rust/issues/104249. Fixes https://github.com/rust-lang/rust/issues/104539.
2022-11-25fix #104700, account for item-local in inner scope for E0425yukang-0/+32
2022-11-24Tune RepeatWith::try_fold and Take::for_each and Vec::extend_trustedScott McMurray-0/+7
2022-11-24Don't suggest associated function call for associated const.Luqman Aden-7/+1
2022-11-24Strenghten GUI test to include extra state in selectorGuillaume Gomez-6/+12
2022-11-24Extend GUI test to include more source code elements checksGuillaume Gomez-2/+24
2022-11-24Rollup merge of #104796 - notriddle:notriddle/unused-issue-104397, r=oli-obkMatthias Krüger-0/+18
lint: do not warn unused parens around higher-ranked function pointers Fixes #104397
2022-11-24Rollup merge of #104792 - notriddle:notriddle/crate-search-title-display, ↵Matthias Krüger-1/+2
r=GuillaumeGomez rustdoc: simplify `.search-results-title` CSS By using `display: flex`, we still get the never-wrapping layout with `#crate-search-div` maxing out and truncating its text. The title itself winds up always filling its parent, but since `#crate-search` doesn't have `flex-grow` set, it won't fill available space.
2022-11-24Rollup merge of #104782 - oli-obk:const_eval_limit_bump, r=pnkfelixMatthias Krüger-4/+4
Bump the const eval step limit fixes https://github.com/rust-lang/rust/issues/103814 https://github.com/rust-lang/rust/pull/103877 has too much of an impact to beta backport. So let's just increase the limit, avoiding the immediate breakage. r? ``@pnkfelix``
2022-11-24Rollup merge of #104780 - BoxyUwU:error_reported_not_be_bad, r=oli-obkMatthias Krüger-0/+16
make `error_reported` check for delayed bugs Fixes #104768 `error_reported()` was only checking if there were errors emitted, not for `delay_bug`s which can also be a source of `ErrorGuaranteed`. I assume the same is true of `lint_err_count` but i dont know
2022-11-24Rollup merge of #104514 - chenyukang:yukang/fix-104513-ice, r=petrochenkovMatthias Krüger-0/+24
Use node_ty_opt to avoid ICE in visit_ty Fixes #104513
2022-11-24Use kw::Empty for elided lifetimes in path.Camille GILLOT-33/+195
2022-11-24Change how suggested lifetime args are computed.Camille GILLOT-35/+35
2022-11-24Auto merge of #104321 - Swatinem:async-gen, r=oli-obkbors-74/+80
Avoid `GenFuture` shim when compiling async constructs Previously, async constructs would be lowered to "normal" generators, with an additional `from_generator` / `GenFuture` shim in between to convert from `Generator` to `Future`. The compiler will now special-case these generators internally so that async constructs will *directly* implement `Future` without the need to go through the `from_generator` / `GenFuture` shim. The primary motivation for this change was hiding this implementation detail in stack traces and debuginfo, but it can in theory also help the optimizer as there is less abstractions to see through. --- Given this demo code: ```rust pub async fn a(arg: u32) -> Backtrace { let bt = b().await; let _arg = arg; bt } pub async fn b() -> Backtrace { Backtrace::force_capture() } ``` I would get the following with the latest stable compiler (on Windows): ``` 4: async_codegen::b::async_fn$0 at .\src\lib.rs:10 5: core::future::from_generator::impl$1::poll<enum2$<async_codegen::b::async_fn_env$0> > at /rustc/897e37553bba8b42751c67658967889d11ecd120\library\core\src\future\mod.rs:91 6: async_codegen::a::async_fn$0 at .\src\lib.rs:4 7: core::future::from_generator::impl$1::poll<enum2$<async_codegen::a::async_fn_env$0> > at /rustc/897e37553bba8b42751c67658967889d11ecd120\library\core\src\future\mod.rs:91 ``` whereas now I get a much cleaner stack trace: ``` 3: async_codegen::b::async_fn$0 at .\src\lib.rs:10 4: async_codegen::a::async_fn$0 at .\src\lib.rs:4 ```
2022-11-24make `error_reported` check for delayed bugsBoxy-0/+16
2022-11-24Avoid `GenFuture` shim when compiling async constructsArpad Borsos-74/+80
Previously, async constructs would be lowered to "normal" generators, with an additional `from_generator` / `GenFuture` shim in between to convert from `Generator` to `Future`. The compiler will now special-case these generators internally so that async constructs will *directly* implement `Future` without the need to go through the `from_generator` / `GenFuture` shim. The primary motivation for this change was hiding this implementation detail in stack traces and debuginfo, but it can in theory also help the optimizer as there is less abstractions to see through.
2022-11-24Rollup merge of #104771 - est31:if_let_chain_broken_mir_test, r=davidtwcoMatthias Krüger-0/+31
Add regression test for issue #99938 That issue was a dupe of #99852, and it got fixed since, but it's always better to have multiple regression tests rather than one. closes #99938
2022-11-24Rollup merge of #104753 - compiler-errors:drop-tracking-var-ice, r=oli-obkMatthias Krüger-0/+168
Pass `InferCtxt` to `DropRangeVisitor` so we can resolve vars The types that we encounter in the `TypeckResults` that we pass to the `DropRangeVisitor` are not yet fully resolved, since that only happens in writeback after type checking is complete. Instead, pass down the whole `InferCtxt` so that we can resolve any inference vars that have been constrained since they were written into the results. This is similar to how the `MemCategorizationContext` in the `ExprUseVisitor` also needs to pass down both typeck results _and_ the inference context. Fixes an ICE mentioned in this comment: https://github.com/rust-lang/rust/issues/104382#issuecomment-1324410781
2022-11-24Rollup merge of #104742 - WaffleLapkin:forbidden-SUPER-deref, r=compiler-errorsMatthias Krüger-6/+11
Make `deref_into_dyn_supertrait` lint the impl and not the usage Proposed by ``@compiler-errors`` in https://github.com/rust-lang/rust/issues/89460#issuecomment-1320806785 r? ``@crlf0710``
2022-11-24Rollup merge of #104594 - compiler-errors:dyn-star-rcvr, r=eholk,estebankMatthias Krüger-4/+137
Properly handle `Pin<&mut dyn* Trait>` receiver in codegen This ensures we can actually await a `dyn* Future`, which seems important for async fn in dyn trait. Also, disable `dyn*` trait upcasting. It's not exactly complete right now, and can cause strange ICEs for no reason -- nobody's using it either. I thought it was cute to implement when I did it, but I didn't think about how it interacts structurally with `CoerceUnsized` correctly. Fixes #104794, presumably removing `dyn*` upcasting and its `CoerceUnsized` issues does the trick.
2022-11-24Rollup merge of #103908 - estebank:consider-cloning, r=compiler-errorsMatthias Krüger-28/+1179
Suggest `.clone()` or `ref binding` on E0382
2022-11-24fix #104513, Use node_ty_opt to avoid ICE in visit_tyyukang-0/+24
2022-11-24Auto merge of #104610 - ouz-a:revert-overflow, r=compiler-errorsbors-13/+13
Reverts check done by #100757 As my `fix` caused more issues than it resolved it's better to revert it. ( #103274 #104322 https://github.com/rust-lang/rust/issues/104606) r? `@compiler-errors` Reopens #95134
2022-11-24Adjust testsMichael Goulet-5/+21
2022-11-24Properly handle `Pin<&mut dyn* Trait>` receiver in codegenMichael Goulet-0/+62
2022-11-24Disable dyn* upcastingMichael Goulet-2/+57
2022-11-23lint: do not warn unused parens around higher-ranked function pointersMichael Howell-0/+18
Fixes #104397
2022-11-23rustdoc: simplify `.search-results-title` CSSMichael Howell-1/+2
By using `display: flex`, we still get the never-wrapping layout with `#crate-search-div` maxing out and truncating its text. The title itself winds up always filling its parent, but since `#crate-search` doesn't have `flex-grow` set, it won't fill available space.