Skip to content
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 12 pull requests #127064

Closed
wants to merge 34 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
356027b
ast_passes/validation: update module docs
jieyouxu Apr 17, 2024
0e35216
ast_passes/validation: update attribute macro example
jieyouxu Apr 17, 2024
9aec5c5
Add test for fn pointer duplication.
cjgillot Apr 9, 2024
d223ba6
Document test.
cjgillot Apr 10, 2024
4c779d7
Mark `foo` as explicitly inline.
cjgillot May 4, 2024
11acf83
bootstrap: exclude cargo from package metadata
onur-ozkan Jun 14, 2024
457ac5d
don't fetch/sync cargo submodule by default
onur-ozkan Jun 14, 2024
8c3ebf7
refactor `tool_doc` macro in bootstrap
onur-ozkan Jun 14, 2024
51f6e68
handle cargo submodule in a lazy-load way
onur-ozkan Jun 14, 2024
ac7595f
Support for -Z patchable-function-entry
maurer Dec 12, 2023
9b0ae75
Support `#[patchable_function_entries]`
maurer Dec 12, 2023
7c56398
Updated code for changes to RFC, added additional error handling, added
nebulark May 2, 2024
d5ff4f4
Simplify `str::clone_into`
DaniPopes Jun 25, 2024
414ebea
add serde derive Serialize to stable_mir
sskeirik Jun 17, 2024
315be7d
Update browser-ui-test version to `0.18.0`
GuillaumeGomez Jun 26, 2024
0c0dfb8
Switch back `non_local_definitions` lint to allow-by-default
Urgau Jun 27, 2024
648cb16
Enable const casting for `f16` and `f128`
tgross35 Jun 13, 2024
4a11ab0
Fix Markdown tables in platform-support.md
xen0n Jun 27, 2024
3457ecc
remove unnecessary packages from `metadata::workspace_members`
onur-ozkan Jun 27, 2024
ae64514
Migrate `run-make/override-aliased-flags` to `rmake.rs`
GuillaumeGomez Jun 27, 2024
789ee88
Tighten spans for async blocks
compiler-errors Jun 27, 2024
8d246b0
Updated diagnostic messages
nebulark Jun 26, 2024
d7fd67a
Rollup merge of #123714 - cjgillot:static-fnptr, r=wesleywiser
jhpratt Jun 28, 2024
1a0d6c4
Rollup merge of #124091 - jieyouxu:ast-validation-top-level-docs, r=w…
jhpratt Jun 28, 2024
f432014
Rollup merge of #124741 - nebulark:patchable-function-entries-pr, r=e…
jhpratt Jun 28, 2024
5c5b50e
Rollup merge of #126470 - onur-ozkan:optional-cargo-submodule, r=Kobzol
jhpratt Jun 28, 2024
584715a
Rollup merge of #126963 - runtimeverification:smir_serde_derive, r=ol…
jhpratt Jun 28, 2024
c79b475
Rollup merge of #126970 - DaniPopes:simplify-str-clone_into, r=cuviper
jhpratt Jun 28, 2024
d19478b
Rollup merge of #127010 - GuillaumeGomez:update-puppeteer, r=notriddle
jhpratt Jun 28, 2024
8661f54
Rollup merge of #127015 - Urgau:non_local_def-tmp-allow, r=lqd
jhpratt Jun 28, 2024
bf1cedf
Rollup merge of #127029 - xen0n:fix-platform-support-table, r=lqd
jhpratt Jun 28, 2024
80955dd
Rollup merge of #127032 - tgross35:f16-f128-const-eval-cast, r=oli-obk
jhpratt Jun 28, 2024
0c54d77
Rollup merge of #127041 - GuillaumeGomez:run-make-override-aliased-fl…
jhpratt Jun 28, 2024
863e408
Rollup merge of #127058 - compiler-errors:tighten-async-spans, r=oli-obk
jhpratt Jun 28, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Switch back non_local_definitions lint to allow-by-default
as request T-lang is requesting some major changes in the lint inner
workings in #126768#issuecomment-2192634762
  • Loading branch information
Urgau committed Jun 27, 2024
commit 0c0dfb88eeefbbaa4c10cfa4a7f0e16541e086eb
2 changes: 1 addition & 1 deletion compiler/rustc_lint/src/non_local_def.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ declare_lint! {
/// All nested bodies (functions, enum discriminant, array length, consts) (expect for
/// `const _: Ty = { ... }` in top-level module, which is still undecided) are checked.
pub NON_LOCAL_DEFINITIONS,
Warn,
Allow,
"checks for non-local definitions",
report_in_external_macro
}
Expand Down
2 changes: 2 additions & 0 deletions tests/rustdoc-ui/doctest/non_local_defs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
//@ normalize-stderr-test: "tests/rustdoc-ui/doctest" -> "$$DIR"
//@ normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"

