about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2023-03-30Rollup merge of #109347 - cjgillot:issue-109305, r=WaffleLapkinMichael Goulet-69/+65
Skip no_mangle if the item has no name. Fixes https://github.com/rust-lang/rust/issues/109305
2023-03-30Auto merge of #109740 - ↵bors-1/+42
compiler-errors:new-solver-deep-reject-placeholder-consts, r=lcnr Don't ICE on placeholder consts in deep reject Since we canonicalize const params into placeholder consts, we need to be able to handle them during deep reject. r? `@lcnr` (though maybe `@oli-obk` can look at this one too, if he wants 😸) Fixes compiler-errors/next-solver-hir-issues#10
2023-03-30Refactor glibc time64 support, riscv32 always has 64-bit `time_t`beetrees-14/+36
2023-03-30Add `IndexSlice` to go with `IndexVec`Scott McMurray-70/+160
Moves the methods that don't need full `IndexVec`-ness over to `IndexSlice`, and have `IndexVec` deref to `IndexSlice` so everything keeps working.
2023-03-30Update contributing links for rustc-dev-guide changesJynn Nelson-2/+1
- Remove unused reference link in CONTRIBUTING.md - Change the contributing_url for triagebot to the getting started page
2023-03-30Update gccjit and remove libc 0.1 dependencyUlrich Weigand-16/+10
2023-03-30Update `ty::VariantDef` to use `IndexVec<FieldIdx, FieldDef>`Scott McMurray-104/+127
And while doing the updates for that, also uses `FieldIdx` in `ProjectionKind::Field` and `TypeckResults::field_indices`. There's more places that could use it (like `rustc_const_eval` and `LayoutS`), but I tried to keep this PR from exploding to *even more* places. Part 2/? of https://github.com/rust-lang/compiler-team/issues/606
2023-03-30Auto merge of #108576 - ↵bors-29/+483
megakorre:rustdock_additional_typecheck_before_clean, r=GuillaumeGomez rustdoc: run more HIR validation to mirror rustc # Explanation While investigating these issues: https://github.com/rust-lang/rust/issues/107093, https://github.com/rust-lang/rust/issues/106079 I thought it maybe would be useful to test running `rustdoc` on all rust files under `tests/ui` grepping for files that causes any ICEs. And these are the files I found would cause ICEs. ``` // These are handled by this fix. tests/ui/late-bound-lifetimes/mismatched_arg_count.rs tests/ui/associated-consts/issue-102335-const.rs tests/ui/const-generics/generic_const_exprs/issue-102768.rs tests/ui/const-generics/const-arg-type-arg-misordered.rs tests/ui/generic-associated-types/parse/trait-path-type-error-once-implemented.rs tests/ui/typeck/issue-88643.rs tests/ui/typeck/issue-75889.rs tests/ui/typeck/issue-83621-placeholder-static-in-extern.rs // These are not they will still produce a ICE after this change tests/ui/limits/issue-56762.rs tests/ui/union/projection-as-union-type-error-2.rs tests/ui/union/projection-as-union-type-error.rs ``` I reduces the issues handled by this PR down to the tests added in the PR. That includes the linked issues. But the 3 files that are not handled I will leave for a future PR. This PR adds the `type_collecting` step from `hir_analysis::check_crate` to the rustdoc typechecks. It had the following comment on it. ``` // this ensures that later parts of type checking can assume that items // have valid types and not error ``` Adding the check report the same errors as rustc does for these input. And not ICE when the lint checker walks the HIR or when in the `rustdoc::clean` pass. This PR updates the expected errors of some existing rustdoc-ui tests (some now report less errors). These new reported errors does mirror the errors reported by rustc. # Performance It does more checking so it will probably regress. We should run ``@bors` try `@rust-timer` queue` and see. # Discussion Maybe instead of calling a subset of the checks in `hir_analysis::check_crate` and having comments that say they should be kept in sync. We could instead call `check_crate` directly and pass in some flag. Maybe `check_toplevel_signatures_only` or something like that. That flag would have to skip most of the checks in that function tough.
2023-03-30Closures always implement FnOnce in new solverMichael Goulet-3/+25
2023-03-30rustdoc: tidy excess whitespacePatrik Kårlin-4/+4
2023-03-30ignore failing cross-compiled run-make testsJoshua Nelson-0/+127
`run-make-fulldeps` is never cross-compiled, so a lot of these tests never accounted for --target. Ignore them when cross-compiling for now.
2023-03-30fix `sysroot-crates-are-unstable` for cross-compilationJoshua Nelson-0/+1
2023-03-30move `tools.mk` to run-makeJoshua Nelson-88/+88
apparently I missed some tests in the last commit. Rather than having dozens of tests use the long version, use the short version in `run-make` and the long version in `run-make-fulldeps` (which is now only three tests)
2023-03-30rustdoc: add error messages to the testPatrik Kårlin-60/+74
2023-03-30rustdoc: remove other redundant itemPatrik Kårlin-11/+0
2023-03-30rustdoc: remove excess from rustdoc testPatrik Kårlin-6/+2
2023-03-30rustdoc: remove redundant testPatrik Kårlin-13/+0
2023-03-30rustdoc: update with --bless and change expected errorsPatrik Kårlin-30/+352
2023-03-30rustdoc: run more HIR validation to mirror rustcPatrik Kårlin-0/+146
2023-03-30fix typo and adjust commentjoboet-2/+2
Co-authored-by: Ralf Jung <post@ralfj.de>
2023-03-30core: use `pointer::write` to cleanup `LazyCell` initializationjoboet-8/+7
2023-03-30core: improve code documentation for `LazyCell`joboet-5/+24
2023-03-30core: optimize `LazyCell` sizejoboet-11/+59
2023-03-30Auto merge of #109769 - JohnTitor:rollup-7n2bnpg, r=JohnTitorbors-44/+160
Rollup of 7 pull requests Successful merges: - #106985 (Enhanced doucmentation of binary search methods for `slice` and `VecDeque` for unsorted instances) - #109509 (compiletest: Don't allow tests with overlapping prefix names) - #109719 (RELEASES: Add "Only support Android NDK 25 or newer" to 1.68.0) - #109748 (Don't ICE on `DiscriminantKind` projection in new solver) - #109749 (Canonicalize float var as float in new solver) - #109761 (Drop binutils on powerpc-unknown-freebsd) - #109766 (Fix title for openharmony.md) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-03-30fix wrong includesJoshua Nelson-7/+7
2023-03-30Move almost all run-make-fulldeps to run-makeJoshua Nelson-2/+2
They pass fine.
2023-03-30Rollup merge of #109766 - Amanieu:ohos-title, r=JohnTitorYuki Okushi-1/+1
Fix title for openharmony.md
2023-03-30Rollup merge of #109761 - pkubaj:patch-1, r=ozkanonurYuki Okushi-5/+0
Drop binutils on powerpc-unknown-freebsd FreeBSD 13.1 and 13.2 can build Rust with LLD just fine on powerpc.
2023-03-30Rollup merge of #109749 - compiler-errors:new-solver-float-var, r=lcnrYuki Okushi-1/+9
Canonicalize float var as float in new solver Typo in new canonicalizer -- we should be canonicalizing float vars as `CanonicalTyVarKind::Float`, not `CanonicalTyVarKind::Int`. Fixes compiler-errors/next-solver-hir-issues#9
2023-03-30Rollup merge of #109748 - compiler-errors:new-solver-discr-kind-ice, r=lcnrYuki Okushi-15/+94
Don't ICE on `DiscriminantKind` projection in new solver As title says, since we now actually call `Ty::discriminant_kind` on placeholder types 😃 Also drive-by simplify `Pointee::Metadata` projection logic, and fix the UI test because the `<T as Pointee>::Metadata` tests weren't actually exercising the new projection logic, since we still eagerly normalize (which hits `project.rs` in the old solver) in HIR typeck. r? `@lcnr` tho feel free to re-roll, this pr is very low-priority and not super specific to the new trait solver. Fixes compiler-errors/next-solver-hir-issues#14
2023-03-30Rollup merge of #109719 - tyilo:patch-1, r=Mark-SimulacrumYuki Okushi-0/+1
RELEASES: Add "Only support Android NDK 25 or newer" to 1.68.0 See https://blog.rust-lang.org/2023/01/09/android-ndk-update-r25.html and https://internals.rust-lang.org/t/rust-1-68-0-pre-release-testing/18481/2
2023-03-30Rollup merge of #109509 - ehuss:overlapping-tests, r=Mark-SimulacrumYuki Okushi-2/+35
compiletest: Don't allow tests with overlapping prefix names Some tests will delete their output directory before starting. The output directory is based on the test names. If one test is the prefix of another test, then when that test starts, it could try to delete the output directory of the other test with the longer path, or otherwise clash with it while the two tests are trying to create/delete/modify the same directory. In practice, this manifested as a random error on macOS where two tests were trying to create/delete/create `rustdoc/primitive` and `rustdoc/primitive/no_std`, which resulted in an EINVAL (InvalidInput) error. This renames some of the offending tests, adds `compiletest-ignore-dir` to prevent compiletest from processing some files, and adds a check to prevent this from happening in the future. Fixes #109397
2023-03-30Rollup merge of #106985 - jofas:106746-fix, r=ChrisDentonYuki Okushi-20/+20
Enhanced doucmentation of binary search methods for `slice` and `VecDeque` for unsorted instances Fixes #106746. Issue #106746 raises the concern that the binary search methods for slices and deques aren't explicit enough about the fact that they are only applicable to sorted slices/deques. I changed the explanation for these methods. I took the relatively harsh description of the behaviour of binary search on unsorted collections ("unspecified and meaningless") from the description of the [`partition_point`](https://doc.rust-lang.org/std/primitive.slice.html#method.partition_point) method: > If this slice is not partitioned, the returned result is unspecified and meaningless, as this method performs a kind of binary search.
2023-03-30Fix title for openharmony.mdAmanieu d'Antras-1/+1
2023-03-30Remove an out-of-date comment on `QueryCache::lookup`.Nicholas Nethercote-3/+0
2023-03-30`CacheAligned` and `Sharded` don't need to derive `Clone`.Nicholas Nethercote-2/+1
2023-03-30Remove `RwLock::clone_guard`.Nicholas Nethercote-12/+0
It's unused.
2023-03-30Improve the `rustc_data_structures::sync` module doc comment.Nicholas Nethercote-19/+44
Also, `MTRef<'a, T>` is a typedef for a reference to a `T`, but in practice it's only used (and useful) in combination with `MTLock`, i.e. `MTRef<'a, MTLock<T>>`. So this commit changes it to be a typedef for a reference to an `MTLock<T>`, and renames it as `MTLockRef`. I think this clarifies things, because I found `MTRef` quite puzzling at first.
2023-03-30Auto merge of #105587 - tgross35:once-cell-min, r=m-ou-sebors-156/+163
Partial stabilization of `once_cell` This PR aims to stabilize a portion of the `once_cell` feature: - `core::cell::OnceCell` - `std::cell::OnceCell` (re-export of the above) - `std::sync::OnceLock` This will leave `LazyCell` and `LazyLock` unstabilized, which have been moved to the `lazy_cell` feature flag. Tracking issue: https://github.com/rust-lang/rust/issues/74465 (does not fully close, but it may make sense to move to a new issue) Future steps for separate PRs: - ~~Add `#[inline]` to many methods~~ #105651 - Update cranelift usage of the `once_cell` crate - Update rust-analyzer usage of the `once_cell` crate - Update error messages discussing once_cell ## To be stabilized API summary ```rust // core::cell (in core/cell/once.rs) pub struct OnceCell<T> { .. } impl<T> OnceCell<T> { pub const fn new() -> OnceCell<T>; pub fn get(&self) -> Option<&T>; pub fn get_mut(&mut self) -> Option<&mut T>; pub fn set(&self, value: T) -> Result<(), T>; pub fn get_or_init<F>(&self, f: F) -> &T where F: FnOnce() -> T; pub fn into_inner(self) -> Option<T>; pub fn take(&mut self) -> Option<T>; } impl<T: Clone> Clone for OnceCell<T>; impl<T: Debug> Debug for OnceCell<T> impl<T> Default for OnceCell<T>; impl<T> From<T> for OnceCell<T>; impl<T: PartialEq> PartialEq for OnceCell<T>; impl<T: Eq> Eq for OnceCell<T>; ``` ```rust // std::sync (in std/sync/once_lock.rs) impl<T> OnceLock<T> { pub const fn new() -> OnceLock<T>; pub fn get(&self) -> Option<&T>; pub fn get_mut(&mut self) -> Option<&mut T>; pub fn set(&self, value: T) -> Result<(), T>; pub fn get_or_init<F>(&self, f: F) -> &T where F: FnOnce() -> T; pub fn into_inner(self) -> Option<T>; pub fn take(&mut self) -> Option<T>; } impl<T: Clone> Clone for OnceLock<T>; impl<T: Debug> Debug for OnceLock<T>; impl<T> Default for OnceLock<T>; impl<#[may_dangle] T> Drop for OnceLock<T>; impl<T> From<T> for OnceLock<T>; impl<T: PartialEq> PartialEq for OnceLock<T> impl<T: Eq> Eq for OnceLock<T>; impl<T: RefUnwindSafe + UnwindSafe> RefUnwindSafe for OnceLock<T>; unsafe impl<T: Send> Send for OnceLock<T>; unsafe impl<T: Sync + Send> Sync for OnceLock<T>; impl<T: UnwindSafe> UnwindSafe for OnceLock<T>; ``` No longer planned as part of this PR, and moved to the `rust_cell_try` feature gate: ```rust impl<T> OnceCell<T> { pub fn get_or_try_init<F, E>(&self, f: F) -> Result<&T, E> where F: FnOnce() -> Result<T, E>; } impl<T> OnceLock<T> { pub fn get_or_try_init<F, E>(&self, f: F) -> Result<&T, E> where F: FnOnce() -> Result<T, E>; } ``` I am new to this process so would appreciate mentorship wherever needed.
2023-03-30removed deprecated markdown links from documentationjofas-6/+0
2023-03-30Drop binutils on powerpc-unknown-freebsdpkubaj-5/+0
FreeBSD 13.1 and 13.2 can build Rust with LLD just fine on powerpc.
2023-03-30Auto merge of #109499 - spastorino:new-rpitit-19, r=compiler-errorsbors-33/+69
Give return-position impl traits in trait a (synthetic) name to avoid name collisions with new lowering strategy The only needed commit from this PR is the last one. r? `@compiler-errors` Needs #109455.
2023-03-30Update compiler-builtins to 0.1.91 to bring in msp430 shift primitive fixes.William D. Jones-3/+3
2023-03-30Auto merge of #109224 - oli-obk:smir, r=pnkfelixbors-11/+239
Stable MIR: Add basic MIR body datastructures At this point it will panic on most useful MIR, but you can do basic assignments r? `@pnkfelix`
2023-03-30deep reject only unify numeric var with concrete numericMichael Goulet-0/+4
2023-03-30canonicalize float var as float in new solverMichael Goulet-1/+9
2023-03-30Check pointee metadata correctly in ui testMichael Goulet-13/+9
2023-03-30Don't ICE on DiscriminantKind projection in new solverMichael Goulet-2/+85
2023-03-30Auto merge of #107221 - kleisauke:getentropy-emscripten, r=ChrisDentonbors-4/+5
Use `getentropy()` instead of `/dev/urandom` on Emscripten `/dev/urandom` is usually available on Emscripten, except when using the special `NODERAWFS` filesystem backend, which replaces all normal filesystem access with direct Node.js operations. Since this filesystem backend directly access the filesystem on the OS, it is not recommended to depend on `/dev/urandom`, especially when trying to run the Wasm binary on OSes that are not Unix-based. This can be considered a non-functional change, since Emscripten implements `/dev/urandom` in the same way as `getentropy()` when not linking with `-sNODERAWFS`.
2023-03-29Don't ICE on placeholder consts in deep rejectMichael Goulet-1/+42