Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 10 pull requests #70109

Closed
wants to merge 58 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
a113609
keyword docs for else and inkeyword docs for else and in.
gilescope Dec 30, 2019
57f1bb1
clean up E0308 explanation
GuillaumeGomez Feb 13, 2020
64460a1
Update tests
GuillaumeGomez Mar 8, 2020
f5efb68
miri: categorize errors into "unsupported" and "UB"
RalfJung Mar 8, 2020
d02543a
fmt, tweak messages and bless
RalfJung Mar 8, 2020
9a95b01
generalize InvalidNullPointerUsage to InvalidIntPointerUsage
RalfJung Mar 8, 2020
3ebcd78
fmt, and fix rustfmt-induced rebase hickup
RalfJung Mar 8, 2020
2764d3d
start Miri messages lower-case
RalfJung Mar 9, 2020
3e61442
explain why we catch PointerUseAfterFree
RalfJung Mar 9, 2020
d8f8168
avoid boolean inversion
RalfJung Mar 9, 2020
9681422
we are on 2018 edition, use try block
RalfJung Mar 9, 2020
93436d8
make error message less confusing
RalfJung Mar 9, 2020
e219dd4
fmt
RalfJung Mar 11, 2020
b2779d8
Use smaller discriminants for generators
jonas-schievink Mar 9, 2020
4266807
Add a test for generator discriminants
jonas-schievink Mar 9, 2020
49aabd8
Fix rebase fallout
jonas-schievink Mar 14, 2020
5a9ccc9
Remove `free_region_map` from `TypeckTables`
matthewjasper Nov 30, 2019
cefd030
Don't use `TypeckTables` in NiceRegionError
matthewjasper Feb 15, 2020
0a7f16e
Erase regions in writeback
matthewjasper Feb 15, 2020
1ee5829
Update tests for erasing regions in typeck
matthewjasper Feb 15, 2020
3314a34
Don't unwind when hitting the macro expansion recursion limit
Zoxc Feb 26, 2020
bdaf9e4
Update test
Zoxc Feb 29, 2020
aa20d96
Don't prepend with space before paren
GuillaumeGomez Mar 17, 2020
429b16e
Make `newtype_index` methods const
ecstatic-morse Mar 10, 2020
7f5a284
Rename `from_u32_const` -> `from_u32`
ecstatic-morse Mar 10, 2020
cc4a577
Add requisite feature gates for const assert
ecstatic-morse Mar 10, 2020
9ac93ee
Hold index of generator `self` arg in `const`
ecstatic-morse Mar 10, 2020
81172d8
Update pretty tests
GuillaumeGomez Mar 17, 2020
9a017da
Update rustdoc test and remove TODO comment
GuillaumeGomez Mar 17, 2020
548b182
Prevent stack overflow for deeply recursive code
oli-obk Nov 2, 2018
6c25307
Add `psm` to the crate whitelist
oli-obk Nov 26, 2019
410cdd7
Set the default stack size to 8MB
nagisa Feb 23, 2020
fb10e5c
Resolve some review comments
nagisa Mar 14, 2020
bb9f14c
rustc_expand::base: nix panictry! uses
Centril Mar 17, 2020
a57ccf7
nix panictry! in ParserAnyMacro::make
Centril Mar 17, 2020
1b8331b
nix remaining rustc_expand::panictry! uses.
Centril Mar 17, 2020
3c71f70
generic_extension: defatalize Error case
Centril Mar 17, 2020
76c5a4f
defatalize BangProcMacro::expand
Centril Mar 17, 2020
4bea03d
defatalize AttrProcMacro::expand
Centril Mar 17, 2020
a98ea5a
defatalize ProcMacroDerive::expand
Centril Mar 17, 2020
576c7c9
remove ExtCxt::struct_span_warn
Centril Mar 17, 2020
8dddaed
mbe::transcribe: defatalize errors.
Centril Mar 17, 2020
ad5304a
defatalize `compile_declarative_macro`
Centril Mar 17, 2020
de6e144
expand: nix unused method
Centril Mar 17, 2020
c440890
defatalize get_test_runner
Centril Mar 17, 2020
5a42b65
defatalize expand_test_or_bench
Centril Mar 17, 2020
83313e4
expand: add recovery for parse_nt
Centril Mar 17, 2020
7d38b0f
expand: address review comments
Centril Mar 18, 2020
d6e0e11
Rollup merge of #55617 - oli-obk:stacker, r=oli-obk,nagisa
Centril Mar 18, 2020
2b2dda1
Rollup merge of #67749 - gilescope:keyword-in, r=Dylan-DPC
Centril Mar 18, 2020
af6af30
Rollup merge of #69139 - GuillaumeGomez:cleanup-e0308, r=Dylan-DPC
Centril Mar 18, 2020
1dfc89b
Rollup merge of #69189 - matthewjasper:erase-the-world, r=nikomatsakis
Centril Mar 18, 2020
ee3336f
Rollup merge of #69497 - Zoxc:ast-fragment-error, r=petrochenkov
Centril Mar 18, 2020
4e0bd1b
Rollup merge of #69837 - jonas-schievink:gen-discr-opt, r=tmandry
Centril Mar 18, 2020
f1af774
Rollup merge of #69839 - RalfJung:miri-error-cleanup, r=oli-obk
Centril Mar 18, 2020
fc69654
Rollup merge of #69899 - ecstatic-morse:const-idx-methods, r=oli-obk
Centril Mar 18, 2020
9318ffa
Rollup merge of #70074 - Centril:unpanictry, r=petrochenkov
Centril Mar 18, 2020
73f7c43
Rollup merge of #70075 - GuillaumeGomez:fix-repr-display, r=petrochenkov
Centril Mar 18, 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
make error message less confusing
  • Loading branch information
