Skip to content

Commit 46b8c23

Browse files
committed
Auto merge of rust-lang#93967 - cjgillot:short-struct-span, r=petrochenkov
Shorten def_span for more items. The `def_span` query only returns the signature span for functions. Struct/enum/union definitions can also have a very long body. This PR shortens the associated span.
2 parents 5018181 + 42e4eee commit 46b8c23

File tree

421 files changed

+2171
-3495
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

421 files changed

+2171
-3495
lines changed

compiler/rustc_middle/src/hir/map/mod.rs

+90-30
Original file line numberDiff line numberDiff line change
@@ -934,28 +934,105 @@ impl<'hir> Map<'hir> {
934934
}
935935

936936
/// Gets the span of the definition of the specified HIR node.
937-
/// This is used by `tcx.get_span`
937+
/// This is used by `tcx.def_span`.
938938
pub fn span(self, hir_id: HirId) -> Span {
939939
self.opt_span(hir_id)
940940
.unwrap_or_else(|| bug!("hir::map::Map::span: id not in map: {:?}", hir_id))
941941
}
942942

943943
pub fn opt_span(self, hir_id: HirId) -> Option<Span> {
944+
fn until_within(outer: Span, end: Span) -> Span {
945+
if let Some(end) = end.find_ancestor_inside(outer) {
946+
outer.with_hi(end.hi())
947+
} else {
948+
outer
949+
}
950+
}
951+
952+
fn named_span(item_span: Span, ident: Ident, generics: Option<&Generics<'_>>) -> Span {
953+
if ident.name != kw::Empty {
954+
let mut span = until_within(item_span, ident.span);
955+
if let Some(g) = generics
956+
&& !g.span.is_dummy()
957+
&& let Some(g_span) = g.span.find_ancestor_inside(item_span)
958+
{
959+
span = span.to(g_span);
960+
}
961+
span
962+
} else {
963+
item_span
964+
}
965+
}
966+
944967
let span = match self.find(hir_id)? {
945-
Node::Param(param) => param.span,
968+
// Function-like.
969+
Node::Item(Item { kind: ItemKind::Fn(sig, ..), .. })
970+
| Node::TraitItem(TraitItem { kind: TraitItemKind::Fn(sig, ..), .. })
971+
| Node::ImplItem(ImplItem { kind: ImplItemKind::Fn(sig, ..), .. }) => sig.span,
972+
// Constants and Statics.
973+
Node::Item(Item {
974+
kind:
975+
ItemKind::Const(ty, ..)
976+
| ItemKind::Static(ty, ..)
977+
| ItemKind::Impl(Impl { self_ty: ty, .. }),
978+
span: outer_span,
979+
..
980+
})
981+
| Node::TraitItem(TraitItem {
982+
kind: TraitItemKind::Const(ty, ..),
983+
span: outer_span,
984+
..
985+
})
986+
| Node::ImplItem(ImplItem {
987+
kind: ImplItemKind::Const(ty, ..),
988+
span: outer_span,
989+
..
990+
})
991+
| Node::ForeignItem(ForeignItem {
992+
kind: ForeignItemKind::Static(ty, ..),
993+
span: outer_span,
994+
..
995+
}) => until_within(*outer_span, ty.span),
996+
// With generics and bounds.
997+
Node::Item(Item {
998+
kind: ItemKind::Trait(_, _, generics, bounds, _),
999+
span: outer_span,
1000+
..
1001+
})
1002+
| Node::TraitItem(TraitItem {
1003+
kind: TraitItemKind::Type(bounds, _),
1004+
generics,
1005+
span: outer_span,
1006+
..
1007+
}) => {
1008+
let end = if let Some(b) = bounds.last() { b.span() } else { generics.span };
1009+
until_within(*outer_span, end)
1010+
}
1011+
// Other cases.
9461012
Node::Item(item) => match &item.kind {
947-
ItemKind::Fn(sig, _, _) => sig.span,
948-
_ => item.span,
1013+
ItemKind::Use(path, _) => path.span,
1014+
_ => named_span(item.span, item.ident, item.kind.generics()),
9491015
},
950-
Node::ForeignItem(foreign_item) => foreign_item.span,
951-
Node::TraitItem(trait_item) => match &trait_item.kind {
952-
TraitItemKind::Fn(sig, _) => sig.span,
953-
_ => trait_item.span,
954-
},
955-
Node::ImplItem(impl_item) => match &impl_item.kind {
956-
ImplItemKind::Fn(sig, _) => sig.span,
957-
_ => impl_item.span,
1016+
Node::ImplItem(item) => named_span(item.span, item.ident, Some(item.generics)),
1017+
Node::ForeignItem(item) => match item.kind {
1018+
ForeignItemKind::Fn(decl, _, _) => until_within(item.span, decl.output.span()),
1019+
_ => named_span(item.span, item.ident, None),
9581020
},
1021+
Node::Ctor(..) => return self.opt_span(self.get_parent_node(hir_id)),
1022+
_ => self.span_with_body(hir_id),
1023+
};
1024+
Some(span)
1025+
}
1026+
1027+
/// Like `hir.span()`, but includes the body of items
1028+
/// (instead of just the item header)
1029+
pub fn span_with_body(self, hir_id: HirId) -> Span {
1030+
match self.get(hir_id) {
1031+
Node::Param(param) => param.span,
1032+
Node::Item(item) => item.span,
1033+
Node::ForeignItem(foreign_item) => foreign_item.span,
1034+
Node::TraitItem(trait_item) => trait_item.span,
1035+
Node::ImplItem(impl_item) => impl_item.span,
9591036
Node::Variant(variant) => variant.span,
9601037
Node::Field(field) => field.span,
9611038
Node::AnonConst(constant) => self.body(constant.body).value.span,
@@ -973,29 +1050,12 @@ impl<'hir> Map<'hir> {
9731050
Node::Pat(pat) => pat.span,
9741051
Node::Arm(arm) => arm.span,
9751052
Node::Block(block) => block.span,
976-
Node::Ctor(..) => match self.find(self.get_parent_node(hir_id))? {
977-
Node::Item(item) => item.span,
978-
Node::Variant(variant) => variant.span,
979-
_ => unreachable!(),
980-
},
1053+
Node::Ctor(..) => self.span_with_body(self.get_parent_node(hir_id)),
9811054
Node::Lifetime(lifetime) => lifetime.span,
9821055
Node::GenericParam(param) => param.span,
9831056
Node::Infer(i) => i.span,
9841057
Node::Local(local) => local.span,
9851058
Node::Crate(item) => item.spans.inner_span,
986-
};
987-
Some(span)
988-
}
989-
990-
/// Like `hir.span()`, but includes the body of function items
991-
/// (instead of just the function header)
992-
pub fn span_with_body(self, hir_id: HirId) -> Span {
993-
match self.find(hir_id) {
994-
Some(Node::TraitItem(item)) => item.span,
995-
Some(Node::ImplItem(impl_item)) => impl_item.span,
996-
Some(Node::Item(item)) => item.span,
997-
Some(_) => self.span(hir_id),
998-
_ => bug!("hir::map::Map::span_with_body: id not in map: {:?}", hir_id),
9991059
}
10001060
}
10011061

src/test/incremental/issue-61323.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ struct C(Box<A>);
1010

1111
#[cfg(cfail)]
1212
struct C(A);
13-
//[cfail]~^ ERROR 12:1: 12:13: recursive type `C` has infinite size [E0072]
13+
//[cfail]~^ ERROR 12:1: 12:9: recursive type `C` has infinite size [E0072]
1414

1515
fn main() {}

src/test/mir-opt/const_promotion_extern_static.BAR.PromoteTemps.diff

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@
4040
- StorageDead(_5); // scope 0 at $DIR/const-promotion-extern-static.rs:9:43: 9:44
4141
- StorageDead(_3); // scope 0 at $DIR/const-promotion-extern-static.rs:9:43: 9:44
4242
StorageDead(_1); // scope 0 at $DIR/const-promotion-extern-static.rs:9:43: 9:44
43-
return; // scope 0 at $DIR/const-promotion-extern-static.rs:9:1: 9:45
43+
return; // scope 0 at $DIR/const-promotion-extern-static.rs:9:1: 9:28
4444
}
4545

4646
bb2 (cleanup): {
47-
resume; // scope 0 at $DIR/const-promotion-extern-static.rs:9:1: 9:45
47+
resume; // scope 0 at $DIR/const-promotion-extern-static.rs:9:1: 9:28
4848
}
4949
- }
5050
-

