31 files changed +118
-213
lines changed Original file line number Diff line number Diff line change @@ -556,6 +556,7 @@ fn method_autoderef_steps<'tcx>(
556
556
557
557
let final_ty = autoderef. final_ty ( true ) ;
558
558
let opt_bad_ty = match final_ty. kind ( ) {
559
+ ty:: Infer ( ty:: TyVar ( _) ) if !reached_raw_pointer => None ,
559
560
ty:: Infer ( ty:: TyVar ( _) ) | ty:: Error ( _) => Some ( MethodAutoderefBadTy {
560
561
reached_raw_pointer,
561
562
ty : infcx. make_query_response_ignoring_pending_obligations ( inference_vars, final_ty) ,
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
- //@ known-bug: #121613
1
+ //! This test used to ICE #121613
2
+ //! Using a generic parameter where there are none expected
3
+ //! caused an ICE, hiding the important later errors.
4
+
5
+ #![ feature( more_qualified_paths) ]
6
+
2
7
fn main ( ) {
3
8
let _ = <Foo as A >:: Assoc { br: 2 } ;
4
9
5
10
let <E >:: V ( ..) = E :: V ( |a, b| a. cmp ( b) ) ;
11
+ //~^ ERROR: multiple applicable items in scope
6
12
}
7
13
8
14
struct StructStruct {
Original file line number Diff line number Diff line change
1
+ error[E0034]: multiple applicable items in scope
2
+ --> $DIR/param_mismatch_on_associatedtype_constructor.rs:10:36
3
+ |
4
+ LL | let <E>::V(..) = E::V(|a, b| a.cmp(b));
5
+ | ^^^ multiple `cmp` found
6
+ |
7
+ note: candidate #1 is defined in the trait `Iterator`
8
+ --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
9
+ note: candidate #2 is defined in the trait `Ord`
10
+ --> $SRC_DIR/core/src/cmp.rs:LL:COL
11
+ help: disambiguate the method for candidate #1
12
+ |
13
+ LL | let <E>::V(..) = E::V(|a, b| Iterator::cmp(a, b));
14
+ | ~~~~~~~~~~~~~~~~~~~
15
+ help: disambiguate the method for candidate #2
16
+ |
17
+ LL | let <E>::V(..) = E::V(|a, b| Ord::cmp(&a, b));
18
+ | ~~~~~~~~~~~~~~~
19
+
20
+ error: aborting due to 1 previous error
21
+
22
+ For more information about this error, try `rustc --explain E0034`.
Original file line number Diff line number Diff line change @@ -29,12 +29,12 @@ impl<F> Deref for Value<Rc<F>> {
29
29
30
30
fn main ( ) {
31
31
let var_fn = Value :: wrap ( ) ;
32
- //~^ ERROR type annotations needed for `Value<Rc<_>>`
33
32
34
33
// The combination of `Value: Wrap` obligation plus the autoderef steps
35
34
// (caused by the `Deref` impl above) actually means that the self type
36
35
// of the method fn below is constrained to be `Value<Rc<dyn Fn(?0, ?1) -> ?2>>`.
37
36
// However, that's only known to us on the error path -- we still need
38
37
// to emit an ambiguity error, though.
39
38
let _ = var_fn. clone ( ) ;
39
+ //~^ ERROR: the size for values of type `dyn Fn(_, _) -> _` cannot be known
40
40
}
Original file line number Diff line number Diff line change 1
- error[E0282 ]: type annotations needed for `Value<Rc<_>>`
2
- --> $DIR/deref-ambiguity-becomes-nonambiguous.rs:31:9
1
+ error[E0277 ]: the size for values of type `dyn Fn(_, _) -> _` cannot be known at compilation time
2
+ --> $DIR/deref-ambiguity-becomes-nonambiguous.rs:38:13
3
3
|
4
- LL | let var_fn = Value::wrap();
5
- | ^^^^^^
6
- ...
7
4
LL | let _ = var_fn.clone();
8
- | ----- type must be known at this point
5
+ | ^^^^^^^^^^^^^^ doesn't have a size known at compile-time
9
6
|
10
- help: consider giving `var_fn` an explicit type, where the placeholders `_` are specified
7
+ = help: the trait `Sized` is not implemented for `dyn Fn(_, _) -> _`, which is required by `Value<Rc<_>>: Deref`
8
+ note: required for `Value<Rc<dyn Fn(_, _) -> _>>` to implement `Deref`
9
+ --> $DIR/deref-ambiguity-becomes-nonambiguous.rs:22:9
11
10
|
12
- LL | let var_fn: Value<Rc<_>> = Value::wrap();
13
- | ++++++++++++++
11
+ LL | impl<F> Deref for Value<Rc<F>> {
12
+ | - ^^^^^ ^^^^^^^^^^^^
13
+ | |
14
+ | unsatisfied trait bound introduced here
14
15
15
16
error: aborting due to 1 previous error
16
17
17
- For more information about this error, try `rustc --explain E0282 `.
18
+ For more information about this error, try `rustc --explain E0277 `.
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ LL | needs_foo(|x| {
5
5
| ^
6
6
...
7
7
LL | x.to_string();
8
- | --------- type must be known at this point
8
+ | ---- --------- type must be known at this point
9
9
|
10
10
help: consider giving this closure parameter an explicit type
11
11
|
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ LL | let mut iter = foo(n - 1, m);
5
5
| ^^^^^^^^
6
6
LL |
7
7
LL | assert_eq!(iter.get(), 1);
8
- | --- type must be known at this point
8
+ | ------- --- type must be known at this point
9
9
|
10
10
help: consider giving `iter` an explicit type
11
11
|
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ LL | let x = my_foo();
5
5
| ^
6
6
LL |
7
7
LL | x.my_debug();
8
- | -------- type must be known at this point
8
+ | ---- -------- type must be known at this point
9
9
|
10
10
help: consider giving `x` an explicit type
11
11
|
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ error[E0282]: type annotations needed for `&_`
4
4
LL | let x = &my_foo();
5
5
| ^
6
6
LL | x.my_debug();
7
- | -------- type must be known at this point
7
+ | ---- -------- type must be known at this point
8
8
|
9
9
help: consider giving `x` an explicit type, where the placeholders `_` are specified
10
10
|
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ LL | let x = my_foo();
5
5
| ^
6
6
LL |
7
7
LL | x.my_debug();
8
- | -------- type must be known at this point
8
+ | ---- -------- type must be known at this point
9
9
|
10
10
help: consider giving `x` an explicit type
11
11
|
@@ -19,7 +19,7 @@ LL | let x = &my_bar();
19
19
| ^
20
20
LL |
21
21
LL | x.my_debug();
22
- | -------- type must be known at this point
22
+ | ---- -------- type must be known at this point
23
23
|
24
24
help: consider giving `x` an explicit type, where the placeholders `_` are specified
25
25
|
Original file line number Diff line number Diff line change 1
- error[E0282 ]: type annotations needed
2
- --> $DIR/hidden-type-is-opaque-2.rs:10:17
1
+ error[E0599 ]: no method named `reify_as` found for type `_` in the current scope
2
+ --> $DIR/hidden-type-is-opaque-2.rs:11:14
3
3
|
4
- LL | Thunk::new(|mut cont| {
5
- | ^^^^^^^^
6
- LL |
7
4
LL | cont.reify_as();
8
- | -------- type must be known at this point
9
- |
10
- help: consider giving this closure parameter an explicit type
11
- |
12
- LL | Thunk::new(|mut cont: /* Type */| {
13
- | ++++++++++++
5
+ | ^^^^^^^^ method not found in `_`
14
6
15
- error[E0282 ]: type annotations needed
16
- --> $DIR/hidden-type-is-opaque-2.rs:20:17
7
+ error[E0599 ]: no method named `reify_as` found for type `_` in the current scope
8
+ --> $DIR/hidden-type-is-opaque-2.rs:21:14
17
9
|
18
- LL | Thunk::new(|mut cont| {
19
- | ^^^^^^^^
20
- LL |
21
10
LL | cont.reify_as();
22
- | -------- type must be known at this point
23
- |
24
- help: consider giving this closure parameter an explicit type
25
- |
26
- LL | Thunk::new(|mut cont: /* Type */| {
27
- | ++++++++++++
11
+ | ^^^^^^^^ method not found in `_`
28
12
29
13
error: aborting due to 2 previous errors
30
14
31
- For more information about this error, try `rustc --explain E0282 `.
15
+ For more information about this error, try `rustc --explain E0599 `.
Original file line number Diff line number Diff line change 1
- error[E0282 ]: type annotations needed
2
- --> $DIR/hidden-type-is-opaque-2.rs:10:17
1
+ error[E0599 ]: no method named `reify_as` found for type `_` in the current scope
2
+ --> $DIR/hidden-type-is-opaque-2.rs:11:14
3
3
|
4
- LL | Thunk::new(|mut cont| {
5
- | ^^^^^^^^
6
- LL |
7
4
LL | cont.reify_as();
8
- | -------- type must be known at this point
9
- |
10
- help: consider giving this closure parameter an explicit type
11
- |
12
- LL | Thunk::new(|mut cont: /* Type */| {
13
- | ++++++++++++
5
+ | ^^^^^^^^ method not found in `_`
14
6
15
- error[E0282 ]: type annotations needed
16
- --> $DIR/hidden-type-is-opaque-2.rs:20:17
7
+ error[E0599 ]: no method named `reify_as` found for type `_` in the current scope
8
+ --> $DIR/hidden-type-is-opaque-2.rs:21:14
17
9
|
18
- LL | Thunk::new(|mut cont| {
19
- | ^^^^^^^^
20
- LL |
21
10
LL | cont.reify_as();
22
- | -------- type must be known at this point
23
- |
24
- help: consider giving this closure parameter an explicit type
25
- |
26
- LL | Thunk::new(|mut cont: /* Type */| {
27
- | ++++++++++++
11
+ | ^^^^^^^^ method not found in `_`
28
12
29
13
error: aborting due to 2 previous errors
30
14
31
- For more information about this error, try `rustc --explain E0282 `.
15
+ For more information about this error, try `rustc --explain E0599 `.
Original file line number Diff line number Diff line change 8
8
9
9
fn reify_as ( ) -> Thunk < impl FnOnce ( Continuation ) -> Continuation > {
10
10
Thunk :: new ( |mut cont| {
11
- //~^ ERROR type annotations needed
12
11
cont. reify_as ( ) ;
12
+ //~^ ERROR: no method named `reify_as` found for type `_`
13
13
cont
14
14
} )
15
15
}
@@ -18,8 +18,8 @@ type Tait = impl FnOnce(Continuation) -> Continuation;
18
18
19
19
fn reify_as_tait ( ) -> Thunk < Tait > {
20
20
Thunk :: new ( |mut cont| {
21
- //~^ ERROR type annotations needed
22
21
cont. reify_as ( ) ;
22
+ //~^ ERROR: no method named `reify_as` found for type `_`
23
23
cont
24
24
} )
25
25
}
Original file line number Diff line number Diff line change 1
1
error[E0282]: type annotations needed
2
- --> $DIR/method-resolution4.rs:13:20
2
+ --> $DIR/method-resolution4.rs:13:9
3
3
|
4
4
LL | foo(false).next().unwrap();
5
- | ^^^^ cannot infer type
5
+ | ^^^^^^^^^^^^^ ^^^^ cannot infer type
6
6
7
7
error[E0308]: mismatched types
8
8
--> $DIR/method-resolution4.rs:16:5
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
1
error[E0282]: type annotations needed
2
- --> $DIR/recursive-bound-eval.rs:18:28
2
+ --> $DIR/recursive-bound-eval.rs:19:13
3
3
|
4
4
LL | move || recursive_fn().parse()
5
- | ^^^^^ cannot infer type
5
+ | ^^^^^^^^^^^^^^^^^ ^^^^^ cannot infer type
6
6
7
7
error: aborting due to 1 previous error
8
8
Original file line number Diff line number Diff line change 3
3
4
4
//@revisions: next current
5
5
//@[next] compile-flags: -Znext-solver
6
+ //@[current] check-pass
6
7
7
8
pub trait Parser < E > {
8
9
fn parse ( & self ) -> E ;
@@ -16,8 +17,7 @@ impl<E, T: Fn() -> E> Parser<E> for T {
16
17
17
18
pub fn recursive_fn < E > ( ) -> impl Parser < E > {
18
19
move || recursive_fn ( ) . parse ( )
19
- //~^ ERROR: type annotations needed
20
- //[current]~^^ ERROR: no method named `parse` found for opaque type
20
+ //[next]~^ ERROR: type annotations needed
21
21
}
22
22
23
23
fn main ( ) { }
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
1
//@ revisions: current next
2
2
//@ ignore-compare-mode-next-solver (explicit revisions)
3
- //@[current] check-pass
3
+ //@ check-pass
4
4
//@[next] compile-flags: -Znext-solver
5
5
#![ feature( coroutines, coroutine_trait) ]
6
6
7
7
use std:: ops:: { Coroutine , CoroutineState } ;
8
8
9
9
fn foo ( ) -> impl Coroutine < Yield = ( ) , Return = ( ) > {
10
- // FIXME(-Znext-solver): this fails with a mismatched types as the
11
- // hidden type of the opaque ends up as {type error}. We should not
12
- // emit errors for such goals.
13
10
14
- #[ coroutine] || { //[next]~ ERROR mismatched types
11
+ #[ coroutine] || {
15
12
let mut gen = Box :: pin ( foo ( ) ) ;
16
- //[next]~^ ERROR type annotations needed
17
13
let mut r = gen. as_mut ( ) . resume ( ( ) ) ;
18
14
while let CoroutineState :: Yielded ( v) = r {
19
15
yield v;
There was a problem loading the remainder of the diff.
0 commit comments