#![doc(test(attr(warn(non_local_definitions))))]

//! ```
//! #[macro_export]
//! macro_rules! a_macro { () => {} }
Expand Down
8 changes: 6 additions & 2 deletions tests/rustdoc-ui/doctest/non_local_defs.stderr
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
warning: non-local `macro_rules!` definition, `#[macro_export]` macro should be written at top level module
--> $DIR/non_local_defs.rs:9:1
--> $DIR/non_local_defs.rs:11:1
|
LL | macro_rules! a_macro { () => {} }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: remove the `#[macro_export]` or make this doc-test a standalone test with its own `fn main() { ... }`
= note: a `macro_rules!` definition is non-local if it is nested inside an item and has a `#[macro_export]` attribute
= note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <https://github.com/rust-lang/rust/issues/120363>
= note: `#[warn(non_local_definitions)]` on by default
note: the lint level is defined here
--> $DIR/non_local_defs.rs:8:9
|
LL | #![warn(non_local_definitions)]
| ^^^^^^^^^^^^^^^^^^^^^

warning: 1 warning emitted

2 changes: 1 addition & 1 deletion tests/rustdoc-ui/doctest/non_local_defs.stdout
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

running 1 test
test $DIR/non_local_defs.rs - (line 7) ... ok
test $DIR/non_local_defs.rs - (line 9) ... ok

test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in $TIME

2 changes: 2 additions & 0 deletions tests/ui/lint/non-local-defs/cargo-update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
// of the `cargo update` suggestion we assert it here.
//@ error-pattern: `cargo update -p non_local_macro`

#![warn(non_local_definitions)]

extern crate non_local_macro;

struct LocalStruct;
Expand Down
8 changes: 6 additions & 2 deletions tests/ui/lint/non-local-defs/cargo-update.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item
--> $DIR/cargo-update.rs:17:1
--> $DIR/cargo-update.rs:19:1
|
LL | non_local_macro::non_local_impl!(LocalStruct);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand All @@ -14,7 +14,11 @@ LL | non_local_macro::non_local_impl!(LocalStruct);
= note: an `impl` is never scoped, even when it is nested inside an item, as it may impact type checking outside of that item, which can be the case if neither the trait or the self type are at the same nesting level as the `impl`
= note: items in an anonymous const item (`const _: () = { ... }`) are treated as in the same scope as the anonymous const's declaration for the purpose of this lint
= note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <https://github.com/rust-lang/rust/issues/120363>
= note: `#[warn(non_local_definitions)]` on by default
note: the lint level is defined here
--> $DIR/cargo-update.rs:13:9
|
LL | #![warn(non_local_definitions)]
| ^^^^^^^^^^^^^^^^^^^^^
= note: this warning originates in the macro `non_local_macro::non_local_impl` (in Nightly builds, run with -Z macro-backtrace for more info)

warning: 1 warning emitted
Expand Down
2 changes: 2 additions & 0 deletions tests/ui/lint/non-local-defs/consts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
//@ edition:2021
//@ rustc-env:CARGO_CRATE_NAME=non_local_def

#![warn(non_local_definitions)]

struct Test;