src/test/mir-opt/const_promotion_extern_static.BOP.mir_map.0.mir

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ static BOP: &i32 = {
1212
_1 = &_2; // scope 0 at $DIR/const-promotion-extern-static.rs:16:20: 16:23
1313
_0 = &(*_1); // scope 0 at $DIR/const-promotion-extern-static.rs:16:20: 16:23
1414
StorageDead(_1); // scope 0 at $DIR/const-promotion-extern-static.rs:16:22: 16:23
15-
return; // scope 0 at $DIR/const-promotion-extern-static.rs:16:1: 16:24
15+
return; // scope 0 at $DIR/const-promotion-extern-static.rs:16:1: 16:17
1616
}
1717
}

src/test/mir-opt/const_promotion_extern_static.FOO.PromoteTemps.diff

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@
4242
- StorageDead(_5); // scope 0 at $DIR/const-promotion-extern-static.rs:13:54: 13:55
4343
- StorageDead(_3); // scope 0 at $DIR/const-promotion-extern-static.rs:13:54: 13:55
4444
StorageDead(_1); // scope 0 at $DIR/const-promotion-extern-static.rs:13:54: 13:55
45-
return; // scope 0 at $DIR/const-promotion-extern-static.rs:13:1: 13:56
45+
return; // scope 0 at $DIR/const-promotion-extern-static.rs:13:1: 13:28
4646
}
4747

