-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #112344 - matthiaskrgr:rollup-tswr83e, r=matthiaskrgr
Rollup of 7 pull requests Successful merges: - #111058 (Correct fortanix LVI test print function) - #111369 (Added custom risc32-imac for esp-espidf target) - #111962 (Make GDB Python Pretty Printers loadable after spawning GDB, avoiding required `rust-gdb`) - #112019 (Don't suggest changing `&self` and `&mut self` in function signature to be mutable when taking `&mut self` in closure) - #112199 (Fix suggestion for matching struct with `..` on both ends) - #112220 (Cleanup some `EarlyBinder::skip_binder()` -> `EarlyBinder::subst_identity()`) - #112325 (diagnostics: do not suggest type name tweaks on type-inferred closure args) r? `@ghost` `@rustbot` modify labels: rollup
- Loading branch information
Showing
24 changed files
with
320 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
use crate::spec::{cvs, PanicStrategy, RelocModel, Target, TargetOptions}; | ||
|
||
pub fn target() -> Target { | ||
Target { | ||
data_layout: "e-m:e-p:32:32-i64:64-n32-S128".into(), | ||
llvm_target: "riscv32".into(), | ||
pointer_width: 32, | ||
arch: "riscv32".into(), | ||
|
||
options: TargetOptions { | ||
families: cvs!["unix"], | ||
os: "espidf".into(), | ||
env: "newlib".into(), | ||
vendor: "espressif".into(), | ||
linker: Some("riscv32-esp-elf-gcc".into()), | ||
cpu: "generic-rv32".into(), | ||
|
||
// As RiscV32IMAC architecture does natively support atomics, | ||
// automatically enable the support for the Rust STD library. | ||
max_atomic_width: Some(64), | ||
atomic_cas: true, | ||
|
||
features: "+m,+a,+c".into(), | ||
panic_strategy: PanicStrategy::Abort, | ||
relocation_model: RelocModel::Static, | ||
emit_debug_gdb_scripts: false, | ||
eh_frame_header: false, | ||
..Default::default() | ||
}, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,14 @@ | ||
# Add this folder to the python sys path; GDB Python-interpreter will now find modules in this path | ||
import sys | ||
from os import path | ||
self_dir = path.dirname(path.realpath(__file__)) | ||
sys.path.append(self_dir) | ||
|
||
import gdb | ||
import gdb_lookup | ||
gdb_lookup.register_printers(gdb.current_objfile()) | ||
|
||
# current_objfile can be none; even with `gdb foo-app`; sourcing this file after gdb init now works | ||
try: | ||
gdb_lookup.register_printers(gdb.current_objfile()) | ||
except Exception: | ||
gdb_lookup.register_printers(gdb.selected_inferior().progspace) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
CHECK: print | ||
CHECK: lfence | ||
CHECK: lfence | ||
CHECK: lfence | ||
CHECK: callq 0x{{[[:xdigit:]]*}} <_Unwind_Resume> | ||
CHECK-NEXT: ud2 | ||
CHECK: popq | ||
CHECK-NEXT: popq [[REGISTER:%[a-z]+]] | ||
CHECK-NEXT: lfence | ||
CHECK-NEXT: jmpq *[[REGISTER]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
struct Foo {} | ||
|
||
impl Foo { | ||
pub fn foo(&mut self) { | ||
|| bar(&mut self); | ||
//~^ ERROR cannot borrow `self` as mutable, as it is not declared as mutable | ||
} | ||
|
||
pub fn baz(&self) { | ||
|| bar(&mut self); | ||
//~^ ERROR cannot borrow `self` as mutable, as it is not declared as mutable | ||
//~| ERROR cannot borrow data in a `&` reference as mutable | ||
} | ||
|
||
pub fn qux(mut self) { | ||
|| bar(&mut self); | ||
// OK | ||
} | ||
|
||
pub fn quux(self) { | ||
|| bar(&mut self); | ||
//~^ ERROR cannot borrow `self` as mutable, as it is not declared as mutable | ||
} | ||
} | ||
|
||
fn bar(_: &mut Foo) {} | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
error[E0596]: cannot borrow `self` as mutable, as it is not declared as mutable | ||
--> $DIR/issue-111554.rs:5:16 | ||
| | ||
LL | || bar(&mut self); | ||
| ^^^^^^^^^ cannot borrow as mutable | ||
|
||
error[E0596]: cannot borrow `self` as mutable, as it is not declared as mutable | ||
--> $DIR/issue-111554.rs:10:16 | ||
| | ||
LL | || bar(&mut self); | ||
| ^^^^^^^^^ cannot borrow as mutable | ||
|
||
error[E0596]: cannot borrow data in a `&` reference as mutable | ||
--> $DIR/issue-111554.rs:10:16 | ||
| | ||
LL | || bar(&mut self); | ||
| ^^^^^^^^^ cannot borrow as mutable | ||
|
||
error[E0596]: cannot borrow `self` as mutable, as it is not declared as mutable | ||
--> $DIR/issue-111554.rs:21:16 | ||
| | ||
LL | pub fn quux(self) { | ||
| ---- help: consider changing this to be mutable: `mut self` | ||
LL | || bar(&mut self); | ||
| ^^^^^^^^^ cannot borrow as mutable | ||
|
||
error: aborting due to 4 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0596`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
trait Foo: std::fmt::Debug {} | ||
|
||
fn print_foos(foos: impl Iterator<Item = dyn Foo>) { | ||
foos.for_each(|foo| { //~ ERROR [E0277] | ||
println!("{:?}", foo); //~ ERROR [E0277] | ||
}); | ||
} | ||
|
||
fn main() {} |
Oops, something went wrong.