Revert old span change

This commit is contained in:
Esteban Küber 2020-04-17 12:26:32 -07:00
parent 1f43fc0209
commit 322b2045f2
7 changed files with 11 additions and 21 deletions

View File

@ -1017,18 +1017,8 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
self.prohibit_generics(trait_ref.path.segments.split_last().unwrap().1);
let path_span = if let [segment] = &trait_ref.path.segments[..] {
// FIXME: `trait_ref.path.span` can point to a full path with multiple
// segments, even though `trait_ref.path.segments` is of length `1`. Work
// around that bug here, even though it should be fixed elsewhere.
// This would otherwise cause an invalid suggestion. For an example, look at
// `src/test/ui/issues/issue-28344.rs`.
segment.ident.span
} else {
trait_ref.path.span
};
let (substs, assoc_bindings, arg_count_correct) = self.create_substs_for_ast_trait_ref(
path_span,
trait_ref.path.span,
trait_def_id,
self_ty,
trait_ref.path.segments.last().unwrap(),

View File

@ -218,13 +218,13 @@ error[E0107]: wrong number of lifetime arguments: expected 2, found 1
--> $DIR/missing-lifetime-specifier.rs:54:45
|
LL | static f: RefCell<HashMap<i32, Vec<Vec<&Tar<'static, i32>>>>> = RefCell::new(HashMap::new());
| ^^^ expected 2 lifetime arguments
| ^^^^^^^^^^^^^^^^^ expected 2 lifetime arguments
error[E0107]: wrong number of lifetime arguments: expected 2, found 1
--> $DIR/missing-lifetime-specifier.rs:54:45
|
LL | static f: RefCell<HashMap<i32, Vec<Vec<&Tar<'static, i32>>>>> = RefCell::new(HashMap::new());
| ^^^ expected 2 lifetime arguments
| ^^^^^^^^^^^^^^^^^ expected 2 lifetime arguments
error[E0228]: the lifetime bound for this object type cannot be deduced from context; please supply an explicit bound
--> $DIR/missing-lifetime-specifier.rs:54:45
@ -236,7 +236,7 @@ error[E0107]: wrong number of lifetime arguments: expected 2, found 1
--> $DIR/missing-lifetime-specifier.rs:54:45
|
LL | static f: RefCell<HashMap<i32, Vec<Vec<&Tar<'static, i32>>>>> = RefCell::new(HashMap::new());
| ^^^ expected 2 lifetime arguments
| ^^^^^^^^^^^^^^^^^ expected 2 lifetime arguments
error[E0228]: the lifetime bound for this object type cannot be deduced from context; please supply an explicit bound
--> $DIR/missing-lifetime-specifier.rs:54:45
@ -248,7 +248,7 @@ error[E0107]: wrong number of lifetime arguments: expected 2, found 1
--> $DIR/missing-lifetime-specifier.rs:54:45
|
LL | static f: RefCell<HashMap<i32, Vec<Vec<&Tar<'static, i32>>>>> = RefCell::new(HashMap::new());
| ^^^ expected 2 lifetime arguments
| ^^^^^^^^^^^^^^^^^ expected 2 lifetime arguments
error: aborting due to 28 previous errors

View File

@ -2,7 +2,7 @@ error[E0658]: parenthetical notation is only stable when used with `Fn`-family t
--> $DIR/unboxed-closure-feature-gate.rs:13:20
|
LL | let x: Box<dyn Foo(isize)>;
| ^^^
| ^^^^^^^^^^
|
= note: see issue #29625 <https://github.com/rust-lang/rust/issues/29625> for more information
= help: add `#![feature(unboxed_closures)]` to the crate attributes to enable

View File

@ -2,7 +2,7 @@ error[E0658]: the precise format of `Fn`-family traits' type parameters is subje
--> $DIR/unboxed-closure-sugar-not-used-on-fn.rs:3:17
|
LL | fn bar1(x: &dyn Fn<(), Output=()>) {
| ^^ help: use parenthetical notation instead: `Fn() -> ()`
| ^^^^^^^^^^^^^^^^^ help: use parenthetical notation instead: `Fn() -> ()`
|
= note: see issue #29625 <https://github.com/rust-lang/rust/issues/29625> for more information
= help: add `#![feature(unboxed_closures)]` to the crate attributes to enable
@ -11,7 +11,7 @@ error[E0658]: the precise format of `Fn`-family traits' type parameters is subje
--> $DIR/unboxed-closure-sugar-not-used-on-fn.rs:7:28
|
LL | fn bar2<T>(x: &T) where T: Fn<()> {
| ^^ help: use parenthetical notation instead: `Fn() -> ()`
| ^^^^^^ help: use parenthetical notation instead: `Fn() -> ()`
|
= note: see issue #29625 <https://github.com/rust-lang/rust/issues/29625> for more information
= help: add `#![feature(unboxed_closures)]` to the crate attributes to enable

View File

@ -2,7 +2,7 @@ error[E0107]: wrong number of lifetime arguments: expected 1, found 0
--> $DIR/unboxed-closure-sugar-region.rs:30:51
|
LL | fn test2(x: &dyn Foo<(isize,),Output=()>, y: &dyn Foo(isize)) {
| ^^^ expected 1 lifetime argument
| ^^^^^^^^^^ expected 1 lifetime argument
error: aborting due to previous error

View File

@ -2,7 +2,7 @@ error[E0107]: wrong number of type arguments: expected 3, found 1
--> $DIR/unboxed-closure-sugar-wrong-number-number-type-parameters-3.rs:5:16
|
LL | fn foo(_: &dyn Three())
| ^^^^^ expected 3 type arguments
| ^^^^^^^ expected 3 type arguments
error[E0220]: associated type `Output` not found for `Three<(), [type error], [type error]>`
--> $DIR/unboxed-closure-sugar-wrong-number-number-type-parameters-3.rs:5:16

View File

@ -31,7 +31,7 @@ LL | | }
| |_- type parameter `A` must be specified for this
...
LL | let e = Bar::<usize>::lol();
| ^^^ missing reference to `A`
| ^^^^^^^^^^^^^^^^^ missing reference to `A`
|
= note: because of the default `Self` reference, type parameters must be specified on object types