-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do not fail
method_autoderef_steps
on infer types. Let method resol…
…ution handle it
- Loading branch information
Showing
35 changed files
with
173 additions
and
183 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
30 changes: 30 additions & 0 deletions
30
tests/ui/associated-types/param_mismatch_on_associatedtype_constructor.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,30 @@ | ||
//! This test used to ICE #121613 | ||
//! Using a generic parameter where there are none expected | ||
//! caused an ICE, hiding the important later errors. | ||
#![feature(more_qualified_paths)] | ||
|
||
fn main() { | ||
let _ = <Foo as A>::Assoc { br: 2 }; | ||
|
||
let <E>::V(..) = E::V(|a, b| a.cmp(b)); | ||
//~^ ERROR: multiple applicable items in scope | ||
} | ||
|
||
struct StructStruct { | ||
br: i8, | ||
} | ||
|
||
struct Foo; | ||
|
||
trait A { | ||
type Assoc; | ||
} | ||
|
||
impl A for Foo { | ||
type Assoc = StructStruct; | ||
} | ||
|
||
enum E { | ||
V(u8), | ||
} |
22 changes: 22 additions & 0 deletions
22
tests/ui/associated-types/param_mismatch_on_associatedtype_constructor.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,22 @@ | ||
error[E0034]: multiple applicable items in scope | ||
--> $DIR/param_mismatch_on_associatedtype_constructor.rs:10:36 | ||
| | ||
LL | let <E>::V(..) = E::V(|a, b| a.cmp(b)); | ||
| ^^^ multiple `cmp` found | ||
| | ||
note: candidate #1 is defined in the trait `Iterator` | ||
--> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL | ||
note: candidate #2 is defined in the trait `Ord` | ||
--> $SRC_DIR/core/src/cmp.rs:LL:COL | ||
help: disambiguate the method for candidate #1 | ||
| | ||
LL | let <E>::V(..) = E::V(|a, b| Iterator::cmp(a, b)); | ||
| ~~~~~~~~~~~~~~~~~~~ | ||
help: disambiguate the method for candidate #2 | ||
| | ||
LL | let <E>::V(..) = E::V(|a, b| Ord::cmp(&a, b)); | ||
| ~~~~~~~~~~~~~~~ | ||
|
||
error: aborting due to 1 previous error | ||
|
||
For more information about this error, try `rustc --explain E0034`. |
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
20 changes: 10 additions & 10 deletions
20
tests/ui/autoref-autoderef/deref-ambiguity-becomes-nonambiguous.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 |
---|---|---|
@@ -1,17 +1,17 @@ | ||
error[E0282]: type annotations needed for `Value<Rc<_>>` | ||
--> $DIR/deref-ambiguity-becomes-nonambiguous.rs:31:9 | ||
error[E0283]: type annotations needed | ||
--> $DIR/deref-ambiguity-becomes-nonambiguous.rs:38:9 | ||
| | ||
LL | let var_fn = Value::wrap(); | ||
| ^^^^^^ | ||
... | ||
LL | let _ = var_fn.clone(); | ||
| ----- type must be known at this point | ||
| ^ ------ ----- required by a bound introduced by this call | ||
| | | ||
| type must be known at this point | ||
| | ||
help: consider giving `var_fn` an explicit type, where the placeholders `_` are specified | ||
= note: cannot satisfy `_: Clone` | ||
help: consider giving this pattern a type | ||
| | ||
LL | let var_fn: Value<Rc<_>> = Value::wrap(); | ||
| ++++++++++++++ | ||
LL | let _: /* Type */ = var_fn.clone(); | ||
| ++++++++++++ | ||
|
||
error: aborting due to 1 previous error | ||
|
||
For more information about this error, try `rustc --explain E0282`. | ||
For more information about this error, try `rustc --explain E0283`. |
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
30 changes: 7 additions & 23 deletions
30
tests/ui/impl-trait/hidden-type-is-opaque-2.default.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 |
---|---|---|
@@ -1,31 +1,15 @@ | ||
error[E0282]: type annotations needed | ||
--> $DIR/hidden-type-is-opaque-2.rs:10:17 | ||
error[E0599]: no method named `reify_as` found for type `_` in the current scope | ||
--> $DIR/hidden-type-is-opaque-2.rs:11:14 | ||
| | ||
LL | Thunk::new(|mut cont| { | ||
| ^^^^^^^^ | ||
LL | | ||
LL | cont.reify_as(); | ||
| -------- type must be known at this point | ||
| | ||
help: consider giving this closure parameter an explicit type | ||
| | ||
LL | Thunk::new(|mut cont: /* Type */| { | ||
| ++++++++++++ | ||
| ^^^^^^^^ method not found in `_` | ||
|
||
error[E0282]: type annotations needed | ||
--> $DIR/hidden-type-is-opaque-2.rs:20:17 | ||
error[E0599]: no method named `reify_as` found for type `_` in the current scope | ||
--> $DIR/hidden-type-is-opaque-2.rs:21:14 | ||
| | ||
LL | Thunk::new(|mut cont| { | ||
| ^^^^^^^^ | ||
LL | | ||
LL | cont.reify_as(); | ||
| -------- type must be known at this point | ||
| | ||
help: consider giving this closure parameter an explicit type | ||
| | ||
LL | Thunk::new(|mut cont: /* Type */| { | ||
| ++++++++++++ | ||
| ^^^^^^^^ method not found in `_` | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0282`. | ||
For more information about this error, try `rustc --explain E0599`. |
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,31 +1,15 @@ | ||
error[E0282]: type annotations needed | ||
--> $DIR/hidden-type-is-opaque-2.rs:10:17 | ||
error[E0599]: no method named `reify_as` found for type `_` in the current scope | ||
--> $DIR/hidden-type-is-opaque-2.rs:11:14 | ||
| | ||
LL | Thunk::new(|mut cont| { | ||
| ^^^^^^^^ | ||
LL | | ||
LL | cont.reify_as(); | ||
| -------- type must be known at this point | ||
| | ||
help: consider giving this closure parameter an explicit type | ||
| | ||
LL | Thunk::new(|mut cont: /* Type */| { | ||
| ++++++++++++ | ||
| ^^^^^^^^ method not found in `_` | ||
|
||
error[E0282]: type annotations needed | ||
--> $DIR/hidden-type-is-opaque-2.rs:20:17 | ||
error[E0599]: no method named `reify_as` found for type `_` in the current scope | ||
--> $DIR/hidden-type-is-opaque-2.rs:21:14 | ||
| | ||
LL | Thunk::new(|mut cont| { | ||
| ^^^^^^^^ | ||
LL | | ||
LL | cont.reify_as(); | ||
| -------- type must be known at this point | ||
| | ||
help: consider giving this closure parameter an explicit type | ||
| | ||
LL | Thunk::new(|mut cont: /* Type */| { | ||
| ++++++++++++ | ||
| ^^^^^^^^ method not found in `_` | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0282`. | ||
For more information about this error, try `rustc --explain E0599`. |
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 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 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
6 changes: 3 additions & 3 deletions
6
tests/ui/inference/detect-old-time-version-format_description-parse.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 |
---|---|---|
@@ -1,13 +1,13 @@ | ||
#![crate_name = "time"] | ||
#![crate_type = "lib"] | ||
|
||
//@check-pass | ||
|
||
// This code compiled without error in Rust 1.79, but started failing in 1.80 | ||
// after the addition of several `impl FromIterator<_> for Box<str>`. | ||
|
||
pub fn parse() -> Option<Vec<()>> { | ||
let iter = std::iter::once(Some(())).map(|o| o.map(Into::into)); | ||
let items = iter.collect::<Option<Box<_>>>()?; //~ ERROR E0282 | ||
//~^ NOTE this is an inference error on crate `time` caused by an API change in Rust 1.80.0; update `time` to version `>=0.3.35` | ||
let items = iter.collect::<Option<Box<_>>>()?; | ||
Some(items.into()) | ||
//~^ NOTE type must be known at this point | ||
} |
14 changes: 0 additions & 14 deletions
14
tests/ui/inference/detect-old-time-version-format_description-parse.stderr
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
Oops, something went wrong.