about summary refs log tree commit diff
path: root/src/test/ui
AgeCommit message (Collapse)AuthorLines
2022-02-15Overhaul `RegionKind` and `Region`.Nicholas Nethercote-4/+4
Specifically, change `Region` from this: ``` pub type Region<'tcx> = &'tcx RegionKind; ``` to this: ``` pub struct Region<'tcx>(&'tcx Interned<RegionKind>); ``` This now matches `Ty` and `Predicate` more closely. Things to note - Regions have always been interned, but we haven't been using pointer-based `Eq` and `Hash`. This is now happening. - I chose to impl `Deref` for `Region` because it makes pattern matching a lot nicer, and `Region` can be viewed as just a smart wrapper for `RegionKind`. - Various methods are moved from `RegionKind` to `Region`. - There is a lot of tedious sigil changes. - A couple of types like `HighlightBuilder`, `RegionHighlightMode` now have a `'tcx` lifetime because they hold a `Ty<'tcx>`, so they can call `mk_region`. - A couple of test outputs change slightly, I'm not sure why, but the new outputs are a little better.
2022-02-15Auto merge of #93752 - eholk:drop-tracking-break-continue, r=nikomatsakisbors-0/+19
Generator drop tracking: improve break and continue handling This PR fixes two related issues. One, sometimes break or continue have a block target instead of an expression target. This seems to mainly happen with try blocks. Since the drop tracking analysis only works on expressions, if we see a block target for break or continue, we substitute the last expression of the block as the target instead. Two, break and continue were incorrectly being treated as the same, so continue would also show up as an exit from the loop or block. This patch corrects the way continue is handled by keeping a stack of loop entry points and uses those to find the target of the continue. Fixes #93197 r? `@nikomatsakis`
2022-02-14suggest using raw string literals when invalid escapes appearErin Petra Sofiya Moon-0/+29
i'd guess about 70% of "bad escape" cases occur when someone meant to use a raw string literal because they're passing it directly to Regex::new(). this emits an advisory (Applicability::MaybeIncorrect) help: suggestion to the user that they use an r"" string, on top of the normal notes about looking at the string literal documentation/spec.
2022-02-14Auto merge of #93652 - spastorino:fix-negative-overlap-check-regions, ↵bors-6/+48
r=nikomatsakis Fix negative overlap check regions r? `@nikomatsakis`
2022-02-14Mark `unsafe_pin_internals` as `incomplete`.Daniel Henry-Mantilla-0/+31
This thus still makes it technically possible to enable the feature, and thus to trigger UB without `unsafe`, but this is fine since incomplete features are known to be potentially unsound (labelled "may not be safe"). This follows from the discussion at https://github.com/rust-lang/rust/pull/93176#discussion_r799413561
2022-02-14Add failing test that should passSantiago Pastorino-0/+23
2022-02-14Write {ui,} tests for `pin_macro` and `pin!`Daniel Henry-Mantilla-0/+84
2022-02-14Properly check regions on negative overlap checkSantiago Pastorino-6/+25
2022-02-14further update `fuzzy_match_tys`lcnr-31/+58
2022-02-14fuzzify `fuzzy_match_tys`lcnr-18/+30
2022-02-14Make `find_similar_impl_candidates` a little fuzzier.Ben Reeves-1/+32
2022-02-14Fix suggestion to slice if scurtinee is a reference to `Result` or `Option`Chayim Refael Friedman-1/+30
2022-02-13update stderr messagesSaltyKitkat-41/+41
2022-02-13stabilize const_ptr_offsetSaltyKitkat-8/+2
2022-02-13Rollup merge of #93810 - matthewjasper:chalk-and-canonical-universes, r=jackh726Matthias Krüger-112/+119
Improve chalk integration - Support subtype bounds in chalk lowering - Handle universes in canonicalization - Handle type parameters in chalk responses - Use `chalk_ir::LifetimeData::Empty` for `ty::ReEmpty` - Remove `ignore-compare-mode-chalk` for tests that no longer hang (they may still fail or ICE) This is enough to get a hello world program to compile with `-Zchalk` now. Some of the remaining issues that are needed to get Chalk integration working on larger programs are: - rust-lang/chalk#234 - rust-lang/chalk#548 - rust-lang/chalk#734 - Generators are handled differently in chalk and rustc r? `@jackh726`
2022-02-13Rollup merge of #90532 - fee1-dead:improve-const-fn-err-msg, r=oli-obkMatthias Krüger-119/+345
More informative error message for E0015 Helps with #92380
2022-02-12Use known-bug prop for GAT bug testsJack Huey-27/+32
2022-02-12Auto merge of #91403 - cjgillot:inherit-async, r=oli-obkbors-190/+133
Inherit lifetimes for async fn instead of duplicating them. The current desugaring of `async fn foo<'a>(&usize) -> &u8` is equivalent to ```rust fn foo<'a, '0>(&'0 usize) -> foo<'static, 'static>::Opaque<'a, '0, '_>; type foo<'_a, '_0>::Opaque<'a, '0, '1> = impl Future<Output = &'1 u8>; ``` following the RPIT model. Duplicating all the inherited lifetime parameters and setting the inherited version to `'static` makes lowering more complex and causes issues like #61949. This PR removes the duplication of inherited lifetimes to directly use ```rust fn foo<'a, '0>(&'0 usize) -> foo<'a, '0>::Opaque<'_>; type foo<'a, '0>::Opaque<'1> = impl Future<Output = &'1 u8>; ``` following the TAIT model. Fixes https://github.com/rust-lang/rust/issues/61949
2022-02-12Auto merge of #93697 - the8472:fix-windows-path-hash, r=Mark-Simulacrumbors-0/+1
Fix hashing for windows paths containing a CurDir component * the logic only checked for / but not for \ * verbatim paths shouldn't skip items at all since they don't get normalized * the extra branches get optimized out on unix since is_sep_byte is a trivial comparison and is_verbatim is always-false * tests lacked windows coverage for these cases That lead to equal paths not having equal hashes and to unnecessary collisions.
2022-02-12Update chalk testsMatthew Jasper-112/+119
2022-02-12ignore test on wasm32The 8472-0/+1
A fix applied to std::Path::hash triggers a miscompilation/assert in LLVM in this test on wasm32. The miscompilation appears to pre-existing. Reverting some previous changes done std::Path also trigger it and slight modifications such as changing the test path from "a" to "ccccccccccc" also make it pass, indicating it's very flaky. Since the fix is for a higher-tier platform than wasm it takes precedence.
2022-02-12Ignore failing test on aarch64Benoît du Garreau-0/+3
2022-02-12ReblessDeadbeef-3/+41
2022-02-12Rollup merge of #93757 - jackh726:gat-bug-tests, r=nikomatsakisMatthias Krüger-0/+450
Add some known GAT bugs as tests In the spirit of rust-lang/compiler-team#476 These tests are marked as "check-fail", but also commented with "this should pass". This many of the open GAT issues that are accepted bugs. r? ``@nikomatsakis``
2022-02-12Rollup merge of #93595 - compiler-errors:ice-on-lifetime-arg, r=jackh726Matthias Krüger-4/+41
fix ICE when parsing lifetime as function argument I don't really like this, but we basically need to emit an error instead of just delaying an bug, because there are too many places in the AST that aren't covered by my previous PRs... cc: https://github.com/rust-lang/rust/issues/93282#issuecomment-1028052945
2022-02-12Rollup merge of #91908 - matthiaskrgr:ices, r=jackh726Matthias Krüger-0/+46
Add 2 tests fixes #91139 fixes #91069
2022-02-12Report the selection error when possibleDeadbeef-22/+71
2022-02-12Handle Fn family trait call errrorDeadbeef-7/+14
2022-02-12Rebased and improved errorsDeadbeef-13/+32
2022-02-12bless youDeadbeef-87/+200
2022-02-12Fix line numberJack Huey-1/+1
Co-authored-by: David Tolnay <dtolnay@gmail.com>
2022-02-12Auto merge of #93691 - compiler-errors:mir-tainted-by-errors, r=oli-obkbors-56/+26
Implement `tainted_by_errors` in MIR borrowck, use it to skip CTFE Putting this up for initial review. The issue that I found is when we're evaluating a const, we're doing borrowck, but doing nothing with the fact that borrowck fails. This implements a `tainted_by_errors` field for MIR borrowck like we have in infcx, so we can use that information to return an `Err` during const eval if our const fails to borrowck. This PR needs some cleaning up. I should probably just use `Result` in more places, instead of `.expect`ing in the places I am, but I just wanted it to compile so I could see if it worked! Fixes #93646 r? `@oli-obk` feel free to reassign
2022-02-12Bless nll tests.Camille GILLOT-27/+19
2022-02-12Inherit lifetimes for async fn instead of duplicating them.Camille GILLOT-163/+114
2022-02-11Add 2 testsMatthias Krüger-0/+46
fixes #91139 fixes #91069
2022-02-11Rollup merge of #93909 - saschanaz:patch-2, r=petrochenkovMatthias Krüger-8/+8
Fix typo: explicitely -> explicitly
2022-02-11Rollup merge of #93868 - Amanieu:asm_reg_conflict, r=cjgillotMatthias Krüger-0/+30
Fix incorrect register conflict detection in asm! This would previously incorrectly reject two subregisters that were distinct but part of the same larger register, for example `al` and `ah`.
2022-02-11Rollup merge of #93782 - adamgemmell:dev/adagem01/split-pauth, r=AmanieuMatthias Krüger-0/+68
Split `pauth` target feature Per discussion on https://github.com/rust-lang/rust/issues/86941 we'd like to split `pauth` into `paca` and `pacg` in order to better support possible future environments that only have the keys available for address or generic authentication. At the moment LLVM has the one `pauth` target_feature while Linux presents separate `paca` and `pacg` flags for feature detection. Because the use of [target_feature](https://rust-lang.github.io/rfcs/2045-target-feature.html) will "allow the compiler to generate code under the assumption that this code will only be reached in hosts that support the feature", it does not make sense to simply translate `paca` into the LLVM feature `pauth`, as it will generate code as if `pacg` is available. To accommodate this we error if only one of the two features is present. If LLVM splits them in the future we can remove this restriction without making a breaking change. r? ```@Amanieu```
2022-02-11Rollup merge of #91607 - FabianWolff:issue-91560-const-span, r=jackh726Matthias Krüger-14/+77
Make `span_extend_to_prev_str()` more robust Fixes #91560. The logic in `span_extend_to_prev_str()` is currently quite brittle and fails if there is extra whitespace or something else in between, and it also should return an `Option` but doesn't currently.
2022-02-11use body.tainted_by_error to skip loading MIRMichael Goulet-16/+3
2022-02-11fix tests, add new tests checking borrowck CFTE ICEMichael Goulet-40/+23
2022-02-11Auto merge of #93893 - oli-obk:sad_revert, r=oli-obkbors-2287/+1606
Revert lazy TAIT PR Revert https://github.com/rust-lang/rust/pull/92306 (sorry `@Aaron1011,` will include your changes in the fix PR) Revert https://github.com/rust-lang/rust/pull/93783 Revert https://github.com/rust-lang/rust/pull/92007 fixes https://github.com/rust-lang/rust/issues/93788 fixes https://github.com/rust-lang/rust/issues/93794 fixes https://github.com/rust-lang/rust/issues/93821 fixes https://github.com/rust-lang/rust/issues/93831 fixes https://github.com/rust-lang/rust/issues/93841
2022-02-11Fix typo: explicitely->explicitlyKagami Sascha Rosylight-8/+8
2022-02-11Revert "Auto merge of #92007 - oli-obk:lazy_tait2, r=nikomatsakis"Oli Scherer-2148/+1610
This reverts commit e7cc3bddbe0d0e374d05e7003e662bba1742dbae, reversing changes made to 734368a200904ef9c21db86c595dc04263c87be0.
2022-02-11Revert "Auto merge of #92306 - Aaron1011:opaque-type-op, r=oli-obk"Oli Scherer-62/+11
This reverts commit 1f0a96862ac9d4c6ca3e4bb500c8b9eac4d83049, reversing changes made to bf242bb1199e25ca2274df5c4114e0c9436b74e9.
2022-02-11Revert "Fix regression from lazy opaque types"Oli Scherer-94/+2
This reverts commit 239f1e716dcb1e145b5df5f9439524c817d123b2.
2022-02-10only mark projection as ambiguous if GAT substs are constrainedMichael Goulet-10/+37
2022-02-11Rollup merge of #93861 - JulianKnodt:notraitace, r=wesleywiserMatthias Krüger-0/+76
Fix ICE if no trait assoc const eq Fixes #93835
2022-02-10RebaseCharisee-32/+0
2022-02-10replace feature expression (cfg_panic) in lib and remove expression from testsCharisee-4/+2
Rebase commit