Record tcx.def_span
instead of item.span
in crate metadata
This was missed in PR #75465. As a result, a few places have been using the full body span of functions, instead of just the header span.
This commit is contained in:
parent
4eff9b0b29
commit
e734733a9e
7 changed files with 20 additions and 42 deletions
|
@ -1300,7 +1300,7 @@ impl EncodeContext<'a, 'tcx> {
|
||||||
});
|
});
|
||||||
record!(self.tables.visibility[def_id] <-
|
record!(self.tables.visibility[def_id] <-
|
||||||
ty::Visibility::from_hir(&item.vis, item.hir_id, tcx));
|
ty::Visibility::from_hir(&item.vis, item.hir_id, tcx));
|
||||||
record!(self.tables.span[def_id] <- item.span);
|
record!(self.tables.span[def_id] <- self.tcx.def_span(def_id));
|
||||||
record!(self.tables.attributes[def_id] <- item.attrs);
|
record!(self.tables.attributes[def_id] <- item.attrs);
|
||||||
// FIXME(eddyb) there should be a nicer way to do this.
|
// FIXME(eddyb) there should be a nicer way to do this.
|
||||||
match item.kind {
|
match item.kind {
|
||||||
|
|
|
@ -1,16 +1,10 @@
|
||||||
error[E0080]: could not evaluate static initializer
|
error[E0080]: could not evaluate static initializer
|
||||||
--> $SRC_DIR/core/src/ptr/mod.rs:LL:COL
|
--> $SRC_DIR/core/src/ptr/mod.rs:LL:COL
|
||||||
|
|
|
|
||||||
LL | / pub unsafe fn drop_in_place<T: ?Sized>(to_drop: *mut T) {
|
LL | pub unsafe fn drop_in_place<T: ?Sized>(to_drop: *mut T) {
|
||||||
LL | | // Code here does not matter - this is replaced by the
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
LL | | // real drop glue by the compiler.
|
| |
|
||||||
LL | |
|
| calling non-const function `<Vec<i32> as Drop>::drop`
|
||||||
LL | | // SAFETY: see comment above
|
|
||||||
LL | | unsafe { drop_in_place(to_drop) }
|
|
||||||
LL | | }
|
|
||||||
| | ^
|
|
||||||
| | |
|
|
||||||
| |_calling non-const function `<Vec<i32> as Drop>::drop`
|
|
||||||
| inside `drop_in_place::<Vec<i32>> - shim(Some(Vec<i32>))` at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
|
| inside `drop_in_place::<Vec<i32>> - shim(Some(Vec<i32>))` at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
|
||||||
|
|
|
|
||||||
::: $DIR/drop.rs:18:1
|
::: $DIR/drop.rs:18:1
|
||||||
|
|
|
@ -18,14 +18,10 @@ error: `$x:expr` may be followed by `$y:tt`, which is not allowed for `expr` fra
|
||||||
--> $DIR/same-sequence-span.rs:19:1
|
--> $DIR/same-sequence-span.rs:19:1
|
||||||
|
|
|
|
||||||
LL | proc_macro_sequence::make_foo!();
|
LL | proc_macro_sequence::make_foo!();
|
||||||
| ^--------------------------------
|
| ---------------------------------^^^^^^^^^^^^^
|
||||||
| |
|
| |
|
||||||
| _in this macro invocation
|
| not allowed after `expr` fragments
|
||||||
| |
|
| in this macro invocation
|
||||||
LL | |
|
|
||||||
LL | |
|
|
||||||
LL | | fn main() {}
|
|
||||||
... |
|
|
||||||
|
|
|
|
||||||
= note: allowed there are: `=>`, `,` or `;`
|
= note: allowed there are: `=>`, `,` or `;`
|
||||||
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
Def site: $DIR/auxiliary/make-macro.rs:7:9: 16:10 (#5)
|
Def site: $DIR/auxiliary/make-macro.rs:7:9: 7:56 (#5)
|
||||||
Input: TokenStream [Ident { ident: "$crate", span: $DIR/meta-macro-hygiene.rs:24:37: 24:43 (#4) }, Punct { ch: ':', spacing: Joint, span: $DIR/meta-macro-hygiene.rs:24:43: 24:45 (#4) }, Punct { ch: ':', spacing: Alone, span: $DIR/meta-macro-hygiene.rs:24:43: 24:45 (#4) }, Ident { ident: "dummy", span: $DIR/meta-macro-hygiene.rs:24:45: 24:50 (#4) }, Punct { ch: '!', spacing: Alone, span: $DIR/meta-macro-hygiene.rs:24:50: 24:51 (#4) }, Group { delimiter: Parenthesis, stream: TokenStream [], span: $DIR/meta-macro-hygiene.rs:24:51: 24:53 (#4) }]
|
Input: TokenStream [Ident { ident: "$crate", span: $DIR/meta-macro-hygiene.rs:24:37: 24:43 (#4) }, Punct { ch: ':', spacing: Joint, span: $DIR/meta-macro-hygiene.rs:24:43: 24:45 (#4) }, Punct { ch: ':', spacing: Alone, span: $DIR/meta-macro-hygiene.rs:24:43: 24:45 (#4) }, Ident { ident: "dummy", span: $DIR/meta-macro-hygiene.rs:24:45: 24:50 (#4) }, Punct { ch: '!', spacing: Alone, span: $DIR/meta-macro-hygiene.rs:24:50: 24:51 (#4) }, Group { delimiter: Parenthesis, stream: TokenStream [], span: $DIR/meta-macro-hygiene.rs:24:51: 24:53 (#4) }]
|
||||||
Respanned: TokenStream [Ident { ident: "$crate", span: $DIR/auxiliary/make-macro.rs:7:9: 16:10 (#5) }, Punct { ch: ':', spacing: Joint, span: $DIR/auxiliary/make-macro.rs:7:9: 16:10 (#5) }, Punct { ch: ':', spacing: Alone, span: $DIR/auxiliary/make-macro.rs:7:9: 16:10 (#5) }, Ident { ident: "dummy", span: $DIR/auxiliary/make-macro.rs:7:9: 16:10 (#5) }, Punct { ch: '!', spacing: Alone, span: $DIR/auxiliary/make-macro.rs:7:9: 16:10 (#5) }, Group { delimiter: Parenthesis, stream: TokenStream [], span: $DIR/auxiliary/make-macro.rs:7:9: 16:10 (#5) }]
|
Respanned: TokenStream [Ident { ident: "$crate", span: $DIR/auxiliary/make-macro.rs:7:9: 7:56 (#5) }, Punct { ch: ':', spacing: Joint, span: $DIR/auxiliary/make-macro.rs:7:9: 7:56 (#5) }, Punct { ch: ':', spacing: Alone, span: $DIR/auxiliary/make-macro.rs:7:9: 7:56 (#5) }, Ident { ident: "dummy", span: $DIR/auxiliary/make-macro.rs:7:9: 7:56 (#5) }, Punct { ch: '!', spacing: Alone, span: $DIR/auxiliary/make-macro.rs:7:9: 7:56 (#5) }, Group { delimiter: Parenthesis, stream: TokenStream [], span: $DIR/auxiliary/make-macro.rs:7:9: 7:56 (#5) }]
|
||||||
#![feature /* 0#0 */(prelude_import)]
|
#![feature /* 0#0 */(prelude_import)]
|
||||||
// ignore-tidy-linelength
|
// ignore-tidy-linelength
|
||||||
// aux-build:make-macro.rs
|
// aux-build:make-macro.rs
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
Def site: $DIR/auxiliary/make-macro.rs:7:9: 16:10 (#4)
|
Def site: $DIR/auxiliary/make-macro.rs:7:9: 7:56 (#4)
|
||||||
Input: TokenStream []
|
Input: TokenStream []
|
||||||
Respanned: TokenStream []
|
Respanned: TokenStream []
|
||||||
|
|
|
@ -1,26 +1,14 @@
|
||||||
error: reached the recursion limit while instantiating `drop_in_place::<S<fn(fn(fn(fn(fn...)))))))))))))))))))))))))))))>))`
|
error: reached the recursion limit while instantiating `drop_in_place::<S<fn(fn(fn(fn(fn...)))))))))))))))))))))))))))))>))`
|
||||||
--> $SRC_DIR/core/src/ptr/mod.rs:LL:COL
|
--> $SRC_DIR/core/src/ptr/mod.rs:LL:COL
|
||||||
|
|
|
|
||||||
LL | / pub unsafe fn drop_in_place<T: ?Sized>(to_drop: *mut T) {
|
LL | pub unsafe fn drop_in_place<T: ?Sized>(to_drop: *mut T) {
|
||||||
LL | | // Code here does not matter - this is replaced by the
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
LL | | // real drop glue by the compiler.
|
|
||||||
LL | |
|
|
||||||
LL | | // SAFETY: see comment above
|
|
||||||
LL | | unsafe { drop_in_place(to_drop) }
|
|
||||||
LL | | }
|
|
||||||
| |_^
|
|
||||||
|
|
|
|
||||||
note: `drop_in_place` defined here
|
note: `drop_in_place` defined here
|
||||||
--> $SRC_DIR/core/src/ptr/mod.rs:LL:COL
|
--> $SRC_DIR/core/src/ptr/mod.rs:LL:COL
|
||||||
|
|
|
|
||||||
LL | / pub unsafe fn drop_in_place<T: ?Sized>(to_drop: *mut T) {
|
LL | pub unsafe fn drop_in_place<T: ?Sized>(to_drop: *mut T) {
|
||||||
LL | | // Code here does not matter - this is replaced by the
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
LL | | // real drop glue by the compiler.
|
|
||||||
LL | |
|
|
||||||
LL | | // SAFETY: see comment above
|
|
||||||
LL | | unsafe { drop_in_place(to_drop) }
|
|
||||||
LL | | }
|
|
||||||
| |_^
|
|
||||||
= note: the full type name has been written to '$TEST_BUILD_DIR/recursion/issue-38591-non-regular-dropck-recursion/issue-38591-non-regular-dropck-recursion.long-type.txt'
|
= note: the full type name has been written to '$TEST_BUILD_DIR/recursion/issue-38591-non-regular-dropck-recursion/issue-38591-non-regular-dropck-recursion.long-type.txt'
|
||||||
|
|
||||||
error: aborting due to previous error
|
error: aborting due to previous error
|
||||||
|
|
|
@ -2,7 +2,7 @@ error: reached the type-length limit while instantiating `std::mem::drop::<Optio
|
||||||
--> $SRC_DIR/core/src/mem/mod.rs:LL:COL
|
--> $SRC_DIR/core/src/mem/mod.rs:LL:COL
|
||||||
|
|
|
|
||||||
LL | pub fn drop<T>(_x: T) {}
|
LL | pub fn drop<T>(_x: T) {}
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
|
|
||||||
= note: the full type name has been written to '$TEST_BUILD_DIR/type_length_limit/type_length_limit.long-type.txt'
|
= note: the full type name has been written to '$TEST_BUILD_DIR/type_length_limit/type_length_limit.long-type.txt'
|
||||||
= help: consider adding a `#![type_length_limit="8"]` attribute to your crate
|
= help: consider adding a `#![type_length_limit="8"]` attribute to your crate
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue