-
Notifications
You must be signed in to change notification settings - Fork 12.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rollup of 8 pull requests #78350
Rollup of 8 pull requests #78350
Commits on Oct 21, 2020
-
add rustc_allow_const_fn_unstable attribute
allow_internal_unstable is currently used to side-step feature gate and stability checks. While it was originally only meant to be used only on macros, its use was expanded to const functions. This commit prepares stricter checks for the usage of allow_internal_unstable (only on macros) and introduces the rustc_allow_const_fn_unstable attribute for usage on functions. See rust-lang#69399
Configuration menu - View commit details
-
Copy full SHA for 3948b05 - Browse repository at this point
Copy the full SHA 3948b05View commit details -
Configuration menu - View commit details
-
Copy full SHA for 05f4a9a - Browse repository at this point
Copy the full SHA 05f4a9aView commit details -
validate allow_internal_unstable target
Adds a check to make sure `#[allow_internal_unstable]` can be applied only to macro definitions.
Configuration menu - View commit details
-
Copy full SHA for 7258740 - Browse repository at this point
Copy the full SHA 7258740View commit details -
validate rustc_allow_const_fn_unstable targets
Adds a check to make sure `#[rustc_allow_const_fn_unstable]` can be applied only to functions.
Configuration menu - View commit details
-
Copy full SHA for 3a63bf0 - Browse repository at this point
Copy the full SHA 3a63bf0View commit details -
Configuration menu - View commit details
-
Copy full SHA for 3a58ad9 - Browse repository at this point
Copy the full SHA 3a58ad9View commit details
Commits on Oct 23, 2020
-
Configuration menu - View commit details
-
Copy full SHA for 7d30c53 - Browse repository at this point
Copy the full SHA 7d30c53View commit details -
ignore #[rustc_allow_const_fn_unstable] for macro expansion
Recognition for `rustc_allow_const_fn_unstable` attribute was errorneously added in 05f4a9a.
Configuration menu - View commit details
-
Copy full SHA for 83fbddd - Browse repository at this point
Copy the full SHA 83fbdddView commit details -
rename allow_internal_unstable() to rustc_allow_const_fn_unstable() i…
…n rustc_mir Followup rename from 05f4a9a, which introduced `#[rustc_allow_const_fn_unstable]` for `const fn`s.
Configuration menu - View commit details
-
Copy full SHA for 13b481b - Browse repository at this point
Copy the full SHA 13b481bView commit details -
fix validation for rustc_allow_const_fn_unstable targets
The validation was introduced in 3a63bf0 without strict validation of functions, e. g. all function types were allowed. Now the validation only allows `const fn`s.
Configuration menu - View commit details
-
Copy full SHA for ac2c599 - Browse repository at this point
Copy the full SHA ac2c599View commit details
Commits on Oct 24, 2020
-
Link to cargo's
build-std
feature instead ofxargo
in custom targ……et docs The `xargo` tool is in maintenance mode since 2018 and the `build-std` feature of cargo already works reasonably well for most use cases.
Configuration menu - View commit details
-
Copy full SHA for 11a7087 - Browse repository at this point
Copy the full SHA 11a7087View commit details -
Configuration menu - View commit details
-
Copy full SHA for 3b6c4fe - Browse repository at this point
Copy the full SHA 3b6c4feView commit details -
Link directly to
#build-std
anchorCo-authored-by: Jonas Schievink <jonasschievink@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for eb5db6c - Browse repository at this point
Copy the full SHA eb5db6cView commit details -
Fix inconsistencies in handling of inert attributes on statements
When the 'early' and 'late' visitors visit an attribute target, they activate any lint attributes (e.g. `#[allow]`) that apply to it. This can affect warnings emitted on sibiling attributes. For example, the following code does not produce an `unused_attributes` for `#[inline]`, since the sibiling `#[allow(unused_attributes)]` suppressed the warning. ```rust trait Foo { #[allow(unused_attributes)] #[inline] fn first(); #[inline] #[allow(unused_attributes)] fn second(); } ``` However, we do not do this for statements - instead, the lint attributes only become active when we visit the struct nested inside `StmtKind` (e.g. `Item`). Currently, this is difficult to observe due to another issue - the `HasAttrs` impl for `StmtKind` ignores attributes for `StmtKind::Item`. As a result, the `unused_doc_comments` lint will never see attributes on item statements. This commit makes two interrelated fixes to the handling of inert (non-proc-macro) attributes on statements: * The `HasAttr` impl for `StmtKind` now returns attributes for `StmtKind::Item`, treating it just like every other `StmtKind` variant. The only place relying on the old behavior was macro which has been updated to explicitly ignore attributes on item statements. This allows the `unused_doc_comments` lint to fire for item statements. * The `early` and `late` lint visitors now activate lint attributes when invoking the callback for `Stmt`. This ensures that a lint attribute (e.g. `#[allow(unused_doc_comments)]`) can be applied to sibiling attributes on an item statement. For now, the `unused_doc_comments` lint is explicitly disabled on item statements, which preserves the current behavior. The exact locatiosn where this lint should fire are being discussed in PR rust-lang#78306
Configuration menu - View commit details
-
Copy full SHA for ac384ac - Browse repository at this point
Copy the full SHA ac384acView commit details -
Compute proper module parent during resolution
Fixes rust-lang#75982 The direct parent of a module may not be a module (e.g. `const _: () = { #[path = "foo.rs"] mod foo; };`). To find the parent of a module for purposes of resolution, we need to walk up the tree until we hit a module or a crate root.
Configuration menu - View commit details
-
Copy full SHA for 283053a - Browse repository at this point
Copy the full SHA 283053aView commit details -
Configuration menu - View commit details
-
Copy full SHA for dd683e5 - Browse repository at this point
Copy the full SHA dd683e5View commit details
Commits on Oct 25, 2020
-
Rollup merge of rust-lang#77984 - Aaron1011:fix/macro-mod-weird-paren…
…t, r=petrochenkov Compute proper module parent during resolution Fixes rust-lang#75982 The direct parent of a module may not be a module (e.g. `const _: () = { #[path = "foo.rs"] mod foo; };`). To find the parent of a module for purposes of resolution, we need to walk up the tree until we hit a module or a crate root.
Configuration menu - View commit details
-
Copy full SHA for 569d29d - Browse repository at this point
Copy the full SHA 569d29dView commit details -
Rollup merge of rust-lang#78085 - wesleywiser:mir_validation_switch_i…
…nt, r=oli-obk MIR validation should check `SwitchInt` values are valid for the type Fixes rust-lang#75440
Configuration menu - View commit details
-
Copy full SHA for dbdc61f - Browse repository at this point
Copy the full SHA dbdc61fView commit details -
Rollup merge of rust-lang#78208 - liketechnik:issue-69399, r=oli-obk
replace `#[allow_internal_unstable]` with `#[rustc_allow_const_fn_unstable]` for `const fn`s `#[allow_internal_unstable]` is currently used to side-step feature gate and stability checks. While it was originally only meant to be used only on macros, its use was expanded to `const fn`s. This pr adds stricter checks for the usage of `#[allow_internal_unstable]` (only on macros) and introduces the `#[rustc_allow_const_fn_unstable]` attribute for usage on `const fn`s. This pr does not change any of the functionality associated with the use of `#[allow_internal_unstable]` on macros or the usage of `#[rustc_allow_const_fn_unstable]` (instead of `#[allow_internal_unstable]`) on `const fn`s (see rust-lang#69399 (comment)). Note: The check for `#[rustc_allow_const_fn_unstable]` currently only validates that the attribute is used on a function, because I don't know how I would check if the function is a `const fn` at the place of the check. I therefore openend this as a 'draft pull request'. Closes rust-lang#69399 r? @oli-obk
Configuration menu - View commit details
-
Copy full SHA for 72e02b0 - Browse repository at this point
Copy the full SHA 72e02b0View commit details -
Rollup merge of rust-lang#78209 - JohnTitor:compiler-builtins, r=Amanieu
Update `compiler_builtins` to 0.1.36 So, the libc build with cargo's `build-std` feature emits a lot of warnings like: ``` warning: a method with this name may be added to the standard library in the future --> /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/compiler_builtins-0.1.35/src/int/udiv.rs:98:23 | 98 | q = n << (<$ty>::BITS - sr); | ^^^^^^^^^^^ ... 268 | udivmod_inner!(n, d, rem, u128) | ------------------------------- in this macro invocation | = warning: once this method is added to the standard library, the ambiguity may cause an error or change in behavior! = note: for more information, see issue rust-lang#48919 <rust-lang/issues/48919> = help: call with fully qualified syntax `Int::BITS(...)` to keep using the current method = help: add `#![feature(int_bits_const)]` to the crate attributes to enable `num::<impl u128>::BITS` = note: this warning originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) ``` (You can find the full log in https://github.com/rust-lang/libc/runs/1283695796?check_suite_focus=true for example.) 0.1.36 contains rust-lang/compiler-builtins#332 so this version should remove this warning. cc rust-lang/libc#1942
Configuration menu - View commit details
-
Copy full SHA for e00e611 - Browse repository at this point
Copy the full SHA e00e611View commit details -
Rollup merge of rust-lang#78276 - cutsoy:bump-backtrace, r=nagisa
Bump backtrace-rs to enable Mach-O support on iOS. Related to rust-lang/backtrace-rs#378. Fixes backtraces on iOS that were missing in Rust v1.47.0 after switching to gimli because it only enabled Mach-O support on macOS.
Configuration menu - View commit details
-
Copy full SHA for 3e017c7 - Browse repository at this point
Copy the full SHA 3e017c7View commit details -
Rollup merge of rust-lang#78320 - phil-opp:patch-5, r=GuillaumeGomez,…
…alexcrichton Link to cargo's `build-std` feature instead of `xargo` in custom target docs The `xargo` tool is in maintenance mode since 2018 and the `build-std` feature of cargo already works reasonably well for most use cases.
Configuration menu - View commit details
-
Copy full SHA for 63e48cd - Browse repository at this point
Copy the full SHA 63e48cdView commit details -
Rollup merge of rust-lang#78322 - ssomers:btree_no_min_len_at_node_le…
…vel, r=Mark-Simulacrum BTreeMap: stop mistaking node::MIN_LEN for a node level constraint Correcting rust-lang#77612 that fell into the trap of assuming that node::MIN_LEN is an imposed minimum everywhere, and trying to make it much more clear it is an offered minimum at the node level. r? @Mark-Simulacrum
Configuration menu - View commit details
-
Copy full SHA for 9085656 - Browse repository at this point
Copy the full SHA 9085656View commit details -
Rollup merge of rust-lang#78326 - Aaron1011:fix/min-stmt-lints, r=pet…
…rochenkov Split out statement attributes changes from rust-lang#78306 This is the same as PR rust-lang#78306, but `unused_doc_comments` is modified to explicitly ignore statement items (which preserves the current behavior). This shouldn't have any user-visible effects, so it can be landed without lang team discussion. --------- When the 'early' and 'late' visitors visit an attribute target, they activate any lint attributes (e.g. `#[allow]`) that apply to it. This can affect warnings emitted on sibiling attributes. For example, the following code does not produce an `unused_attributes` for `#[inline]`, since the sibiling `#[allow(unused_attributes)]` suppressed the warning. ```rust trait Foo { #[allow(unused_attributes)] #[inline] fn first(); #[inline] #[allow(unused_attributes)] fn second(); } ``` However, we do not do this for statements - instead, the lint attributes only become active when we visit the struct nested inside `StmtKind` (e.g. `Item`). Currently, this is difficult to observe due to another issue - the `HasAttrs` impl for `StmtKind` ignores attributes for `StmtKind::Item`. As a result, the `unused_doc_comments` lint will never see attributes on item statements. This commit makes two interrelated fixes to the handling of inert (non-proc-macro) attributes on statements: * The `HasAttr` impl for `StmtKind` now returns attributes for `StmtKind::Item`, treating it just like every other `StmtKind` variant. The only place relying on the old behavior was macro which has been updated to explicitly ignore attributes on item statements. This allows the `unused_doc_comments` lint to fire for item statements. * The `early` and `late` lint visitors now activate lint attributes when invoking the callback for `Stmt`. This ensures that a lint attribute (e.g. `#[allow(unused_doc_comments)]`) can be applied to sibiling attributes on an item statement. For now, the `unused_doc_comments` lint is explicitly disabled on item statements, which preserves the current behavior. The exact locatiosn where this lint should fire are being discussed in PR rust-lang#78306
Configuration menu - View commit details
-
Copy full SHA for 0a26e4b - Browse repository at this point
Copy the full SHA 0a26e4bView commit details