about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2021-04-18Added a test.Tor Hovland-0/+21
2021-04-18Add stability tags to ImportItem.Tor Hovland-4/+22
2021-04-18Auto merge of #84065 - c410-f3r:tests-tests-tests, r=petrochenkovbors-1/+1
Move some tests to more reasonable directories - 6 cc #73494 r? `@petrochenkov` git mv bad/bad-const-type.* static/ git mv bad/bad-crate-name.* extern git mv bad/bad-env-capture* fn/ git mv bad/bad-expr-lhs.* expr/ git mv bad/bad-expr-path* expr/ git mv bad/bad-extern-link-attrs.* extern/ git mv bad/bad-intrinsic-monomorphization.* intrinsics/ git mv bad/bad-lint-cap* lint/ git mv bad/bad-main.* fn git mv bad/bad-method-typaram-kind.* type/ git mv bad/bad-mid-path-type-params.* fn git mv bad/bad-module.* modules/ git mv bad/bad-sized.* type/ git mv bad/bad-type-env-capture.* fn
2021-04-18Auto merge of #84064 - hyd-dev:unknown-lints, r=petrochenkovbors-44/+85
Do not ignore path segments in the middle in `#[allow]`/`#[warn]`/`#[deny]`/`#[forbid]` attributes Fixes #83477.
2021-04-17Auto merge of #84061 - ↵bors-76/+76
AngelicosPhosphoros:issue-75598-add-inline-always-arithmetic, r=nagisa Add some #[inline(always)] to arithmetic methods of integers I tried to add it only to methods which return results of intrinsics and don't have any branching. Branching could made performance of debug builds (`-Copt-level=0`) worse. Main goal of changes is allowing wider optimizations in `-Copt-level=1`. Closes: https://github.com/rust-lang/rust/issues/75598 r? `@nagisa`
2021-04-17Move some tests to more reasonable directories - 6Caio-1/+1
2021-04-17Auto merge of #84279 - Dylan-DPC:rollup-k7otd7e, r=Dylan-DPCbors-2254/+2295
Rollup of 4 pull requests Successful merges: - #83237 (rustdoc: use more precise relative URLs) - #84150 (rustdoc: move some search code into search.js) - #84203 (rustdoc: Give a more accurate span for anchor failures) - #84257 (Add documentation to help people find `Ipv4Addr::UNSPECIFIED`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-04-17Rollup merge of #84257 - joshtriplett:inaddr-any, r=m-ou-seDylan DPC-0/+3
Add documentation to help people find `Ipv4Addr::UNSPECIFIED` People looking for `INADDR_ANY` don't always find `Ipv4Addr::UNSPECIFIED`; add some documentation to help.
2021-04-17Rollup merge of #84203 - jyn514:anchor-span, r=euclioDylan DPC-14/+34
rustdoc: Give a more accurate span for anchor failures r? `@euclio`
2021-04-17Rollup merge of #84150 - jsha:defer-search-js, r=GuillaumeGomezDylan DPC-1693/+1682
rustdoc: move some search code into search.js This reduces main.s from 3094 lines to 1587. Also it saves some bytes of download in the case where search isn't used. There were a fair number of variables that needed to be accessible in both main.js and search.js, but I didn't want to put too many symbols in the global namespace, so I consolidated much of the search-related state and functions into a new object `window.searchState`. Demo at https://hoffman-andrews.com/rust/move-search/std/?search=foo
2021-04-17Rollup merge of #83237 - notriddle:short-links, r=jyn514Dylan DPC-547/+576
rustdoc: use more precise relative URLs This is a fairly large diff, and will probably conflict with https://github.com/rust-lang/rust/pull/82815 since it reduces (but does not eliminate) the use of the old depth variable. Instead of using a depth counter and adding "../" to get to the top, this commit makes rustdoc actually compare the path of what it's linking from to the path that it's linking to. This makes the resulting HTML shorter. Here's a comparison of one of the largest (non-source) files in the Rust standard library docs (about 4% improvement before gzipping). $ wc -c struct.Wrapping.old.html struct.Wrapping.new.html 2387389 struct.Wrapping.old.html 2298538 struct.Wrapping.new.html Most if it can be efficiently gzipped away. $ wc -c struct.Wrapping.old.html.gz struct.Wrapping.new.html.gz 70679 struct.Wrapping.old.html.gz 70050 struct.Wrapping.new.html.gz But it also makes a difference in the final DOM size, reducing it from 91MiB to 82MiB.
2021-04-17rustdoc: Give a more accurate span for anchor failuresJoshua Nelson-14/+34
2021-04-17Auto merge of #84270 - nagisa:nagisa/bump-llvm, r=cuviperbors-0/+0
Include a backport for wrong DWARF information A partial fix for #83139 r? `@cuviper` or `@nikic`
2021-04-17rustdoc: move the cx argument to the end of the listMichael Howell-33/+33
This should help make things consistent.
2021-04-17rustdoc: change 'cx to 'tcx, to match the struct itselfMichael Howell-60/+60
2021-04-17Remove assert that no longer mattersMichael Howell-7/+0
The function `to_src_with_space` doesn't even accept the cache as a parameter, so it doesn't matter any more what's in it.
2021-04-17rustdoc: use more precise relative URLSMichael Howell-577/+613
Instead of using a depth counter and adding "../" to get to the top, this commit makes rustdoc actually compare the path of what it's linking from to the path that it's linking to. This makes the resulting HTML shorter. Here's a comparison of one of the largest (non-source) files in the Rust standard library docs (about 4% improvement before gzipping). $ wc -c struct.Wrapping.old.html struct.Wrapping.new.html 2387389 struct.Wrapping.old.html 2298538 struct.Wrapping.new.html Most if it can be efficiently gzipped away. $ wc -c struct.Wrapping.old.html.gz struct.Wrapping.new.html.gz 70679 struct.Wrapping.old.html.gz 70050 struct.Wrapping.new.html.gz But it also makes a difference in the final DOM size, reducing it from 91MiB to 82MiB.
2021-04-17Auto merge of #84261 - Aaron1011:error-dup-revisions, r=Mark-Simulacrumbors-9/+19
Error when compiletest is passed duplicate revisions Currently, we allow the user to write things like '// revisions: rpass1 rpass1', which will not test what they were intending to test.
2021-04-17Auto merge of #84260 - Aaron1011:global-alloc-eval-always, r=cjgillotbors-0/+14
Mark `has_global_allocator` query as `eval_always` Fixes #84252 This query reads from untracked global state in `CStore`.
2021-04-17Include a backport for wrong DWARF informationSimonas Kazlauskas-0/+0
A partial fix for #83139
2021-04-17Do not ignore path segments in the middle in ↵hyd-dev-44/+85
`#[allow]`/`#[warn]`/`#[deny]`/`#[forbid]` attributes
2021-04-17Auto merge of #84246 - notriddle:rustdoc-path-printing-cleanup, r=jyn514bors-43/+1
rustdoc: get rid of unused path printing code The code for printing a raw path is only used in utils.rs, which only prints the alternative (non-HTML) format. Path has a function that does the same thing without HTML support, so use that instead.
2021-04-17Auto merge of #84244 - ABouttefeux:closure-return-conflict-suggest, r=estebankbors-22/+60
fix incomplete diagnostic notes when closure returns conflicting for genric type fixes #84128 Correctly report the span on for conflicting return type in closures
2021-04-17Auto merge of #84243 - Soveu:fix-derive-macro-const-default, r=petrochenkovbors-2/+27
Builtin derive macros: fix error with const generics default This fixes a bug where builtin derive macros (like Clone, Debug) would basically copy-paste the default from a const generic, causing a compile error with very confusing message - it would say defaults are not allowed in impl blocks, while pointing at struct/enum/union definition.
2021-04-17Auto merge of #84113 - SNCPlay42:suggestion-extern-crate, r=petrochenkovbors-11/+46
Detect when suggested paths enter extern crates more rigorously When reporting resolution errors, the compiler tries to avoid suggesting importing inaccessible paths from other crates. However, the search for suggestions only recognized when it was entering a crate root directly, and so failed to recognize a path like `crate::module::private_item`, where `module` was imported from another crate with `use other_crate::module`, as entering another crate. Fixes #80079 Fixes #84081
2021-04-16Auto merge of #84074 - notriddle:rustdoc-macro-visibility, r=jyn514bors-12/+57
rustdoc: clean up and test macro visibility print This fixes the overly-complex invariant mentioned in <https://github.com/rust-lang/rust/pull/83237#issuecomment-815346570>, where the macro source can't have any links in it only because the cache hasn't been populated yet.
2021-04-16Error when compiletest is passed duplicate revisionsAaron Hill-9/+19
Currently, we allow the user to write things like '// revisions: rpass1 rpass1', which will not test what they were intending to test.
2021-04-16Mark `has_global_allocator` query as `eval_always`Aaron Hill-0/+14
Fixes #84252 This query reads from untracked global state in `CStore`.
2021-04-16Add documentation to help people find `Ipv4Addr::UNSPECIFIED`Josh Triplett-0/+3
People looking for `INADDR_ANY` don't always find `Ipv4Addr::UNSPECIFIED`; add some documentation and an alias to help.
2021-04-16Auto merge of #84249 - crlf0710:fix_miri, r=RalfJungbors-8/+8
Update miri. Fixes #84240. r? `@RalfJung`
2021-04-17Update miri.Charles Lew-8/+8
2021-04-16Auto merge of #83416 - alexcrichton:const-thread-local, r=sfacklerbors-49/+244
std: Add a variant of thread locals with const init This commit adds a variant of the `thread_local!` macro as a new `thread_local_const_init!` macro which requires that the initialization expression is constant (e.g. could be stuck into a `const` if so desired). This form of thread local allows for a more efficient implementation of `LocalKey::with` both if the value has a destructor and if it doesn't. If the value doesn't have a destructor then `with` should desugar to exactly as-if you use `#[thread_local]` given sufficient inlining. The purpose of this new form of thread locals is to precisely be equivalent to `#[thread_local]` on platforms where possible for values which fit the bill (those without destructors). This should help close the gap in performance between `thread_local!`, which is safe, relative to `#[thread_local]`, which is not easy to use in a portable fashion.
2021-04-16std: Add a variant of thread locals with const initAlex Crichton-49/+244
This commit adds a variant of the `thread_local!` macro as a new `thread_local_const_init!` macro which requires that the initialization expression is constant (e.g. could be stuck into a `const` if so desired). This form of thread local allows for a more efficient implementation of `LocalKey::with` both if the value has a destructor and if it doesn't. If the value doesn't have a destructor then `with` should desugar to exactly as-if you use `#[thread_local]` given sufficient inlining. The purpose of this new form of thread locals is to precisely be equivalent to `#[thread_local]` on platforms where possible for values which fit the bill (those without destructors). This should help close the gap in performance between `thread_local!`, which is safe, relative to `#[thread_local]`, which is not easy to use in a portable fashion.
2021-04-16rustdoc: get rid of unused path printing codeMichael Howell-43/+1
The code for printing a raw path is only used in utils.rs, which only prints the alternative (non-HTML) format. Path has a function that does the same thing without HTML support, so use that instead.
2021-04-16fix reporting return type in some casesAliénore Bouttefeux-22/+60
2021-04-16builtin derive macros: fix error with const generics defaultSoveu-2/+27
2021-04-16Auto merge of #84241 - Dylan-DPC:rollup-jk9nt6k, r=Dylan-DPCbors-194/+526
Rollup of 4 pull requests Successful merges: - #83337 (rustdoc: Hide item contents, not items) - #83944 (Fix a couple resolve bugs from binder refactor) - #84145 (Address comments for vecdeque_binary_search #78021) - #84172 (Compiler error messages: reduce assertiveness of message E0384) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-04-16Rollup merge of #84172 - jayaddison:compiler/E0384-reduce-assertiveness, ↵Dylan DPC-36/+36
r=petrochenkov Compiler error messages: reduce assertiveness of message E0384 This message is emitted as guidance by the compiler when a developer attempts to reassign a value to an immutable variable. Following the message will always currently work, but it may not always be the best course of action; following the 'consider ...' messaging pattern provides a hint to the developer that it could be wise to explore other alternatives. Resolves #84144
2021-04-16Rollup merge of #84145 - vojtechkral:vecdeque-binary-search, r=m-ou-seDylan DPC-3/+87
Address comments for vecdeque_binary_search #78021
2021-04-16Rollup merge of #83944 - jackh726:binder-refactor-fix2, r=lcnrDylan DPC-1/+56
Fix a couple resolve bugs from binder refactor Fixes #83753 Fixes #83907
2021-04-16Rollup merge of #83337 - Manishearth:item-hide, r=GuillaumeGomezDylan DPC-154/+347
rustdoc: Hide item contents, not items This tweaks rustdoc to hide item contents instead of items, and only when there are too many of them. This means that users will _always_ see the type parameters, and will _often_ see fields/etc as long as they are small. Traits have some heuristics for hiding only the methods or only the methods and the consts, since the associated types are super important. I'm happy to play around with the heuristics here; we could potentially make it so that structs/enums/etc are always hidden but traits will try really hard to show type aliases. This needs a test, but you can see it rendered at https://manishearth.net/sand/doc_render/bar/ <details> <summary> Code example </summary> ```rust pub struct PubStruct { pub a: usize, pub b: usize, } pub struct BigPubStruct { pub a: usize, pub b: usize, pub c: usize, pub d: usize, pub e: usize, pub f: usize, } pub union BigUnion { pub a: usize, pub b: usize, pub c: usize, pub d: usize, pub e: usize, pub f: usize, } pub union Union { pub a: usize, pub b: usize, pub c: usize, } pub struct PrivStruct { a: usize, b: usize, } pub enum Enum { A, B, C, D { a: u8, b: u8 } } pub enum LargeEnum { A, B, C, D, E, F, G, H, I, J } pub trait Trait { type A; #[must_use] fn foo(); fn bar(); } pub trait GinormousTrait { type A; type B; type C; type D; type E; type F; const N: usize = 1; #[must_use] fn foo(); fn bar(); } pub trait HugeTrait { type A; const M: usize = 1; const N: usize = 1; const O: usize = 1; const P: usize = 1; const Q: usize = 1; #[must_use] fn foo(); fn bar(); } pub trait BigTrait { type A; #[must_use] fn foo(); fn bar(); fn baz(); fn quux(); fn frob(); fn greeble(); } #[macro_export] macro_rules! foo { (a) => {a}; } ``` </details> Fixes https://github.com/rust-lang/rust/issues/82114
2021-04-16Auto merge of #84230 - cuviper:llvm-12, r=nikicbors-1/+1
Update to LLVM 12.0.0 final
2021-04-16Auto merge of #84217 - crlf0710:remove_main_attr_pure, r=petrochenkovbors-214/+59
Remove #[main] attribute. This removes the #[main] attribute support from the compiler according to the decisions within #29634. For existing use cases within test harness generation, replaced it with a newly-introduced internal attribute `#[rustc_main]`. This is first part extracted from #84062 . Closes #29634. r? `@petrochenkov`
2021-04-16Auto merge of #84228 - SkiFire13:fix-84213, r=estebankbors-0/+70
Suggest to borrow after failing to cast from T to *const/mut T Fixes #84213
2021-04-16Remove #[main] attribute.Charles Lew-214/+59
2021-04-16Auto merge of #84220 - gpluscb:weak_doc, r=jyn514bors-2/+2
Correct outdated documentation for rc::Weak This was overlooked in ~~#50357~~ #51901
2021-04-16Auto merge of #84226 - Aaron1011:track-link-dead-code, r=Mark-Simulacrumbors-2/+2
Track `-C link-dead-code` during incremental compilation This option influences monomorphization, which participates in incremental compilation.
2021-04-15Update to LLVM 12.0.0 finalJosh Stone-1/+1
2021-04-15Add regression testGiacomo Stevanato-0/+55
2021-04-15Add suggestion to borrow when casting T to *const/mut TGiacomo Stevanato-0/+15