summary refs log tree commit diff
path: root/tests/ui/const-generics/generic_const_exprs
AgeCommit message (Collapse)AuthorLines
2024-01-30Provide more context on derived obligation error primary labelEsteban Küber-1/+1
Expand the primary span of E0277 when the immediate unmet bound is not what the user wrote: ``` error[E0277]: the trait bound `i32: Bar` is not satisfied --> f100.rs:6:6 | 6 | <i32 as Foo>::foo(); | ^^^ the trait `Bar` is not implemented for `i32`, which is required by `i32: Foo` | help: this trait has no implementations, consider adding one --> f100.rs:2:1 | 2 | trait Bar {} | ^^^^^^^^^ note: required for `i32` to implement `Foo` --> f100.rs:3:14 | 3 | impl<T: Bar> Foo for T {} | --- ^^^ ^ | | | unsatisfied trait bound introduced here ``` Fix #40120.
2024-01-30Rollup merge of #120293 - estebank:issue-102629, r=nnethercoteGuillaume Gomez-10/+10
Deduplicate more sized errors on call exprs Change the implicit `Sized` `Obligation` `Span` for call expressions to include the whole expression. This aids the existing deduplication machinery to reduce the number of errors caused by a single unsized expression.
2024-01-26Auto merge of #116167 - RalfJung:structural-eq, r=lcnrbors-2/+2
remove StructuralEq trait The documentation given for the trait is outdated: *all* function pointers implement `PartialEq` and `Eq` these days. So the `StructuralEq` trait doesn't really seem to have any reason to exist any more. One side-effect of this PR is that we allow matching on some consts that do not implement `Eq`. However, we already allowed matching on floats and consts containing floats, so this is not new, it is just allowed in more cases now. IMO it makes no sense at all to allow float matching but also sometimes require an `Eq` instance. If we want to require `Eq` we should adjust https://github.com/rust-lang/rust/pull/115893 to check for `Eq`, and rule out float matching for good. Fixes https://github.com/rust-lang/rust/issues/115881
2024-01-24remove StructuralEq traitRalf Jung-2/+2
2024-01-24Deduplicate more sized errors on call exprsEsteban Küber-10/+10
Change the implicit `Sized` `Obligation` `Span` for call expressions to include the whole expression. This aids the existing deduplication machinery to reduce the number of errors caused by a single unsized expression.
2024-01-22Make generic const type mismatches not hide trait impls from the trait solverOli Scherer-2/+34
2024-01-09Avoid silencing relevant follow-up errorsOli Scherer-4/+97
2024-01-02Adjust compiler tests for unused_tuple_struct_fields -> dead_codeJake Goulding-1/+1
2023-12-09report_not_const_evaluatable_error to avoid ICEing on ConstKind::ExprLenko Donchev-0/+89
2023-11-30generic_const_exprs: suggest to add the feature, not use itRalf Jung-11/+11
2023-11-27Auto merge of #117200 - rmehri01:repeated_help, r=WaffleLapkinbors-1/+0
Don't add redundant help for object safety violations Fixes #117186 r? WaffleLapkin
2023-11-26don't add redundant help for object safety violationsRyan Mehri-1/+0
2023-11-24Show number in error message even for one errorNilstrieb-24/+24
Co-authored-by: Adrian <adrian.iosdev@gmail.com>
2023-10-29On object safety error, mention new enum as alternativeEsteban Küber-0/+1
When we encounter a `dyn Trait` that isn't object safe, look for its implementors. If there's one, mention using it directly If there are less than 9, mention the possibility of creating a new enum and using that instead. Account for object unsafe `impl Trait on dyn Trait {}`. Make a distinction between public and sealed traits. Fix #80194.
2023-10-25Rollup merge of #116401 - WaffleLapkin:vtablin''', r=oli-obkMatthias Krüger-2/+5
Return multiple object-safety violation errors and code improvements to the object-safety check See individual commits for more information. Split off of #114260, since it turned out that the main intent of that PR was wrong. r? oli-obk
2023-10-25Return multiple object-safety violation errorsMaybe Waffle-2/+5
2023-10-25Work around the fact that `check_mod_type_wf` may spuriously return ↵Oli Scherer-0/+25
`ErrorGuaranteed`, even if that error is only emitted by `check_modwitem_types`
2023-10-15place evaluation: require the original pointer to be aligned if an access ↵Ralf Jung-2/+3
happens
2023-10-15Auto merge of #116688 - compiler-errors:rustfmt-up, r=WaffleLapkin,Nilstriebbors-1/+1
Format all the let-chains in compiler crates Since rust-lang/rustfmt#5910 has landed, soon we will have support for formatting let-chains (as soon as rustfmt syncs and beta gets bumped). This PR applies the changes [from master rustfmt to rust-lang/rust eagerly](https://rust-lang.zulipchat.com/#narrow/stream/122651-general/topic/out.20formatting.20of.20prs/near/374997516), so that the next beta bump does not have to deal with a 200+ file diff and can remain concerned with other things like `cfg(bootstrap)` -- #113637 was a pain to land, for example, because of let-else. I will also add this commit to the ignore list after it has landed. The commands that were run -- I'm not great at bash-foo, but this applies rustfmt to every compiler crate, and then reverts the two crates that should probably be formatted out-of-tree. ``` ~/rustfmt $ ls -1d ~/rust/compiler/* | xargs -I@ cargo run --bin rustfmt -- `@/src/lib.rs` --config-path ~/rust --edition=2021 # format all of the compiler crates ~/rust $ git checkout HEAD -- compiler/rustc_codegen_{gcc,cranelift} # revert changes to cg-gcc and cg-clif ``` cc `@rust-lang/rustfmt` r? `@WaffleLapkin` or `@Nilstrieb` who said they may be able to review this purely mechanical PR :> cc `@Mark-Simulacrum` and `@petrochenkov,` who had some thoughts on the order of operations with big formatting changes in https://github.com/rust-lang/rust/pull/95262#issue-1178993801. I think the situation has changed since then, given that let-chains support exists on master rustfmt now, and I'm fairly confident that this formatting PR should land even if *bootstrap* rustfmt doesn't yet format let-chains in order to lessen the burden of the next beta bump.
2023-10-14Propagate pattern errors via a new `PatKind::Error` variantNadrieril-13/+1
Instead of via `Const::new_error`
2023-10-13Bless tests and new warnings due to formatting changesMichael Goulet-1/+1
2023-10-11Prevent spurious `unreachable pattern` lintsOli Scherer-1/+13
Means you'll get more `non-exhaustive` patterns
2023-10-09Extend impl's def_span to include where clausesMichael Goulet-1/+1
2023-09-28make adt_const_params feature suggestion more consistent with others and ↵asquared31415-1/+1
only suggest it when the type can probably work
2023-09-10Point out if a local trait has no implementationsMichael Goulet-1/+5
2023-09-01Auto merge of #113126 - Bryanskiy:delete_old, r=petrochenkovbors-26/+2
Replace old private-in-public diagnostic with type privacy lints Next part of RFC https://github.com/rust-lang/rust/issues/48054. r? `@petrochenkov`
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-08interpret: remove incomplete protection against invalid where clausesRalf Jung-70/+13
2023-08-06bless testsDeadbeef-7/+35
2023-08-02Replace old private-in-public diagnostic with type privacy lintsBryanskiy-26/+2
2023-07-18moved note as unspanned note, moved note to the bottom of the msgnxya-5/+1
2023-07-18added links as a notenxya-1/+1
2023-07-18add links to query documentation for E0391nxya-1/+1
2023-07-18added links as a notenxya-1/+6
2023-07-18add links to query documentation for E0391nxya-1/+1
2023-07-10Do not set up wrong span for adjustmentsMichael Goulet-1/+1
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-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-15privacy: Feature gate new type privacy lintsVadim Petrochenkov-1/+1
2023-06-13Auto merge of #112549 - jieyouxu:fix-tests-for-unit-bindings, r=Nilstriebbors-1/+1
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)-1/+1
- 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-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-02Auto merge of #112198 - compiler-errors:rollup-o2xe4of, r=compiler-errorsbors-3/+7
Rollup of 7 pull requests Successful merges: - #111670 (Require that const param tys implement `ConstParamTy`) - #111914 (CFI: Fix cfi with async: transform_ty: unexpected GeneratorWitness(Bi…) - #112030 (Migrate `item_trait_alias` to Askama) - #112150 (Support 128-bit atomics on all x86_64 Apple targets) - #112174 (Fix broken link) - #112190 (Improve comments on `TyCtxt` and `GlobalCtxt`.) - #112193 (Check tuple elements are `Sized` in `offset_of`) Failed merges: - #112071 (Group rfcs tests) r? `@ghost` `@rustbot` modify labels: rollup
2023-06-01Implement custom diagnostic for ConstParamTyMichael Goulet-3/+7
2023-06-01Use translatable diagnostics in `rustc_const_eval`Deadbeef-2/+2
2023-05-26Blesses UI tests, add known bug to typeid-equality-by-subtypingonestacked-4/+17