about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/CoverageMappingWrapper.cpp
diff options
context:
space:
mode:
authorManish Goregaokar <manishsmail@gmail.com>2021-09-10 08:23:15 -0700
committerGitHub <noreply@github.com>2021-09-10 08:23:15 -0700
commite422612f8ed51d41fdc6afc8f1ef4949c450815e (patch)
tree564fd1f01cf09a0548c263d96571f8fae87ed8c2 /compiler/rustc_llvm/llvm-wrapper/CoverageMappingWrapper.cpp
parent000dbd27f146f4fd6ee2fb5e0f3060c440a08898 (diff)
parent57fcb2e2d63306e762943b9edffa4454e89ef665 (diff)
downloadrust-e422612f8ed51d41fdc6afc8f1ef4949c450815e.tar.gz
rust-e422612f8ed51d41fdc6afc8f1ef4949c450815e.zip
Rollup merge of #87088 - FabianWolff:issue-87060, r=estebank
Fix stray notes when the source code is not available

Fixes #87060. To reproduce it with a local build of rustc, you have to copy the compiler (e.g. `build/x86_64-unknown-linux-gnu/stage1/`) somewhere and then rename the compiler source directory (maybe there is a smarter way as well). Then, rustc won't find the standard library sources and report stray notes such as
```
note: deref defined here
```
with no location for "here". Another example I've found is this:
```rust
use std::ops::Add;

fn foo<T: Add<Output=()>>(x: T) {
    x + x;
}

fn main() {}
```
```
error[E0382]: use of moved value: `x`
  --> binop.rs:4:9
   |
3  | fn foo<T: Add<Output=()>>(x: T) {
   |                           - move occurs because `x` has type `T`, which does not implement the `Copy` trait
4  |     x + x;
   |     ----^
   |     |   |
   |     |   value used here after move
   |     `x` moved due to usage in operator
   |
note: calling this operator moves the left-hand side
help: consider further restricting this bound
   |
3  | fn foo<T: Add<Output=()> + Copy>(x: T) {
   |                          ^^^^^^

error: aborting due to previous error
```
where, again, the note is supposed to point somewhere but doesn't. I have fixed this by checking whether the corresponding source code is actually available before emitting the note.
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/CoverageMappingWrapper.cpp')
0 files changed, 0 insertions, 0 deletions