diff options
| author | Eduard Burtescu <edy.burt@gmail.com> | 2016-08-29 22:53:18 +0300 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2016-09-12 16:59:42 -0700 |
| commit | 74cf38c9e8e08c7e7e3e6f61c45131b13fc5b001 (patch) | |
| tree | 517c2b3d6474412c8503e14aa2fd3eadd5eec089 | |
| parent | f79ab4fca8bb25e1fdbeeef6ad98a3820ce43733 (diff) | |
| download | rust-74cf38c9e8e08c7e7e3e6f61c45131b13fc5b001.tar.gz rust-74cf38c9e8e08c7e7e3e6f61c45131b13fc5b001.zip | |
llvm: backport "[SimplifyCFG] Hoisting invalidates metadata".
| m--------- | src/llvm | 0 | ||||
| -rw-r--r-- | src/rustllvm/llvm-auto-clean-trigger | 2 | ||||
| -rw-r--r-- | src/test/run-pass/issue-36023.rs | 32 |
3 files changed, 33 insertions, 1 deletions
diff --git a/src/llvm b/src/llvm -Subproject 786aad117be48547f4ca50fae84c4879fa992d4 +Subproject eee68eafa7e8e4ce996b49f5551636639a6c331 diff --git a/src/rustllvm/llvm-auto-clean-trigger b/src/rustllvm/llvm-auto-clean-trigger index 378810a8b89..67f8730c258 100644 --- a/src/rustllvm/llvm-auto-clean-trigger +++ b/src/rustllvm/llvm-auto-clean-trigger @@ -1,4 +1,4 @@ # If this file is modified, then llvm will be forcibly cleaned and then rebuilt. # The actual contents of this file do not matter, but to trigger a change on the # build bots then the contents should be changed so git updates the mtime. -2016-08-07 +2016-08-23 diff --git a/src/test/run-pass/issue-36023.rs b/src/test/run-pass/issue-36023.rs new file mode 100644 index 00000000000..f6c03b384f2 --- /dev/null +++ b/src/test/run-pass/issue-36023.rs @@ -0,0 +1,32 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or +// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license +// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +use std::ops::Deref; + +fn main() { + if env_var("FOOBAR").as_ref().map(Deref::deref).ok() == Some("yes") { + panic!() + } + + let env_home: Result<String, ()> = Ok("foo-bar-baz".to_string()); + let env_home = env_home.as_ref().map(Deref::deref).ok(); + + if env_home == Some("") { panic!() } +} + +#[inline(never)] +fn env_var(s: &str) -> Result<String, VarError> { + Err(VarError::NotPresent) +} + +pub enum VarError { + NotPresent, + NotUnicode(String), +} |
