about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
diff options
context:
space:
mode:
authorJonas Schievink <jonasschievink@gmail.com>2020-10-02 20:26:55 +0200
committerGitHub <noreply@github.com>2020-10-02 20:26:55 +0200
commitc8eb2059dae70b99576352ded93592e6462daafc (patch)
tree7e705b1fa74738b3e4aa9ef58a8e75cc6c7c28f7 /compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
parent17c9b710b535f2a35b0a1e6270ca5bf31a0ba188 (diff)
parenteacfb2b265fc108a0b024e6afacaf3f28fd0235e (diff)
downloadrust-c8eb2059dae70b99576352ded93592e6462daafc.tar.gz
rust-c8eb2059dae70b99576352ded93592e6462daafc.zip
Rollup merge of #76739 - davidtwco:issue-75323-non-static-lifetime-in-anonconst, r=varkor
resolve: prohibit anon const non-static lifetimes

Fixes #75323, fixes #74447 and fixes #73375.

This PR prohibits non-static lifetimes in anonymous constants when only the `min_const_generics` feature is enabled. ~~To do so, `to_region_vid`'s `bug!` had to be changed into a delayed bug, which unfortunately required providing it a `TyCtxt`.~~

---
~~While I am happy with how the implementation of the error turned out in `rustc_passes::check_const`,  emitting an error wasn't sufficient to avoid hitting the ICE later. I also tried implementing the error in `rustc_mir::transform::check_consts::validation` and that worked, but it didn't silence the ICE either. To silence the ICE, I changed it to a delayed bug which worked but was more invasive that I would have liked, and required I return an incorrect lifetime. It's possible that this check should be implemented earlier in the compiler to make the invasive changes unnecessary, but I wasn't sure where that would be and wanted to get some feedback first.~~
The approach taken by this PR has been changed to implement the error in name resolution, which ended up being much simpler.

cc @rust-lang/wg-const-eval
r? @lcnr
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions