Skip to content

Rollup of 9 pull requests #123036

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

Merged
merged 29 commits into from
Mar 25, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
d1ba632
Delegation: fix ICE on `bound_vars` divergence
Bryanskiy Mar 22, 2024
bf12aa4
Don't emit an error about failing to produce a file with a specific name
pacak Mar 21, 2024
b84326e
tests/ui: Add a directory for warnings, add a test
pacak Mar 22, 2024
08235b1
Validate that we're only matching on unit struct for path pattern
compiler-errors Mar 22, 2024
87808e7
Use `chunk_by` when building `ReverseSccGraph`
cuviper Mar 24, 2024
127c36c
add test for https://github.com/rust-lang/rust/issues/119731
matthiaskrgr Mar 24, 2024
db68dc2
add test for #116599
matthiaskrgr Mar 24, 2024
8ed5e67
add test for #114464
matthiaskrgr Mar 24, 2024
cdea6d8
add test for ICE: no entry found for key for const function in gener…
matthiaskrgr Mar 24, 2024
b151e06
add test for ICE: min_specialization: Ok(['?0, Const { ty: usize, ki…
matthiaskrgr Mar 24, 2024
6203ebe
add test for ICE with associated_const_equality #108220
matthiaskrgr Mar 24, 2024
5e0d8c3
add test for ICE: no errors encountered even though delay_span_bug i…
matthiaskrgr Mar 24, 2024
56ea366
add test for Failed to normalize closure with TAIT #109020
matthiaskrgr Mar 24, 2024
e800b99
add tests for ICE in mir building with captured value of unresolved t…
matthiaskrgr Mar 24, 2024
e4d816e
add tests for ICE: 'broken MIR: bad assignment: NoSolution' on trait …
matthiaskrgr Mar 24, 2024
4719293
Fix unpretty UI test when /tmp does not exist
Alexendoo Mar 24, 2024
2cb5347
Rename `{enter,exit}_lint_attrs` to `check_attributes{,_post}`
Alexendoo Mar 24, 2024
e6918b1
Add async-closures/once.rs back to cranelift tests
compiler-errors Mar 25, 2024
3733dcc
Add needs-unwind annotations to a couple of tests
bjorn3 Mar 25, 2024
5f5dcae
Add needs-unwind for proc macro tests
bjorn3 Mar 25, 2024
ded16b3
Rollup merge of #122842 - pacak:explicit_name, r=michaelwoerister
matthiaskrgr Mar 25, 2024
ccc5310
Rollup merge of #122881 - Bryanskiy:delegation-fixes-2, r=petrochenkov
matthiaskrgr Mar 25, 2024
e9ec442
Rollup merge of #122910 - compiler-errors:unit-struct-in-path-pat-onl…
matthiaskrgr Mar 25, 2024
9b4ee1b
Rollup merge of #122970 - cuviper:use-chunk_by, r=Mark-Simulacrum
matthiaskrgr Mar 25, 2024
877f293
Rollup merge of #122988 - matthiaskrgr:icetests, r=petrochenkov
matthiaskrgr Mar 25, 2024
657dd0b
Rollup merge of #122999 - Alexendoo:unpretty-avoid-crash-test, r=petr…
matthiaskrgr Mar 25, 2024
10daf8a
Rollup merge of #123001 - Alexendoo:check-attributes, r=oli-obk
matthiaskrgr Mar 25, 2024
11f168f
Rollup merge of #123022 - compiler-errors:clif-tests-async-closure, r…
matthiaskrgr Mar 25, 2024
4369718
Rollup merge of #123034 - bjorn3:test_ignores, r=compiler-errors
matthiaskrgr Mar 25, 2024
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
Prev Previous commit
Next Next commit
add tests for ICE: 'broken MIR: bad assignment: NoSolution' on trait …
…with default method and no impls

Fixes #109869
  • Loading branch information
matthiaskrgr committed Mar 24, 2024
commit e4d816e66c9de3e78a330cd27287c10b831b1c14
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// ICE 'broken MIR: bad assignment: NoSolution'
// on trait with default method and no impls
// issue: rust-lang/rust#109869

type Spanned<T> = (T, ());

trait Span<T> {}

impl<T> Span<T> for (T, ()) {}

impl<F, T: From<F>> From<Spanned<F>> for dyn Span<T>
where
Self: Sized
{
fn from((from, ()): Spanned<F>) -> Self {
(T::from(from), ())
//~^ ERROR mismatched types
}
}

pub fn main() {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
error[E0308]: mismatched types
--> $DIR/ice-trait-with-default-method-but-no-impl-broken-mir-109869-1.rs:16:9
|
LL | fn from((from, ()): Spanned<F>) -> Self {
| ---- expected `(dyn Span<T> + 'static)` because of return type
LL | (T::from(from), ())
| ^^^^^^^^^^^^^^^^^^^ expected `dyn Span`, found `(T, ())`
|
= note: expected trait object `(dyn Span<T> + 'static)`
found tuple `(T, ())`
= help: `(T, ())` implements `Span` so you could box the found value and coerce it to the trait object `Box<dyn Span>`, you will have to change the expected type as well
help: call `Into::into` on this expression to convert `(T, ())` into `(dyn Span<T> + 'static)`
|
LL | (T::from(from), ()).into()
| +++++++

error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0308`.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// ICE 'broken MIR: bad assignment: NoSolution'
// on trait with default method and no impls
// issue: rust-lang/rust#109869

trait Empty<T> {}

impl<T> Default for dyn Empty<T>
where
Self: Sized,
{
fn default() -> Self {
()
//~^ ERROR mismatched types
}
}

pub fn main() {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
error[E0308]: mismatched types
--> $DIR/ice-trait-with-default-method-but-no-impl-broken-mir-109869-2.rs:12:9
|
LL | fn default() -> Self {
| ---- expected `(dyn Empty<T> + 'static)` because of return type
LL | ()
| ^^ expected `dyn Empty`, found `()`
|
= note: expected trait object `(dyn Empty<T> + 'static)`
found unit type `()`

error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0308`.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// ICE 'broken MIR: bad assignment: NoSolution'
// on trait with default method and no impls
// issue: rust-lang/rust#109869

#![feature(trivial_bounds)]
trait Empty {}

impl Default for dyn Empty
where
Self: Sized,
{
fn default() -> Self {
()
//~^ ERROR mismatched types
}
}

pub fn main() {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
error[E0308]: mismatched types
--> $DIR/ice-trait-with-default-method-but-no-impl-broken-mir-109869-trivial-bounds.rs:13:9
|
LL | fn default() -> Self {
| ---- expected `(dyn Empty + 'static)` because of return type
LL | ()
| ^^ expected `dyn Empty`, found `()`
|
= note: expected trait object `(dyn Empty + 'static)`
found unit type `()`

error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0308`.