about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2021-05-01compute where_outer on demand, remove it from ModuleTimothée Delabrouille-15/+14
2021-04-28Auto merge of #83713 - spastorino:revert-pub-macro-rules, r=nikomatsakisbors-170/+24
Revert "Rollup merge of #82296 - spastorino:pubrules, r=nikomatsakis" This reverts commit e2561c58a41023a14e0e583113dcf55e1ecb236a, reversing changes made to 2982ba50fc4bb629b8fe4108a81cb2f9b053510b. As discussed in #83641 this feature is not complete and in particular doesn't work cross macros and given that this is not going to be included in edition 2021 nobody seems to be trying to fix the underlying problem. When can add this again I guess, whenever somebody has the time to make it work cross crates. r? `@nikomatsakis`
2021-04-28Auto merge of #84498 - workingjubilee:update-grab-bag, r=Mark-Simulacrumbors-3/+2
Update grab bag This PR slides a bunch of crate versions forward until suddenly a bunch of deps fall out of the tree! In doing so this mostly picks up a version bump in the `redox_users` crate which makes most of the features default to optional. crossbeam-utils 0.7 => 0.8.3 (where applicable) https://github.com/crossbeam-rs/crossbeam/blob/master/crossbeam-utils/CHANGELOG.md directories 3.0.1 => 3.0.2 ignore 0.4.16 => 0.4.17 tempfile 3.0.5 => tempfile 3.2 Removes constant_time_eq from deps exceptions Removes arrayref from deps exceptions And also removes: - blake2b_simd - const_fn (the package, not the feature) - constant_time_eq - redox_users 0.3.4 - rust-argon2
2021-04-27Auto merge of #84635 - ehuss:update-cargo, r=ehussbors-0/+0
Update cargo 5 commits in 0ed318d182e465cd66071b91ac3d265af63ef8a1..4369396ce7d270972955d876eaa4954bea56bcd9 2021-04-23 20:54:54 +0000 to 2021-04-27 14:35:53 +0000 - Fix rebuild issues with rustdoc. (rust-lang/cargo#9419) - Always use full metadata hash for -C metadata. (rust-lang/cargo#9418) - Expose build.target .cargo/config setting as packages.target in Cargo.toml (rust-lang/cargo#9030) - Some changes to rustdoc fingerprint checking. (rust-lang/cargo#9404) - Document that CARGO_PKG_ are availble to build.rs (rust-lang/cargo#9405)
2021-04-27Update cargoEric Huss-0/+0
2021-04-27Auto merge of #84494 - tdelabro:84304-bis, r=jyn514bors-128/+158
84304 - rustdoc: shrink Item::Attributes Helps with https://github.com/rust-lang/rust/issues/84304
2021-04-27Rollup merge of #84610 - flip1995:clippyup, r=Manishearth,flip1995Dylan DPC-326/+416
Update Clippy Out of cycle sync: I want to get https://github.com/rust-lang/rust-clippy/pull/7129 into beta that is branched next week. This sync only adds one new feature in efc4c6c, which looks fine to me. Otherwise it only contains bug fixes and/or restricts lints further. r? `@Manishearth`
2021-04-27Rollup merge of #84132 - Manishearth:lldb-nonstandard, r=Mark-SimulacrumDylan DPC-1/+1
Ignore nonstandard lldb version strings in compiletest Fixes https://github.com/rust-lang/rust/issues/84131 Unsure if I should do the same for the Apple LLDB branch above.
2021-04-27Merge commit '7c7683c8efe447b251d6c5ca6cce51233060f6e8' into clippyupflip1995-326/+416
2021-04-27Auto merge of #84606 - JohnTitor:test-84408, r=lcnrbors-0/+38
Add a regression test for issue-84408 Closes #84408 r? `@lcnr`
2021-04-27cfg taken out of Attributes, put in ItemTimothée Delabrouille-85/+104
check item.is_fake() instead of self_id.is_some() Remove empty branching in Attributes::from_ast diverse small refacto after Josha review cfg computation moved in merge_attrs refacto use from_ast twice for coherence take cfg out of Attributes and move it to Item
2021-04-27Removed usage of Attributes in FnDecl and ExternalCrate. Relocate part of ↵Timothée Delabrouille-53/+64
the fields in Attributes, as functions in AttributesExt. refacto use from_def_id_and_attrs_and_parts instead of an old trick most of josha suggestions + check if def_id is not fake before using it in a query Removed usage of Attributes in FnDecl and ExternalCrate. Relocate part of the Attributes fields as functions in AttributesExt.
2021-04-27Auto merge of #77246 - yaahc:typeof-errors, r=oli-obkbors-0/+32
try enabling typeof for fun error messages
2021-04-27Rename a test for consistencyYuki Okushi-0/+0
2021-04-27Add a regression test for issue-84408Yuki Okushi-0/+38
2021-04-27Auto merge of #84552 - GuillaumeGomez:open-impl-blocks-by-default, r=jshabors-9/+27
Open impl blocks by default Fixes #84558. Part of #84422. As you can see on https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/context/struct.TyCtxt.html, impl blocks are currently not open by default whereas they should. I also realized that a test was outdated so I removed it and opened #84550 because it seems like the rustdoc-gui test suite isn't run on CI... cc `@jyn514` r? `@jsha`
2021-04-26add ui test for new typeof error messagesJane Lusby-0/+32
2021-04-26Rollup merge of #84574 - hi-rustin:rustin-patch-typo, r=jyn514Mara Bos-2/+2
rustdoc: Fix typos in maybe_inline_local fn Introduced by https://github.com/rust-lang/rust/pull/79061. r? `@jyn514`
2021-04-26Auto merge of #84583 - joshtriplett:target-tier-policy, r=pietroalbinibors-1/+642
Add the target tier policy from accepted RFC 2803
2021-04-26Cross-reference target tier policy from platform-supportJosh Triplett-1/+2
2021-04-26Add the target tier policy from accepted RFC 2803Josh Triplett-0/+640
2021-04-26Add open attribute on details which are supposed to be open by default ↵Guillaume Gomez-4/+2
instead of opening them with JS
2021-04-26rustdoc: Fix typo for maybe_inline_local fnhi-rustin-2/+2
2021-04-26Auto merge of #84544 - RalfJung:const_fn_in_trait, r=oli-obkbors-55/+13
Always reject `const fn` in `trait` during parsing. 'const fn' in trait are rejected in the AST: https://github.com/rust-lang/rust/blob/b78c0d8a4d5af91a4a55d029293e3ecb879ec142/compiler/rustc_ast_passes/src/ast_validation.rs#L1411 So this feature gate check is a NOP and we can just remove it. The src/test/ui/feature-gates/feature-gate-min_const_fn.rs and src/test/ui/feature-gates/feature-gate-const_fn.rs tests ensure that we still reject `const fn` in `trait` Cc https://github.com/rust-lang/rust/issues/84510 r? `@oli-obk`
2021-04-25Auto merge of #84564 - Dylan-DPC:rollup-wxa2yr0, r=Dylan-DPCbors-30/+323
Rollup of 8 pull requests Successful merges: - #84235 (refactor StyledBuffer) - #84450 (Give a better error when `std` or `core` are missing) - #84486 (Handle pretty printing of `else if let` clauses without ICEing) - #84499 (Tweak trait not `use`d suggestion) - #84516 (Add suggestion to "use break" when attempting to implicit-break a loop) - #84520 (Improve diagnostics for function passed when a type was expected.) - #84541 (Inline most raw socket, fd and handle conversions) - #84547 (Get rid of is_min_const_fn) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-04-25Rollup merge of #84547 - RalfJung:max_const_fn, r=oli-obkDylan DPC-30/+80
Get rid of is_min_const_fn This removes the last trace of the min_const_fn mechanism by making the unsafety checker agnostic about whether something is a min or "non-min" const fn. It seems this distinction was used to disallow some features inside `const fn`, but that is the responsibility of the const checker, not of the unsafety checker. No test seems to even notice this change in the unsafety checker so I guess we are good... r? `@oli-obk` Cc https://github.com/rust-lang/rust/issues/84510
2021-04-25Rollup merge of #84520 - hameerabbasi:fn-as-ty, r=lcnrDylan DPC-0/+27
Improve diagnostics for function passed when a type was expected. This PR improves diagnostics, it provides more information when a function is passed where a type is expected. r? `@lcnr`
2021-04-25Rollup merge of #84516 - torhovland:issue-84114, r=estebankDylan DPC-0/+78
Add suggestion to "use break" when attempting to implicit-break a loop Fixes #84114
2021-04-25Rollup merge of #84499 - estebank:issue-84272, r=jackh726Dylan DPC-0/+67
Tweak trait not `use`d suggestion Fix #84272. Follow up to #83667.
2021-04-25Rollup merge of #84486 - Smittyvb:else-if-let-hir-pretty-print, r=petrochenkovDylan DPC-0/+47
Handle pretty printing of `else if let` clauses without ICEing When pretty printing the HIR of `if ... {} else if let ... {}` clauses, this displays it the `else if let` part as `match` it gets desugared to, the same way normal `if let` statements are currently displayed, instead of ICEing. ```rust pub fn main() { if true { // 1 } else if let a = 1 { // 2 } else { // 3 } } ``` now gets desugared (via `rustc -Zunpretty=hir,typed src/x.rs`) to: ```rust #[prelude_import] use ::std::prelude::rust_2015::*; #[macro_use] extern crate std; pub fn main() ({ (if (true as bool) ({ // 1 } as ()) else {match (1 as i32) { a => { // 2 } _ => { // 3 } }} as ()) } as ()) ``` For comparison, this code gets HIR prettyprinted the same way before and after this change: ```rust pub fn main() { if let a = 1 { // 2 } else { // 3 } } ``` turns into ```rust #[prelude_import] use ::std::prelude::rust_2015::*; #[macro_use] extern crate std; pub fn main() ({ (match (1 as i32) { a => { // 2 } _ => { // 3 } } as ()) } as ()) ``` This closes #82329. It closes #84434 as well, due to having the same root cause.
2021-04-25Rollup merge of #84450 - jyn514:missing-std, r=petrochenkovDylan DPC-0/+24
Give a better error when `std` or `core` are missing - Suggest using `rustup target add` if `RUSTUP_HOME` is set. I don't know if there's any precedent for doing this, but it seems harmless enough and it will be a big help. - On nightly, suggest using `cargo build -Z build-std` if `CARGO` is set - Add a note about `#![no_std]` if `std` is missing but not core - Add a note that std may be unsupported if `std` is missing but not core Fixes https://github.com/rust-lang/rust/issues/84418. r? `@petrochenkov`
2021-04-25Auto merge of #84325 - jsha:ephemeral-collapse, r=GuillaumeGomezbors-28/+18
rustdoc: make expand/collapse all ephemeral The `[+]` in the upper right of a rustdoc page expands or collapses all toggles on the page. That state is stored across page loads, but is used inconsistently. This change explicitly stops storing or using the state. This also moves the code for toggling display of trait implementations so that it's near the other toggling code. Fixes #84318
2021-04-25Auto merge of #84481 - RalfJung:miri, r=RalfJungbors-9/+7
update Miri Fixes https://github.com/rust-lang/rust/issues/84553 Cc `@rust-lang/miri` r? `@ghost`
2021-04-25update MiriRalf Jung-9/+7
2021-04-25Give a better error when std or core are missingJoshua Nelson-0/+24
- Suggest using `rustup target add` if `RUSTUP_HOME` is set. I don't know if there's any precedent for doing this, but it seems harmless enough and it will be a big help. - Add a note about `#![no_std]` if `std` is missing but not core - On nightly, suggest using `cargo build -Z build-std` if `CARGO` is set - Add a note that std may be unsupported if `std` is missing but not core - Don't suggest `#![no_std]` when the load isn't injected by the compiler
2021-04-25fix clippyRalf Jung-1/+1
2021-04-25make sure raw ptr casts in 'const' context are unsafeRalf Jung-25/+76
2021-04-25Add test to ensure that the element pointed to by the URL hash is "expanded"Guillaume Gomez-0/+18
2021-04-25Auto merge of #84299 - lcnr:const-generics-defaults-name-res, r=varkorbors-88/+260
various const parameter defaults improvements Actually resolve names in const parameter defaults, fixing `struct Foo<const N: usize = { usize::MAX }>`. --- Split generic parameter ban rib for types and consts, allowing ```rust #![feature(const_generics_defaults)] struct Q; struct Foo<T = Q, const Q: usize = 3>(T); ``` --- Remove the type/const ordering restriction if `const_generics_defaults` is active, even if `const_generics` is not. allowing us to stabilize and test const param defaults separately. --- Check well formedness of const parameter defaults, eagerly emitting an error for `struct Foo<const N: usize = { 0 - 1 }>` --- Do not forbid const parameters in param defaults, allowing `struct Foo<const N: usize, T = [u8; N]>(T)` and `struct Foo<const N: usize, const M: usize = N>`. Note that this should not change anything which is stabilized, as on stable, type parameters must be in front of const parameters, which means that type parameter defaults are only allowed if no const parameters exist. We still forbid generic parameters inside of const param types. r? `@varkor` `@petrochenkov`
2021-04-25Fix expansion for item pointed to by the URL hashGuillaume Gomez-0/+2
2021-04-25Remove unneeded rustdoc-gui test because DOM changedGuillaume Gomez-5/+0
2021-04-25Add test to ensure that impl blocks are open by defaultGuillaume Gomez-0/+3
2021-04-25Open all impl blocks by defaultGuillaume Gomez-2/+4
2021-04-25get rid of min_const_fn references in library/ and rustdocRalf Jung-4/+3
2021-04-25Auto merge of #84216 - RalfJung:black-box, r=Mark-Simulacrumbors-6/+6
move core::hint::black_box under its own feature gate The `black_box` function had its own RFC and is tracked separately from the `test` feature at https://github.com/rust-lang/rust/issues/64102. Let's reflect this in the feature gate. To avoid breaking all the benchmarks, libtest's `test::black_box` is a wrapping definition, not a reexport -- this means it is still under the `test` feature gate.
2021-04-25fix sanitizer testsRalf Jung-4/+4
2021-04-25move core::hint::black_box under its own feature gateRalf Jung-2/+2
2021-04-25'const fn' in trait are rejected in the AST, this feature gate check is a NOPRalf Jung-55/+13
2021-04-25Auto merge of #84147 - cuviper:array-method-dispatch, r=nikomatsakis,m-ou-sebors-150/+118
Cautiously add IntoIterator for arrays by value Add the attribute described in #84133, `#[rustc_skip_array_during_method_dispatch]`, which effectively hides a trait from method dispatch when the receiver type is an array. Then cherry-pick `IntoIterator for [T; N]` from #65819 and gate it with that attribute. Arrays can now be used as `IntoIterator` normally, but `array.into_iter()` has edition-dependent behavior, returning `slice::Iter` for 2015 and 2018 editions, or `array::IntoIter` for 2021 and later. r? `@nikomatsakis` cc `@LukasKalbertodt` `@rust-lang/libs`
2021-04-25Improve diagnostics for function passed when a type was expected.Hameer Abbasi-0/+27