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
..
rustc rfc3052: Remove authors field from Cargo manifests 2021-07-29 14:56:05 -07:00
rustc_apfloat rfc3052: Remove authors field from Cargo manifests 2021-07-29 14:56:05 -07:00
rustc_arena Remove unused arena macro args 2021-08-30 13:09:38 +02:00
rustc_ast Bump stage0 compiler to 1.56 2021-09-08 20:51:05 -04:00
rustc_ast_lowering Change is_unsized to add_implicitly_sized 2021-09-07 18:08:46 -04:00
rustc_ast_passes Bump stage0 compiler to 1.56 2021-09-08 20:51:05 -04:00
rustc_ast_pretty Add let-else to AST 2021-08-30 20:17:45 -05:00
rustc_attr Remove Session.used_attrs and move logic to CheckAttrVisitor 2021-08-21 13:27:27 -05:00
rustc_borrowck Fix two uses of span_note when the source is not available 2021-09-09 21:17:05 +02:00
rustc_builtin_macros Auto merge of #88598 - estebank:type-ascription-can-die-in-a-fire, r=wesleywiser 2021-09-04 01:40:36 +00:00
rustc_codegen_cranelift Move the dataflow framework to its own crate. 2021-09-07 19:57:07 +02:00
rustc_codegen_llvm Auto merge of #88499 - eddyb:layout-off, r=nagisa 2021-09-05 16:14:41 +00:00
rustc_codegen_ssa Auto merge of #88161 - michaelwoerister:fix-whole-archive-no-bundle, r=petrochenkov 2021-09-07 12:31:11 +00:00
rustc_const_eval Bump stage0 compiler to 1.56 2021-09-08 20:51:05 -04:00
rustc_data_structures Bump stage0 compiler to 1.56 2021-09-08 20:51:05 -04:00
rustc_driver Rename rustc_mir to rustc_const_eval. 2021-09-07 20:46:26 +02:00
rustc_error_codes Update E0785.md 2021-08-30 22:18:55 -07:00
rustc_errors Bump stage0 compiler to 1.56 2021-09-08 20:51:05 -04:00
rustc_expand Rollup merge of #86165 - m-ou-se:proc-macro-span-shrink, r=dtolnay 2021-09-10 08:23:14 -07:00
rustc_feature Ignore automatically derived impls of Clone and Debug in dead code analysis 2021-09-09 19:49:07 +02:00
rustc_fs_util rfc3052: Remove authors field from Cargo manifests 2021-07-29 14:56:05 -07:00
rustc_graphviz rfc3052: Remove authors field from Cargo manifests 2021-07-29 14:56:05 -07:00
rustc_hir Don't move ?Trait bounds to param bounds if they're in where clauses 2021-09-07 18:08:46 -04:00
rustc_hir_pretty Don't move ?Trait bounds to param bounds if they're in where clauses 2021-09-07 18:08:46 -04:00
rustc_incremental Auto merge of #83214 - cjgillot:dep-map, r=michaelwoerister 2021-09-06 23:58:16 +00:00
rustc_index Suggested changes 2021-08-27 16:21:25 -07:00
rustc_infer Use index newtyping for TyVid 2021-09-06 22:38:06 -04:00
rustc_interface Rename rustc_mir to rustc_const_eval. 2021-09-07 20:46:26 +02:00
rustc_lexer Fix more “a”/“an” typos 2021-08-22 17:27:18 +02:00
rustc_lint Auto merge of #88435 - cjgillot:no-walk-crate, r=Aaron1011 2021-09-05 21:40:34 +00:00
rustc_lint_defs Tracking issue for UNSUPPORTED_CALLING_CONVENTIONS 2021-08-27 20:47:00 +03:00
rustc_llvm RustWrapper: adapt to LLVM change 0f45c16f2caa 2021-08-26 10:40:27 -04:00
rustc_macros Rollup merge of #86123 - Aaron1011:query-span, r=cjgillot 2021-08-19 19:30:04 +02:00
rustc_metadata Auto merge of #88538 - bjorn3:no_session_in_crate_loader, r=petrochenkov 2021-09-04 07:17:12 +00:00
rustc_middle Ignore automatically derived impls of Clone and Debug in dead code analysis 2021-09-09 19:49:07 +02:00
rustc_mir_build Ignore automatically derived impls of Clone and Debug in dead code analysis 2021-09-09 19:49:07 +02:00
rustc_mir_dataflow Rebase fallout. 2021-09-08 20:40:30 +02:00
rustc_mir_transform Ignore automatically derived impls of Clone and Debug in dead code analysis 2021-09-09 19:49:07 +02:00
rustc_monomorphize Rebase fallout. 2021-09-08 20:40:30 +02:00
rustc_parse Bump stage0 compiler to 1.56 2021-09-08 20:51:05 -04:00
rustc_parse_format rfc3052: Remove authors field from Cargo manifests 2021-07-29 14:56:05 -07:00
rustc_passes Ignore automatically derived impls of Clone and Debug in dead code analysis 2021-09-09 19:49:07 +02:00
rustc_plugin_impl Remove Session.used_attrs and move logic to CheckAttrVisitor 2021-08-21 13:27:27 -05:00
rustc_privacy Rename walk_crate. 2021-09-02 19:23:11 +02:00
rustc_query_impl Auto merge of #83214 - cjgillot:dep-map, r=michaelwoerister 2021-09-06 23:58:16 +00:00
rustc_query_system Remove redundant Span in QueryJobInfo 2021-09-01 11:10:58 -07:00
rustc_resolve Move confused_type_with_std_module to ResolverOutputs 2021-09-06 11:20:59 -05:00
rustc_save_analysis Bump stage0 compiler to 1.56 2021-09-08 20:51:05 -04:00
rustc_serialize Fix more “a”/“an” typos 2021-08-22 16:35:29 +02:00
rustc_session Revert "Remove optimization_fuel_crate from Session" 2021-09-08 17:36:41 +02:00
rustc_span Ignore automatically derived impls of Clone and Debug in dead code analysis 2021-09-09 19:49:07 +02:00
rustc_symbol_mangling Rollup merge of #85534 - csmoe:demagnle-assert, r=michaelwoerister 2021-08-29 16:25:28 +02:00
rustc_target Auto merge of #88499 - eddyb:layout-off, r=nagisa 2021-09-05 16:14:41 +00:00
rustc_trait_selection Use index newtyping for TyVid 2021-09-06 22:38:06 -04:00
rustc_traits Auto merge of #88371 - Manishearth:rollup-pkkjsme, r=Manishearth 2021-08-27 01:07:17 +00:00
rustc_ty_utils Auto merge of #88371 - Manishearth:rollup-pkkjsme, r=Manishearth 2021-08-27 01:07:17 +00:00
rustc_type_ir Use index newtyping for TyVid 2021-09-06 22:38:06 -04:00
rustc_typeck Bump stage0 compiler to 1.56 2021-09-08 20:51:05 -04:00