Auto merge of #108357 - matthiaskrgr:rollup-ceo3q2s, r=matthiaskrgr
Rollup of 6 pull requests Successful merges: - #107736 ( Rename atomic 'as_mut_ptr' to 'as_ptr' to match Cell (ref #66893) ) - #108176 (Don't delay `ReError` bug during lexical region resolve) - #108315 (Lint dead code in closures and generators) - #108342 (apply query response: actually define opaque types) - #108344 (Fix test filename for #105700) - #108353 (resolve: Remove `ImportResolver`) Failed merges: - #107911 (Add check for invalid #[macro_export] arguments) r? `@ghost` `@rustbot` modify labels: rollup
This commit is contained in:
commit
da439d9874
15 changed files with 179 additions and 121 deletions
16
tests/ui/lint/dead-code/in-closure.rs
Normal file
16
tests/ui/lint/dead-code/in-closure.rs
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
// edition: 2021
|
||||
|
||||
#![deny(dead_code)]
|
||||
|
||||
pub fn foo() {
|
||||
let closure = || {
|
||||
fn a() {} //~ ERROR function `a` is never used
|
||||
};
|
||||
closure()
|
||||
}
|
||||
|
||||
pub async fn async_foo() {
|
||||
const A: usize = 1; //~ ERROR constant `A` is never used
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
20
tests/ui/lint/dead-code/in-closure.stderr
Normal file
20
tests/ui/lint/dead-code/in-closure.stderr
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
error: function `a` is never used
|
||||
--> $DIR/in-closure.rs:7:12
|
||||
|
|
||||
LL | fn a() {}
|
||||
| ^
|
||||
|
|
||||
note: the lint level is defined here
|
||||
--> $DIR/in-closure.rs:3:9
|
||||
|
|
||||
LL | #![deny(dead_code)]
|
||||
| ^^^^^^^^^
|
||||
|
||||
error: constant `A` is never used
|
||||
--> $DIR/in-closure.rs:13:11
|
||||
|
|
||||
LL | const A: usize = 1;
|
||||
| ^
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
|
|
@ -1,10 +1,10 @@
|
|||
error: recursion limit reached while expanding `#[invalid_attribute]`
|
||||
--> $DIR/issue_21102.rs:6:1
|
||||
--> $DIR/issue-105700.rs:6:1
|
||||
|
|
||||
LL | #![invalid_attribute]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= help: consider increasing the recursion limit by adding a `#![recursion_limit = "8"]` attribute to your crate (`issue_21102`)
|
||||
= help: consider increasing the recursion limit by adding a `#![recursion_limit = "8"]` attribute to your crate (`issue_105700`)
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
22
tests/ui/regions/resolve-re-error-ice.rs
Normal file
22
tests/ui/regions/resolve-re-error-ice.rs
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
// check-pass
|
||||
|
||||
// Allow this for now, can remove this UI test when this becomes a hard error.
|
||||
#![allow(implied_bounds_entailment)]
|
||||
|
||||
use std::collections::hash_map::{Keys, HashMap};
|
||||
use std::marker::PhantomData;
|
||||
|
||||
trait MapAssertion<'a, K, V, R> {
|
||||
fn key_set(&self) -> Subject<Keys<K, V>, (), R>;
|
||||
}
|
||||
|
||||
struct Subject<'a, T, V, R>(PhantomData<(&'a T, V, R)>);
|
||||
|
||||
impl<'a, K, V, R> MapAssertion<'a, K, V, R> for Subject<'a, HashMap<K, V>, (), R>
|
||||
{
|
||||
fn key_set(&self) -> Subject<'a, Keys<K, V>, (), R> {
|
||||
todo!()
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
15
tests/ui/regions/resolve-re-error-ice.stderr
Normal file
15
tests/ui/regions/resolve-re-error-ice.stderr
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
Future incompatibility report: Future breakage diagnostic:
|
||||
warning: impl method assumes more implied bounds than the corresponding trait method
|
||||
--> $DIR/resolve-re-error-ice.rs:17:16
|
||||
|
|
||||
LL | fn key_set(&self) -> Subject<'a, Keys<K, V>, (), R> {
|
||||
| ^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace this type to make the impl signature compatible: `Subject<'_, std::collections::hash_map::Keys<'_, K, V>, (), R>`
|
||||
|
|
||||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
||||
= note: for more information, see issue #105572 <https://github.com/rust-lang/rust/issues/105572>
|
||||
note: the lint level is defined here
|
||||
--> $DIR/resolve-re-error-ice.rs:4:10
|
||||
|
|
||||
LL | #![allow(implied_bounds_entailment)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue