Files
rust/compiler
Manish Goregaokar e422612f8e 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.
2021-09-10 08:23:15 -07:00
..
2021-09-08 20:51:05 -04:00
2021-08-30 20:17:45 -05:00
2021-08-30 22:18:55 -07:00
2021-09-08 20:51:05 -04:00
2021-08-27 16:21:25 -07:00
2021-09-06 22:38:06 -04:00
2021-09-08 20:40:30 +02:00
2021-09-08 20:40:30 +02:00
2021-09-08 20:51:05 -04:00
2021-09-02 19:23:11 +02:00
2021-09-08 20:51:05 -04:00