-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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 #106177 - matthiaskrgr:rollup-oe7z8ix, r=matthiaskrgr
Rollup of 4 pull requests Successful merges: - #105515 (Account for macros in const generics) - #106146 (Readme: update section on how to run `x.py`) - #106150 (Detect when method call on LHS might be shadowed) - #106174 (Remove unused empty CSS rules in ayu theme) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
- Loading branch information
Showing
12 changed files
with
306 additions
and
27 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// build-pass | ||
pub fn foo<const BAR: bool> () {} | ||
|
||
fn main() { | ||
foo::<{cfg!(feature = "foo")}>(); | ||
} |
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,23 @@ | ||
#![allow(unused)] | ||
|
||
struct X { | ||
x: (), | ||
} | ||
pub trait A { | ||
fn foo(&mut self, _: usize) -> &mut (); | ||
} | ||
impl A for X { | ||
fn foo(&mut self, _: usize) -> &mut () { | ||
&mut self.x | ||
} | ||
} | ||
impl X { | ||
fn foo(&mut self, _: usize) -> &mut Self { | ||
self | ||
} | ||
} | ||
|
||
fn main() { | ||
let mut x = X { x: () }; | ||
*x.foo(0) = (); //~ ERROR E0308 | ||
} |
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,25 @@ | ||
error[E0308]: mismatched types | ||
--> $DIR/shadowed-lplace-method-2.rs:22:17 | ||
| | ||
LL | *x.foo(0) = (); | ||
| --------- ^^ expected struct `X`, found `()` | ||
| | | ||
| expected due to the type of this binding | ||
| | ||
note: the `foo` call is resolved to the method in `X`, shadowing the method of the same name on trait `A` | ||
--> $DIR/shadowed-lplace-method-2.rs:22:8 | ||
| | ||
LL | *x.foo(0) = (); | ||
| ^^^ refers to `X::foo` | ||
help: you might have meant to call the other method; you can use the fully-qualified path to call it explicitly | ||
| | ||
LL | *<_ as A>::foo(&mut x, 0) = (); | ||
| ++++++++++++++++++ ~ | ||
help: try wrapping the expression in `X` | ||
| | ||
LL | *x.foo(0) = X { x: () }; | ||
| ++++++ + | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0308`. |
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,10 @@ | ||
// run-rustfix | ||
#![allow(unused_imports)] | ||
use std::borrow::BorrowMut; | ||
use std::cell::RefCell; | ||
use std::rc::Rc; | ||
|
||
fn main() { | ||
let rc = Rc::new(RefCell::new(true)); | ||
*std::cell::RefCell::<_>::borrow_mut(&rc) = false; //~ ERROR E0308 | ||
} |
Oops, something went wrong.