RalfJung committed Mar 11, 2020
commit 93436d8fd76d04f0d25ade71eec2ed480af3f404
4 changes: 2 additions & 2 deletions src/librustc/mir/interpret/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -485,8 +485,8 @@ impl fmt::Debug for UnsupportedOpInfo {
initializer"
),

ReadPointerAsBytes => write!(f, "unable to turn this pointer into raw bytes",),
ReadBytesAsPointer => write!(f, "unable to turn these bytes into a pointer"),
ReadPointerAsBytes => write!(f, "unable to turn pointer into raw bytes",),
ReadBytesAsPointer => write!(f, "unable to turn bytes into a pointer"),
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ error: any use of this value will cause an error
LL | const I32_REF_U8_UNION: u8 = unsafe { Nonsense { int_32_ref: &3 }.uint_8 };
| --------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
| |
| unable to turn this pointer into raw bytes
| unable to turn pointer into raw bytes
|
= note: `#[deny(const_err)]` on by default

Expand All @@ -22,15 +22,15 @@ error: any use of this value will cause an error
LL | const I32_REF_U16_UNION: u16 = unsafe { Nonsense { int_32_ref: &3 }.uint_16 };
| ----------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
| |
| unable to turn this pointer into raw bytes
| unable to turn pointer into raw bytes

error: any use of this value will cause an error
--> $DIR/const-pointer-values-in-various-types.rs:34:45
|
LL | const I32_REF_U32_UNION: u32 = unsafe { Nonsense { int_32_ref: &3 }.uint_32 };
| ----------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
| |
| unable to turn this pointer into raw bytes
| unable to turn pointer into raw bytes

error[E0080]: it is undefined behavior to use this value
--> $DIR/const-pointer-values-in-various-types.rs:37:5
Expand All @@ -54,23 +54,23 @@ error: any use of this value will cause an error
LL | const I32_REF_I8_UNION: i8 = unsafe { Nonsense { int_32_ref: &3 }.int_8 };
| --------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
| |
| unable to turn this pointer into raw bytes
| unable to turn pointer into raw bytes

