Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
d72d5f4
Dogfood Duration API in std::time tests
workingjubilee Oct 22, 2020
ef027a1
Duration::zero() -> Duration::ZERO
workingjubilee Oct 22, 2020
b989d46
Support enable/disable sanitizers/profiler per target
12101111 Oct 25, 2020
af4d178
Fixup tests: Duration::MIN -> ::ZERO
workingjubilee Oct 27, 2020
82f3a23
Remove Duration::MIN entirely
workingjubilee Oct 27, 2020
439171e
look at assoc ct, check the type of nodes
lcnr Nov 7, 2020
685fd53
BTreeMap: split off most code of append, slightly improve interfaces
ssomers Oct 26, 2020
ffa70d7
Support inlining diverging function calls
tmiasko Nov 9, 2020
3e012e2
add error_occured field to ConstQualifs, fix #76064
vn-ki Nov 6, 2020
b57fe64
fix tests and formatting
vn-ki Nov 6, 2020
26f0f12
Upgrading dlmalloc to 0.2.1
raoulstrackx Nov 9, 2020
b3fc46c
check mir exists before validation; fix tests
vn-ki Nov 9, 2020
c8943c6
Add flags customizing behaviour of MIR inlining
tmiasko Nov 10, 2020
0c56372
review comments
vn-ki Nov 10, 2020
03eec5c
Cleanup and comment intra-doc link pass
jyn514 Nov 10, 2020
ce91c68
rustc_taret: Remove `TargetOptions::is_like_android`
petrochenkov Nov 10, 2020
ca17a91
rustc_target: Move target env "gnu" from `linux_base` to `linux_gnu_b…
petrochenkov Nov 10, 2020
1854425
Fix typo in comment
eltociear Nov 11, 2020
de84ad9
Implement destructuring assignment for structs and slices
fanzier Nov 7, 2020
2453ce7
Ship llvm-cov through llvm-tools
dalance Nov 11, 2020
50cbd7b
Rollup merge of #78138 - fortanix:raoul/dlmalloc0.2, r=Mark-Simulacrum
jonas-schievink Nov 11, 2020
2446a26
Rollup merge of #78216 - workingjubilee:duration-zero, r=m-ou-se
jonas-schievink Nov 11, 2020
85c1193
Rollup merge of #78354 - 12101111:rustbuild_profiler, r=Mark-Simulacrum
jonas-schievink Nov 11, 2020
0ecd045
Rollup merge of #78417 - ssomers:btree_chop_up_2, r=Mark-Simulacrum
jonas-schievink Nov 11, 2020
052834f
Rollup merge of #78809 - vn-ki:fix-issue-76064, r=oli-obk
jonas-schievink Nov 11, 2020
49ffe3c
Rollup merge of #78832 - lcnr:const-evaluatable-unevaluated, r=oli-obk
jonas-schievink Nov 11, 2020
ce3f729
Rollup merge of #78836 - fanzier:struct-and-slice-destructuring, r=pe…
jonas-schievink Nov 11, 2020
46bf94c
Rollup merge of #78873 - tmiasko:inline-opts, r=oli-obk
jonas-schievink Nov 11, 2020
84316e6
Rollup merge of #78899 - tmiasko:inline-diverging, r=oli-obk
jonas-schievink Nov 11, 2020
d7291c0
Rollup merge of #78923 - jyn514:intra-doc-comments, r=Manishearth
jonas-schievink Nov 11, 2020
7549d0d
Rollup merge of #78929 - petrochenkov:linuxbase, r=joshtriplett
jonas-schievink Nov 11, 2020
1acb5bb
Rollup merge of #78930 - petrochenkov:notlikeandroid, r=Mark-Simulacrum
jonas-schievink Nov 11, 2020
496ee33
Rollup merge of #78942 - eltociear:patch-1, r=jonas-schievink
jonas-schievink Nov 11, 2020
492d616
Rollup merge of #78947 - dalance:llvm_cov, r=Mark-Simulacrum
jonas-schievink Nov 11, 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
fix tests and formatting
  • Loading branch information
vn-ki committed Nov 9, 2020
commit b57fe6476ee41086b4e7d44296e57ba9ca0f6501
2 changes: 1 addition & 1 deletion compiler/rustc_mir/src/const_eval/eval_queries.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ use crate::interpret::{
ScalarMaybeUninit, StackPopCleanup,
};

use rustc_errors::ErrorReported;
use rustc_hir::def::DefKind;
use rustc_middle::mir;
use rustc_middle::mir::interpret::ErrorHandled;
use rustc_errors::ErrorReported;
use rustc_middle::traits::Reveal;
use rustc_middle::ty::print::with_no_trimmed_paths;
use rustc_middle::ty::{self, subst::Subst, TyCtxt};
Expand Down
6 changes: 5 additions & 1 deletion compiler/rustc_mir/src/transform/check_consts/qualifs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ use rustc_trait_selection::traits;

use super::ConstCx;

pub fn in_any_value_of_ty(cx: &ConstCx<'_, 'tcx>, ty: Ty<'tcx>, error_occured: bool) -> ConstQualifs {
pub fn in_any_value_of_ty(
cx: &ConstCx<'_, 'tcx>,
ty: Ty<'tcx>,
error_occured: bool,
) -> ConstQualifs {
ConstQualifs {
has_mut_interior: HasMutInterior::in_any_value_of_ty(cx, ty),
needs_drop: NeedsDrop::in_any_value_of_ty(cx, ty),
Expand Down
6 changes: 5 additions & 1 deletion compiler/rustc_mir/src/transform/check_consts/validation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,11 @@ impl Qualifs<'mir, 'tcx> {
has_mut_interior.get().contains(local) || self.indirectly_mutable(ccx, local, location)
}

fn in_return_place(&mut self, ccx: &'mir ConstCx<'mir, 'tcx>, error_occured: bool) -> ConstQualifs {
fn in_return_place(
&mut self,
ccx: &'mir ConstCx<'mir, 'tcx>,
error_occured: bool,
) -> ConstQualifs {
// Find the `Return` terminator if one exists.
//
// If no `Return` terminator exists, this MIR is divergent. Just return the conservative
Expand Down
1 change: 0 additions & 1 deletion src/test/ui/consts/const-call.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@ fn f(x: usize) -> usize {
fn main() {
let _ = [0; f(2)];
//~^ ERROR calls in constants are limited to constant functions
//~| ERROR evaluation of constant value failed
}
11 changes: 2 additions & 9 deletions src/test/ui/consts/const-call.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,6 @@ error[E0015]: calls in constants are limited to constant functions, tuple struct
LL | let _ = [0; f(2)];
| ^^^^

error[E0080]: evaluation of constant value failed
--> $DIR/const-call.rs:6:17
|
LL | let _ = [0; f(2)];
| ^^^^ calling non-const function `f`

error: aborting due to 2 previous errors
error: aborting due to previous error

Some errors have detailed explanations: E0015, E0080.
For more information about an error, try `rustc --explain E0015`.
For more information about this error, try `rustc --explain E0015`.
1 change: 0 additions & 1 deletion src/test/ui/consts/const-eval/issue-52442.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
fn main() {
[(); { &loop { break } as *const _ as usize } ];
//~^ ERROR casting pointers to integers in constants is unstable
//~| ERROR evaluation of constant value failed
}
11 changes: 2 additions & 9 deletions src/test/ui/consts/const-eval/issue-52442.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,6 @@ LL | [(); { &loop { break } as *const _ as usize } ];
= note: see issue #51910 <https://github.com/rust-lang/rust/issues/51910> for more information
= help: add `#![feature(const_raw_ptr_to_usize_cast)]` to the crate attributes to enable

