about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2022-11-24effective visibility: Fix private visibility calculation for modulesVadim Petrochenkov-1/+1
Optimizations removed in the previous commit required this function to behave incorrectly, but now those optimizations are gone so we can fix the bug. Fixes https://github.com/rust-lang/rust/issues/104249
2022-11-24effective visibility: Remove questionable optimizationsVadim Petrochenkov-6/+50
First, they require eagerly calculating private visibility (current normal module), which is somewhat expensive. Private visibilities are also lost once calculated, instead of being cached in the table. Second, I cannot prove that the optimizations are correct. Maybe they can be partially reinstated in the future in cases when it's cheap and provably correct to do them. They will also probably be merged into `fn update` in that case. Partially fixes https://github.com/rust-lang/rust/issues/104249 Fixes https://github.com/rust-lang/rust/issues/104539
2022-11-23Account for closuresEsteban Küber-19/+0
2022-11-23Account for `x @ y` and suggest `ref x @ ref y`Esteban Küber-18/+328
2022-11-23review comments: inline bindings and fix typoEsteban Küber-19/+19
2022-11-23Fix rebaseEsteban Küber-0/+5
2022-11-23Tweak output to account for alternative bindings in the same patternEsteban Küber-8/+2
2022-11-23Fix wordingEsteban Küber-19/+19
2022-11-23Tweak output in for loopsEsteban Küber-16/+0
Do not suggest `.clone()` as we already suggest borrowing the iterated value.
2022-11-23Remove logic duplicationEsteban Küber-19/+19
2022-11-23Do not suggest `ref` multiple times for the same bindingEsteban Küber-8/+0
2022-11-23Suggest `.clone()` or `ref binding` on E0382Esteban Küber-20/+905
2022-11-23add invariance testb-naber-0/+24
2022-11-23Separate lifetime ident from resolution in HIR.Camille GILLOT-4/+4
2022-11-23add more testsb-naber-0/+31
2022-11-23add testsb-naber-0/+21
2022-11-23Bump the const eval step limitOli Scherer-4/+4
2022-11-23Add regression test for issue 99938est31-0/+31
That issue was a dupe of 99852, but it's always better to have multiple regression tests rather than one.
2022-11-23Use nicer spans for `deref_into_dyn_supertrait`Maybe Waffle-10/+7
2022-11-23Make `deref_into_dyn_supertrait` lint the impl and not the usageMaybe Waffle-6/+14
2022-11-23Rollup merge of #104751 - nnethercote:fix-104620, r=petrochenkovDylan DPC-0/+12
Fix an ICE parsing a malformed attribute. Fixes #104620. r? `@petrochenkov`
2022-11-23Rollup merge of #104744 - notriddle:notriddle/struct-fields-display-block, ↵Dylan DPC-0/+10
r=GuillaumeGomez rustdoc: give struct fields CSS `display: block` Fixes #104737
2022-11-23Rollup merge of #104286 - ozkanonur:fix-doc-bootstrap-recompilation, r=jyn514Dylan DPC-0/+37
copy doc output files by format This pr provides copying doc outputs by checking output format without removing output directory on each trigger. Resolves #103785
2022-11-23Rollup merge of #104269 - compiler-errors:hang-in-where-clause-sugg, r=lcnrDylan DPC-0/+68
Fix hang in where-clause suggestion with `predicate_can_apply` Using `predicate_may_hold` during error reporting causes an evaluation overflow, which (because we use `evaluate_obligation_no_overflow`) then causes the predicate to need to be re-evaluated locally, which results in a hang. ... but since the "add a where clause" suggestion is best-effort, just throw any overflow errors. No need for 100% accuracy. r? `@lcnr` who has been thinking about overflows... Let me know if you want more context about this issue, and as always, feel free to reassign. Fixes #104225
2022-11-23Auto merge of #102750 - the8472:opt-field-order, r=wesleywiserbors-25/+47
optimize field ordering by grouping m*2^n-sized fields with equivalently aligned ones ```rust use std::ptr::addr_of; use std::mem; struct Foo { word: u32, byte: u8, ary: [u8; 4] } fn main() { let foo: Foo = unsafe { mem::zeroed() }; println!("base: {:p}\nword: {:p}\nbyte: {:p}\nary: {:p}", &foo, addr_of!(foo.word), addr_of!(foo.byte), addr_of!(foo.ary)); } ``` prints ``` base: 0x7fffc1a8a668 word: 0x7fffc1a8a668 byte: 0x7fffc1a8a66c ary: 0x7fffc1a8a66d ``` I.e. the `u8` in the middle causes the array to sit at an odd offset, which might prevent optimizations, especially on architectures where unaligned loads are costly. Note that this will make field ordering niche-dependent, i.e. a `Bar<T>` with `T=char` and `T=u32` may result in different field order, this may break some code that makes invalid assumptions about `repr(Rust)` types.
2022-11-23Fix #104639, find the right lower bound region in the scenario of partial ↵yukang-0/+10
order relations
2022-11-23Add fatal overflow testMichael Goulet-0/+41
2022-11-23Do not need to account for overflow in predicate_can_applyMichael Goulet-0/+27
2022-11-22Consolidate rustdoc's lint passes into a single passNoah Lev-6/+2
This should improve performance and simplify the code.
2022-11-22Rollup merge of #104621 - YC:master, r=davidtwcoManish Goregaokar-0/+41
Fix --extern library finding errors - `crate_name` is not specified/passed to `metadata_crate_location_unknown_type` https://github.com/rust-lang/rust/blob/c493bae0d8efd75723460ce5c371f726efa93f15/compiler/rustc_error_messages/locales/en-US/metadata.ftl#L274-L275 - `metadata_lib_filename_form` is missing `$` - Add additional check to ensure that library is file Testing 1. Create file `a.rs` ```rust extern crate t; fn main() {} ``` 1. Create empty file `x` 1. Create empty directory `y` 1. Run ```sh $ rustc -o a a.rs --extern t=x $ rustc -o a a.rs --extern t=y ``` Both currently panic with stable.
2022-11-22Rollup merge of #104359 - Nilstrieb:plus-one, r=fee1-deadManish Goregaokar-33/+56
Refactor must_use lint into two parts Before, the lint did the checking for `must_use` and pretty printing the types in a special format in one pass, causing quite complex and untranslatable code. Now the collection and printing is split in two. That should also make it easier to translate or extract the type pretty printing in the future. Also fixes an integer overflow in the array length pluralization calculation. fixes #104352
2022-11-22Rollup merge of #103488 - oli-obk:impl_trait_for_tait, r=lcnrManish Goregaokar-160/+292
Allow opaque types in trait impl headers and rely on coherence to reject unsound cases r? ````@lcnr```` fixes #99840
2022-11-23Pass InferCtxt to DropRangeVisitor so we can resolve varsMichael Goulet-0/+168
2022-11-23Fix an ICE parsing a malformed attribute.Nicholas Nethercote-0/+12
Fixes #104620.
2022-11-22add tests for field ordering optimizationThe 8472-0/+21
2022-11-22fix tests, update size assertsThe 8472-25/+26
2022-11-22rustdoc: make struct fields `display: block`Michael Howell-0/+10
2022-11-23Rollup merge of #104724 - WaffleLapkin:to_def_idn't, r=compiler-errorsYuki Okushi-9/+32
Fix `ClosureKind::to_def_id` `Fn` and `FnOnce` were mixed up in https://github.com/rust-lang/rust/pull/99131.
2022-11-23Rollup merge of #104722 - mejrs:stress, r=ChrisDentonYuki Okushi-16/+51
Speed up mpsc_stress test See https://rust-lang.zulipchat.com/#narrow/stream/122651-general/topic/mpsc_stress for context r? windows
2022-11-23Rollup merge of #104717 - ↵Yuki Okushi-0/+31
GuillaumeGomez:test-projection-used-as-const-generic, r=oli-obk Add failing test for projections used as const generic Based on the experiment done in https://github.com/rust-lang/rust/pull/104443, we realized it's currently not possible to support projections in const generics. More information about it in https://github.com/rust-lang/rust/pull/104443#discussion_r1029375633. This PR adds the UI test in any case so we can gather data in order to work towards adding `TyAlias` into the ABI in the future. r? ``@oli-obk``
2022-11-23Rollup merge of #102293 - ecnelises:aix.initial, r=davidtwcoYuki Okushi-1/+1
Add powerpc64-ibm-aix as Tier-3 target This is part of the effort mentioned in https://github.com/rust-lang/compiler-team/issues/553. A reference to these options are definitions from [clang](https://github.com/llvm/llvm-project/blob/ad6fe32032a6229e0c40510e9bed419a01c695b3/clang/lib/Basic/Targets/PPC.h#L414-L448) and [llvm](https://github.com/llvm/llvm-project/blob/main/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp). AIX has a system `ld` but [its options and behaviors](https://www.ibm.com/docs/en/aix/7.3?topic=l-ld-command) are different from GNU ld. Thanks to ``@bzEq`` for contributing the linking args.
2022-11-22Speed up mpsc_stress testmejrs-16/+51
2022-11-22Fix `ClosureKind::to_def_id`Maybe Waffle-9/+32
2022-11-22Add failing test for projections used as const genericGuillaume Gomez-0/+31
2022-11-22Auto merge of #104711 - Dylan-DPC:rollup-gkw1qr8, r=Dylan-DPCbors-0/+36
Rollup of 6 pull requests Successful merges: - #104295 (Check generics parity before collecting return-position `impl Trait`s in trait) - #104464 (Reduce exceptions overallocation on non Windows x86_64) - #104615 (Create def_id for async fns during lowering) - #104669 (Only declare bindings for if-let guards once per arm) - #104701 (Remove a lifetime resolution hack from `compare_predicate_entailment`) - #104710 (disable strict-provenance-violating doctests in Miri) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-11-22Rollup merge of #104669 - LeSeulArtichaut:88015-if-let-guard-bindings, ↵Dylan DPC-0/+7
r=cjgillot Only declare bindings for if-let guards once per arm Currently, each candidate for a match arm uses separate locals for the bindings in the if-let guard, causing problems (#88015) when those branches converge in the arm body. Fixes #88015 (🤞)
2022-11-22Rollup merge of #104295 - compiler-errors:rpitit-generics-parity, r=eholkDylan DPC-0/+29
Check generics parity before collecting return-position `impl Trait`s in trait The only thing is that this duplicates the error message for number of generics mismatch, but we already deduplicate that error message in Cargo. I could add a flag to delay the error if the reviewer cares. Fixes #104281 Also drive-by adds a few comments to the `collect_trait_impl_trait_tys` method, and removes an unused argument from `compare_number_of_generics`.
2022-11-22Auto merge of #103578 - petrochenkov:nofict, r=nagisabors-294/+122
Unreserve braced enum variants in value namespace With this PR braced enum variants (`enum E { V { /*...*/ } }`) no longer take a slot in value namespace, so the special case mentioned in the note in https://github.com/rust-lang/rfcs/blob/master/text/1506-adt-kinds.md#braced-structs is removed. Report - https://github.com/rust-lang/rust/pull/103578#issuecomment-1292594900.
2022-11-22Tests for bad --extern library path and fileSteven Tang-0/+41
2022-11-21Fix incorrect span when using byte-escaped rbraceCassaundra Smith-0/+28
Fix #103826.