rust/src
bors 3982eb35ca Auto merge of #81360 - Aaron1011:trait-caller-loc, r=nagisa
Support forwarding caller location through trait object method call

Since PR #69251, the `#[track_caller]` attribute has been supported on
traits. However, it only has an effect on direct (monomorphized) method
calls. Calling a `#[track_caller]` method on a trait object will *not*
propagate caller location information - instead, `Location::caller()` will
return the location of the method definition.

This PR forwards caller location information when `#[track_caller]` is
present on the method definition in the trait. This is possible because
`#[track_caller]` in this position is 'inherited' by any impls of that
trait, so all implementations will have the same ABI.

This PR does *not* change the behavior in the case where
`#[track_caller]` is present only on the impl of a trait.
While all implementations of the method might have an explicit
`#[track_caller]`, we cannot know this at codegen time, since other
crates may have impls of the trait. Therefore, we keep the current
behavior of not forwarding the caller location, ensuring that all
implementations of the trait will have the correct ABI.

See the modified test for examples of how this works
2021-07-10 14:11:39 +00:00
..
bootstrap Rollup merge of #86913 - Stupremee:document-rustdoc-private-items, r=jyn514 2021-07-08 18:30:39 +02:00
build_helper Revert "Revert "Move llvm submodule updates to rustbuild"" 2021-06-04 22:17:01 -04:00
ci Clean up rustdoc static files 2021-07-07 17:52:18 +02:00
doc Update books 2021-07-06 17:07:35 -07:00
etc Auto merge of #85363 - EFanZh:gdb-pretty-print-slices, r=michaelwoerister 2021-07-08 12:25:47 +00:00
librustdoc Rollup merge of #86903 - GuillaumeGomez:small-header-display, r=Nemo157 2021-07-08 18:30:38 +02:00
llvm-project@39c5555872 Update LLVM submodule 2021-05-23 18:05:11 +10:00
rustdoc-json-types rustdoc- Show defaults on const generics 2021-06-03 09:01:25 +01:00
test Auto merge of #81360 - Aaron1011:trait-caller-loc, r=nagisa 2021-07-10 14:11:39 +00:00
tools Rollup merge of #84961 - GuillaumeGomez:rework-session-globals, r=oli-obk 2021-07-08 18:30:32 +02:00
README.md
stage0.txt Update to new bootstrap compiler 2021-06-28 11:30:49 -04:00
version Bump to 1.54 2021-06-11 19:19:55 -04:00

This directory contains the source code of the rust project, including:

  • The test suite
  • The bootstrapping build system
  • Various submodules for tools, like rustdoc, rls, etc.

For more information on how various parts of the compiler work, see the rustc dev guide.