error[E0080]: evaluation of constant value failed
--> $DIR/issue-52442.rs:2:13
|
LL | [(); { &loop { break } as *const _ as usize } ];
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ "pointer-to-integer cast" needs an rfc before being allowed inside constants

error: aborting due to 2 previous errors
error: aborting due to previous error

Some errors have detailed explanations: E0080, E0658.
For more information about an error, try `rustc --explain E0080`.
For more information about this error, try `rustc --explain E0658`.
1 change: 0 additions & 1 deletion src/test/ui/consts/const-eval/match-test-ptr-null.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ fn main() {
let _: [u8; 0] = [4; {
match &1 as *const i32 as usize {
//~^ ERROR casting pointers to integers in constants
//~| ERROR evaluation of constant value failed
0 => 42,
n => n,
}
Expand Down
11 changes: 2 additions & 9 deletions src/test/ui/consts/const-eval/match-test-ptr-null.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,6 @@ LL | match &1 as *const i32 as usize {
= note: see issue #51910 <https://github.com/rust-lang/rust/issues/51910> for more information
= help: add `#![feature(const_raw_ptr_to_usize_cast)]` to the crate attributes to enable

error[E0080]: evaluation of constant value failed
--> $DIR/match-test-ptr-null.rs:6:15
|
LL | match &1 as *const i32 as usize {
| ^^^^^^^^^^^^^^^^^^^^^^^^^ "pointer-to-integer cast" needs an rfc before being allowed inside constants

error: aborting due to 2 previous errors
error: aborting due to previous error

Some errors have detailed explanations: E0080, E0658.
For more information about an error, try `rustc --explain E0080`.
For more information about this error, try `rustc --explain E0658`.
1 change: 0 additions & 1 deletion src/test/ui/consts/issue-68542-closure-in-array-len.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

struct Bug {
a: [(); (|| { 0 })()] //~ ERROR calls in constants are limited to
//~^ ERROR evaluation of constant value failed
}

fn main() {}
11 changes: 2 additions & 9 deletions src/test/ui/consts/issue-68542-closure-in-array-len.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,6 @@ error[E0015]: calls in constants are limited to constant functions, tuple struct
LL | a: [(); (|| { 0 })()]
| ^^^^^^^^^^^^

error[E0080]: evaluation of constant value failed
--> $DIR/issue-68542-closure-in-array-len.rs:6:13
|
LL | a: [(); (|| { 0 })()]
| ^^^^^^^^^^^^ calling non-const function `Bug::a::{constant#0}::{closure#0}`

error: aborting due to 2 previous errors
error: aborting due to previous error

Some errors have detailed explanations: E0015, E0080.
For more information about an error, try `rustc --explain E0015`.
For more information about this error, try `rustc --explain E0015`.