error: any use of this value will cause an error
--> $DIR/const-pointer-values-in-various-types.rs:46:45
|
LL | const I32_REF_I16_UNION: i16 = unsafe { Nonsense { int_32_ref: &3 }.int_16 };
| ----------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
| |
| unable to turn this pointer into raw bytes
| unable to turn pointer into raw bytes

error: any use of this value will cause an error
--> $DIR/const-pointer-values-in-various-types.rs:49:45
|
LL | const I32_REF_I32_UNION: i32 = unsafe { Nonsense { int_32_ref: &3 }.int_32 };
| ----------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
| |
| unable to turn this pointer into raw bytes
| unable to turn pointer into raw bytes

error[E0080]: it is undefined behavior to use this value
--> $DIR/const-pointer-values-in-various-types.rs:52:5
Expand All @@ -94,7 +94,7 @@ error: any use of this value will cause an error
LL | const I32_REF_F32_UNION: f32 = unsafe { Nonsense { int_32_ref: &3 }.float_32 };
| ----------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
| |
| unable to turn this pointer into raw bytes
| unable to turn pointer into raw bytes

error[E0080]: it is undefined behavior to use this value
--> $DIR/const-pointer-values-in-various-types.rs:61:5
Expand All @@ -110,39 +110,39 @@ error: any use of this value will cause an error
LL | const I32_REF_BOOL_UNION: bool = unsafe { Nonsense { int_32_ref: &3 }.truthy_falsey };
| ------------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
| |
| unable to turn this pointer into raw bytes
| unable to turn pointer into raw bytes

error: any use of this value will cause an error
--> $DIR/const-pointer-values-in-various-types.rs:67:47
|
LL | const I32_REF_CHAR_UNION: char = unsafe { Nonsense { int_32_ref: &3 }.character };
| ------------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
| |
| unable to turn this pointer into raw bytes
| unable to turn pointer into raw bytes

error: any use of this value will cause an error
--> $DIR/const-pointer-values-in-various-types.rs:70:39
|
LL | const STR_U8_UNION: u8 = unsafe { Nonsense { stringy: "3" }.uint_8 };
| ----------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
| |
| unable to turn this pointer into raw bytes
| unable to turn pointer into raw bytes

error: any use of this value will cause an error
--> $DIR/const-pointer-values-in-various-types.rs:73:41
|
LL | const STR_U16_UNION: u16 = unsafe { Nonsense { stringy: "3" }.uint_16 };
| ------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
| |
| unable to turn this pointer into raw bytes
| unable to turn pointer into raw bytes

error: any use of this value will cause an error
--> $DIR/const-pointer-values-in-various-types.rs:76:41
|
LL | const STR_U32_UNION: u32 = unsafe { Nonsense { stringy: "3" }.uint_32 };
| ------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
| |
| unable to turn this pointer into raw bytes
| unable to turn pointer into raw bytes

error[E0080]: it is undefined behavior to use this value
--> $DIR/const-pointer-values-in-various-types.rs:79:5
Expand All @@ -158,31 +158,31 @@ error: any use of this value will cause an error
LL | const STR_U128_UNION: u128 = unsafe { Nonsense { stringy: "3" }.uint_128 };
| --------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
| |
| unable to turn this pointer into raw bytes
| unable to turn pointer into raw bytes

error: any use of this value will cause an error
--> $DIR/const-pointer-values-in-various-types.rs:85:39
|
LL | const STR_I8_UNION: i8 = unsafe { Nonsense { stringy: "3" }.int_8 };
| ----------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
| |
| unable to turn this pointer into raw bytes
| unable to turn pointer into raw bytes

error: any use of this value will cause an error
--> $DIR/const-pointer-values-in-various-types.rs:88:41
|
LL | const STR_I16_UNION: i16 = unsafe { Nonsense { stringy: "3" }.int_16 };
| ------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
| |
| unable to turn this pointer into raw bytes
| unable to turn pointer into raw bytes

