about summary refs log tree commit diff
path: root/tests
AgeCommit message (Collapse)AuthorLines
2023-03-11Auto merge of #109019 - matthiaskrgr:rollup-ihjntil, r=matthiaskrgrbors-25/+99
Rollup of 9 pull requests Successful merges: - #104363 (Make `unused_allocation` lint against `Box::new` too) - #106633 (Stabilize `nonzero_min_max`) - #106844 (allow negative numeric literals in `concat!`) - #108071 (Implement goal caching with the new solver) - #108542 (Force parentheses around `match` expression in binary expression) - #108690 (Place size limits on query keys and values) - #108708 (Prevent overflow through Arc::downgrade) - #108739 (Prevent the `start_bx` basic block in codegen from having two `Builder`s at the same time) - #108806 (Querify register_tools and post-expansion early lints) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-03-11Rollup merge of #108542 - bwmf2:expanded, r=wesleywiserMatthias Krüger-1/+25
Force parentheses around `match` expression in binary expression This attempts to solve https://github.com/rust-lang/rust/issues/98790.
2023-03-11Rollup merge of #106844 - Ezrashaw:concat-negative-int-lit, r=dtolnayMatthias Krüger-3/+31
allow negative numeric literals in `concat!` Fixes #106837 While *technically* negative numeric literals are implemented as unary operations, users can reasonably expect that negative literals are treated the same as positive literals.
2023-03-11Rollup merge of #104363 - WaffleLapkin:bonk_box_new, r=NilstriebMatthias Krüger-21/+43
Make `unused_allocation` lint against `Box::new` too Previously it only linted against `box` syntax, which likely won't ever be stabilized, which is pretty useless. Even now I'm not sure if it's a meaningful lint, but it's at least something :shrug: This means that code like the following will be linted against: ```rust Box::new([1, 2, 3]).len(); f(&Box::new(1)); // where f : &i32 -> () ``` The lint works by checking if a `Box::new` (or `box`) expression has an a borrow adjustment, meaning that the code that first stores the box in a variable won't be linted against: ```rust let boxed = Box::new([1, 2, 3]); // no lint boxed.len(); ```
2023-03-11Rollup merge of #108988 - adrianheine:crate-reference-block, r=petrochenkovMatthias Krüger-0/+5
rustdoc: Don't crash on `crate` references in blocks This is a regression from #94857.
2023-03-11Rollup merge of #108949 - Urgau:check-cfg-target-json, r=oli-obkMatthias Krüger-0/+46
Honor current target when checking conditional compilation values This is fixed by simply using the currently registered target in the current session. We need to use it because of target json that are not by design included in the rustc list of targets. Fixes https://github.com/rust-lang/rust/issues/108941
2023-03-11Rollup merge of #108927 - Ayush1325:pal-cleanup, r=workingjubileeMatthias Krüger-5/+5
Move __thread_local_inner to sys Move `__thread_local_inner` macro in `crate::thread::local` to `crate::sys`. Initially, I was thinking about removing this macro completely, but I could not find a way to create the generic statics without macros, so in the end, I just moved to code around. This probably will need a rebase once https://github.com/rust-lang/rust/pull/108917 is merged r? ``@workingjubilee``
2023-03-11Rollup merge of #108711 - Nilstrieb:nt-note, r=petrochenkovMatthias Krüger-0/+1
Add note when matching token with nonterminal The current error message is _really_ confusing. The implementation is slightly hacky, but not that much more hacky than all this nonterminal stuff.. r? ``@petrochenkov``
2023-03-11Auto merge of #109001 - matthiaskrgr:rollup-a3agnwp, r=matthiaskrgrbors-260/+148
Rollup of 8 pull requests Successful merges: - #105798 (Relax ordering rules for `asm!` operands) - #105962 (Stabilize path_as_mut_os_str) - #106085 (use problem matchers for tidy CI) - #107711 (Stabilize movbe target feature) - #108017 (Add `--no-undefined-version` link flag and fix associated breakage) - #108891 (Remove an extraneous include) - #108902 (no more do while :<) - #108912 (Document tool lints) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-03-10Rollup merge of #105798 - Amanieu:relax-asm, r=joshtriplettMatthias Krüger-260/+148
Relax ordering rules for `asm!` operands The `asm!` and `global_asm!` macros require their operands to appear strictly in the following order: - Template strings - Positional operands - Named operands - Explicit register operands - `clobber_abi` - `options` This is overly strict and can be inconvienent when building complex `asm!` statements with macros. This PR relaxes the ordering requirements as follows: - Template strings must still come before all other operands. - Positional operands must still come before named and explicit register operands. - Named and explicit register operands can be freely mixed. - `options` and `clobber_abi` can appear in any position after the template strings. r? ```````@joshtriplett```````
2023-03-10Rollup merge of #108983 - ↵Matthias Krüger-1/+16
LeSeulArtichaut:108646-target-feature-default-impl, r=cjgillot Forbid `#[target_feature]` on safe default implementations Fixes #108646.
2023-03-10Rollup merge of #108947 - compiler-errors:ct-infer-no-shapeshifting, r=BoxyUwUMatthias Krüger-21/+50
Don't even try to combine consts with incompatible types ~I left a more detailed explanation for why this fixes this issue in the UI test, but in general, we should not try to unify const infer vars and rigid consts if they have incompatible types. That's because we don't want something like a `ConstArgHasType` predicate to suddenly go from passing to failing, or vice versa, due to a shallow resolve.~ 1. Use the `type_of` for a parameter in `try_eval_lit_or_param`, instead of the "expected" type from a `WithOptConstParam` def id. 2. Don't combine consts that have incompatible types. Fixes #108781
2023-03-10Rollup merge of #108930 - Ezrashaw:better-error-for-manual-fn-impl, ↵Matthias Krüger-0/+46
r=petrochenkov feat: implement better error for manual impl of `Fn*` traits Fixes #39259 cc `@estebank` (you gave me some advice in the linked issue, would you like to review?)
2023-03-10Rollup merge of #108900 - bvanjoi:issue-108275, r=petrochenkovMatthias Krüger-6/+36
fix(lexer): print whitespace warning for \x0c - close https://github.com/rust-lang/rust/issues/108275 - discussion: https://github.com/rust-lang/rust/pull/108403
2023-03-10Rollup merge of #108834 - compiler-errors:fn-ptr-fn-obl, r=spastorinoMatthias Krüger-0/+33
Do not ICE when we have fn pointer `Fn` obligations with bound vars in the self type We never supported solving `for<'a> fn(&'a ()): Fn(&'a ())` -- I tried to add that support in #104929, but iirc `@lcnr` wanted to support this more generally by eagerly instantiating trait predicate binders with placeholders. That never happened due to blockers in the old solver, but we probably shouldn't ICE in any case. On the bright side, this passes on the new solver :^)
2023-03-10Rollup merge of #108828 - compiler-errors:new-solver-alias-eq-on-num-var, r=lcnrMatthias Krüger-15/+72
Emit alias-eq when equating numeric var and projection This doesn't fix everything having to do with projections and infer vars, but it does fix a common case I saw in HIR typeck. r? `@lcnr`
2023-03-10Moved thread_local implementation to sys::commonAyush Singh-5/+5
This allows removing all the platform-dependent code from `library/std/src/thread/local.rs` and `library/std/src/thread/mod.rs` Signed-off-by: Ayush Singh <ayushsingh1325@gmail.com>
2023-03-10Add note when matching token with nonterminalNilstrieb-0/+1
The current error message is _really_ confusing.
2023-03-10rustdoc: Don't crash on `crate` references in blocksAdrian Heine-0/+5
This is a regression from #94857.
2023-03-10Auto merge of #108977 - matthiaskrgr:rollup-1bnl1hu, r=matthiaskrgrbors-2/+27
Rollup of 9 pull requests Successful merges: - #108879 (Unconstrained terms should account for infer vars being equated) - #108936 (Rustdoc: don't hide anonymous reexport) - #108940 (Add myself to compiler reviewers list) - #108945 (Make some report and emit errors take DefIds instead of BodyIds) - #108946 (Document the resulting values produced when using `From<bool>` on floats) - #108956 (Make ptr::from_ref and ptr::from_mut in #106116 const.) - #108960 (Remove `body_def_id` from `Inherited`) - #108963 (only call git on git checkouts during bootstrap) - #108964 (Fix the docs for pointer method with_metadata_of) Failed merges: - #108950 (Directly construct Inherited in typeck.) r? `@ghost` `@rustbot` modify labels: rollup
2023-03-10Forbid `#[target_feature]` on safe default implementationsLéo Lanteri Thauvin-1/+16
2023-03-10Auto merge of #102256 - cjgillot:let-under, r=lcnrbors-14/+185
Introduce a no-op `PlaceMention` statement for `let _ =`. Fixes https://github.com/rust-lang/rust/issues/54003 Fixes https://github.com/rust-lang/rust/issues/80059 Split from https://github.com/rust-lang/rust/pull/101500 This PR introduces a new `PlaceMention` statement dedicated to matches that neither introduce bindings nor ascribe types. Without this, all traces of the match would vanish from MIR, making it impossible to diagnose unsafety or use in #101500. This allows to mark `let _ = <unsafe union access or dereference>` as requiring an unsafe block. Nominating for lang team, as this introduces an extra error.
2023-03-10Rollup merge of #108936 - GuillaumeGomez:rustdoc-anonymous-reexport, r=notriddleMatthias Krüger-2/+27
Rustdoc: don't hide anonymous reexport Fixes https://github.com/rust-lang/rust/issues/108931. From https://github.com/rust-lang/rust/issues/108931, it appears that having anonymous re-exports for traits is actually used in some places, so instead of hiding them automatically, we should prevent them to be ever inlined. r? `@notriddle`
2023-03-10feat: implement better error for manual impl of `Fn*` traitsEzra Shaw-0/+46
2023-03-09Honor current target when checking conditional compilation valuesUrgau-0/+46
This is fixed by simply using the currently registered target in the current session. We need to use it because of target json that are not by design included in the rustc list of targets.
2023-03-09Use param's real type in try_eval_lit_or_paramMichael Goulet-21/+50
2023-03-09Update coverage info.Camille GILLOT-1/+1
2023-03-09Test `let _ =` for const_mut_refs.Camille GILLOT-1/+13
2023-03-09Also test destructuring assignment.Camille GILLOT-4/+21
2023-03-09Ignore AscribeUserType in unsafeck to avoid duplicate diagnostics.Camille GILLOT-32/+14
2023-03-09Introduce a no-op PlaceMention statement for `let _ =`.Camille GILLOT-16/+59
2023-03-09Add ui test.Camille GILLOT-11/+128
2023-03-09Propagate expected return type instead of real return type in check_binopMichael Goulet-15/+33
2023-03-09Fix canonicalizer bug for int/float vars tooMichael Goulet-0/+21
2023-03-09Update rustdoc anonymous reexport test and add regression test for #108931Guillaume Gomez-2/+27
2023-03-09Emit alias-eq when equating numeric var and projectionMichael Goulet-0/+18
2023-03-09fix(lexer): not skipped whitespace warning for '\x0c'bohan-6/+36
2023-03-09Rollup merge of #108870 - ↵Matthias Krüger-0/+29
GuillaumeGomez:rustdoc-reexport-of-reexport-of-private, r=notriddle Fix invalid inlining of reexport of reexport of private item Fixes https://github.com/rust-lang/rust/issues/108679. The problem is that a reexport is always resolving to the end type, so if the end type is private, the reexport inlines. Except that if you reexport a public reexport (which reexports the private item), then it should not be inlined again. r? `@notriddle`
2023-03-09Rollup merge of #108854 - Ezrashaw:improve-int-idents, r=oli-obkMatthias Krüger-9/+27
feat/refactor: improve errors in case of ident with number at start Improve parser code when we parse a integer (or float) literal but expect an identifier. We emit an error message saying that identifiers can't begin with numbers. This PR just improves that code and expands it to all identifiers. Note that I haven't implemented error recovery (this didn't exist before anyway), I might do that in a follow up PR.
2023-03-09Rollup merge of #108294 - compiler-errors:arbitary-sugg-binder, r=TaKO8KiMatthias Krüger-0/+38
Place binder correctly for arbitrary trait bound suggestion suggest `for<'a> &'a T: Trait` instead of `&'a T: for<'a> T`.
2023-03-09Rollup merge of #106915 - notriddle:notriddle/load-only-one-theme, ↵Matthias Krüger-6/+6
r=GuillaumeGomez,jsha Only load one CSS theme by default This is a tweaked version of #103971 that uses `document.write` to create the stylesheet link at startup, avoiding a FOUC during page navigation. It also rebases the PR, making it work with the new hashed filenames. Fixes #82614 Preview: http://notriddle.com/notriddle-rustdoc-demos/load-only-one-theme-v2/std/index.html
2023-03-09feat/refactor: improve errors in case of ident with number at startEzra Shaw-9/+27
2023-03-09Auto merge of #108920 - matthiaskrgr:rollup-qrr9a0u, r=matthiaskrgrbors-48/+112
Rollup of 8 pull requests Successful merges: - #108754 (Retry `pred_known_to_hold_modulo_regions` with fulfillment if ambiguous) - #108759 (1.41.1 supported 32-bit Apple targets) - #108839 (Canonicalize root var when making response from new solver) - #108856 (Remove DropAndReplace terminator) - #108882 (Tweak E0740) - #108898 (Set `LIBC_CHECK_CFG=1` when building Rust code in bootstrap) - #108911 (Improve rustdoc-gui/tester.js code a bit) - #108916 (Remove an unused return value in `rustc_hir_typeck`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-03-09Auto merge of #108178 - cjgillot:ssa-deref, r=oli-obkbors-0/+254
Do not consider `&mut *x` as mutating `x` in `CopyProp` This PR removes an unfortunate overly cautious case from the current implementation. Found by https://github.com/rust-lang/rust/pull/105274 cc `@saethlin`
2023-03-08Rollup merge of #108882 - compiler-errors:E0740, r=eholkMatthias Krüger-45/+62
Tweak E0740 Also drive-by suppress E0740 if it's an unresolved type.
2023-03-08Rollup merge of #108856 - Zeegomo:remove-drop-and-rep, r=tmiaskoMatthias Krüger-3/+5
Remove DropAndReplace terminator #107844 made DropAndReplace unused, let's remove it completely from the codebase.
2023-03-08Rollup merge of #108839 - compiler-errors:canonicalize-the-root-var, r=lcnrMatthias Krüger-0/+45
Canonicalize root var when making response from new solver During trait solving, if we equate two inference variables `?0` and `?1` but don't equate them with any rigid types, then `InferCtxt::probe_ty_var` will return `Err` for both of these. The canonicalizer code will then canonicalize the variables independently(!), and the response will not reflect the fact that these two variables have been made equal. This hinders inference and I also don't think it's sound? I haven't thought too much about it past that, so let's talk about it. r? ``@lcnr``
2023-03-08Rollup merge of #108903 - rust-lang:pa-fix-clippy-tests, r=flip1995Matthias Krüger-40/+0
Move Clippy tests back to their intended directory See https://github.com/rust-lang/rust/pull/108674#issuecomment-1459736086. r? `@flip1995`
2023-03-08Rollup merge of #108901 - LYF1999:yf/108897, r=lcnrMatthias Krüger-0/+45
fix: evaluate with wrong obligation stack fix #108897 r? ``@lcnr``
2023-03-08Rollup merge of #108884 - compiler-errors:tweak-illegal-copy-impl-message, ↵Matthias Krüger-56/+48
r=WaffleLapkin Tweak illegal `Copy` impl message The phrase "may not" can both mean "is not able to" and "possibly does not". Disambiguate this by just using "cannot". ``@Lokathor`` expressed being annoyed by this [here](https://twitter.com/Lokathor/status/1633200313544089602?s=20). Also drive-by fix for this extremely noisy message: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=6a37275bc810f7846bfe191845b7d11d. r? diagnostics