about summary refs log tree commit diff
path: root/tests/ui/const-generics
AgeCommit message (Collapse)AuthorLines
2023-08-25Walk through full path in point_at_path_if_possibleMichael Goulet-2/+2
2023-08-23Improve note for the invalid_reference_casting lintUrgau-0/+1
Add link to the book interior mutability chapter, https://doc.rust-lang.org/book/ch15-05-interior-mutability.html.
2023-08-09Rollup merge of #114606 - bvanjoi:fix-113462, r=compiler-errorsMatthias Krüger-0/+27
fix: not insert missing lifetime for `ConstParamTy` Fixes #113462 We should ignore the missing lifetime, as it's illegal to include a lifetime in a const param. r? ``@compiler-errors``
2023-08-08Auto merge of #114637 - matthiaskrgr:rollup-544y8p5, r=matthiaskrgrbors-70/+13
Rollup of 11 pull requests Successful merges: - #106425 (Make ExitStatus implement Default) - #113480 (add aarch64-unknown-teeos target) - #113586 (Mention style for new syntax in tracking issue template) - #113593 (CFI: Fix error compiling core with LLVM CFI enabled) - #114612 (update llvm-wrapper include to silence deprecation warning) - #114613 (Prevent constant rebuilds of `rustc-main` (and thus everything else)) - #114615 (interpret: remove incomplete protection against invalid where clauses) - #114628 (Allowing re-implementation of mir_drops_elaborated query) - #114629 (tests: Uncomment now valid GAT code behind FIXME) - #114630 (Migrate GUI colors test to original CSS color format) - #114631 (add provisional cache test for new solver) r? `@ghost` `@rustbot` modify labels: rollup
2023-08-08Rollup merge of #114615 - RalfJung:interpret-invalid-where, r=lcnrMatthias Krüger-70/+13
interpret: remove incomplete protection against invalid where clauses Cc https://github.com/rust-lang/rust/issues/97477, https://github.com/rust-lang/project-const-generics/issues/37 r? ``@lcnr``
2023-08-08Auto merge of #114545 - fee1-dead-contrib:lower-impl-effect, r=oli-obkbors-8/+36
correctly lower `impl const` to bind to host effect param r? `@oli-obk`
2023-08-08interpret: remove incomplete protection against invalid where clausesRalf Jung-70/+13
2023-08-08fix: not insert missing lifetime for `ConstParamTy`bohan-0/+27
2023-08-06add testcase that hits valtree_into_mplace with a custom DSTRalf Jung-0/+21
2023-08-06bless testsDeadbeef-8/+36
2023-08-02Auto merge of #112431 - Urgau:cast_ref_to_mut_improvments, r=Nilstriebbors-2/+11
Improve `invalid_reference_casting` lint This PR is a follow-up to https://github.com/rust-lang/rust/pull/111567 and https://github.com/rust-lang/rust/pull/113422. This PR does multiple things: - First it adds support for deferred de-reference, the goal is to support code like this, where the casting and de-reference are not done on the same expression ```rust let myself = self as *const Self as *mut Self; *myself = Self::Ready(value); ``` - Second it does not lint anymore on SB/TB UB code by only checking assignments (`=`, `+=`, ...) and creation of mutable references `&mut *` - Thirdly it greatly improves the diagnostics in particular for cast from `&mut` to `&mut` or assignments - ~~And lastly it renames the lint from `cast_ref_to_mut` to `invalid_reference_casting` which is more consistent with the ["rules"](https://github.com/rust-lang/rust-clippy/issues/2845) and also more consistent with what the lint checks~~ *https://github.com/rust-lang/rust/pull/113422* This PR is best reviewed commit by commit. r? compiler
2023-08-02Replace old private-in-public diagnostic with type privacy lintsBryanskiy-26/+2
2023-08-01Auto merge of #112849 - m-ou-se:panic-message-format, r=thomccbors-2/+2
Change default panic handler message format. This changes the default panic hook's message format from: ``` thread '{thread}' panicked at '{message}', {location} ``` to ``` thread '{thread}' panicked at {location}: {message} ``` This puts the message on its own line without surrounding quotes, making it easiser to read. For example: Before: ``` thread 'main' panicked at 'env variable `IMPORTANT_PATH` should be set by `wrapper_script.sh`', src/main.rs:4:6 ``` After: ``` thread 'main' panicked at src/main.rs:4:6: env variable `IMPORTANT_PATH` should be set by `wrapper_script.sh` ``` --- See this PR by `@nyurik,` which does that for only multi-line messages (specifically because of `assert_eq`): https://github.com/rust-lang/rust/pull/111071 This is the change that does that for *all* panic messages.
2023-07-31normalize backtrace error messagesyukang-5/+5
2023-07-29print omitted frames count for short backtrace modeyukang-0/+2
2023-07-29Adjust some tests for invalid_reference_casting improvementsUrgau-3/+3
2023-07-29Revert "Temporarily switch invalid_reference_casting lint to allow-by-default"Urgau-2/+11
This reverts commit f25ad54a4d0febbcb2b7e951835228b7b2320b49.
2023-07-29Change default panic handler message format.Mara Bos-2/+2
2023-07-29Auto merge of #113422 - Urgau:cast_ref_to_mut-pre-beta, r=Nilstriebbors-11/+2
Rename and allow `cast_ref_to_mut` lint This PR is a small subset of https://github.com/rust-lang/rust/pull/112431, that is the renaming of the lint (`cast_ref_to_mut` -> `invalid_reference_casting`). BUT also temporarily change the default level of the lint from deny-by-default to allow-by-default until https://github.com/rust-lang/rust/pull/112431 is merged. r? `@Nilstrieb`
2023-07-27update tests, adding known-bugDeadbeef-18/+2
2023-07-18moved note as unspanned note, moved note to the bottom of the msgnxya-10/+2
2023-07-18added links as a notenxya-2/+2
2023-07-18add links to query documentation for E0391nxya-2/+2
2023-07-18added links as a notenxya-2/+12
2023-07-18add links to query documentation for E0391nxya-2/+2
2023-07-14Auto merge of #113519 - SparrowLii:parallel_typeck, r=cjgillotbors-22/+20
typeck in parallel #108118 caused `typeck` to be transferred to the serial part (`check_unused`), which made the performance of parallel rustc significantly reduced. This pr re-parallelize this part, which increases the average performance improvement of parallel rustc in `full` and `incr-full` scenarios from [14.4%](https://github.com/rust-lang/rust/pull/110284#issuecomment-1545354608) to [23.2%](https://github.com/rust-lang/rust/pull/110284#issuecomment-1624770626). r? `@cjgillot` cc `@oli-obk` `@Zoxc`
2023-07-13Temporarily switch invalid_reference_casting lint to allow-by-defaultUrgau-11/+2
2023-07-13Rename cast_ref_to_mut lint to invalid_reference_castingUrgau-1/+1
2023-07-11typeck in parallelSparrowLii-22/+20
2023-07-10Do not set up wrong span for adjustmentsMichael Goulet-3/+3
2023-07-08Rollup merge of #113005 - compiler-errors:dont-query-normalize, r=cjgillotMatthias Krüger-15/+15
Don't call `query_normalize` when reporting similar impls Firstly, It's sketchy to be using `query_normalize` at all during HIR typeck -- it's asking for an ICE 😅. Secondly, we're normalizing an impl trait ref that potentially has parameter types in `ty::ParamEnv::empty()`, which is kinda sketchy as well. The only UI test change from removing this normalization is that we don't evaluate anonymous constants in impls, which end up giving us really ugly suggestions: ``` error[E0277]: the trait bound `[X; 35]: Default` is not satisfied --> /home/gh-compiler-errors/test.rs:4:5 | 4 | <[X; 35] as Default>::default(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Default` is not implemented for `[X; 35]` | = help: the following other types implement trait `Default`: &[T] &mut [T] [T; 32] [T; core::::array::{impl#30}::{constant#0}] [T; core::::array::{impl#31}::{constant#0}] [T; core::::array::{impl#32}::{constant#0}] [T; core::::array::{impl#33}::{constant#0}] [T; core::::array::{impl#34}::{constant#0}] and 27 others ``` So just fold the impls with a `BottomUpFolder` that calls `ty::Const::eval`. This doesn't work totally correctly with generic-const-exprs, but it's fine for stable code, and this is error reporting after all.
2023-07-04implement `ConstEvaluatable` goals in new solverlcnr-1/+13
we don't yet handle `generic_const_exprs`, someone else can do that :3
2023-06-29Fix type privacy lints error messageBryanskiy-4/+4
2023-06-29Rollup merge of #112670 - petrochenkov:typriv, r=eholkMatthias Krüger-1/+1
privacy: Type privacy lints fixes and cleanups See individual commits. Follow up to https://github.com/rust-lang/rust/pull/111801.
2023-06-27Don't sort strings right after we just sorted by typesMichael Goulet-15/+15
2023-06-25Rollup merge of #112990 - JohnTitor:issue-96699, r=TaKO8KiGuillaume Gomez-0/+87
Add a regression test for #96699 Closes #96699 r? `@BoxyUwU`
2023-06-24Add a regression test for #96699Yuki Okushi-0/+87
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2023-06-24Add a regression test for #109141Yuki Okushi-0/+39
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2023-06-19Don't ICE on unnormalized struct tail in layout computationMichael Goulet-4/+4
2023-06-15privacy: Feature gate new type privacy lintsVadim Petrochenkov-1/+1
2023-06-15change `std::marker::Sized` to just `Sized`Lukas Markeffsky-2/+2
2023-06-14Rollup merge of #112506 - compiler-errors:const-infer-ice, r=b-naberMatthias Krüger-6/+6
Properly check associated consts for infer placeholders We only reported an error if it was in a "suggestable" position (according to `is_suggestable_infer_ty`) -- this isn't correct for infer tys that can show up in other places in the constant's type, like behind a dyn trait. fixes #112491
2023-06-14Rollup merge of #112520 - chenyukang:yukang-fix-112505, r=fee1-deadMatthias Krüger-0/+19
Fix the overflow issue for transmute_generic_consts Fixes #112505
2023-06-13Auto merge of #112549 - jieyouxu:fix-tests-for-unit-bindings, r=Nilstriebbors-2/+2
Adjust UI tests for `unit_bindings` lint - Explicitly annotate `let x: () = expr;` where `x` has unit type, or remove the unit binding to leave only `expr;` instead. - Use `let () = init;` or `let pat = ();` where appropriate. - Fix disjoint-capture-in-same-closure test which wasn't actually testing a closure: `tests/ui/closures/2229_closure_analysis/run_pass/disjoint-capture-in-same-closure.rs`. Note that unfortunately there's *a lot* of UI tests, there are a couple of places where I may have left something like `let (): ()` (this is not needed but is left over from an ealier version of the lint) which is bad style. This PR is to help with the `unit_bindings` lint at #112380.
2023-06-12Adjust UI tests for `unit_bindings`许杰友 Jieyou Xu (Joe)-2/+2
- Either explicitly annotate `let x: () = expr;` where `x` has unit type, or remove the unit binding to leave only `expr;` instead. - Fix disjoint-capture-in-same-closure test
2023-06-12Private-in-public lints implementationBryanskiy-2/+26
2023-06-11Fix the overflow issue for transmute_generic_constsyukang-0/+19
2023-06-11properly check associated consts for infer placeholdersMichael Goulet-6/+6
2023-06-08add a test for #105709Takayuki Maeda-0/+9
replace build with check Co-authored-by: Michael Goulet <michael@errs.io> use appropriate test name
2023-06-06remove `has_error_field` helper methodlcnr-25/+4