forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of rust-lang#128350 - matthiaskrgr:rollup-bcuhts8, r=matth…
…iaskrgr Rollup of 6 pull requests Successful merges: - rust-lang#127882 (Don't elaborate associated types with Sized bounds in `trait_object_ty` in cfi) - rust-lang#128174 (Don't record trait aliases as marker traits) - rust-lang#128202 (Tell users not to file a bug when using internal library features) - rust-lang#128239 (Don't ICE when encountering error regions when confirming object method candidate) - rust-lang#128337 (skip assoc type during infer source visitor) - rust-lang#128341 (Make `rustc_attr::parse_version` pub) r? `@ghost` `@rustbot` modify labels: rollup
- Loading branch information
Showing
19 changed files
with
228 additions
and
77 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 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.
24 changes: 24 additions & 0 deletions
24
tests/ui/inference/need_type_info/incompat-call-after-qualified-path-0.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,24 @@ | ||
// issue#121613 | ||
|
||
#![feature(more_qualified_paths)] | ||
|
||
struct S {} | ||
|
||
struct Foo; | ||
|
||
trait A { | ||
type Assoc; | ||
} | ||
|
||
impl A for Foo { | ||
type Assoc = S; | ||
} | ||
|
||
fn f() {} | ||
|
||
fn main() { | ||
<Foo as A>::Assoc {}; | ||
f(|a, b| a.cmp(b)); | ||
//~^ ERROR: type annotations needed | ||
//~| ERROR: this function takes 0 arguments but 1 argument was supplied | ||
} |
32 changes: 32 additions & 0 deletions
32
tests/ui/inference/need_type_info/incompat-call-after-qualified-path-0.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,32 @@ | ||
error[E0282]: type annotations needed | ||
--> $DIR/incompat-call-after-qualified-path-0.rs:21:6 | ||
| | ||
LL | f(|a, b| a.cmp(b)); | ||
| ^ - type must be known at this point | ||
| | ||
help: consider giving this closure parameter an explicit type | ||
| | ||
LL | f(|a: /* Type */, b| a.cmp(b)); | ||
| ++++++++++++ | ||
|
||
error[E0061]: this function takes 0 arguments but 1 argument was supplied | ||
--> $DIR/incompat-call-after-qualified-path-0.rs:21:3 | ||
| | ||
LL | f(|a, b| a.cmp(b)); | ||
| ^ --------------- unexpected argument | ||
| | ||
note: function defined here | ||
--> $DIR/incompat-call-after-qualified-path-0.rs:17:4 | ||
| | ||
LL | fn f() {} | ||
| ^ | ||
help: remove the extra argument | ||
| | ||
LL - f(|a, b| a.cmp(b)); | ||
LL + f(); | ||
| | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
Some errors have detailed explanations: E0061, E0282. | ||
For more information about an error, try `rustc --explain E0061`. |
28 changes: 28 additions & 0 deletions
28
tests/ui/inference/need_type_info/incompat-call-after-qualified-path-1.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,28 @@ | ||
// issue#121613 | ||
|
||
#![feature(more_qualified_paths)] | ||
|
||
struct S<T> { | ||
a: T | ||
} | ||
|
||
struct Foo; | ||
|
||
trait A { | ||
type Assoc<T>; | ||
} | ||
|
||
impl A for Foo { | ||
type Assoc<T> = S<T>; | ||
} | ||
|
||
fn f() {} | ||
|
||
fn main() { | ||
<Foo as A>::Assoc::<i32> { | ||
a: 1 | ||
}; | ||
f(|a, b| a.cmp(b)); | ||
//~^ ERROR: type annotations needed | ||
//~| ERROR: this function takes 0 arguments but 1 argument was supplied | ||
} |
32 changes: 32 additions & 0 deletions
32
tests/ui/inference/need_type_info/incompat-call-after-qualified-path-1.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,32 @@ | ||
error[E0282]: type annotations needed | ||
--> $DIR/incompat-call-after-qualified-path-1.rs:25:6 | ||
| | ||
LL | f(|a, b| a.cmp(b)); | ||
| ^ - type must be known at this point | ||
| | ||
help: consider giving this closure parameter an explicit type | ||
| | ||
LL | f(|a: /* Type */, b| a.cmp(b)); | ||
| ++++++++++++ | ||
|
||
error[E0061]: this function takes 0 arguments but 1 argument was supplied | ||
--> $DIR/incompat-call-after-qualified-path-1.rs:25:3 | ||
| | ||
LL | f(|a, b| a.cmp(b)); | ||
| ^ --------------- unexpected argument | ||
| | ||
note: function defined here | ||
--> $DIR/incompat-call-after-qualified-path-1.rs:19:4 | ||
| | ||
LL | fn f() {} | ||
| ^ | ||
help: remove the extra argument | ||
| | ||
LL - f(|a, b| a.cmp(b)); | ||
LL + f(); | ||
| | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
Some errors have detailed explanations: E0061, E0282. | ||
For more information about an error, try `rustc --explain E0061`. |
11 changes: 11 additions & 0 deletions
11
tests/ui/methods/dont-ice-on-object-lookup-w-error-region.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,11 @@ | ||
// Fix for issue: #122914 | ||
|
||
use std::future::Future; | ||
use std::pin::Pin; | ||
|
||
fn project(x: Pin<&'missing mut dyn Future<Output = ()>>) { | ||
//~^ ERROR use of undeclared lifetime name `'missing` | ||
let _ = x.poll(todo!()); | ||
} | ||
|
||
fn main() {} |
11 changes: 11 additions & 0 deletions
11
tests/ui/methods/dont-ice-on-object-lookup-w-error-region.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,11 @@ | ||
error[E0261]: use of undeclared lifetime name `'missing` | ||
--> $DIR/dont-ice-on-object-lookup-w-error-region.rs:6:20 | ||
| | ||
LL | fn project(x: Pin<&'missing mut dyn Future<Output = ()>>) { | ||
| - ^^^^^^^^ undeclared lifetime | ||
| | | ||
| help: consider introducing lifetime `'missing` here: `<'missing>` | ||
|
||
error: aborting due to 1 previous error | ||
|
||
For more information about this error, try `rustc --explain E0261`. |
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,38 @@ | ||
// Check that we only elaborate non-`Self: Sized` associated types when | ||
// erasing the receiver from trait ref. | ||
|
||
//@ revisions: cfi kcfi | ||
// FIXME(#122848) Remove only-linux once OSX CFI binaries work | ||
//@ only-linux | ||
//@ [cfi] needs-sanitizer-cfi | ||
//@ [kcfi] needs-sanitizer-kcfi | ||
//@ compile-flags: -C target-feature=-crt-static | ||
//@ [cfi] compile-flags: -C codegen-units=1 -C lto -C prefer-dynamic=off -C opt-level=0 | ||
//@ [cfi] compile-flags: -Z sanitizer=cfi | ||
//@ [kcfi] compile-flags: -Z sanitizer=kcfi | ||
//@ [kcfi] compile-flags: -C panic=abort -C prefer-dynamic=off | ||
//@ run-pass | ||
|
||
trait Foo { | ||
type Bar<'a> | ||
where | ||
Self: Sized; | ||
|
||
fn test(&self); | ||
} | ||
|
||
impl Foo for () { | ||
type Bar<'a> = () | ||
where | ||
Self: Sized; | ||
|
||
fn test(&self) {} | ||
} | ||
|
||
fn test(x: &dyn Foo) { | ||
x.test(); | ||
} | ||
|
||
fn main() { | ||
test(&()); | ||
} |
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,7 @@ | ||
#![feature(trait_alias, marker_trait_attr)] | ||
|
||
#[marker] | ||
//~^ ERROR attribute should be applied to a trait | ||
trait Foo = Send; | ||
|
||
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,11 @@ | ||
error: attribute should be applied to a trait | ||
--> $DIR/not-a-marker.rs:3:1 | ||
| | ||
LL | #[marker] | ||
| ^^^^^^^^^ | ||
LL | | ||
LL | trait Foo = Send; | ||
| ----------------- not a trait | ||
|
||
error: aborting due to 1 previous error | ||
|