1
Fork 0

Add check for ui_testing via promoting parameters from ParseSess to Session

This commit is contained in:
George-lewis 2024-01-10 00:37:30 -05:00
parent b55faad314
commit 36a69e9d39
44 changed files with 188 additions and 233 deletions

View file

@ -1170,7 +1170,7 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
sym::rust_logo => {
if !self.tcx.features().rustdoc_internals {
feature_err(
&self.tcx.sess.parse_sess,
&self.tcx.sess,
sym::rustdoc_internals,
meta.span(),
"the `#[doc(rust_logo)]` attribute is used for Rust branding",
@ -1815,7 +1815,7 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
(target, self.tcx.features().fn_align)
{
feature_err(
&self.tcx.sess.parse_sess,
&self.tcx.sess,
sym::fn_align,
hint.span(),
"`repr(align)` attributes on functions are unstable",

View file

@ -147,7 +147,7 @@ impl<'tcx> CheckConstVisitor<'tcx> {
[missing_primary, ref missing_secondary @ ..] => {
let msg =
format!("{} is not allowed in a `{}`", expr.name(), const_kind.keyword_name());
let mut err = feature_err(&tcx.sess.parse_sess, *missing_primary, span, msg);
let mut err = feature_err(&tcx.sess, *missing_primary, span, msg);
// If multiple feature gates would be required to enable this expression, include
// them as help messages. Don't emit a separate error for each missing feature gate.

View file

@ -45,14 +45,13 @@ impl DebuggerVisualizerCollector<'_> {
}
};
let file =
match resolve_path(&self.sess.parse_sess, visualizer_path.as_str(), attr.span) {
Ok(file) => file,
Err(err) => {
err.emit();
return;
}
};
let file = match resolve_path(&self.sess, visualizer_path.as_str(), attr.span) {
Ok(file) => file,
Err(err) => {
err.emit();
return;
}
};
match std::fs::read(&file) {
Ok(contents) => {

View file

@ -135,7 +135,7 @@ fn configure_main(tcx: TyCtxt<'_>, visitor: &EntryContext<'_>) -> Option<(DefId,
if main_def.is_import && !tcx.features().imported_main {
let span = main_def.span;
feature_err(
&tcx.sess.parse_sess,
&tcx.sess,
sym::imported_main,
span,
"using an imported function as entry point `main` is experimental",