forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#132090 - compiler-errors:baily, r=lcnr
Stop being so bail-y in candidate assembly A conceptual follow-up to rust-lang#132084. We gotta stop bailing so much when there are errors; it's both unnecessary, leads to weird knock-on errors, and it's messing up the vibes lol
- Loading branch information
Showing
39 changed files
with
328 additions
and
240 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ struct Vtable(dyn Cap); | |
trait Cap<'a> {} | ||
|
||
union Transmute { | ||
t: u64, | ||
t: u128, | ||
u: &'static Vtable, | ||
} | ||
|
||
|
18 changes: 18 additions & 0 deletions
18
tests/ui/const-generics/generic_const_exprs/bad-multiply.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// regression test for #124350 | ||
|
||
struct Node<const D: usize> {} | ||
|
||
impl<const D: usize> Node<D> | ||
where | ||
SmallVec<{ D * 2 }>:, | ||
//~^ ERROR generic parameters may not be used in const operations | ||
//~| ERROR constant provided when a type was expected | ||
{ | ||
fn new() -> Self { | ||
Node::new() | ||
} | ||
} | ||
|
||
struct SmallVec<T1>(T1); | ||
|
||
fn main() {} |
18 changes: 18 additions & 0 deletions
18
tests/ui/const-generics/generic_const_exprs/bad-multiply.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
error: generic parameters may not be used in const operations | ||
--> $DIR/bad-multiply.rs:7:16 | ||
| | ||
LL | SmallVec<{ D * 2 }>:, | ||
| ^ cannot perform const operation using `D` | ||
| | ||
= help: const parameters may only be used as standalone arguments, i.e. `D` | ||
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions | ||
|
||
error[E0747]: constant provided when a type was expected | ||
--> $DIR/bad-multiply.rs:7:14 | ||
| | ||
LL | SmallVec<{ D * 2 }>:, | ||
| ^^^^^^^^^ | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0747`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,22 @@ | ||
error[E0046]: not all trait items implemented, missing: `RefTarget` | ||
--> $DIR/ice-type-error-in-tail-124031.rs:9:1 | ||
--> $DIR/ice-type-error-in-tail-124031.rs:11:1 | ||
| | ||
LL | type RefTarget; | ||
| -------------- `RefTarget` from trait | ||
... | ||
LL | impl Trait for () {} | ||
| ^^^^^^^^^^^^^^^^^ missing `RefTarget` in implementation | ||
|
||
error: aborting due to 1 previous error | ||
error[E0512]: cannot transmute between types of different sizes, or dependently-sized types | ||
--> $DIR/ice-type-error-in-tail-124031.rs:20:9 | ||
| | ||
LL | std::mem::transmute::<Option<()>, Option<&Other>>(None); | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: source type: `Option<()>` ($BITS bits) | ||
= note: target type: `Option<&Other>` ($BITS bits) | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0046`. | ||
Some errors have detailed explanations: E0046, E0512. | ||
For more information about an error, try `rustc --explain E0046`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// regression test for #127351 | ||
|
||
#![feature(lazy_type_alias)] | ||
//~^ WARN the feature `lazy_type_alias` is incomplete | ||
|
||
type ExplicitTypeOutlives<T> = T; | ||
|
||
pub struct Warns { | ||
_significant_drop: ExplicitTypeOutlives, | ||
//~^ ERROR missing generics for type alias `ExplicitTypeOutlives` | ||
field: String, | ||
} | ||
|
||
pub fn test(w: Warns) { | ||
let _ = || drop(w.field); | ||
} | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
warning: the feature `lazy_type_alias` is incomplete and may not be safe to use and/or cause compiler crashes | ||
--> $DIR/bad-lazy-type-alias.rs:3:12 | ||
| | ||
LL | #![feature(lazy_type_alias)] | ||
| ^^^^^^^^^^^^^^^ | ||
| | ||
= note: see issue #112792 <https://github.com/rust-lang/rust/issues/112792> for more information | ||
= note: `#[warn(incomplete_features)]` on by default | ||
|
||
error[E0107]: missing generics for type alias `ExplicitTypeOutlives` | ||
--> $DIR/bad-lazy-type-alias.rs:9:24 | ||
| | ||
LL | _significant_drop: ExplicitTypeOutlives, | ||
| ^^^^^^^^^^^^^^^^^^^^ expected 1 generic argument | ||
| | ||
note: type alias defined here, with 1 generic parameter: `T` | ||
--> $DIR/bad-lazy-type-alias.rs:6:6 | ||
| | ||
LL | type ExplicitTypeOutlives<T> = T; | ||
| ^^^^^^^^^^^^^^^^^^^^ - | ||
help: add missing generic argument | ||
| | ||
LL | _significant_drop: ExplicitTypeOutlives<T>, | ||
| +++ | ||
|
||
error: aborting due to 1 previous error; 1 warning emitted | ||
|
||
For more information about this error, try `rustc --explain E0107`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.