error: any use of this value will cause an error
--> $DIR/const-pointer-values-in-various-types.rs:91:41
|
LL | const STR_I32_UNION: i32 = unsafe { Nonsense { stringy: "3" }.int_32 };
| ------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
| |
| unable to turn this pointer into raw bytes
| unable to turn pointer into raw bytes

error[E0080]: it is undefined behavior to use this value
--> $DIR/const-pointer-values-in-various-types.rs:94:5
Expand All @@ -198,15 +198,15 @@ error: any use of this value will cause an error
LL | const STR_I128_UNION: i128 = unsafe { Nonsense { stringy: "3" }.int_128 };
| --------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
| |
| unable to turn this pointer into raw bytes
| unable to turn pointer into raw bytes

error: any use of this value will cause an error
--> $DIR/const-pointer-values-in-various-types.rs:100:41
|
LL | const STR_F32_UNION: f32 = unsafe { Nonsense { stringy: "3" }.float_32 };
| ------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
| |
| unable to turn this pointer into raw bytes
| unable to turn pointer into raw bytes

error[E0080]: it is undefined behavior to use this value
--> $DIR/const-pointer-values-in-various-types.rs:103:5
Expand All @@ -222,15 +222,15 @@ error: any use of this value will cause an error
LL | const STR_BOOL_UNION: bool = unsafe { Nonsense { stringy: "3" }.truthy_falsey };
| --------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
| |
| unable to turn this pointer into raw bytes
| unable to turn pointer into raw bytes

error: any use of this value will cause an error
--> $DIR/const-pointer-values-in-various-types.rs:109:43
|
LL | const STR_CHAR_UNION: char = unsafe { Nonsense { stringy: "3" }.character };
| --------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
| |
| unable to turn this pointer into raw bytes
| unable to turn pointer into raw bytes

error: aborting due to 29 previous errors

Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/consts/const-eval/const_raw_ptr_ops.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ error: any use of this value will cause an error
LL | const Z2: i32 = unsafe { *(42 as *const i32) };
| -------------------------^^^^^^^^^^^^^^^^^^^---
| |
| unable to turn these bytes into a pointer
| unable to turn bytes into a pointer

error: any use of this value will cause an error
--> $DIR/const_raw_ptr_ops.rs:17:26
|
LL | const Z3: i32 = unsafe { *(44 as *const i32) };
| -------------------------^^^^^^^^^^^^^^^^^^^---
| |
| unable to turn these bytes into a pointer
| unable to turn bytes into a pointer

error: aborting due to 5 previous errors

4 changes: 2 additions & 2 deletions src/test/ui/consts/offset_from_ub.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ error: any use of this value will cause an error
LL | intrinsics::ptr_offset_from(self, origin)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
| unable to turn these bytes into a pointer
| unable to turn bytes into a pointer
| inside call to `std::ptr::const_ptr::<impl *const u8>::offset_from` at $DIR/offset_from_ub.rs:28:14
|
::: $DIR/offset_from_ub.rs:26:1
Expand Down Expand Up @@ -81,7 +81,7 @@ error: any use of this value will cause an error
LL | intrinsics::ptr_offset_from(self, origin)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
| unable to turn these bytes into a pointer
| unable to turn bytes into a pointer
| inside call to `std::ptr::const_ptr::<impl *const u8>::offset_from` at $DIR/offset_from_ub.rs:49:14
|
::: $DIR/offset_from_ub.rs:45:1
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/error-codes/E0396-fixed.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ error: any use of this value will cause an error
LL | const VALUE: u8 = unsafe { *REG_ADDR };
| ---------------------------^^^^^^^^^---
| |
| unable to turn these bytes into a pointer
| unable to turn bytes into a pointer
|
= note: `#[deny(const_err)]` on by default

Expand Down