4848
bb2 (cleanup): {
49-
resume; // scope 0 at $DIR/const-promotion-extern-static.rs:13:1: 13:56
49+
resume; // scope 0 at $DIR/const-promotion-extern-static.rs:13:1: 13:28
5050
}
5151
}
5252
-

src/test/mir-opt/issue_41697.{impl#0}-{constant#0}.SimplifyCfg-promote-consts.after.32bit.mir

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
// MIR for `<impl at $DIR/issue-41697.rs:18:1: 22:2>::{constant#0}` after SimplifyCfg-promote-consts
1+
// MIR for `<impl at $DIR/issue-41697.rs:18:1: 18:23>::{constant#0}` after SimplifyCfg-promote-consts
22

3-
<impl at $DIR/issue-41697.rs:18:1: 22:2>::{constant#0}: usize = {
3+
<impl at $DIR/issue-41697.rs:18:1: 18:23>::{constant#0}: usize = {
44
let mut _0: usize; // return place in scope 0 at $DIR/issue-41697.rs:18:19: 18:22
55
let mut _1: (usize, bool); // in scope 0 at $DIR/issue-41697.rs:18:19: 18:22
66

src/test/mir-opt/issue_41697.{impl#0}-{constant#0}.SimplifyCfg-promote-consts.after.64bit.mir

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
// MIR for `<impl at $DIR/issue-41697.rs:18:1: 22:2>::{constant#0}` after SimplifyCfg-promote-consts
1+
// MIR for `<impl at $DIR/issue-41697.rs:18:1: 18:23>::{constant#0}` after SimplifyCfg-promote-consts
22

3-
<impl at $DIR/issue-41697.rs:18:1: 22:2>::{constant#0}: usize = {
3+
<impl at $DIR/issue-41697.rs:18:1: 18:23>::{constant#0}: usize = {
44
let mut _0: usize; // return place in scope 0 at $DIR/issue-41697.rs:18:19: 18:22
55
let mut _1: (usize, bool); // in scope 0 at $DIR/issue-41697.rs:18:19: 18:22
66

src/test/mir-opt/retag.{impl#0}-foo.SimplifyCfg-elaborate-drops.after.mir

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
// MIR for `<impl at $DIR/retag.rs:11:1: 19:2>::foo` after SimplifyCfg-elaborate-drops
1+
// MIR for `<impl at $DIR/retag.rs:11:1: 11:10>::foo` after SimplifyCfg-elaborate-drops
22

3-
fn <impl at $DIR/retag.rs:11:1: 19:2>::foo(_1: &Test, _2: &mut i32) -> &mut i32 {
3+
fn <impl at $DIR/retag.rs:11:1: 11:10>::foo(_1: &Test, _2: &mut i32) -> &mut i32 {
44
debug self => _1; // in scope 0 at $DIR/retag.rs:13:16: 13:21
55
debug x => _2; // in scope 0 at $DIR/retag.rs:13:23: 13:24
66
let mut _0: &mut i32; // return place in scope 0 at $DIR/retag.rs:13:42: 13:53

src/test/mir-opt/retag.{impl#0}-foo_shr.SimplifyCfg-elaborate-drops.after.mir

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
// MIR for `<impl at $DIR/retag.rs:11:1: 19:2>::foo_shr` after SimplifyCfg-elaborate-drops
1+
// MIR for `<impl at $DIR/retag.rs:11:1: 11:10>::foo_shr` after SimplifyCfg-elaborate-drops
22

3-
fn <impl at $DIR/retag.rs:11:1: 19:2>::foo_shr(_1: &Test, _2: &i32) -> &i32 {
3+
fn <impl at $DIR/retag.rs:11:1: 11:10>::foo_shr(_1: &Test, _2: &i32) -> &i32 {
44
debug self => _1; // in scope 0 at $DIR/retag.rs:16:20: 16:25
55
debug x => _2; // in scope 0 at $DIR/retag.rs:16:27: 16:28
66
let mut _0: &i32; // return place in scope 0 at $DIR/retag.rs:16:42: 16:49

src/test/mir-opt/storage_live_dead_in_statics.XXX.mir_map.0.mir

+1-1
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,6 @@ static XXX: &Foo = {
198198
_0 = &(*_1); // scope 0 at $DIR/storage_live_dead_in_statics.rs:5:28: 23:2
199199
StorageDead(_5); // scope 0 at $DIR/storage_live_dead_in_statics.rs:23:1: 23:2
200200
StorageDead(_1); // scope 0 at $DIR/storage_live_dead_in_statics.rs:23:1: 23:2
201-
return; // scope 0 at $DIR/storage_live_dead_in_statics.rs:5:1: 23:3
201+
return; // scope 0 at $DIR/storage_live_dead_in_statics.rs:5:1: 5:25
202202
}
203203
}
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
// MIR for `<impl at $DIR/unusual-item-types.rs:9:1: 11:2>::ASSOCIATED_CONSTANT` 0 mir_map
1+
// MIR for `<impl at $DIR/unusual-item-types.rs:9:1: 9:7>::ASSOCIATED_CONSTANT` 0 mir_map
22

3-
const <impl at $DIR/unusual-item-types.rs:9:1: 11:2>::ASSOCIATED_CONSTANT: i32 = {
3+
const <impl at $DIR/unusual-item-types.rs:9:1: 9:7>::ASSOCIATED_CONSTANT: i32 = {
44
let mut _0: i32; // return place in scope 0 at $DIR/unusual-item-types.rs:10:32: 10:35
55

66
bb0: {
77
_0 = const 2_i32; // scope 0 at $DIR/unusual-item-types.rs:10:38: 10:39
8-
return; // scope 0 at $DIR/unusual-item-types.rs:10:5: 10:40
8+
return; // scope 0 at $DIR/unusual-item-types.rs:10:5: 10:35
99
}
1010
}
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
// MIR for `<impl at $DIR/unusual-item-types.rs:9:1: 11:2>::ASSOCIATED_CONSTANT` 0 mir_map
1+
// MIR for `<impl at $DIR/unusual-item-types.rs:9:1: 9:7>::ASSOCIATED_CONSTANT` 0 mir_map
22

3-
const <impl at $DIR/unusual-item-types.rs:9:1: 11:2>::ASSOCIATED_CONSTANT: i32 = {
3+
const <impl at $DIR/unusual-item-types.rs:9:1: 9:7>::ASSOCIATED_CONSTANT: i32 = {
44
let mut _0: i32; // return place in scope 0 at $DIR/unusual-item-types.rs:10:32: 10:35
55

66
bb0: {
77
_0 = const 2_i32; // scope 0 at $DIR/unusual-item-types.rs:10:38: 10:39
8-
return; // scope 0 at $DIR/unusual-item-types.rs:10:5: 10:40
8+
return; // scope 0 at $DIR/unusual-item-types.rs:10:5: 10:35
99
}
1010
}

src/test/rustdoc-ui/lint-missing-doc-code-example.stderr

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
error: missing code example in this documentation
22
--> $DIR/lint-missing-doc-code-example.rs:19:1
33
|
4-
LL | / pub mod module1 {
5-
LL | | }
6-
| |_^
4+
LL | pub mod module1 {
5+
| ^^^^^^^^^^^^^^^
76
|
87
note: the lint level is defined here
98
--> $DIR/lint-missing-doc-code-example.rs:2:9

src/test/rustdoc/check-source-code-urls-to-def.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ extern crate source_code;
1414
#[path = "auxiliary/source-code-bar.rs"]
1515
pub mod bar;
1616

17-
// @count - '//a[@href="../../src/foo/auxiliary/source-code-bar.rs.html#5-7"]' 4
17+
// @count - '//a[@href="../../src/foo/auxiliary/source-code-bar.rs.html#5"]' 4
1818
use bar::Bar;
19-
// @has - '//a[@href="../../src/foo/auxiliary/source-code-bar.rs.html#13-17"]' 'self'
20-
// @has - '//a[@href="../../src/foo/auxiliary/source-code-bar.rs.html#14-16"]' 'Trait'
19+
// @has - '//a[@href="../../src/foo/auxiliary/source-code-bar.rs.html#13"]' 'self'
20+
// @has - '//a[@href="../../src/foo/auxiliary/source-code-bar.rs.html#14"]' 'Trait'
2121
use bar::sub::{self, Trait};
2222

2323
pub struct Foo;
@@ -42,8 +42,8 @@ pub fn foo(a: u32, b: &str, c: String, d: Foo, e: bar::Bar, f: source_code::Sour
4242
y.hello();
4343
}
4444

45-
// @has - '//a[@href="../../src/foo/auxiliary/source-code-bar.rs.html#14-16"]' 'bar::sub::Trait'
46-
// @has - '//a[@href="../../src/foo/auxiliary/source-code-bar.rs.html#14-16"]' 'Trait'
45+
// @has - '//a[@href="../../src/foo/auxiliary/source-code-bar.rs.html#14"]' 'bar::sub::Trait'
46+
// @has - '//a[@href="../../src/foo/auxiliary/source-code-bar.rs.html#14"]' 'Trait'
4747
pub fn foo2<T: bar::sub::Trait, V: Trait>(t: &T, v: &V, b: bool) {}
4848

4949
pub trait AnotherTrait {}

src/test/rustdoc/inline_cross/macros.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ extern crate macros;
1515
// @has - '//*[@class="docblock"]' 'docs for my_macro'
1616
// @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.2.3: text'
1717
// @has - '//*[@class="stab unstable"]' 'macro_test'
18-
// @has - '//a/@href' '../src/macros/macros.rs.html#8-10'
18+
// @has - '//a/@href' '../src/macros/macros.rs.html#8'
1919
pub use macros::my_macro;

src/test/ui/array-slice-vec/array_const_index-0.stderr

+2-6
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@ error: any use of this value will cause an error
22
--> $DIR/array_const_index-0.rs:2:16
33
|
44
LL | const B: i32 = (&A)[1];
5-
| ---------------^^^^^^^-
6-
| |
7-
| index out of bounds: the length is 0 but the index is 1
5+
| ------------ ^^^^^^^ index out of bounds: the length is 0 but the index is 1
86
|
97
= note: `#[deny(const_err)]` on by default
108
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
@@ -17,9 +15,7 @@ error: any use of this value will cause an error
1715
--> $DIR/array_const_index-0.rs:2:16
1816
|
1917
LL | const B: i32 = (&A)[1];
20-
| ---------------^^^^^^^-
21-
| |
22-
| index out of bounds: the length is 0 but the index is 1
18+
| ------------ ^^^^^^^ index out of bounds: the length is 0 but the index is 1
2319
|
2420
= note: `#[deny(const_err)]` on by default
2521
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!

src/test/ui/array-slice-vec/array_const_index-1.stderr

+2-6
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@ error: any use of this value will cause an error
22
--> $DIR/array_const_index-1.rs:2:16
33
|
44
LL | const B: i32 = A[1];
5-
| ---------------^^^^-
6-
| |
7-
| index out of bounds: the length is 0 but the index is 1
5+
| ------------ ^^^^ index out of bounds: the length is 0 but the index is 1
86
|
97
= note: `#[deny(const_err)]` on by default
108
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
@@ -17,9 +15,7 @@ error: any use of this value will cause an error
1715
--> $DIR/array_const_index-1.rs:2:16
1816
|
1917
LL | const B: i32 = A[1];
20-
| ---------------^^^^-
21-
| |
22-
| index out of bounds: the length is 0 but the index is 1
18+
| ------------ ^^^^ index out of bounds: the length is 0 but the index is 1
2319
|
2420
= note: `#[deny(const_err)]` on by default
2521
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!

src/test/ui/associated-consts/assoc-const-ty-mismatch.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ note: associated constant defined here does not match type
88
--> $DIR/assoc-const-ty-mismatch.rs:5:3
99
|
1010
LL | const N: usize;
11-
| ^^^^^^^^^^^^^^^
11+
| ^^^^^^^^^^^^^^
1212

1313
error: mismatch in bind of associated type, got const
1414
--> $DIR/assoc-const-ty-mismatch.rs:25:18
@@ -20,7 +20,7 @@ note: associated type defined here does not match const
2020
--> $DIR/assoc-const-ty-mismatch.rs:9:3
2121
|
2222
LL | type T;
23-
| ^^^^^^^
23+
| ^^^^^^
2424

2525
error: aborting due to 2 previous errors
2626

src/test/ui/associated-consts/associated-const-ambiguity-report.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ note: candidate #1 is defined in an impl of the trait `Foo` for the type `i32`
88
--> $DIR/associated-const-ambiguity-report.rs:10:5
99
|
1010
LL | const ID: i32 = 1;
11-
| ^^^^^^^^^^^^^^^^^^
11+
| ^^^^^^^^^^^^^
1212
note: candidate #2 is defined in an impl of the trait `Bar` for the type `i32`
1313
--> $DIR/associated-const-ambiguity-report.rs:14:5
1414
|
1515
LL | const ID: i32 = 3;
16-
| ^^^^^^^^^^^^^^^^^^
16+
| ^^^^^^^^^^^^^
1717
help: disambiguate the associated constant for candidate #1
1818
|
1919
LL | const X: i32 = <i32 as Foo>::ID;

src/test/ui/associated-consts/associated-const-private-impl.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0624]: associated constant `ID` is private
22
--> $DIR/associated-const-private-impl.rs:13:30
33
|
44
LL | const ID: i32 = 1;
5-
| ------------------ private associated constant defined here
5+
| ------------- private associated constant defined here
66
...
77
LL | assert_eq!(1, bar1::Foo::ID);
88
| ^^ private associated constant

0 commit comments

Comments
 (0)