-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Rollup of 6 pull requests #41702
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rollup of 6 pull requests #41702
Conversation
Instead, thread around `Option<CodeExtent>` where applicable.
Make a `CodeExtent<'tcx>` be something allocated in an arena instead of an index into the `RegionMaps`.
Instead of requesting the region maps for the entire crate, request for a given item etc. Several bits of code were modified to take `&RegionMaps` as input (e.g., the `resolve_regions_and_report_errors()` function). I am not totally happy with this setup -- I *think* I'd rather have the region maps be part of typeck tables -- but at least the `RegionMaps` works in a "parallel" way to `FreeRegionMap`, so it's not too bad. Given that I expect a lot of this code to go away with NLL, I didn't want to invest *too* much energy tweaking it.
Checks alloca and memcpy are aligned correctly.
This was a pretty narrow test to start with, and it's kind of a pain to update it. Not worth the trouble IMO.
Removes occurences of anonymous parameters from the rustc codebase, as they are to be deprecated. See issue rust-lang#41686 and RFC 1685.
Under MinGW, x.py fails to run with UnboundLocalError. Under MinGW, `x.py` will fail with the following errors: ```bash $ ./x.py Traceback (most recent call last): File "./x.py", line 20, in <module> bootstrap.main() File "C:/src/rust/src/bootstrap/bootstrap.py", line 620, in main bootstrap() File "C:/src/rust/src/bootstrap/bootstrap.py", line 601, in bootstrap rb.build = rb.build_triple() File "C:/src/rust/src/bootstrap/bootstrap.py", line 459, in build_triple if os.environ.get('MSYSTEM') == 'MINGW64': UnboundLocalError: local variable 'os' referenced before assignment ``` The reason is due to the `build_triple` function in `src/bootstrap/bootstrap.py` (Line 416): ```python if ostype == 'Linux': os = subprocess.check_output(['uname', '-o']).strip().decode(default_encoding) ``` Here, the assignment to `os` is causing the `os` module to be shadowed. Then, in (Line 459): ```python if os.environ.get('MSYSTEM') == 'MINGW64': cputype = 'x86_64' ``` `os` now refers to the uninitialized local variable, not the `os` module. Easiest fix is to simply rename the `os` variable to something like `os_from_sp`. Also, there is a small typo fix in `x.py` referencing the wrong file name.
…pping, r=eddyb On demandify region mapping This is an adaptation of @cramertj's PR. I am sort of tempted to keep simplifying it, but also tempted to land it so and we can refactor more in follow-up PRs. As is, it does the following things: - makes the region-maps an on-demand query, per function `tcx.region_maps(def_id)` - interns code extents instead of of having them be integers - remove the "root region extent" and (to some extent) item extents; instead we use `Option<CodeExtent<'tcx>>` in a few places (no space inefficiency since `CodeExtent<'tcx>` is now a pointer). I'm not entirely happy with the way I have it setup though. Here are some of the changes I was considering (I'm not sure if they would work out well): 1. Removing `item_extents` entirely -- they are rarely used now, because most of the relevant places now accept an `Option<Region<'tcx>>` or an `Option<CodeExtent<'tcx>>`, but I think still used in a few places. 2. Merging `RegionMaps` into the typeck tables, instead of having it be its own query. 3. Change `CodeExtent<'tcx>` to store the parent pointer. This would mean that fewer places in the code actually *need* a `RegionMaps` anyhow, since most of them just want to be able to walk "up the tree". On the other hand, you wouldn't be able to intern a `CodeExtent<'tcx>` for some random node-id, you'd need to look it up in the table (since there'd be more information). Most of this code is semi-temporary -- I expect it to largely go away as we move to NLL -- so I'm also not *that* concerned with making it perfect. r? @eddyb
… r=arielb1 Add simple `[repr(align)]` codegen test. Checks alloca and memcpy are aligned correctly. Test added to as additional check for rust-lang#33626.
…=sfackler Fix incorrect hex value in doc comment example. Fixes rust-lang#41682.
Add a lint to disallow anonymous parameters Adds a (allow by default) lint to disallow anonymous parameters, like it was decided in RFC 1685 (rust-lang/rfcs#1685). cc tracking issue rust-lang#41686
Removal pass for anonymous parameters Removes occurences of anonymous parameters from the rustc codebase, as they are to be deprecated. See issue rust-lang#41686 and RFC 1685. r? @frewsxcv
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @arielb1 (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
@bors r+ p=10 |
📌 Commit e0bfd19 has been approved by |
☀️ Test successful - status-appveyor, status-travis |
[repr(align)]
codegen test. #41673, Fix incorrect hex value in doc comment example. #41688, Add a lint to disallow anonymous parameters #41692, Removal pass for anonymous parameters #41693