Skip to content

Rollup of 10 pull requests #135915

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 24 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
a175e8d
CI: free disk on linux arm runner
marcoieni Jan 20, 2025
fdb636e
Add tests for windows-gnu split-debuginfo options
wesleywiser Jan 20, 2025
0b24fc9
Set `DebuginfoKind::Dwarf` for `*-windows-gnu` and `*-windows-gnullvm`
wesleywiser Jan 20, 2025
f7c01d3
Fix sparcv8plus test on LLVM 20
nikic Jan 20, 2025
dca888c
Fix x86_64-bigint-helpers test on LLVM 20
nikic Jan 20, 2025
f0dfda1
fix outdated file path ref in llvm
onur-ozkan Jan 22, 2025
bae2a2f
Remove erroneous `unsafe` in `BTreeSet::upper_bound_mut`
GrigorenkoPV Jan 22, 2025
53578bd
remove implied end of slice
hkBst Jan 22, 2025
c568da9
make bootstrap self test to use bootstrap cargo
onur-ozkan Jan 22, 2025
17b2ede
resolve clippy FIXME
onur-ozkan Jan 22, 2025
e3a5314
reduce number of `prepare_cargo_test` args
onur-ozkan Jan 22, 2025
cd2ecc4
[AIX] Lint on structs that have a different alignment in AIX's C ABI
amy-kwan Jan 15, 2025
72fa874
Don't ICE in coerce when autoderef fails to structurally normalize no…
compiler-errors Dec 25, 2024
0149c0f
rustdoc-json-types: Finalize dyn compatibility renaming
aDotInTheVoid Jan 22, 2025
488c78c
Rollup merge of #134746 - compiler-errors:autoderef-norm-non-wf-coerc…
jhpratt Jan 23, 2025
d89662e
Rollup merge of #135552 - amy-kwan:amy-kwan/reprc-struct-diagnostic-p…
jhpratt Jan 23, 2025
0e05362
Rollup merge of #135764 - nikic:llvm-20-test-fixes, r=wesleywiser
jhpratt Jan 23, 2025
2a5960b
Rollup merge of #135779 - marcoieni:free-disk-arm-runner, r=Kobzol
jhpratt Jan 23, 2025
359983d
Rollup merge of #135790 - wesleywiser:update_windows_gnu_debuginfokin…
jhpratt Jan 23, 2025
fb12de6
Rollup merge of #135879 - onur-ozkan:invalid-file-path, r=jieyouxu
jhpratt Jan 23, 2025
67f0ca0
Rollup merge of #135883 - GrigorenkoPV:btree_set_upper_bound_mut, r=t…
jhpratt Jan 23, 2025
8edd3ea
Rollup merge of #135884 - hkBst:patch-13, r=compiler-errors
jhpratt Jan 23, 2025
5c448d0
Rollup merge of #135887 - onur-ozkan:testing-improvements, r=jieyouxu
jhpratt Jan 23, 2025
3289c8a
Rollup merge of #135898 - aDotInTheVoid:dyndoc, r=fmease
jhpratt Jan 23, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions compiler/rustc_hir_typeck/src/coercion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -461,9 +461,17 @@ impl<'f, 'tcx> Coerce<'f, 'tcx> {
// to the target type), since that should be the least
// confusing.
let Some(InferOk { value: ty, mut obligations }) = found else {
let err = first_error.expect("coerce_borrowed_pointer had no error");
debug!("coerce_borrowed_pointer: failed with err = {:?}", err);
return Err(err);
if let Some(first_error) = first_error {
debug!("coerce_borrowed_pointer: failed with err = {:?}", first_error);
return Err(first_error);
} else {
// This may happen in the new trait solver since autoderef requires
// the pointee to be structurally normalizable, or else it'll just bail.
// So when we have a type like `&<not well formed>`, then we get no
// autoderef steps (even though there should be at least one). That means
// we get no type mismatches, since the loop above just exits early.
return Err(TypeError::Mismatch);
}
};

if ty == a && mt_a.mutbl.is_not() && autoderef.step_count() == 1 {
Expand Down
17 changes: 17 additions & 0 deletions tests/ui/traits/next-solver/non-wf-in-coerce-pointers.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
//@ compile-flags: -Znext-solver

trait Wf {
type Assoc;
}

struct S {
f: &'static <() as Wf>::Assoc,
//~^ ERROR the trait bound `(): Wf` is not satisfied
}

fn main() {
let x: S = todo!();
let y: &() = x.f;
//~^ ERROR mismatched types
//~| ERROR the trait bound `(): Wf` is not satisfied
}
39 changes: 39 additions & 0 deletions tests/ui/traits/next-solver/non-wf-in-coerce-pointers.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
error[E0277]: the trait bound `(): Wf` is not satisfied
--> $DIR/non-wf-in-coerce-pointers.rs:8:17
|
LL | f: &'static <() as Wf>::Assoc,
| ^^^^^^^^^^^^^^^^^ the trait `Wf` is not implemented for `()`
|
help: this trait has no implementations, consider adding one
--> $DIR/non-wf-in-coerce-pointers.rs:3:1
|
LL | trait Wf {
| ^^^^^^^^

error[E0308]: mismatched types
--> $DIR/non-wf-in-coerce-pointers.rs:14:18
|
LL | let y: &() = x.f;
| --- ^^^ types differ
| |
| expected due to this
|
= note: expected reference `&()`
found reference `&'static <() as Wf>::Assoc`

error[E0277]: the trait bound `(): Wf` is not satisfied
--> $DIR/non-wf-in-coerce-pointers.rs:14:18
|
LL | let y: &() = x.f;
| ^^^ the trait `Wf` is not implemented for `()`
|
help: this trait has no implementations, consider adding one
--> $DIR/non-wf-in-coerce-pointers.rs:3:1
|
LL | trait Wf {
| ^^^^^^^^

error: aborting due to 3 previous errors

Some errors have detailed explanations: E0277, E0308.
For more information about an error, try `rustc --explain E0277`.