Skip to content

Commit 8272465

Browse files
committed
Revert old span change
1 parent ac2fb7a commit 8272465

7 files changed

+11
-21
lines changed

src/librustc_typeck/astconv.rs

+1-11
Original file line numberDiff line numberDiff line change
@@ -1015,18 +1015,8 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
10151015

10161016
self.prohibit_generics(trait_ref.path.segments.split_last().unwrap().1);
10171017

1018-
let path_span = if let [segment] = &trait_ref.path.segments[..] {
1019-
// FIXME: `trait_ref.path.span` can point to a full path with multiple
1020-
// segments, even though `trait_ref.path.segments` is of length `1`. Work
1021-
// around that bug here, even though it should be fixed elsewhere.
1022-
// This would otherwise cause an invalid suggestion. For an example, look at
1023-
// `src/test/ui/issues/issue-28344.rs`.
1024-
segment.ident.span
1025-
} else {
1026-
trait_ref.path.span
1027-
};
10281018
let (substs, assoc_bindings, arg_count_correct) = self.create_substs_for_ast_trait_ref(
1029-
path_span,
1019+
trait_ref.path.span,
10301020
trait_def_id,
10311021
self_ty,
10321022
trait_ref.path.segments.last().unwrap(),

src/test/ui/suggestions/missing-lifetime-specifier.stderr

+4-4
Original file line numberDiff line numberDiff line change
@@ -218,13 +218,13 @@ error[E0107]: wrong number of lifetime arguments: expected 2, found 1
218218
--> $DIR/missing-lifetime-specifier.rs:54:45
219219
|
220220
LL | static f: RefCell<HashMap<i32, Vec<Vec<&Tar<'static, i32>>>>> = RefCell::new(HashMap::new());
221-
| ^^^ expected 2 lifetime arguments
221+
| ^^^^^^^^^^^^^^^^^ expected 2 lifetime arguments
222222

223223
error[E0107]: wrong number of lifetime arguments: expected 2, found 1
224224
--> $DIR/missing-lifetime-specifier.rs:54:45
225225
|
226226
LL | static f: RefCell<HashMap<i32, Vec<Vec<&Tar<'static, i32>>>>> = RefCell::new(HashMap::new());
227-
| ^^^ expected 2 lifetime arguments
227+
| ^^^^^^^^^^^^^^^^^ expected 2 lifetime arguments
228228

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

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

253253
error: aborting due to 28 previous errors
254254

src/test/ui/unboxed-closures/unboxed-closure-feature-gate.stderr

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

src/test/ui/unboxed-closures/unboxed-closure-sugar-not-used-on-fn.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0658]: the precise format of `Fn`-family traits' type parameters is subje
22
--> $DIR/unboxed-closure-sugar-not-used-on-fn.rs:3:17
33
|
44
LL | fn bar1(x: &dyn Fn<(), Output=()>) {
5-
| ^^ help: use parenthetical notation instead: `Fn() -> ()`
5+
| ^^^^^^^^^^^^^^^^^ help: use parenthetical notation instead: `Fn() -> ()`
66
|
77
= note: see issue #29625 <https://github.com/rust-lang/rust/issues/29625> for more information
88
= 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
1111
--> $DIR/unboxed-closure-sugar-not-used-on-fn.rs:7:28
1212
|
1313
LL | fn bar2<T>(x: &T) where T: Fn<()> {
14-
| ^^ help: use parenthetical notation instead: `Fn() -> ()`
14+
| ^^^^^^ help: use parenthetical notation instead: `Fn() -> ()`
1515
|
1616
= note: see issue #29625 <https://github.com/rust-lang/rust/issues/29625> for more information
1717
= help: add `#![feature(unboxed_closures)]` to the crate attributes to enable

src/test/ui/unboxed-closures/unboxed-closure-sugar-region.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0107]: wrong number of lifetime arguments: expected 1, found 0
22
--> $DIR/unboxed-closure-sugar-region.rs:30:51
33
|
44
LL | fn test2(x: &dyn Foo<(isize,),Output=()>, y: &dyn Foo(isize)) {
5-
| ^^^ expected 1 lifetime argument
5+
| ^^^^^^^^^^ expected 1 lifetime argument
66

77
error: aborting due to previous error
88

src/test/ui/unboxed-closures/unboxed-closure-sugar-wrong-number-number-type-parameters-3.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0107]: wrong number of type arguments: expected 3, found 1
22
--> $DIR/unboxed-closure-sugar-wrong-number-number-type-parameters-3.rs:5:16
33
|
44
LL | fn foo(_: &dyn Three())
5-
| ^^^^^ expected 3 type arguments
5+
| ^^^^^^^ expected 3 type arguments
66

77
error[E0220]: associated type `Output` not found for `Three<(), [type error], [type error]>`
88
--> $DIR/unboxed-closure-sugar-wrong-number-number-type-parameters-3.rs:5:16

src/test/ui/unspecified-self-in-trait-ref.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ LL | | }
3131
| |_- type parameter `A` must be specified for this
3232
...
3333
LL | let e = Bar::<usize>::lol();
34-
| ^^^ missing reference to `A`
34+
| ^^^^^^^^^^^^^^^^^ missing reference to `A`
3535
|
3636
= note: because of the default `Self` reference, type parameters must be specified on object types
3737

0 commit comments

Comments
 (0)