forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 7
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 rust-lang#112013 - matthiaskrgr:rollup-a4pg2p8, r=matth…
…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#111714 (Stop confusing specification levels when computing expectations.) - rust-lang#111927 (Migrate `item_static` to Askama) - rust-lang#111954 (improve error message for calling a method on a raw pointer with an unknown pointee) - rust-lang#111973 (Update current implementation comments for `select_nth_unstable`) - rust-lang#111976 (Generate docs for bootstrap itself) - rust-lang#111977 (Make errors from `x doc` less verbose) - rust-lang#111987 (do not prefer substs relate during coherence) - rust-lang#111991 (Change ty and const error's pretty printing to be in braces) r? `@ghost` `@rustbot` modify labels: rollup
- Loading branch information
Showing
23 changed files
with
142 additions
and
46 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
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
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
7 changes: 7 additions & 0 deletions
7
tests/ui/lint/rfc-2383-lint-reason/root-attribute-confusion.rs
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,7 @@ | ||
// check-pass | ||
// compile-flags: -Dunused_attributes | ||
|
||
#![deny(unused_crate_dependencies)] | ||
#![feature(lint_reasons)] | ||
|
||
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,28 @@ | ||
// edition: 2018 | ||
|
||
// tests that the pointee type of a raw pointer must be known to call methods on it | ||
// see also: `tests/ui/editions/edition-raw-pointer-method-2018.rs` | ||
|
||
fn main() { | ||
let val = 1_u32; | ||
let ptr = &val as *const u32; | ||
unsafe { | ||
let _a: i32 = (ptr as *const _).read(); | ||
//~^ ERROR cannot call a method on a raw pointer with an unknown pointee type [E0699] | ||
let b = ptr as *const _; | ||
let _b: u8 = b.read(); | ||
//~^ ERROR cannot call a method on a raw pointer with an unknown pointee type [E0699] | ||
let _c = (ptr as *const u8).read(); // we know the type here | ||
} | ||
|
||
let mut val = 2_u32; | ||
let ptr = &mut val as *mut u32; | ||
unsafe { | ||
let _a: i32 = (ptr as *mut _).read(); | ||
//~^ ERROR cannot call a method on a raw pointer with an unknown pointee type [E0699] | ||
let b = ptr as *mut _; | ||
b.write(10); | ||
//~^ ERROR cannot call a method on a raw pointer with an unknown pointee type [E0699] | ||
(ptr as *mut i32).write(1000); // we know the type here | ||
} | ||
} |
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,27 @@ | ||
error[E0699]: cannot call a method on a raw pointer with an unknown pointee type | ||
--> $DIR/call_method_unknown_pointee.rs:10:41 | ||
| | ||
LL | let _a: i32 = (ptr as *const _).read(); | ||
| ^^^^ | ||
|
||
error[E0699]: cannot call a method on a raw pointer with an unknown pointee type | ||
--> $DIR/call_method_unknown_pointee.rs:13:24 | ||
| | ||
LL | let _b: u8 = b.read(); | ||
| ^^^^ | ||
|
||
error[E0699]: cannot call a method on a raw pointer with an unknown pointee type | ||
--> $DIR/call_method_unknown_pointee.rs:21:39 | ||
| | ||
LL | let _a: i32 = (ptr as *mut _).read(); | ||
| ^^^^ | ||
|
||
error[E0699]: cannot call a method on a raw pointer with an unknown pointee type | ||
--> $DIR/call_method_unknown_pointee.rs:24:11 | ||
| | ||
LL | b.write(10); | ||
| ^^^^^ | ||
|
||
error: aborting due to 4 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0699`. |
Oops, something went wrong.