Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
64839ee
Add Pin::new_static.
m-ou-se Oct 8, 2020
390883e
Make Pin::new_static const.
m-ou-se Oct 8, 2020
104c0f0
Rename Pin::new_static to Pin::static_ref.
m-ou-se Oct 12, 2020
2c71f68
Add Pin::static_mut.
m-ou-se Oct 12, 2020
f83446b
Reword safety guarantee of Pin::static_{ref,mut}.
m-ou-se Oct 13, 2020
df95dce
Add missing `mut`.
m-ou-se Oct 15, 2020
7b652d3
Haiku: explicitly set CMAKE_SYSTEM_NAME when cross-compiling
nielx Sep 19, 2020
cc0b718
Mark inout asm! operands as used in liveness pass
oliviacrain Oct 15, 2020
fd193f2
Treat InOut variables like other input variables
oliviacrain Oct 17, 2020
7b33ae6
Improve wording of "cannot multiply" type error
camelid Oct 18, 2020
003516f
BTreeMap: split off most code of remove and split_off
ssomers Oct 17, 2020
48060f1
rustdoc: Show the correct source filename, without `.html`
camelid Oct 19, 2020
17c6c59
Mark InOut operands as used in RWU table with write_place
oliviacrain Oct 19, 2020
8f0bced
Refactor liveness-issue-77915 to liveness-asm and improve tests
oliviacrain Oct 19, 2020
cb33f95
remove what seems to be an outdated comment
RalfJung Oct 19, 2020
c1766c6
fix static_ptr_ty for foreign statics, and more comments in check_uns…
RalfJung Oct 19, 2020
153e843
fix Rvalue::ty for ThreadLocalRef
RalfJung Oct 19, 2020
9dd0bb6
Do not print braces again print_anon_const already does it
spastorino Oct 19, 2020
d641cb8
Allow NtBlock to parse on check inline const next token
spastorino Oct 19, 2020
dcd2d91
Add inline const macro test
spastorino Oct 19, 2020
243c8e9
Apply some review suggestions
camelid Oct 20, 2020
154acf0
Rollup merge of #77726 - fusion-engineering-forks:static-pin, r=dtolnay
JohnTitor Oct 21, 2020
983299f
Rollup merge of #77976 - oliviacrain:issue-77915-fix, r=matthewjasper
JohnTitor Oct 21, 2020
ec025ba
Rollup merge of #78009 - nielx:fix/CMAKE_SYSTEM_NAME, r=Mark-Simulacrum
JohnTitor Oct 21, 2020
1e9e561
Rollup merge of #78056 - ssomers:btree_chop_up_1, r=dtolnay
JohnTitor Oct 21, 2020
76da0e2
Rollup merge of #78063 - camelid:improve-cannot-multiply-error, r=est…
JohnTitor Oct 21, 2020
0d3f068
Rollup merge of #78094 - camelid:rustdoc-fix-source-title, r=jyn514
JohnTitor Oct 21, 2020
dbb36ab
Rollup merge of #78101 - RalfJung:foreign-static, r=oli-obk
JohnTitor Oct 21, 2020
34c2223
Rollup merge of #78118 - spastorino:inline-const-followups, r=petroch…
JohnTitor Oct 21, 2020
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
Refactor liveness-issue-77915 to liveness-asm and improve tests
  • Loading branch information
oliviacrain committed Oct 19, 2020
commit 8f0bceda13ac871dd452841d3b6aa049f9f649a1
43 changes: 43 additions & 0 deletions src/test/ui/liveness/liveness-asm.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
// Ensure inout asm! operands are marked as used by the liveness pass

// check-pass

#![feature(asm)]
#![allow(dead_code)]
#![warn(unused_assignments)]
#![warn(unused_variables)]

// Test the single inout case
unsafe fn f1(mut src: *const u8) {
asm!("/*{0}*/", inout(reg) src); //~ WARN value assigned to `src` is never read
}

unsafe fn f2(mut src: *const u8) -> *const u8 {
asm!("/*{0}*/", inout(reg) src);
src
}

// Test the split inout case
unsafe fn f3(mut src: *const u8) {
asm!("/*{0}*/", inout(reg) src => src); //~ WARN value assigned to `src` is never read
}

unsafe fn f4(mut src: *const u8) -> *const u8 {
asm!("/*{0}*/", inout(reg) src => src);
src
}

// Tests the use of field projections
struct S {
field: *mut u8,
}

unsafe fn f5(src: &mut S) {
asm!("/*{0}*/", inout(reg) src.field);
}

unsafe fn f6(src: &mut S) {
asm!("/*{0}*/", inout(reg) src.field => src.field);
}

fn main() {}
23 changes: 23 additions & 0 deletions src/test/ui/liveness/liveness-asm.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
warning: value assigned to `src` is never read
--> $DIR/liveness-asm.rs:12:32
|
LL | asm!("/*{0}*/", inout(reg) src);
| ^^^
|
note: the lint level is defined here
--> $DIR/liveness-asm.rs:7:9
|
LL | #![warn(unused_assignments)]
| ^^^^^^^^^^^^^^^^^^
= help: maybe it is overwritten before being read?

warning: value assigned to `src` is never read
--> $DIR/liveness-asm.rs:22:39
|
LL | asm!("/*{0}*/", inout(reg) src => src);
| ^^^
|
= help: maybe it is overwritten before being read?

warning: 2 warnings emitted

36 changes: 0 additions & 36 deletions src/test/ui/liveness/liveness-issue-77915.rs

This file was deleted.