Auto merge of #53530 - kennytm:rollup, r=kennytm
Rollup of 17 pull requests Successful merges: - #53030 (Updated RELEASES.md for 1.29.0) - #53104 (expand the documentation on the `Unpin` trait) - #53213 (Stabilize IP associated constants) - #53296 (When closure with no arguments was expected, suggest wrapping) - #53329 (Replace usages of ptr::offset with ptr::{add,sub}.) - #53363 (add individual docs to `core::num::NonZero*`) - #53370 (Stabilize macro_vis_matcher) - #53393 (Mark libserialize functions as inline) - #53405 (restore the page title after escaping out of a search) - #53452 (Change target triple used to check for lldb in build-manifest) - #53462 (Document Box::into_raw returns non-null ptr) - #53465 (Remove LinkMeta struct) - #53492 (update lld submodule to include RISCV patch) - #53496 (Fix typos found by codespell.) - #53521 (syntax: Optimize some literal parsing) - #53540 (Moved issue-53157.rs into src/test/ui/consts/const-eval/) - #53551 (Avoid some Place clones.) Failed merges: r? @ghost
This commit is contained in:
commit
9f9f2c0095
183 changed files with 571 additions and 510 deletions
|
|
@ -28,7 +28,7 @@ fn start(_: isize, _: *const *const u8) -> isize {
|
|||
let _: (char, u32) = Trait::without_default_impl(0);
|
||||
|
||||
// Currently, no object code is generated for trait methods with default
|
||||
// implemenations, unless they are actually called from somewhere. Therefore
|
||||
// implementations, unless they are actually called from somewhere. Therefore
|
||||
// we cannot import the implementations and have to create our own inline.
|
||||
//~ MONO_ITEM fn cgu_export_trait_method::Trait[0]::with_default_impl[0]<u32>
|
||||
let _ = Trait::with_default_impl(0u32);
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
#![feature(plugin_registrar, rustc_private)]
|
||||
#![feature(box_syntax)]
|
||||
#![feature(macro_vis_matcher)]
|
||||
#![cfg_attr(stage0, feature(macro_vis_matcher))]
|
||||
#![feature(macro_at_most_once_rep)]
|
||||
|
||||
#[macro_use] extern crate rustc;
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
#![feature(plugin_registrar)]
|
||||
#![feature(box_syntax, rustc_private)]
|
||||
#![feature(macro_vis_matcher)]
|
||||
#![cfg_attr(stage0, feature(macro_vis_matcher))]
|
||||
#![feature(macro_at_most_once_rep)]
|
||||
|
||||
// Load rustc as a plugin to get macros
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
#![feature(plugin_registrar)]
|
||||
#![feature(box_syntax, rustc_private)]
|
||||
#![feature(macro_vis_matcher)]
|
||||
#![cfg_attr(stage0, feature(macro_vis_matcher))]
|
||||
#![feature(macro_at_most_once_rep)]
|
||||
|
||||
extern crate syntax;
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
// This crate attempts to enumerate the various scenarios for how a
|
||||
// type can define fields and methods with various visiblities and
|
||||
// type can define fields and methods with various visibilities and
|
||||
// stabilities.
|
||||
//
|
||||
// The basic stability pattern in this file has four cases:
|
||||
|
|
@ -23,7 +23,7 @@
|
|||
//
|
||||
// However, since stability attributes can only be observed in
|
||||
// cross-crate linkage scenarios, there is little reason to take the
|
||||
// cross-product (4 stability cases * 4 visiblity cases), because the
|
||||
// cross-product (4 stability cases * 4 visibility cases), because the
|
||||
// first three visibility cases cannot be accessed outside this crate,
|
||||
// and therefore stability is only relevant when the visibility is pub
|
||||
// to the whole universe.
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// error-pattern:runned an unexported test
|
||||
// error-pattern:ran an unexported test
|
||||
// compile-flags:--test
|
||||
// check-stdout
|
||||
|
||||
|
|
@ -17,6 +17,6 @@ mod m {
|
|||
|
||||
#[test]
|
||||
fn unexported() {
|
||||
panic!("runned an unexported test");
|
||||
panic!("ran an unexported test");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
-include ../tools.mk
|
||||
|
||||
# Test that hir-tree output doens't crash and includes
|
||||
# Test that hir-tree output doesn't crash and includes
|
||||
# the string constant we would expect to see.
|
||||
|
||||
all:
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
-include ../tools.mk
|
||||
|
||||
# Test that hir-tree output doens't crash and includes
|
||||
# Test that hir-tree output doesn't crash and includes
|
||||
# the string constant we would expect to see.
|
||||
|
||||
all:
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
LOG := $(TMPDIR)/log.txt
|
||||
|
||||
# This test builds a shared object, then an executable that links it as a native
|
||||
# rust library (constrast to an rlib). The shared library and executable both
|
||||
# rust library (contrast to an rlib). The shared library and executable both
|
||||
# are compiled with address sanitizer, and we assert that a fault in the cdylib
|
||||
# is correctly detected.
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
LOG := $(TMPDIR)/log.txt
|
||||
|
||||
# This test builds a shared object, then an executable that links it as a native
|
||||
# rust library (constrast to an rlib). The shared library and executable both
|
||||
# rust library (contrast to an rlib). The shared library and executable both
|
||||
# are compiled with address sanitizer, and we assert that a fault in the dylib
|
||||
# is correctly detected.
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
#![feature(plugin_registrar, rustc_private)]
|
||||
#![feature(box_syntax)]
|
||||
#![feature(macro_vis_matcher)]
|
||||
#![cfg_attr(stage0, feature(macro_vis_matcher))]
|
||||
#![feature(macro_at_most_once_rep)]
|
||||
|
||||
#[macro_use] extern crate rustc;
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
#![feature(box_syntax, plugin, plugin_registrar, rustc_private)]
|
||||
#![feature(macro_vis_matcher)]
|
||||
#![cfg_attr(stage0, feature(macro_vis_matcher))]
|
||||
#![feature(macro_at_most_once_rep)]
|
||||
#![crate_type = "dylib"]
|
||||
|
||||
|
|
|
|||
|
|
@ -385,7 +385,7 @@ pub fn main() {
|
|||
// RwLock (since we can grab the child pointers in read-only
|
||||
// mode), but we cannot lock a std::sync::Mutex to guard reading
|
||||
// from each node via the same pattern, since once you hit the
|
||||
// cycle, you'll be trying to acquring the same lock twice.
|
||||
// cycle, you'll be trying to acquiring the same lock twice.
|
||||
// (We deal with this by exiting the traversal early if try_lock fails.)
|
||||
|
||||
// Cycle 12: { arc0 -> (arc1, arc2), arc1 -> (), arc2 -> arc0 }, refcells
|
||||
|
|
|
|||
|
|
@ -310,7 +310,7 @@ fn test_order() {
|
|||
}
|
||||
|
||||
fn test_once() {
|
||||
// Make sure each argument are evaluted only once even though it may be
|
||||
// Make sure each argument are evaluated only once even though it may be
|
||||
// formatted multiple times
|
||||
fn foo() -> isize {
|
||||
static mut FOO: isize = 0;
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ pub fn main() {
|
|||
}
|
||||
match 'c' {
|
||||
'a'...'z' => {}
|
||||
_ => panic!("should suppport char ranges")
|
||||
_ => panic!("should support char ranges")
|
||||
}
|
||||
match -3_isize {
|
||||
-7...5 => {}
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ type TypeD = TypeA<'static>;
|
|||
// trailing comma on lifetime bounds
|
||||
type TypeE = TypeA<'static,>;
|
||||
|
||||
// normal type arugment
|
||||
// normal type argument
|
||||
type TypeF<T> = Box<T>;
|
||||
|
||||
// type argument with trailing comma
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
// Issue 33903:
|
||||
// Built-in indexing should be used even when the index is not
|
||||
// trivially an integer
|
||||
// Only built-in indexing can be used in constant expresssions
|
||||
// Only built-in indexing can be used in constant expressions
|
||||
|
||||
const FOO: i32 = [12, 34][0 + 1];
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// Test that we are able to reinitilize box with moved referent
|
||||
// Test that we are able to reinitialize box with moved referent
|
||||
#![feature(nll)]
|
||||
static mut ORDER: [usize; 3] = [0, 0, 0];
|
||||
static mut INDEX: usize = 0;
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
#![feature(macro_vis_matcher)]
|
||||
#![cfg_attr(stage0, feature(macro_vis_matcher))]
|
||||
|
||||
//{{{ issue 40569 ==============================================================
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,8 @@
|
|||
// except according to those terms.
|
||||
|
||||
#![allow(dead_code, unused_imports)]
|
||||
#![feature(macro_vis_matcher, crate_visibility_modifier)]
|
||||
#![cfg_attr(stage0, feature(macro_vis_matcher))]
|
||||
#![feature(crate_visibility_modifier)]
|
||||
|
||||
/**
|
||||
Ensure that `:vis` matches can be captured in existing positions, and passed
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ pub fn main() {
|
|||
}
|
||||
match 'c' {
|
||||
'a'..='z' => {}
|
||||
_ => panic!("should suppport char ranges")
|
||||
_ => panic!("should support char ranges")
|
||||
}
|
||||
match -3 {
|
||||
-7..=5 => {}
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
// Regression test for #23698: The reassignment checker only cared
|
||||
// about the last assigment in a match arm body
|
||||
// about the last assignment in a match arm body
|
||||
|
||||
// Use an extra function to make sure no extra assignments
|
||||
// are introduced by macros in the match statement
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ impl<'a> MyWriter for &'a mut [u8] {
|
|||
let write_len = buf.len();
|
||||
unsafe {
|
||||
*self = slice::from_raw_parts_mut(
|
||||
self.as_mut_ptr().offset(write_len as isize),
|
||||
self.as_mut_ptr().add(write_len),
|
||||
self.len() - write_len
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ fn sanity_check_size<T: Copy>(one: T) {
|
|||
|
||||
fn main() {
|
||||
// This can fail if rustc and LLVM disagree on the size of a type.
|
||||
// In this case, `Option<Packed<(&(), u32)>>` was erronously not
|
||||
// In this case, `Option<Packed<(&(), u32)>>` was erroneously not
|
||||
// marked as packed despite needing alignment `1` and containing
|
||||
// its `&()` discriminant, which has alignment larger than `1`.
|
||||
sanity_check_size((Some(Packed((&(), 0))), true));
|
||||
|
|
|
|||
|
|
@ -37,8 +37,8 @@ unsafe fn test_triangle() -> bool {
|
|||
for i in 0..COUNT / 2 {
|
||||
let (p0, p1, size) = (ascend[2*i], ascend[2*i+1], idx_to_size(i));
|
||||
for j in 0..size {
|
||||
assert_eq!(*p0.offset(j as isize), i as u8);
|
||||
assert_eq!(*p1.offset(j as isize), i as u8);
|
||||
assert_eq!(*p0.add(j), i as u8);
|
||||
assert_eq!(*p1.add(j), i as u8);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -100,8 +100,8 @@ unsafe fn test_triangle() -> bool {
|
|||
for i in 0..COUNT / 2 {
|
||||
let (p0, p1, size) = (ascend[2*i], ascend[2*i+1], idx_to_size(i));
|
||||
for j in 0..size {
|
||||
*p0.offset(j as isize) = i as u8;
|
||||
*p1.offset(j as isize) = i as u8;
|
||||
*p0.add(j) = i as u8;
|
||||
*p1.add(j) = i as u8;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ fn start(argc: isize, argv: *const *const u8) -> isize {
|
|||
|
||||
let args = unsafe {
|
||||
(0..argc as usize).map(|i| {
|
||||
let ptr = *argv.offset(i as isize) as *const _;
|
||||
let ptr = *argv.add(i) as *const _;
|
||||
CStr::from_ptr(ptr).to_bytes().to_vec()
|
||||
}).collect::<Vec<_>>()
|
||||
};
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ extern fn send_signal() {
|
|||
|
||||
fn main() {
|
||||
unsafe {
|
||||
// Install signal hander that runs on alternate signal stack.
|
||||
// Install signal handler that runs on alternate signal stack.
|
||||
let mut action: sigaction = std::mem::zeroed();
|
||||
action.sa_flags = (SA_ONSTACK | SA_SIGINFO) as _;
|
||||
action.sa_sigaction = signal_handler as sighandler_t;
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
#![crate_name = "qwop"]
|
||||
|
||||
/// (writen on a spider's web) Some Macro
|
||||
/// (written on a spider's web) Some Macro
|
||||
#[macro_export]
|
||||
macro_rules! some_macro {
|
||||
() => {
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
#![feature(plugin_registrar)]
|
||||
#![feature(box_syntax, rustc_private)]
|
||||
#![feature(macro_vis_matcher)]
|
||||
#![cfg_attr(stage0, feature(macro_vis_matcher))]
|
||||
#![feature(macro_at_most_once_rep)]
|
||||
|
||||
// Load rustc as a plugin to get macros
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
#![feature(plugin_registrar)]
|
||||
#![feature(box_syntax, rustc_private)]
|
||||
#![feature(macro_vis_matcher)]
|
||||
#![cfg_attr(stage0, feature(macro_vis_matcher))]
|
||||
#![feature(macro_at_most_once_rep)]
|
||||
|
||||
extern crate syntax;
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
#![feature(plugin_registrar)]
|
||||
#![feature(box_syntax, rustc_private)]
|
||||
#![feature(macro_vis_matcher)]
|
||||
#![cfg_attr(stage0, feature(macro_vis_matcher))]
|
||||
#![feature(macro_at_most_once_rep)]
|
||||
|
||||
extern crate syntax;
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// Check that the user gets an errror if they omit a binding from an
|
||||
// Check that the user gets an error if they omit a binding from an
|
||||
// object type.
|
||||
|
||||
pub trait Foo {
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
// revisions: ast migrate nll
|
||||
|
||||
// Since we are testing nll (and migration) explicitly as a separate
|
||||
// revisions, dont worry about the --compare-mode=nll on this test.
|
||||
// revisions, don't worry about the --compare-mode=nll on this test.
|
||||
|
||||
// ignore-compare-mode-nll
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
|
||||
// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
|
|
@ -8,12 +8,8 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// Test that the MSP430 interrupt ABI cannot be used when msp430_interrupt
|
||||
// feature gate is not used.
|
||||
|
||||
macro_rules! m { ($v:vis) => {} }
|
||||
//~^ ERROR :vis fragment specifier is experimental and subject to change
|
||||
|
||||
fn main() {
|
||||
m!(pub);
|
||||
let x = Some(1);
|
||||
let y = x.or_else(4);
|
||||
//~^ ERROR expected a `std::ops::FnOnce<()>` closure, found `{integer}`
|
||||
}
|
||||
12
src/test/ui/closure-expected.stderr
Normal file
12
src/test/ui/closure-expected.stderr
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
error[E0277]: expected a `std::ops::FnOnce<()>` closure, found `{integer}`
|
||||
--> $DIR/closure-expected.rs:13:15
|
||||
|
|
||||
LL | let y = x.or_else(4);
|
||||
| ^^^^^^^ expected an `FnOnce<()>` closure, found `{integer}`
|
||||
|
|
||||
= help: the trait `std::ops::FnOnce<()>` is not implemented for `{integer}`
|
||||
= note: wrap the `{integer}` in a closure with no arguments: `|| { /* code */ }
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0277`.
|
||||
|
|
@ -8,7 +8,7 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// We need to opt inot the `!` feature in order to trigger the
|
||||
// We need to opt into the `!` feature in order to trigger the
|
||||
// requirement that this is testing.
|
||||
#![feature(never_type)]
|
||||
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ error[E0401]: can't use type parameters from outer function
|
|||
--> $DIR/E0401.rs:32:25
|
||||
|
|
||||
LL | impl<T> Iterator for A<T> {
|
||||
| ---- `Self` type implicitely declared here, on the `impl`
|
||||
| ---- `Self` type implicitly declared here, on the `impl`
|
||||
...
|
||||
LL | fn helper(sel: &Self) -> u8 { //~ ERROR E0401
|
||||
| ------ ^^^^ use of type variable from outer function
|
||||
|
|
|
|||
|
|
@ -17,5 +17,5 @@ fn main() {
|
|||
// extern functions are extern "C" fn
|
||||
let _x: extern "C" fn() = f; // OK
|
||||
is_fn(f);
|
||||
//~^ ERROR `extern "C" fn() {f}: std::ops::Fn<()>` is not satisfied
|
||||
//~^ ERROR expected a `std::ops::Fn<()>` closure, found `extern "C" fn() {f}`
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,11 @@
|
|||
error[E0277]: the trait bound `extern "C" fn() {f}: std::ops::Fn<()>` is not satisfied
|
||||
error[E0277]: expected a `std::ops::Fn<()>` closure, found `extern "C" fn() {f}`
|
||||
--> $DIR/extern-wrong-value-type.rs:19:5
|
||||
|
|
||||
LL | is_fn(f);
|
||||
| ^^^^^ the trait `std::ops::Fn<()>` is not implemented for `extern "C" fn() {f}`
|
||||
| ^^^^^ expected an `Fn<()>` closure, found `extern "C" fn() {f}`
|
||||
|
|
||||
= help: the trait `std::ops::Fn<()>` is not implemented for `extern "C" fn() {f}`
|
||||
= note: wrap the `extern "C" fn() {f}` in a closure with no arguments: `|| { /* code */ }
|
||||
note: required by `is_fn`
|
||||
--> $DIR/extern-wrong-value-type.rs:14:1
|
||||
|
|
||||
|
|
|
|||
|
|
@ -1,11 +0,0 @@
|
|||
error[E0658]: :vis fragment specifier is experimental and subject to change (see issue #41022)
|
||||
--> $DIR/feature-gate-macro-vis-matcher.rs:14:19
|
||||
|
|
||||
LL | macro_rules! m { ($v:vis) => {} }
|
||||
| ^^^^^^
|
||||
|
|
||||
= help: add #![feature(macro_vis_matcher)] to the crate attributes to enable
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0658`.
|
||||
|
|
@ -27,5 +27,5 @@ fn main() {
|
|||
//~| found type `std::boxed::Box<dyn std::ops::FnMut() -> isize>`
|
||||
|
||||
needs_fn(1);
|
||||
//~^ ERROR : std::ops::Fn<(isize,)>`
|
||||
//~^ ERROR expected a `std::ops::Fn<(isize,)>` closure, found `{integer}`
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,15 +25,13 @@ LL | let _: () = (box || -> isize { unimplemented!() }) as Box<FnMut() -> is
|
|||
= note: expected type `()`
|
||||
found type `std::boxed::Box<dyn std::ops::FnMut() -> isize>`
|
||||
|
||||
error[E0277]: the trait bound `{integer}: std::ops::Fn<(isize,)>` is not satisfied
|
||||
error[E0277]: expected a `std::ops::Fn<(isize,)>` closure, found `{integer}`
|
||||
--> $DIR/fn-trait-formatting.rs:29:5
|
||||
|
|
||||
LL | needs_fn(1);
|
||||
| ^^^^^^^^ the trait `std::ops::Fn<(isize,)>` is not implemented for `{integer}`
|
||||
| ^^^^^^^^ expected an `Fn<(isize,)>` closure, found `{integer}`
|
||||
|
|
||||
= help: the following implementations were found:
|
||||
<&'a F as std::ops::Fn<A>>
|
||||
<core::str::LinesAnyMap as std::ops::Fn<(&'a str,)>>
|
||||
= help: the trait `std::ops::Fn<(isize,)>` is not implemented for `{integer}`
|
||||
note: required by `needs_fn`
|
||||
--> $DIR/fn-trait-formatting.rs:13:1
|
||||
|
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// `#[macro_export] macro_rules` that doen't originate from macro expansions can be placed
|
||||
// `#[macro_export] macro_rules` that doesn't originate from macro expansions can be placed
|
||||
// into the root module soon enough to act as usual items and shadow globs and preludes.
|
||||
|
||||
#![feature(decl_macro)]
|
||||
|
|
|
|||
|
|
@ -16,6 +16,6 @@ fn main() {
|
|||
let ptr: *mut () = 0 as *mut _;
|
||||
let _: &mut Fn() = unsafe {
|
||||
&mut *(ptr as *mut Fn())
|
||||
//~^ ERROR `(): std::ops::Fn<()>` is not satisfied
|
||||
//~^ ERROR expected a `std::ops::Fn<()>` closure, found `()`
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,11 @@
|
|||
error[E0277]: the trait bound `(): std::ops::Fn<()>` is not satisfied
|
||||
error[E0277]: expected a `std::ops::Fn<()>` closure, found `()`
|
||||
--> $DIR/issue-22034.rs:18:16
|
||||
|
|
||||
LL | &mut *(ptr as *mut Fn())
|
||||
| ^^^ the trait `std::ops::Fn<()>` is not implemented for `()`
|
||||
| ^^^ expected an `Fn<()>` closure, found `()`
|
||||
|
|
||||
= help: the trait `std::ops::Fn<()>` is not implemented for `()`
|
||||
= note: wrap the `()` in a closure with no arguments: `|| { /* code */ }
|
||||
= note: required for the cast to the object type `dyn std::ops::Fn()`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
|
|
|||
|
|
@ -1,8 +1,10 @@
|
|||
error[E0277]: the trait bound `(): std::ops::FnMut<(_, char)>` is not satisfied
|
||||
error[E0277]: expected a `std::ops::FnMut<(_, char)>` closure, found `()`
|
||||
--> $DIR/issue-23966.rs:12:16
|
||||
|
|
||||
LL | "".chars().fold(|_, _| (), ());
|
||||
| ^^^^ the trait `std::ops::FnMut<(_, char)>` is not implemented for `()`
|
||||
| ^^^^ expected an `FnMut<(_, char)>` closure, found `()`
|
||||
|
|
||||
= help: the trait `std::ops::FnMut<(_, char)>` is not implemented for `()`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// Checks lexical scopes cannot see through normal module boundries
|
||||
// Checks lexical scopes cannot see through normal module boundaries
|
||||
|
||||
fn f() {
|
||||
fn g() {}
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
#![feature(macro_vis_matcher)]
|
||||
#![cfg_attr(stage0, feature(macro_vis_matcher))]
|
||||
|
||||
macro_rules! foo {
|
||||
($($p:vis)*) => {} //~ ERROR repetition matches empty token tree
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
// run-pass
|
||||
|
||||
// This test has structs and functions that are by definiton unusable
|
||||
// This test has structs and functions that are by definition unusable
|
||||
// all over the place, so just go ahead and allow dead_code
|
||||
#![allow(dead_code)]
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// Confirm that we don't accidently divide or mod by zero in llvm_type
|
||||
// Confirm that we don't accidentally divide or mod by zero in llvm_type
|
||||
|
||||
// compile-pass
|
||||
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
#![feature(label_break_value)]
|
||||
|
||||
// These are forbidden occurences of label-break-value
|
||||
// These are forbidden occurrences of label-break-value
|
||||
|
||||
fn labeled_unsafe() {
|
||||
unsafe 'b: {} //~ ERROR expected one of `extern`, `fn`, or `{`
|
||||
|
|
|
|||
|
|
@ -9,8 +9,8 @@
|
|||
// except according to those terms.
|
||||
|
||||
// FIXME: Change to UI Test
|
||||
// Check notes are placed on an assignment that can actually precede the current assigmnent
|
||||
// Don't emmit a first assignment for assignment in a loop.
|
||||
// Check notes are placed on an assignment that can actually precede the current assignment
|
||||
// Don't emit a first assignment for assignment in a loop.
|
||||
|
||||
// compile-flags: -Zborrowck=compare
|
||||
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ use lint_unused_extern_crate2::foo as bar;
|
|||
use other::*;
|
||||
|
||||
mod foo {
|
||||
// Test that this is unused even though an earler `extern crate` is used.
|
||||
// Test that this is unused even though an earlier `extern crate` is used.
|
||||
extern crate lint_unused_extern_crate2; //~ ERROR unused extern crate
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
// compile-pass
|
||||
|
||||
#![feature(macro_vis_matcher)]
|
||||
#![cfg_attr(stage0, feature(macro_vis_matcher))]
|
||||
|
||||
#![allow(unused)]
|
||||
#![warn(unreachable_pub)]
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
// compile-pass
|
||||
|
||||
#![feature(crate_visibility_modifier)]
|
||||
#![feature(macro_vis_matcher)]
|
||||
#![cfg_attr(stage0, feature(macro_vis_matcher))]
|
||||
|
||||
#![allow(unused)]
|
||||
#![warn(unreachable_pub)]
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
#![feature(generic_associated_types)]
|
||||
|
||||
//FIXME(#44265): The lifetime shadowing and type parameter shadowing
|
||||
// should cause an error. Now it compiles (errorneously) and this will be addressed
|
||||
// should cause an error. Now it compiles (erroneously) and this will be addressed
|
||||
// by a future PR. Then remove the following:
|
||||
// compile-pass
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
#![deny(rust_2018_compatibility)]
|
||||
|
||||
// Don't make a suggestion for a raw identifer replacement unless raw
|
||||
// Don't make a suggestion for a raw identifier replacement unless raw
|
||||
// identifiers are enabled.
|
||||
|
||||
fn main() {
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
// Test that we DO NOT warn when lifetime name is used multiple
|
||||
// argments, or more than once in a single argument.
|
||||
// arguments, or more than once in a single argument.
|
||||
//
|
||||
// compile-pass
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,10 @@
|
|||
error[E0277]: the trait bound `S: std::ops::Fn<(isize,)>` is not satisfied
|
||||
error[E0277]: expected a `std::ops::Fn<(isize,)>` closure, found `S`
|
||||
--> $DIR/unboxed-closures-fnmut-as-fn.rs:38:13
|
||||
|
|
||||
LL | let x = call_it(&S, 22);
|
||||
| ^^^^^^^ the trait `std::ops::Fn<(isize,)>` is not implemented for `S`
|
||||
| ^^^^^^^ expected an `Fn<(isize,)>` closure, found `S`
|
||||
|
|
||||
= help: the trait `std::ops::Fn<(isize,)>` is not implemented for `S`
|
||||
note: required by `call_it`
|
||||
--> $DIR/unboxed-closures-fnmut-as-fn.rs:33:1
|
||||
|
|
||||
|
|
|
|||
|
|
@ -1,33 +1,36 @@
|
|||
error[E0277]: the trait bound `for<'r> for<'s> unsafe fn(&'s isize) -> isize {square}: std::ops::Fn<(&'r isize,)>` is not satisfied
|
||||
error[E0277]: expected a `std::ops::Fn<(&isize,)>` closure, found `for<'r> unsafe fn(&'r isize) -> isize {square}`
|
||||
--> $DIR/unboxed-closures-unsafe-extern-fn.rs:22:13
|
||||
|
|
||||
LL | let x = call_it(&square, 22);
|
||||
| ^^^^^^^ the trait `for<'r> std::ops::Fn<(&'r isize,)>` is not implemented for `for<'r> unsafe fn(&'r isize) -> isize {square}`
|
||||
| ^^^^^^^ expected an `Fn<(&isize,)>` closure, found `for<'r> unsafe fn(&'r isize) -> isize {square}`
|
||||
|
|
||||
= help: the trait `for<'r> std::ops::Fn<(&'r isize,)>` is not implemented for `for<'r> unsafe fn(&'r isize) -> isize {square}`
|
||||
note: required by `call_it`
|
||||
--> $DIR/unboxed-closures-unsafe-extern-fn.rs:17:1
|
||||
|
|
||||
LL | fn call_it<F:Fn(&isize)->isize>(_: &F, _: isize) -> isize { 0 }
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error[E0277]: the trait bound `for<'r> for<'s> unsafe fn(&'s isize) -> isize {square}: std::ops::FnMut<(&'r isize,)>` is not satisfied
|
||||
error[E0277]: expected a `std::ops::FnMut<(&isize,)>` closure, found `for<'r> unsafe fn(&'r isize) -> isize {square}`
|
||||
--> $DIR/unboxed-closures-unsafe-extern-fn.rs:27:13
|
||||
|
|
||||
LL | let y = call_it_mut(&mut square, 22);
|
||||
| ^^^^^^^^^^^ the trait `for<'r> std::ops::FnMut<(&'r isize,)>` is not implemented for `for<'r> unsafe fn(&'r isize) -> isize {square}`
|
||||
| ^^^^^^^^^^^ expected an `FnMut<(&isize,)>` closure, found `for<'r> unsafe fn(&'r isize) -> isize {square}`
|
||||
|
|
||||
= help: the trait `for<'r> std::ops::FnMut<(&'r isize,)>` is not implemented for `for<'r> unsafe fn(&'r isize) -> isize {square}`
|
||||
note: required by `call_it_mut`
|
||||
--> $DIR/unboxed-closures-unsafe-extern-fn.rs:18:1
|
||||
|
|
||||
LL | fn call_it_mut<F:FnMut(&isize)->isize>(_: &mut F, _: isize) -> isize { 0 }
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error[E0277]: the trait bound `for<'r> for<'s> unsafe fn(&'s isize) -> isize {square}: std::ops::FnOnce<(&'r isize,)>` is not satisfied
|
||||
error[E0277]: expected a `std::ops::FnOnce<(&isize,)>` closure, found `for<'r> unsafe fn(&'r isize) -> isize {square}`
|
||||
--> $DIR/unboxed-closures-unsafe-extern-fn.rs:32:13
|
||||
|
|
||||
LL | let z = call_it_once(square, 22);
|
||||
| ^^^^^^^^^^^^ the trait `for<'r> std::ops::FnOnce<(&'r isize,)>` is not implemented for `for<'r> unsafe fn(&'r isize) -> isize {square}`
|
||||
| ^^^^^^^^^^^^ expected an `FnOnce<(&isize,)>` closure, found `for<'r> unsafe fn(&'r isize) -> isize {square}`
|
||||
|
|
||||
= help: the trait `for<'r> std::ops::FnOnce<(&'r isize,)>` is not implemented for `for<'r> unsafe fn(&'r isize) -> isize {square}`
|
||||
note: required by `call_it_once`
|
||||
--> $DIR/unboxed-closures-unsafe-extern-fn.rs:19:1
|
||||
|
|
||||
|
|
|
|||
|
|
@ -1,33 +1,36 @@
|
|||
error[E0277]: the trait bound `for<'r> for<'s> extern "C" fn(&'s isize) -> isize {square}: std::ops::Fn<(&'r isize,)>` is not satisfied
|
||||
error[E0277]: expected a `std::ops::Fn<(&isize,)>` closure, found `for<'r> extern "C" fn(&'r isize) -> isize {square}`
|
||||
--> $DIR/unboxed-closures-wrong-abi.rs:22:13
|
||||
|
|
||||
LL | let x = call_it(&square, 22);
|
||||
| ^^^^^^^ the trait `for<'r> std::ops::Fn<(&'r isize,)>` is not implemented for `for<'r> extern "C" fn(&'r isize) -> isize {square}`
|
||||
| ^^^^^^^ expected an `Fn<(&isize,)>` closure, found `for<'r> extern "C" fn(&'r isize) -> isize {square}`
|
||||
|
|
||||
= help: the trait `for<'r> std::ops::Fn<(&'r isize,)>` is not implemented for `for<'r> extern "C" fn(&'r isize) -> isize {square}`
|
||||
note: required by `call_it`
|
||||
--> $DIR/unboxed-closures-wrong-abi.rs:17:1
|
||||
|
|
||||
LL | fn call_it<F:Fn(&isize)->isize>(_: &F, _: isize) -> isize { 0 }
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error[E0277]: the trait bound `for<'r> for<'s> extern "C" fn(&'s isize) -> isize {square}: std::ops::FnMut<(&'r isize,)>` is not satisfied
|
||||
error[E0277]: expected a `std::ops::FnMut<(&isize,)>` closure, found `for<'r> extern "C" fn(&'r isize) -> isize {square}`
|
||||
--> $DIR/unboxed-closures-wrong-abi.rs:27:13
|
||||
|
|
||||
LL | let y = call_it_mut(&mut square, 22);
|
||||
| ^^^^^^^^^^^ the trait `for<'r> std::ops::FnMut<(&'r isize,)>` is not implemented for `for<'r> extern "C" fn(&'r isize) -> isize {square}`
|
||||
| ^^^^^^^^^^^ expected an `FnMut<(&isize,)>` closure, found `for<'r> extern "C" fn(&'r isize) -> isize {square}`
|
||||
|
|
||||
= help: the trait `for<'r> std::ops::FnMut<(&'r isize,)>` is not implemented for `for<'r> extern "C" fn(&'r isize) -> isize {square}`
|
||||
note: required by `call_it_mut`
|
||||
--> $DIR/unboxed-closures-wrong-abi.rs:18:1
|
||||
|
|
||||
LL | fn call_it_mut<F:FnMut(&isize)->isize>(_: &mut F, _: isize) -> isize { 0 }
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error[E0277]: the trait bound `for<'r> for<'s> extern "C" fn(&'s isize) -> isize {square}: std::ops::FnOnce<(&'r isize,)>` is not satisfied
|
||||
error[E0277]: expected a `std::ops::FnOnce<(&isize,)>` closure, found `for<'r> extern "C" fn(&'r isize) -> isize {square}`
|
||||
--> $DIR/unboxed-closures-wrong-abi.rs:32:13
|
||||
|
|
||||
LL | let z = call_it_once(square, 22);
|
||||
| ^^^^^^^^^^^^ the trait `for<'r> std::ops::FnOnce<(&'r isize,)>` is not implemented for `for<'r> extern "C" fn(&'r isize) -> isize {square}`
|
||||
| ^^^^^^^^^^^^ expected an `FnOnce<(&isize,)>` closure, found `for<'r> extern "C" fn(&'r isize) -> isize {square}`
|
||||
|
|
||||
= help: the trait `for<'r> std::ops::FnOnce<(&'r isize,)>` is not implemented for `for<'r> extern "C" fn(&'r isize) -> isize {square}`
|
||||
note: required by `call_it_once`
|
||||
--> $DIR/unboxed-closures-wrong-abi.rs:19:1
|
||||
|
|
||||
|
|
|
|||
|
|
@ -1,33 +1,36 @@
|
|||
error[E0277]: the trait bound `for<'r> unsafe fn(isize) -> isize {square}: std::ops::Fn<(&'r isize,)>` is not satisfied
|
||||
error[E0277]: expected a `std::ops::Fn<(&isize,)>` closure, found `unsafe fn(isize) -> isize {square}`
|
||||
--> $DIR/unboxed-closures-wrong-arg-type-extern-fn.rs:23:13
|
||||
|
|
||||
LL | let x = call_it(&square, 22);
|
||||
| ^^^^^^^ the trait `for<'r> std::ops::Fn<(&'r isize,)>` is not implemented for `unsafe fn(isize) -> isize {square}`
|
||||
| ^^^^^^^ expected an `Fn<(&isize,)>` closure, found `unsafe fn(isize) -> isize {square}`
|
||||
|
|
||||
= help: the trait `for<'r> std::ops::Fn<(&'r isize,)>` is not implemented for `unsafe fn(isize) -> isize {square}`
|
||||
note: required by `call_it`
|
||||
--> $DIR/unboxed-closures-wrong-arg-type-extern-fn.rs:18:1
|
||||
|
|
||||
LL | fn call_it<F:Fn(&isize)->isize>(_: &F, _: isize) -> isize { 0 }
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error[E0277]: the trait bound `for<'r> unsafe fn(isize) -> isize {square}: std::ops::FnMut<(&'r isize,)>` is not satisfied
|
||||
error[E0277]: expected a `std::ops::FnMut<(&isize,)>` closure, found `unsafe fn(isize) -> isize {square}`
|
||||
--> $DIR/unboxed-closures-wrong-arg-type-extern-fn.rs:28:13
|
||||
|
|
||||
LL | let y = call_it_mut(&mut square, 22);
|
||||
| ^^^^^^^^^^^ the trait `for<'r> std::ops::FnMut<(&'r isize,)>` is not implemented for `unsafe fn(isize) -> isize {square}`
|
||||
| ^^^^^^^^^^^ expected an `FnMut<(&isize,)>` closure, found `unsafe fn(isize) -> isize {square}`
|
||||
|
|
||||
= help: the trait `for<'r> std::ops::FnMut<(&'r isize,)>` is not implemented for `unsafe fn(isize) -> isize {square}`
|
||||
note: required by `call_it_mut`
|
||||
--> $DIR/unboxed-closures-wrong-arg-type-extern-fn.rs:19:1
|
||||
|
|
||||
LL | fn call_it_mut<F:FnMut(&isize)->isize>(_: &mut F, _: isize) -> isize { 0 }
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error[E0277]: the trait bound `for<'r> unsafe fn(isize) -> isize {square}: std::ops::FnOnce<(&'r isize,)>` is not satisfied
|
||||
error[E0277]: expected a `std::ops::FnOnce<(&isize,)>` closure, found `unsafe fn(isize) -> isize {square}`
|
||||
--> $DIR/unboxed-closures-wrong-arg-type-extern-fn.rs:33:13
|
||||
|
|
||||
LL | let z = call_it_once(square, 22);
|
||||
| ^^^^^^^^^^^^ the trait `for<'r> std::ops::FnOnce<(&'r isize,)>` is not implemented for `unsafe fn(isize) -> isize {square}`
|
||||
| ^^^^^^^^^^^^ expected an `FnOnce<(&isize,)>` closure, found `unsafe fn(isize) -> isize {square}`
|
||||
|
|
||||
= help: the trait `for<'r> std::ops::FnOnce<(&'r isize,)>` is not implemented for `unsafe fn(isize) -> isize {square}`
|
||||
note: required by `call_it_once`
|
||||
--> $DIR/unboxed-closures-wrong-arg-type-extern-fn.rs:20:1
|
||||
|
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// ignore-arm stdcall isn't suppported
|
||||
// ignore-arm stdcall isn't supported
|
||||
|
||||
fn baz(f: extern "stdcall" fn(usize, ...)) {
|
||||
//~^ ERROR: variadic function must have C or cdecl calling convention
|
||||
|
|
|
|||
|
|
@ -8,8 +8,8 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// ignore-arm stdcall isn't suppported
|
||||
// ignore-aarch64 stdcall isn't suppported
|
||||
// ignore-arm stdcall isn't supported
|
||||
// ignore-aarch64 stdcall isn't supported
|
||||
|
||||
extern "stdcall" {
|
||||
fn printf(_: *const u8, ...); //~ ERROR: variadic function must have C or cdecl calling
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
// Test that we can quantify lifetimes outside a constraint (i.e., including
|
||||
// the self type) in a where clause. Specifically, test that implementing for a
|
||||
// specific lifetime is not enough to satisify the `for<'a> ...` constraint, which
|
||||
// specific lifetime is not enough to satisfy the `for<'a> ...` constraint, which
|
||||
// should require *all* lifetimes.
|
||||
|
||||
static X: &'static u32 = &42;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue