Commit graph

217938 commits

Author SHA1 Message Date
Dylan DPC c5d5c57666
Rollup merge of #108189 - compiler-errors:non_lifetime_binders-bound-stuff, r=jackh726
Fix some more `non_lifetime_binders` stuff with higher-ranked trait bounds

1. When assembling candidates for `for<T> T: Sized`, we can't ICE because the self-type is a bound type.
2. Fix an issue where, when canonicalizing in non-universe preserving mode, we don't actually set the universe for placeholders to the root even though we do the same for region vars.
3. Make `Placeholder("T")` format like `T` in error messages.

Fixes #108180
Fixes #108182

r? types
2023-02-19 13:03:42 +05:30
Dylan DPC 636679ecd6
Rollup merge of #108146 - notriddle:notriddle/rustdoc-search-reference, r=GuillaumeGomez
rustdoc: hide `reference` methods in search index

They're hidden in the HTML, so it makes no sense in the search engine for `reference::next` or `reference::shrink` to be shown.

https://rust-lang.zulipchat.com/#narrow/stream/122651-general/topic/What.20is.20.60reference.3A.3Ashrink.60.3F
2023-02-19 13:03:42 +05:30
Dylan DPC 0257e288f5
Rollup merge of #108130 - tshepang:just-one-example, r=workingjubilee
"Basic usage" is redundant for there is just one example
2023-02-19 13:03:42 +05:30
Dylan DPC 4a0f088f7c
Rollup merge of #107951 - petrochenkov:procmacdoc, r=jackh726
resolve: Fix doc links referring to other crates when documenting proc macro crates directly

Fixes https://github.com/rust-lang/rust/issues/107950
2023-02-19 13:03:41 +05:30
Dylan DPC 4165de40f8
Rollup merge of #107783 - notriddle:notriddle/item-table-ul, r=GuillaumeGomez
rustdoc: simplify DOM for `.item-table`

This switches from using `<div>` to the more semantic `<ul>`, and using class names that rhyme with the classes the search results table uses.
2023-02-19 13:03:41 +05:30
Dylan DPC e802713941
Rollup merge of #106933 - schuelermine:fix/doc/102451, r=Amanieu
Update documentation of select_nth_unstable and select_nth_unstable_by to state O(n^2) complexity

See #102451
2023-02-19 13:03:40 +05:30
Dylan DPC 47ec320ce6
Rollup merge of #104659 - tshepang:reflow, r=workingjubilee
reflow the stack size story
2023-02-19 13:03:39 +05:30
KittyBorgX cd3d4fcedf Download rustfmt regardless of rustc being set in config.toml 2023-02-19 11:59:01 +05:30
bors 73f40197ec Auto merge of #107772 - compiler-errors:dyn-star-backend-is-ptr, r=eholk
Make `dyn*`'s value backend type a pointer

One tweak on top of Ralf's commit should fix using `usize` as a `dyn*`-coercible type, and should fix when we're using various other pointer types when LLVM opaque pointers is disabled.

r? `@eholk` but feel free to reassign
cc https://github.com/rust-lang/rust/pull/107728#issuecomment-1421231823 `@RalfJung`
2023-02-19 05:35:03 +00:00
Jacob Pratt 20282c1b20
Reduce limit on macro_rules! diagnostic 2023-02-19 04:17:58 +00:00
Jacob Pratt 378c4ab9ab
Make public API, docs algorithm-agnostic 2023-02-19 04:11:10 +00:00
Jacob Pratt c2f2a3cff2
Add test for println! typo 2023-02-19 03:46:03 +00:00
Jacob Pratt ff052eec80
Use restricted Damerau-Levenshtein algorithm 2023-02-19 03:46:03 +00:00
bors fcdbd1c07f Auto merge of #107867 - compiler-errors:new-solver-fn-trait-safety, r=lcnr
Check that built-in callable types validate their output type is `Sized` (in new solver)

Working on parity with old solver. Putting this up for consideration, it's not *really* needed or anything just yet. Maybe it's better to approach this from another direction (like always checking the item bounds when calling `consider_assumption`? we may need that for coinduction to be sound though?)

This basically implements #100096 for the new solver.
2023-02-19 02:42:10 +00:00
bors f77f4d55bd Auto merge of #107542 - compiler-errors:param-envs-with-inference-vars-are-cursed, r=jackh726
Don't call `with_reveal_all_normalized` in const-eval when `param_env` has inference vars in it

**what:** This slightly shifts the order of operations from an existing hack:

5b6ed253c4/compiler/rustc_middle/src/ty/consts/kind.rs (L225-L230)

in order to avoid calling a tcx query (`TyCtxt::reveal_opaque_types_in_bounds`, via `ParamEnv::with_reveal_all_normalized`) when a param-env has inference variables in it.

**why:** This allows us to enable fingerprinting of query keys/values outside of incr-comp in deubg mode, to make sure we catch other places where we're passing infer vars and other bad things into query keys. Currently that (bbf33836b9) crashes because we introduce inference vars into a param-env in the blanket-impl finder in rustdoc 😓

5b6ed253c4/src/librustdoc/clean/blanket_impl.rs (L43)

See the CI failure here: https://github.com/rust-lang/rust/actions/runs/4058194838/jobs/6984834619
2023-02-18 23:43:42 +00:00
Guillaume Gomez 8d801fd398 Add regression test for #107995 2023-02-18 23:24:58 +01:00
Guillaume Gomez fd62036caa Correctly handle if a link starts with a whitespace 2023-02-18 23:24:58 +01:00
Camille GILLOT 9f6c1df872 Stop implementing _with_overflow intrinsics in codegen backends. 2023-02-18 22:06:29 +00:00
Camille GILLOT 7e795bdf03 Replace _with_overflow instrinsics in LowerIntrinsics. 2023-02-18 21:45:10 +00:00
Camille GILLOT f79db59953 Adapt cg_clif. 2023-02-18 21:35:02 +00:00
Camille GILLOT c107e0e945 Fix codegen test. 2023-02-18 21:35:02 +00:00
Camille GILLOT c1a0f8205c Rename checked_binop_checks_overflow. 2023-02-18 21:35:02 +00:00
Camille GILLOT a5769193d1 Remove special case in rvalue codegen. 2023-02-18 21:35:02 +00:00
Camille GILLOT e9c73ea502 Make name more explicit. 2023-02-18 21:35:02 +00:00
Camille GILLOT 4f13aa7f46 Comment codegen optimization. 2023-02-18 21:35:02 +00:00
Camille Gillot 328696ca17 Update compiler/rustc_middle/src/mir/syntax.rs
Co-authored-by: Ralf Jung <post@ralfj.de>
2023-02-18 21:35:02 +00:00
Camille GILLOT fb1f7f747a Remove exception from MIR doc. 2023-02-18 21:35:02 +00:00
Camille GILLOT 085eaa7ee3 Adapt interpreter. 2023-02-18 21:35:02 +00:00
Camille GILLOT 7f36a3fcd7 Fix CTFE interpreter. 2023-02-18 21:35:02 +00:00
Camille GILLOT 4c93145b33 Remove outdated comment. 2023-02-18 21:35:02 +00:00
Camille GILLOT 7567f1f31d Adapt interpreter. 2023-02-18 21:35:02 +00:00
Camille GILLOT 1480b1c524 Correct comment. 2023-02-18 21:35:02 +00:00
Camille GILLOT d0cc00f758 Add comment. 2023-02-18 21:35:02 +00:00
Camille GILLOT 86dbcb5390 Add codegen test. 2023-02-18 21:35:02 +00:00
Camille GILLOT e34caaf42d Remove overflow checks from ConstProp. 2023-02-18 21:35:02 +00:00
Camille GILLOT 4bd2ebc58b Do not codegen overflow check when not required. 2023-02-18 21:35:02 +00:00
Michael Goulet 3e57b20391 Add test 2023-02-18 20:36:39 +00:00
Michael Goulet d42a3fbd69 Assume we can normalize trait default method RPITITs in param-env instead 2023-02-18 20:36:39 +00:00
Michael Goulet c13d5f1aeb Make sure test_type_match doesn't ICE with late-bound types 2023-02-18 20:16:51 +00:00
bors 4507fdaaa2 Auto merge of #106241 - Sp00ph:vec_deque_iter_methods, r=the8472
Implement more methods for `vec_deque::IntoIter`

This implements a couple `Iterator` methods on `vec_deque::IntoIter` (`(try_)fold`, `(try_)rfold` `advance_(back_)by`, `next_chunk`, `count` and `last`) to allow these to be more efficient than their default implementations, also allowing many other `Iterator` methods that use these under the hood to take advantage of these manual implementations. `vec::IntoIter` has similar implementations for many of these methods. This PR does not yet implement `TrustedRandomAccess` and friends, as I'm not very familiar with the required safety guarantees.

r? `@the8472` (since you also took over my last PR)
2023-02-18 20:12:35 +00:00
Michael Goulet 6f3706ea71 Pretty placeholders using their names 2023-02-18 19:49:40 +00:00
Michael Goulet ec40b1a393 Collapse placeholders to root universe in canonicalizer if not preserving universes 2023-02-18 19:49:40 +00:00
Michael Goulet f4a4a31479 Don't ICE on bound types in sized conditions 2023-02-18 19:49:40 +00:00
Michael Goulet 7f798c2b21 Emit the right types for vtable pointers when dropping dyn* 2023-02-18 19:47:34 +00:00
Michael Goulet e82cc656c8 Make dyn* have the same scalar pair ABI as corresponding fat pointer 2023-02-18 19:47:34 +00:00
Michael Goulet 1f11d841b5 Add codegen test 2023-02-18 19:47:34 +00:00
Michael Goulet df52e2037a Use inttoptr to support usize as dyn* value, use pointercast to make sure pointers are compatible 2023-02-18 19:47:33 +00:00
Michael Goulet 6402c98621 Add consider_implied_clause 2023-02-18 19:45:02 +00:00
Michael Goulet 82b52056fe Check that built-in callable types validate their output type is Sized (in new solver) 2023-02-18 19:32:58 +00:00
Michael Goulet be55ad53a1 Remove default trait RPITIT candidates 2023-02-18 19:25:07 +00:00