trait Uto {}
Expand Down
22 changes: 13 additions & 9 deletions tests/ui/lint/non-local-defs/consts.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item
--> $DIR/consts.rs:13:5
--> $DIR/consts.rs:15:5
|
LL | const Z: () = {
| -----------
Expand All @@ -17,10 +17,14 @@ LL | impl Uto for &Test {}
= note: an `impl` is never scoped, even when it is nested inside an item, as it may impact type checking outside of that item, which can be the case if neither the trait or the self type are at the same nesting level as the `impl`
= note: items in an anonymous const item (`const _: () = { ... }`) are treated as in the same scope as the anonymous const's declaration for the purpose of this lint
= note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <https://github.com/rust-lang/rust/issues/120363>
= note: `#[warn(non_local_definitions)]` on by default
note: the lint level is defined here
--> $DIR/consts.rs:5:9
|
LL | #![warn(non_local_definitions)]
| ^^^^^^^^^^^^^^^^^^^^^

warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item
--> $DIR/consts.rs:24:5
--> $DIR/consts.rs:26:5
|
LL | static A: u32 = {
| ------------- move the `impl` block outside of this static `A`
Expand All @@ -36,7 +40,7 @@ LL | impl Uto2 for Test {}
= note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <https://github.com/rust-lang/rust/issues/120363>

warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item
--> $DIR/consts.rs:32:5
--> $DIR/consts.rs:34:5
|
LL | const B: u32 = {
| ------------ move the `impl` block outside of this constant `B`
Expand All @@ -52,7 +56,7 @@ LL | impl Uto3 for Test {}
= note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <https://github.com/rust-lang/rust/issues/120363>

warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item
--> $DIR/consts.rs:43:5
--> $DIR/consts.rs:45:5
|
LL | fn main() {
| --------- move the `impl` block outside of this function `main`
Expand All @@ -65,7 +69,7 @@ LL | impl Test {
= note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <https://github.com/rust-lang/rust/issues/120363>

warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item
--> $DIR/consts.rs:50:9
--> $DIR/consts.rs:52:9
|
LL | const {
| ___________-
Expand All @@ -84,7 +88,7 @@ LL | | };
= note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <https://github.com/rust-lang/rust/issues/120363>

warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item
--> $DIR/consts.rs:59:9
--> $DIR/consts.rs:61:9
|
LL | const _: u32 = {
| ------------ move the `impl` block outside of this constant `_` and up 2 bodies
Expand All @@ -98,7 +102,7 @@ LL | impl Test {
= note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <https://github.com/rust-lang/rust/issues/120363>

warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item
--> $DIR/consts.rs:72:9
--> $DIR/consts.rs:74:9
|
LL | let _a = || {
| -- move the `impl` block outside of this closure `<unnameable>` and up 2 bodies
Expand All @@ -113,7 +117,7 @@ LL | impl Uto9 for Test {}
= note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <https://github.com/rust-lang/rust/issues/120363>

warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item
--> $DIR/consts.rs:79:9
--> $DIR/consts.rs:81:9
|
LL | type A = [u32; {
| ____________________-
Expand Down
2 changes: 2 additions & 0 deletions tests/ui/lint/non-local-defs/exhaustive-trait.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
//@ check-pass
//@ edition:2021

#![warn(non_local_definitions)]

struct Dog;

fn main() {
Expand Down
18 changes: 11 additions & 7 deletions tests/ui/lint/non-local-defs/exhaustive-trait.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item
--> $DIR/exhaustive-trait.rs:7:5
--> $DIR/exhaustive-trait.rs:9:5
|
LL | fn main() {
| --------- move the `impl` block outside of this function `main`
Expand All @@ -12,10 +12,14 @@ LL | impl PartialEq<()> for Dog {
= note: `impl` may be usable in bounds, etc. from outside the expression, which might e.g. make something constructible that previously wasn't, because it's still on a publicly-visible type
= note: an `impl` is never scoped, even when it is nested inside an item, as it may impact type checking outside of that item, which can be the case if neither the trait or the self type are at the same nesting level as the `impl`
= note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <https://github.com/rust-lang/rust/issues/120363>
= note: `#[warn(non_local_definitions)]` on by default
note: the lint level is defined here
--> $DIR/exhaustive-trait.rs:4:9
|
LL | #![warn(non_local_definitions)]
| ^^^^^^^^^^^^^^^^^^^^^

warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item
--> $DIR/exhaustive-trait.rs:14:5
--> $DIR/exhaustive-trait.rs:16:5
|
LL | fn main() {
| --------- move the `impl` block outside of this function `main`
Expand All @@ -31,7 +35,7 @@ LL | impl PartialEq<()> for &Dog {
= note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <https://github.com/rust-lang/rust/issues/120363>

warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item
--> $DIR/exhaustive-trait.rs:21:5
--> $DIR/exhaustive-trait.rs:23:5
|
LL | fn main() {
| --------- move the `impl` block outside of this function `main`
Expand All @@ -47,7 +51,7 @@ LL | impl PartialEq<Dog> for () {
= note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <https://github.com/rust-lang/rust/issues/120363>

warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item
--> $DIR/exhaustive-trait.rs:28:5
--> $DIR/exhaustive-trait.rs:30:5
|
LL | fn main() {
| --------- move the `impl` block outside of this function `main`
Expand All @@ -63,7 +67,7 @@ LL | impl PartialEq<&Dog> for () {
= note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <https://github.com/rust-lang/rust/issues/120363>

warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item
--> $DIR/exhaustive-trait.rs:35:5
--> $DIR/exhaustive-trait.rs:37:5
|
LL | fn main() {
| --------- move the `impl` block outside of this function `main`
Expand All @@ -79,7 +83,7 @@ LL | impl PartialEq<Dog> for &Dog {
= note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <https://github.com/rust-lang/rust/issues/120363>

warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item
--> $DIR/exhaustive-trait.rs:42:5
--> $DIR/exhaustive-trait.rs:44:5
|
LL | fn main() {
| --------- move the `impl` block outside of this function `main`
Expand Down
2 changes: 2 additions & 0 deletions tests/ui/lint/non-local-defs/exhaustive.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
//@ check-pass
//@ edition:2021

#![warn(non_local_definitions)]

use std::fmt::Display;

trait Trait {}
Expand Down
Loading
Loading