-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Fix #121208 fallout #121434
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
Fix #121208 fallout #121434
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,4 @@ | ||
fn bug<T>() -> impl CallbackMarker< Item = [(); { |_: &mut ()| 3; 4 }] > {} | ||
//~^ ERROR cannot find trait `CallbackMarker` in this scope | ||
|
||
fn main() {} |
This file contains hidden or 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,9 @@ | ||
error[E0405]: cannot find trait `CallbackMarker` in this scope | ||
--> $DIR/span-bug-issue-121431.rs:1:21 | ||
| | ||
LL | fn bug<T>() -> impl CallbackMarker< Item = [(); { |_: &mut ()| 3; 4 }] > {} | ||
| ^^^^^^^^^^^^^^ not found in this scope | ||
|
||
error: aborting due to 1 previous error | ||
|
||
For more information about this error, try `rustc --explain E0405`. |
13 changes: 13 additions & 0 deletions
13
tests/ui/rfcs/rfc-2632-const-trait-impl/effects/span-bug-issue-121418.rs
This file contains hidden or 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,13 @@ | ||
#![feature(const_trait_impl)] | ||
#![feature(effects)] | ||
|
||
struct S; | ||
trait T {} | ||
|
||
impl const dyn T { | ||
//~^ ERROR inherent impls cannot be `const` | ||
//~| ERROR the const parameter `host` is not constrained by the impl trait, self type, or | ||
pub const fn new() -> std::sync::Mutex<dyn T> {} | ||
} | ||
|
||
fn main() {} |
22 changes: 22 additions & 0 deletions
22
tests/ui/rfcs/rfc-2632-const-trait-impl/effects/span-bug-issue-121418.stderr
This file contains hidden or 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,22 @@ | ||
error: inherent impls cannot be `const` | ||
--> $DIR/span-bug-issue-121418.rs:7:12 | ||
| | ||
LL | impl const dyn T { | ||
| ----- ^^^^^ inherent impl for this type | ||
| | | ||
| `const` because of this | ||
| | ||
= note: only trait implementations may be annotated with `const` | ||
|
||
error[E0207]: the const parameter `host` is not constrained by the impl trait, self type, or predicates | ||
--> $DIR/span-bug-issue-121418.rs:7:6 | ||
| | ||
LL | impl const dyn T { | ||
| ^^^^^ unconstrained const parameter | ||
| | ||
= note: expressions using a const parameter must map each value to a distinct output value | ||
= note: proving the result of expressions other than the parameter are unique is not supported | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0207`. |
This file contains hidden or 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,15 @@ | ||
trait Bar { | ||
type Type; | ||
} | ||
struct Foo<'a>(&'a ()); | ||
impl<'a> Bar for Foo<'f> { //~ ERROR undeclared lifetime | ||
type Type = u32; | ||
} | ||
|
||
fn test() //~ ERROR implementation of `Bar` is not general enough | ||
where | ||
for<'a> <Foo<'a> as Bar>::Type: Sized, | ||
{ | ||
} | ||
|
||
fn main() {} |
This file contains hidden or 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,20 @@ | ||
error[E0261]: use of undeclared lifetime name `'f` | ||
--> $DIR/span-bug-issue-121414.rs:5:22 | ||
| | ||
LL | impl<'a> Bar for Foo<'f> { | ||
| - ^^ undeclared lifetime | ||
| | | ||
| help: consider introducing lifetime `'f` here: `'f,` | ||
|
||
error: implementation of `Bar` is not general enough | ||
--> $DIR/span-bug-issue-121414.rs:9:4 | ||
| | ||
LL | fn test() | ||
| ^^^^ implementation of `Bar` is not general enough | ||
| | ||
= note: `Bar` would have to be implemented for the type `Foo<'0>`, for any lifetime `'0`... | ||
= note: ...but `Bar` is actually implemented for the type `Foo<'1>`, for some specific lifetime `'1` | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0261`. |
This file contains hidden or 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,15 @@ | ||
fn test_missing_unsafe_warning_on_repr_packed() { | ||
struct Foo { | ||
x: String, | ||
} | ||
|
||
let foo = Foo { x: String::new() }; | ||
|
||
let c = || { | ||
let (_, t2) = foo.x; //~ ERROR mismatched types | ||
}; | ||
|
||
c(); | ||
} | ||
|
||
fn main() {} |
This file contains hidden or 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,14 @@ | ||
error[E0308]: mismatched types | ||
--> $DIR/span-bug-issue-121410.rs:9:13 | ||
| | ||
LL | let (_, t2) = foo.x; | ||
| ^^^^^^^ ----- this expression has type `String` | ||
| | | ||
| expected `String`, found `(_, _)` | ||
| | ||
= note: expected struct `String` | ||
found tuple `(_, _)` | ||
|
||
error: aborting due to 1 previous error | ||
|
||
For more information about this error, try `rustc --explain E0308`. |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.