Warn about ignored generic bounds in `for` This adds a new lint to fix #42181. For consistency and to avoid code duplication, I also moved the existing "bounds in type aliases are ignored" here. Questions to the reviewer: * Is it okay to just remove a diagnostic error code like this? Should I instead keep the warning about type aliases where it is? The old code provided a detailed explanation of what's going on when asked, that information is now lost. On the other hand, `span_warn!` seems deprecated (after this patch, it has exactly one user left!). * Did I miss any syntactic construct that can appear as `for` in the surface syntax? I covered function types (`for<'a> fn(...)`), generic traits (`for <'a> Fn(...)`, can appear both as bounds as as trait objects) and bounds (`for<'a> F: ...`). * For the sake of backwards compatibility, this adds a warning, not an error. @nikomatsakis suggested an error in https://github.com/rust-lang/rust/issues/42181#issuecomment-306924389, but I feel that can only happen in a new epoch -- right? Cc @eddyb |
||
|---|---|---|
| .. | ||
| bootstrap | ||
| build_helper | ||
| ci | ||
| dlmalloc@9b2dcac06c | ||
| doc | ||
| etc | ||
| grammar | ||
| jemalloc@1f5a28755e | ||
| liballoc | ||
| liballoc_jemalloc | ||
| liballoc_system | ||
| libarena | ||
| libbacktrace | ||
| libcompiler_builtins@266ea0740a | ||
| libcore | ||
| libfmt_macros | ||
| libgetopts | ||
| libgraphviz | ||
| liblibc@56444a4545 | ||
| libpanic_abort | ||
| libpanic_unwind | ||
| libproc_macro | ||
| libprofiler_builtins | ||
| librustc | ||
| librustc_allocator | ||
| librustc_apfloat | ||
| librustc_asan | ||
| librustc_back | ||
| librustc_borrowck | ||
| librustc_const_eval | ||
| librustc_const_math | ||
| librustc_cratesio_shim | ||
| librustc_data_structures | ||
| librustc_driver | ||
| librustc_errors | ||
| librustc_incremental | ||
| librustc_lint | ||
| librustc_llvm | ||
| librustc_lsan | ||
| librustc_metadata | ||
| librustc_mir | ||
| librustc_msan | ||
| librustc_passes | ||
| librustc_platform_intrinsics | ||
| librustc_plugin | ||
| librustc_privacy | ||
| librustc_resolve | ||
| librustc_save_analysis | ||
| librustc_trans | ||
| librustc_trans_utils | ||
| librustc_tsan | ||
| librustc_typeck | ||
| librustdoc | ||
| libserialize | ||
| libstd | ||
| libstd_unicode | ||
| libsyntax | ||
| libsyntax_ext | ||
| libsyntax_pos | ||
| libterm | ||
| libtest | ||
| libunwind | ||
| llvm@0903c72cbb | ||
| llvm-emscripten@2717444753 | ||
| rtstartup | ||
| rustc | ||
| rustllvm | ||
| stdsimd@678cbd325c | ||
| test | ||
| tools | ||
| Cargo.lock | ||
| Cargo.toml | ||
| README.md | ||
| stage0.txt | ||
This directory contains the source code of the rust project, including:
rustcand its testslibstd- Various submodules for tools, like rustdoc, rls, etc.
For more information on how various parts of the compiler work, see the rustc guide.
Their is also useful content in the following READMEs, which are gradually being moved over to the guide:
- https://github.com/rust-lang/rust/tree/master/src/librustc/ty/maps
- https://github.com/rust-lang/rust/tree/master/src/librustc/dep_graph
- https://github.com/rust-lang/rust/blob/master/src/librustc/infer/region_constraints
- https://github.com/rust-lang/rust/tree/master/src/librustc/infer/higher_ranked
- https://github.com/rust-lang/rust/tree/master/src/librustc/infer/lexical_region_resolve