Skip to content

Rollup of 7 pull requests #38325

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

Merged
merged 18 commits into from
Dec 13, 2016
Merged
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
8b0b2b6
Add more examples to UpdSocket
GuillaumeGomez Nov 29, 2016
bee82e8
Avoid using locally installed Source Code Pro font (fixes #24355).
sourcefrog Dec 4, 2016
78fd220
ICH: Add test case for closure expressions.
michaelwoerister Dec 6, 2016
45b89b8
ICH: Add test case sensitive to function bodies in metadata.
michaelwoerister Dec 6, 2016
277675c
ICH: Add test case for indexing expressions.
michaelwoerister Dec 6, 2016
5c3a69e
ICH: Add test case for enum constructor expressions.
michaelwoerister Dec 6, 2016
9ccd5c5
ICH: Add missing annotations for struct constructor expr test case.
michaelwoerister Dec 6, 2016
f78aa4d
Run rustfmt on librustc_mir/hair/cx
srinivasreddy Oct 9, 2016
57f998a
Improve and fix mpsc documentation
Cobrand Nov 22, 2016
c6c3a27
rustdoc: Remove broken src links from reexported items from macros
ollie27 Dec 9, 2016
b7cd840
Handle Ctrl+C in the build script
achanda Dec 11, 2016
dc1a094
Rollup merge of #37052 - srinivasreddy:hair_cx, r=pnkfelix
frewsxcv Dec 12, 2016
8c3c9c2
Rollup merge of #37941 - Cobrand:docfix-issue-37915, r=GuillaumeGomez
frewsxcv Dec 12, 2016
3bd2c80
Rollup merge of #38067 - GuillaumeGomez:udp-doc, r=frewsxcv,nagisa
frewsxcv Dec 12, 2016
5e425b7
Rollup merge of #38164 - sourcefrog:fonts, r=GuillaumeGomez
frewsxcv Dec 12, 2016
a9dcfd0
Rollup merge of #38202 - michaelwoerister:closure-ich-test, r=nikomat…
frewsxcv Dec 12, 2016
e3363f2
Rollup merge of #38264 - ollie27:rustdoc_src_macro, r=brson
frewsxcv Dec 12, 2016
cba1304
Rollup merge of #38299 - achanda:ctrl-c, r=brson
frewsxcv Dec 12, 2016
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
ICH: Add test case sensitive to function bodies in metadata.
  • Loading branch information
michaelwoerister committed Dec 6, 2016
commit 45b89b82c21466f53a4a26c00f23f88357695d15
86 changes: 86 additions & 0 deletions src/test/incremental/hashes/exported_vs_not.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
// 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.

// must-compile-successfully
// revisions: cfail1 cfail2 cfail3
// compile-flags: -Z query-dep-graph

#![allow(warnings)]
#![feature(rustc_attrs)]
#![crate_type="rlib"]

// Case 1: The function body is not exported to metadata. If the body changes,
// the hash of the HirBody node should change, but not the hash of
// either the Hir or the Metadata node.

#[cfg(cfail1)]
pub fn body_not_exported_to_metadata() -> u32 {
1
}

#[cfg(not(cfail1))]
#[rustc_clean(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="HirBody", cfg="cfail2")]
#[rustc_clean(label="HirBody", cfg="cfail3")]
#[rustc_metadata_clean(cfg="cfail2")]
#[rustc_metadata_clean(cfg="cfail3")]
pub fn body_not_exported_to_metadata() -> u32 {
2
}



// Case 2: The function body *is* exported to metadata because the function is
// marked as #[inline]. Only the hash of the Hir depnode should be
// unaffected by a change to the body.

#[cfg(cfail1)]
#[inline]
pub fn body_exported_to_metadata_because_of_inline() -> u32 {
1
}

#[cfg(not(cfail1))]
#[rustc_clean(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="HirBody", cfg="cfail2")]
#[rustc_clean(label="HirBody", cfg="cfail3")]
#[rustc_metadata_dirty(cfg="cfail2")]
#[rustc_metadata_clean(cfg="cfail3")]
#[inline]
pub fn body_exported_to_metadata_because_of_inline() -> u32 {
2
}



// Case 2: The function body *is* exported to metadata because the function is
// generic. Only the hash of the Hir depnode should be
// unaffected by a change to the body.

#[cfg(cfail1)]
#[inline]
pub fn body_exported_to_metadata_because_of_generic() -> u32 {
1
}

#[cfg(not(cfail1))]
#[rustc_clean(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="HirBody", cfg="cfail2")]
#[rustc_clean(label="HirBody", cfg="cfail3")]
#[rustc_metadata_dirty(cfg="cfail2")]
#[rustc_metadata_clean(cfg="cfail3")]
#[inline]
pub fn body_exported_to_metadata_because_of_generic() -> u32 {
2
}